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
213 changes: 213 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79405,6 +79405,67 @@ components:
type: string
x-enum-varnames:
- MONITOR_ALERT_TRIGGER
MonitorAutomationAttributes:
description: Automatic investigation settings for a monitor.
properties:
enabled:
description: Whether Bits automatically investigates alerts from this monitor.
example: true
type: boolean
required:
- enabled
type: object
MonitorAutomationData:
description: Automatic investigation configuration identified by monitor ID.
properties:
attributes:
$ref: "#/components/schemas/MonitorAutomationAttributes"
id:
description: The monitor ID.
example: "12345678"
type: string
type:
$ref: "#/components/schemas/MonitorAutomationType"
required:
- id
- type
- attributes
type: object
MonitorAutomationRequest:
description: Set whether Bits automatically investigates alerts from a monitor.
properties:
data:
$ref: "#/components/schemas/MonitorAutomationRequestData"
required:
- data
type: object
MonitorAutomationRequestData:
description: The automatic investigation settings to apply.
properties:
attributes:
$ref: "#/components/schemas/MonitorAutomationAttributes"
type:
$ref: "#/components/schemas/MonitorAutomationType"
required:
- type
- attributes
type: object
MonitorAutomationResponse:
description: Automatic investigation settings for a monitor.
properties:
data:
$ref: "#/components/schemas/MonitorAutomationData"
required:
- data
type: object
MonitorAutomationType:
description: The resource type for monitor automation settings.
enum:
- monitor_automation
example: monitor_automation
type: string
x-enum-varnames:
- MONITOR_AUTOMATION
MonitorConfigPolicyAttributeCreateRequest:
description: Policy and policy type for a monitor configuration policy.
properties:
Expand Down Expand Up @@ -145227,6 +145288,158 @@ paths:
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/monitors/{monitor_id}/automation:
get:
description: Manage the Bits automatic investigation setting independently of the monitor definition. Requires access to the monitor and the specified permissions. A newly created monitor and updated settings can take time to appear in reads.
operationId: GetMonitorAutomation
parameters:
- description: The monitor ID.
in: path
name: monitor_id
required: true
schema:
format: int64
minimum: 1
type: integer
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
enabled: true
id: "12345678"
type: monitor_automation
schema:
$ref: "#/components/schemas/MonitorAutomationResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Invalid request or unsupported monitor type.
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Missing permission or automatic investigation API access is not enabled.
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Monitor not found or not visible to the caller.
"412":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: The monitor setting could not be updated.
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- monitors_read
- bits_investigations_read
summary: Get automatic investigation settings for a monitor
tags:
- Bits AI
x-permission:
operator: AND
permissions:
- monitors_read
- bits_investigations_read
x-unstable: This endpoint is in preview and is subject to change.
put:
description: Manage the Bits automatic investigation setting independently of the monitor definition. Requires access to the monitor and the specified permissions. A newly created monitor and updated settings can take time to appear in reads. The enabled attribute is required; false disables automatic investigations. Repeated requests set the same desired state. This operation does not create or delete the monitor.
operationId: UpdateMonitorAutomation
parameters:
- description: The monitor ID.
in: path
name: monitor_id
required: true
schema:
format: int64
minimum: 1
type: integer
requestBody:
content:
application/json:
example:
data:
attributes:
enabled: true
type: monitor_automation
schema:
$ref: "#/components/schemas/MonitorAutomationRequest"
description: Automatic investigation settings to apply.
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
enabled: true
id: "12345678"
type: monitor_automation
schema:
$ref: "#/components/schemas/MonitorAutomationResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Invalid request or unsupported monitor type.
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Missing permission or automatic investigation API access is not enabled.
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Monitor not found or not visible to the caller.
"412":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: The monitor setting could not be updated.
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- monitors_read
- monitors_write
- bits_investigations_write
summary: Update monitor automatic investigation settings
tags:
- Bits AI
x-codegen-request-body-name: body
x-permission:
operator: AND
permissions:
- monitors_read
- monitors_write
- bits_investigations_write
x-unstable: This endpoint is in preview and is subject to change.
/api/v2/cases:
get:
description: >-
Expand Down
9 changes: 9 additions & 0 deletions examples/v2/bits-ai/GetMonitorAutomation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Get automatic investigation settings for a monitor returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.get_monitor_automation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::BitsAIAPI.new
p api_instance.get_monitor_automation(9223372036854775807)
12 changes: 12 additions & 0 deletions examples/v2/bits-ai/GetMonitorAutomation_1312691475.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Read automatic investigation settings for a new monitor

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.get_monitor_automation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::BitsAIAPI.new

# there is a valid "monitor" in the system
MONITOR_ID = ENV["MONITOR_ID"]
p api_instance.get_monitor_automation(MONITOR_ID.to_i)
18 changes: 18 additions & 0 deletions examples/v2/bits-ai/UpdateMonitorAutomation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Update monitor automatic investigation settings returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.update_monitor_automation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::BitsAIAPI.new

body = DatadogAPIClient::V2::MonitorAutomationRequest.new({
data: DatadogAPIClient::V2::MonitorAutomationRequestData.new({
attributes: DatadogAPIClient::V2::MonitorAutomationAttributes.new({
enabled: true,
}),
type: DatadogAPIClient::V2::MonitorAutomationType::MONITOR_AUTOMATION,
}),
})
p api_instance.update_monitor_automation(9223372036854775807, body)
21 changes: 21 additions & 0 deletions examples/v2/bits-ai/UpdateMonitorAutomation_2360742230.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Enable automatic investigations for a monitor

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.update_monitor_automation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::BitsAIAPI.new

# there is a valid "monitor" in the system
MONITOR_ID = ENV["MONITOR_ID"]

body = DatadogAPIClient::V2::MonitorAutomationRequest.new({
data: DatadogAPIClient::V2::MonitorAutomationRequestData.new({
type: DatadogAPIClient::V2::MonitorAutomationType::MONITOR_AUTOMATION,
attributes: DatadogAPIClient::V2::MonitorAutomationAttributes.new({
enabled: true,
}),
}),
})
p api_instance.update_monitor_automation(MONITOR_ID.to_i, body)
21 changes: 21 additions & 0 deletions examples/v2/bits-ai/UpdateMonitorAutomation_2686390723.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Disable automatic investigations for a monitor

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.update_monitor_automation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::BitsAIAPI.new

# there is a valid "monitor" in the system
MONITOR_ID = ENV["MONITOR_ID"]

body = DatadogAPIClient::V2::MonitorAutomationRequest.new({
data: DatadogAPIClient::V2::MonitorAutomationRequestData.new({
type: DatadogAPIClient::V2::MonitorAutomationType::MONITOR_AUTOMATION,
attributes: DatadogAPIClient::V2::MonitorAutomationAttributes.new({
enabled: false,
}),
}),
})
p api_instance.update_monitor_automation(MONITOR_ID.to_i, body)
7 changes: 7 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,13 @@
"v2.GetInvestigation" => {
"id" => "String",
},
"v2.GetMonitorAutomation" => {
"monitor_id" => "Integer",
},
"v2.UpdateMonitorAutomation" => {
"monitor_id" => "Integer",
"body" => "MonitorAutomationRequest",
},
"v2.SearchCases" => {
"page_size" => "Integer",
"page_number" => "Integer",
Expand Down
Loading
Loading