From 506e00ca334d07efd026f9dbc19836bde4151fe6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 6 Apr 2026 18:16:35 +0000 Subject: [PATCH] Regenerate client from commit c0a649d of spec repo --- .generator/schemas/v2/openapi.yaml | 523 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 161 ++++++ examples/v2/bits-ai/GetInvestigation.py | 16 + examples/v2/bits-ai/ListInvestigations.py | 14 + .../bits-ai/ListInvestigations_130750454.py | 14 + examples/v2/bits-ai/TriggerInvestigation.py | 39 ++ src/datadog_api_client/configuration.py | 3 + src/datadog_api_client/v2/api/bits_ai_api.py | 218 ++++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../v2/model/get_investigation_response.py | 48 ++ .../model/get_investigation_response_data.py | 58 ++ ..._investigation_response_data_attributes.py | 52 ++ .../model/get_investigation_response_links.py | 33 ++ .../v2/model/investigation_conclusion.py | 45 ++ .../v2/model/investigation_type.py | 35 ++ .../v2/model/list_investigations_response.py | 62 +++ .../list_investigations_response_data.py | 60 ++ ...investigations_response_data_attributes.py | 39 ++ .../list_investigations_response_links.py | 71 +++ .../list_investigations_response_meta.py | 42 ++ .../list_investigations_response_meta_page.py | 45 ++ .../model/monitor_alert_trigger_attributes.py | 45 ++ .../v2/model/trigger_attributes.py | 48 ++ .../v2/model/trigger_investigation_request.py | 40 ++ .../trigger_investigation_request_data.py | 54 ++ ...r_investigation_request_data_attributes.py | 40 ++ .../trigger_investigation_request_type.py | 37 ++ .../model/trigger_investigation_response.py | 40 ++ .../trigger_investigation_response_data.py | 64 +++ ..._investigation_response_data_attributes.py | 33 ++ .../trigger_investigation_response_type.py | 37 ++ .../v2/model/trigger_type.py | 35 ++ src/datadog_api_client/v2/models/__init__.py | 54 ++ tests/v2/features/bits_ai.feature | 69 +++ tests/v2/features/undo.json | 18 + 36 files changed, 2201 insertions(+) create mode 100644 examples/v2/bits-ai/GetInvestigation.py create mode 100644 examples/v2/bits-ai/ListInvestigations.py create mode 100644 examples/v2/bits-ai/ListInvestigations_130750454.py create mode 100644 examples/v2/bits-ai/TriggerInvestigation.py create mode 100644 src/datadog_api_client/v2/api/bits_ai_api.py create mode 100644 src/datadog_api_client/v2/model/get_investigation_response.py create mode 100644 src/datadog_api_client/v2/model/get_investigation_response_data.py create mode 100644 src/datadog_api_client/v2/model/get_investigation_response_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/get_investigation_response_links.py create mode 100644 src/datadog_api_client/v2/model/investigation_conclusion.py create mode 100644 src/datadog_api_client/v2/model/investigation_type.py create mode 100644 src/datadog_api_client/v2/model/list_investigations_response.py create mode 100644 src/datadog_api_client/v2/model/list_investigations_response_data.py create mode 100644 src/datadog_api_client/v2/model/list_investigations_response_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/list_investigations_response_links.py create mode 100644 src/datadog_api_client/v2/model/list_investigations_response_meta.py create mode 100644 src/datadog_api_client/v2/model/list_investigations_response_meta_page.py create mode 100644 src/datadog_api_client/v2/model/monitor_alert_trigger_attributes.py create mode 100644 src/datadog_api_client/v2/model/trigger_attributes.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_request.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_request_data.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_request_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_request_type.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_response.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_response_data.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_response_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/trigger_investigation_response_type.py create mode 100644 src/datadog_api_client/v2/model/trigger_type.py create mode 100644 tests/v2/features/bits_ai.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e83df8269e..730cce5a68 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -28854,6 +28854,64 @@ components: $ref: "#/components/schemas/GetInterfacesData" type: array type: object + GetInvestigationResponse: + description: Response for a single Bits AI investigation. + properties: + data: + $ref: "#/components/schemas/GetInvestigationResponseData" + links: + $ref: "#/components/schemas/GetInvestigationResponseLinks" + required: + - data + - links + type: object + GetInvestigationResponseData: + description: Data for the get investigation response. + properties: + attributes: + $ref: "#/components/schemas/GetInvestigationResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + GetInvestigationResponseDataAttributes: + description: Attributes of the investigation. + properties: + conclusions: + description: The conclusions drawn from the investigation. + items: + $ref: "#/components/schemas/InvestigationConclusion" + type: array + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - title + - status + - conclusions + type: object + GetInvestigationResponseLinks: + description: Links related to the investigation. + properties: + self: + description: The URL to the investigation in the Datadog app. + example: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - self + type: object GetIssueIncludeQueryParameterItem: description: Relationship object that should be included in the response. enum: @@ -34312,6 +34370,34 @@ components: - DOWN - WARNING - "OFF" + InvestigationConclusion: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + properties: + description: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + example: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + type: string + summary: + description: A summary of the finding, including affected components and timeframe. + example: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + type: string + title: + description: The title of the conclusion. + example: "High CPU usage detected on web-server-01" + type: string + required: + - title + - summary + - description + type: object + InvestigationType: + description: The resource type for investigations. + enum: + - investigation + example: investigation + type: string + x-enum-varnames: + - INVESTIGATION Issue: description: The issue matching the request. properties: @@ -37692,6 +37778,113 @@ components: description: The type of the resource. The value should always be tags. type: string type: object + ListInvestigationsResponse: + description: Response for listing investigations. + properties: + data: + description: List of investigations. + items: + $ref: "#/components/schemas/ListInvestigationsResponseData" + type: array + links: + $ref: "#/components/schemas/ListInvestigationsResponseLinks" + meta: + $ref: "#/components/schemas/ListInvestigationsResponseMeta" + required: + - data + - meta + - links + type: object + ListInvestigationsResponseData: + description: Data for an investigation list item. + properties: + attributes: + $ref: "#/components/schemas/ListInvestigationsResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + ListInvestigationsResponseDataAttributes: + description: Attributes of an investigation list item. + properties: + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - status + - title + type: object + ListInvestigationsResponseLinks: + description: Pagination links for the list investigations response. + properties: + first: + description: Link to the first page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + required: + - first + - next + - self + type: object + ListInvestigationsResponseMeta: + description: Metadata for the list investigations response. + properties: + page: + $ref: "#/components/schemas/ListInvestigationsResponseMetaPage" + required: + - page + type: object + ListInvestigationsResponseMetaPage: + description: Pagination metadata. + properties: + limit: + description: Maximum number of results per page. + example: 10 + format: int64 + type: integer + offset: + description: Offset of the current page. + example: 0 + format: int64 + type: integer + total: + description: Total number of investigations. + example: 50 + format: int64 + type: integer + required: + - total + - limit + - offset + type: object ListKindCatalogResponse: description: List kind response. properties: @@ -41050,6 +41243,28 @@ components: maxLength: 255 type: string type: object + MonitorAlertTriggerAttributes: + description: Attributes for a monitor alert trigger. + properties: + event_id: + description: The event ID associated with the monitor alert. + example: "1234567890123456789" + type: string + event_ts: + description: The timestamp of the event in Unix milliseconds. + example: 1700000000000 + format: int64 + type: integer + monitor_id: + description: The monitor ID that triggered the alert. + example: 12345678 + format: int64 + type: integer + required: + - monitor_id + - event_id + - event_ts + type: object MonitorConfigPolicyAttributeCreateRequest: description: Policy and policy type for a monitor configuration policy. properties: @@ -70410,6 +70625,94 @@ components: - $ref: "#/components/schemas/SlackTriggerWrapper" - $ref: "#/components/schemas/SoftwareCatalogTriggerWrapper" - $ref: "#/components/schemas/WorkflowTriggerWrapper" + TriggerAttributes: + description: The trigger definition for starting an investigation. + properties: + monitor_alert_trigger: + $ref: "#/components/schemas/MonitorAlertTriggerAttributes" + type: + $ref: "#/components/schemas/TriggerType" + required: + - type + - monitor_alert_trigger + type: object + TriggerInvestigationRequest: + description: Request to trigger a new investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationRequestData" + required: + - data + type: object + TriggerInvestigationRequestData: + description: Data for the trigger investigation request. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationRequestDataAttributes" + type: + $ref: "#/components/schemas/TriggerInvestigationRequestType" + required: + - type + - attributes + type: object + TriggerInvestigationRequestDataAttributes: + description: Attributes for the trigger investigation request. + properties: + trigger: + $ref: "#/components/schemas/TriggerAttributes" + required: + - trigger + type: object + TriggerInvestigationRequestType: + description: The resource type for trigger investigation requests. + enum: + - trigger_investigation_request + example: trigger_investigation_request + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_REQUEST + TriggerInvestigationResponse: + description: Response after triggering an investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationResponseData" + required: + - data + type: object + TriggerInvestigationResponseData: + description: Data for the trigger investigation response. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationResponseDataAttributes" + id: + description: Unique identifier for the trigger response. + example: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: string + type: + $ref: "#/components/schemas/TriggerInvestigationResponseType" + required: + - id + - type + - attributes + type: object + TriggerInvestigationResponseDataAttributes: + description: Attributes for the trigger investigation response. + properties: + investigation_id: + description: The ID of the investigation that was created. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - investigation_id + type: object + TriggerInvestigationResponseType: + description: The resource type for trigger investigation responses. + enum: + - trigger_investigation_response + example: trigger_investigation_response + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_RESPONSE TriggerRateLimit: description: Defines a rate limit for a trigger. properties: @@ -70433,6 +70736,14 @@ components: x-enum-varnames: - SECURITY_FINDINGS - SECURITY_SIGNALS + TriggerType: + description: The type of trigger for the investigation. + enum: + - monitor_alert_trigger + example: monitor_alert_trigger + type: string + x-enum-varnames: + - MONITOR_ALERT_TRIGGER UCConfigPair: description: The definition of `UCConfigPair` object. example: @@ -74236,6 +74547,8 @@ components: apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. appsec_vm_read: View infrastructure, application code, and library vulnerability findings. billing_read: View your organization's billing information. + bits_investigations_read: View Bits AI investigations. + bits_investigations_write: Create and manage Bits AI investigations. cases_read: View Cases. cases_write: Create and update cases. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. @@ -78326,6 +78639,213 @@ paths: operator: OR permissions: - user_access_manage + /api/v2/bits-ai/investigations: + get: + description: List all Bits AI investigations for the organization. + operationId: ListInvestigations + parameters: + - description: Offset for pagination. + example: 0 + in: query + name: page[offset] + required: false + schema: + format: int64 + type: integer + - description: Maximum number of investigations to return. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 25 + format: int64 + maximum: 100 + type: integer + - description: Filter investigations by monitor ID. + example: 12345678 + in: query + name: filter[monitor_id] + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + first: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + next: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + self: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + meta: + page: + limit: 10 + offset: 0 + total: 50 + schema: + $ref: "#/components/schemas/ListInvestigationsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: List Bits AI investigations + tags: + - Bits AI + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + "x-permission": + 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 new Bits AI investigation based on a monitor alert. + operationId: TriggerInvestigation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + trigger: + monitor_alert_trigger: + event_id: "1234567890123456789" + event_ts: 1700000000000 + monitor_id: 12345678 + type: monitor_alert_trigger + type: trigger_investigation_request + schema: + $ref: "#/components/schemas/TriggerInvestigationRequest" + description: Trigger investigation request body. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + investigation_id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + id: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: trigger_investigation_response + schema: + $ref: "#/components/schemas/TriggerInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_write + summary: Trigger a Bits AI investigation + tags: + - Bits AI + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - bits_investigations_write + 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. + operationId: GetInvestigation + parameters: + - description: The ID of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + conclusions: + - description: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + summary: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + title: "High CPU usage detected on web-server-01" + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + self: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + schema: + $ref: "#/components/schemas/GetInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: Get a Bits AI investigation + tags: + - Bits AI + "x-permission": + 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: >- @@ -114317,6 +114837,9 @@ tags: is used to automatically map groups of users to roles in Datadog using attributes 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 - 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 diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index c3be7e8838..f060e2cb94 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -88,6 +88,13 @@ datadog\_api\_client.v2.api.aws\_logs\_integration\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.bits\_ai\_api module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.api.bits_ai_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.case\_management\_api module -------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index d1dc990342..ee0b174739 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -12268,6 +12268,34 @@ datadog\_api\_client.v2.model.get\_interfaces\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.get\_investigation\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.get_investigation_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.get\_investigation\_response\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.get_investigation_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.get\_investigation\_response\_data\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.get_investigation_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.get\_investigation\_response\_links module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.get_investigation_response_links + :members: + :show-inheritance: + datadog\_api\_client.v2.model.get\_issue\_include\_query\_parameter\_item module -------------------------------------------------------------------------------- @@ -14795,6 +14823,20 @@ datadog\_api\_client.v2.model.interface\_attributes\_status module :members: :show-inheritance: +datadog\_api\_client.v2.model.investigation\_conclusion module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.investigation_conclusion + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.investigation\_type module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.investigation_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.ip\_allowlist\_attributes module -------------------------------------------------------------- @@ -16020,6 +16062,48 @@ datadog\_api\_client.v2.model.list\_interface\_tags\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_investigations\_response module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_investigations_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_investigations\_response\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_investigations_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_investigations\_response\_data\_attributes module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_investigations_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_investigations\_response\_links module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_investigations_response_links + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_investigations\_response\_meta module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_investigations_response_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_investigations\_response\_meta\_page module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_investigations_response_meta_page + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_kind\_catalog\_response module ------------------------------------------------------------------ @@ -18232,6 +18316,13 @@ datadog\_api\_client.v2.model.microsoft\_teams\_workflows\_webhook\_response\_at :members: :show-inheritance: +datadog\_api\_client.v2.model.monitor\_alert\_trigger\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.monitor_alert_trigger_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.monitor\_config\_policy\_attribute\_create\_request module ---------------------------------------------------------------------------------------- @@ -31840,6 +31931,69 @@ datadog\_api\_client.v2.model.trigger module :members: :show-inheritance: +datadog\_api\_client.v2.model.trigger\_attributes module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_request module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_request\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_request\_data\_attributes module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_request\_type module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_request_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_response\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_response\_data\_attributes module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.trigger\_investigation\_response\_type module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_investigation_response_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.trigger\_rate\_limit module --------------------------------------------------------- @@ -31854,6 +32008,13 @@ datadog\_api\_client.v2.model.trigger\_source module :members: :show-inheritance: +datadog\_api\_client.v2.model.trigger\_type module +-------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.trigger_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.uc\_config\_pair module ----------------------------------------------------- diff --git a/examples/v2/bits-ai/GetInvestigation.py b/examples/v2/bits-ai/GetInvestigation.py new file mode 100644 index 0000000000..bee2825441 --- /dev/null +++ b/examples/v2/bits-ai/GetInvestigation.py @@ -0,0 +1,16 @@ +""" +Get a Bits AI investigation returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.bits_ai_api import BitsAIApi + +configuration = Configuration() +configuration.unstable_operations["get_investigation"] = True +with ApiClient(configuration) as api_client: + api_instance = BitsAIApi(api_client) + response = api_instance.get_investigation( + id="id", + ) + + print(response) diff --git a/examples/v2/bits-ai/ListInvestigations.py b/examples/v2/bits-ai/ListInvestigations.py new file mode 100644 index 0000000000..b44c9606ca --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations.py @@ -0,0 +1,14 @@ +""" +List Bits AI investigations returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.bits_ai_api import BitsAIApi + +configuration = Configuration() +configuration.unstable_operations["list_investigations"] = True +with ApiClient(configuration) as api_client: + api_instance = BitsAIApi(api_client) + response = api_instance.list_investigations() + + print(response) diff --git a/examples/v2/bits-ai/ListInvestigations_130750454.py b/examples/v2/bits-ai/ListInvestigations_130750454.py new file mode 100644 index 0000000000..f874dba113 --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations_130750454.py @@ -0,0 +1,14 @@ +""" +List Bits AI investigations returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.bits_ai_api import BitsAIApi + +configuration = Configuration() +configuration.unstable_operations["list_investigations"] = True +with ApiClient(configuration) as api_client: + api_instance = BitsAIApi(api_client) + items = api_instance.list_investigations_with_pagination() + for item in items: + print(item) diff --git a/examples/v2/bits-ai/TriggerInvestigation.py b/examples/v2/bits-ai/TriggerInvestigation.py new file mode 100644 index 0000000000..77a3e92275 --- /dev/null +++ b/examples/v2/bits-ai/TriggerInvestigation.py @@ -0,0 +1,39 @@ +""" +Trigger a Bits AI investigation returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.bits_ai_api import BitsAIApi +from datadog_api_client.v2.model.monitor_alert_trigger_attributes import MonitorAlertTriggerAttributes +from datadog_api_client.v2.model.trigger_attributes import TriggerAttributes +from datadog_api_client.v2.model.trigger_investigation_request import TriggerInvestigationRequest +from datadog_api_client.v2.model.trigger_investigation_request_data import TriggerInvestigationRequestData +from datadog_api_client.v2.model.trigger_investigation_request_data_attributes import ( + TriggerInvestigationRequestDataAttributes, +) +from datadog_api_client.v2.model.trigger_investigation_request_type import TriggerInvestigationRequestType +from datadog_api_client.v2.model.trigger_type import TriggerType + +body = TriggerInvestigationRequest( + data=TriggerInvestigationRequestData( + attributes=TriggerInvestigationRequestDataAttributes( + trigger=TriggerAttributes( + monitor_alert_trigger=MonitorAlertTriggerAttributes( + event_id="1234567890123456789", + event_ts=1700000000000, + monitor_id=12345678, + ), + type=TriggerType.MONITOR_ALERT_TRIGGER, + ), + ), + type=TriggerInvestigationRequestType.TRIGGER_INVESTIGATION_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["trigger_investigation"] = True +with ApiClient(configuration) as api_client: + api_instance = BitsAIApi(api_client) + response = api_instance.trigger_investigation(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index c40c8ba9fc..fa80397122 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -266,6 +266,9 @@ def __init__( "v2.get_open_api": False, "v2.list_apis": False, "v2.update_open_api": False, + "v2.get_investigation": False, + "v2.list_investigations": False, + "v2.trigger_investigation": False, "v2.create_case_jira_issue": False, "v2.create_case_notebook": False, "v2.create_case_service_now_ticket": False, diff --git a/src/datadog_api_client/v2/api/bits_ai_api.py b/src/datadog_api_client/v2/api/bits_ai_api.py new file mode 100644 index 0000000000..d087080048 --- /dev/null +++ b/src/datadog_api_client/v2/api/bits_ai_api.py @@ -0,0 +1,218 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +import collections +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) +from datadog_api_client.v2.model.list_investigations_response import ListInvestigationsResponse +from datadog_api_client.v2.model.list_investigations_response_data import ListInvestigationsResponseData +from datadog_api_client.v2.model.trigger_investigation_response import TriggerInvestigationResponse +from datadog_api_client.v2.model.trigger_investigation_request import TriggerInvestigationRequest +from datadog_api_client.v2.model.get_investigation_response import GetInvestigationResponse + + +class BitsAIApi: + """ + Use the Bits AI endpoints to retrieve AI-powered investigations. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._get_investigation_endpoint = _Endpoint( + settings={ + "response_type": (GetInvestigationResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/bits-ai/investigations/{id}", + "operation_id": "get_investigation", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_investigations_endpoint = _Endpoint( + settings={ + "response_type": (ListInvestigationsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/bits-ai/investigations", + "operation_id": "list_investigations", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_offset": { + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + "page_limit": { + "validation": { + "inclusive_maximum": 100, + }, + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "filter_monitor_id": { + "openapi_types": (int,), + "attribute": "filter[monitor_id]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._trigger_investigation_endpoint = _Endpoint( + settings={ + "response_type": (TriggerInvestigationResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/bits-ai/investigations", + "operation_id": "trigger_investigation", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (TriggerInvestigationRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def get_investigation( + self, + id: str, + ) -> GetInvestigationResponse: + """Get a Bits AI investigation. + + Get a specific Bits AI investigation by ID. + + :param id: The ID of the investigation. + :type id: str + :rtype: GetInvestigationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + return self._get_investigation_endpoint.call_with_http_info(**kwargs) + + def list_investigations( + self, + *, + page_offset: Union[int, UnsetType] = unset, + page_limit: Union[int, UnsetType] = unset, + filter_monitor_id: Union[int, UnsetType] = unset, + ) -> ListInvestigationsResponse: + """List Bits AI investigations. + + List all Bits AI investigations for the organization. + + :param page_offset: Offset for pagination. + :type page_offset: int, optional + :param page_limit: Maximum number of investigations to return. + :type page_limit: int, optional + :param filter_monitor_id: Filter investigations by monitor ID. + :type filter_monitor_id: int, optional + :rtype: ListInvestigationsResponse + """ + kwargs: Dict[str, Any] = {} + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if filter_monitor_id is not unset: + kwargs["filter_monitor_id"] = filter_monitor_id + + return self._list_investigations_endpoint.call_with_http_info(**kwargs) + + def list_investigations_with_pagination( + self, + *, + page_offset: Union[int, UnsetType] = unset, + page_limit: Union[int, UnsetType] = unset, + filter_monitor_id: Union[int, UnsetType] = unset, + ) -> collections.abc.Iterable[ListInvestigationsResponseData]: + """List Bits AI investigations. + + Provide a paginated version of :meth:`list_investigations`, returning all items. + + :param page_offset: Offset for pagination. + :type page_offset: int, optional + :param page_limit: Maximum number of investigations to return. + :type page_limit: int, optional + :param filter_monitor_id: Filter investigations by monitor ID. + :type filter_monitor_id: int, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[ListInvestigationsResponseData] + """ + kwargs: Dict[str, Any] = {} + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if filter_monitor_id is not unset: + kwargs["filter_monitor_id"] = filter_monitor_id + + local_page_size = get_attribute_from_path(kwargs, "page_limit", 25) + endpoint = self._list_investigations_endpoint + set_attribute_from_path(kwargs, "page_limit", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_offset_param": "page_offset", + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + + def trigger_investigation( + self, + body: TriggerInvestigationRequest, + ) -> TriggerInvestigationResponse: + """Trigger a Bits AI investigation. + + Trigger a new Bits AI investigation based on a monitor alert. + + :param body: Trigger investigation request body. + :type body: TriggerInvestigationRequest + :rtype: TriggerInvestigationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._trigger_investigation_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index db7cdb8ab0..e9c6175cfe 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -10,6 +10,7 @@ from datadog_api_client.v2.api.application_security_api import ApplicationSecurityApi from datadog_api_client.v2.api.audit_api import AuditApi from datadog_api_client.v2.api.authn_mappings_api import AuthNMappingsApi +from datadog_api_client.v2.api.bits_ai_api import BitsAIApi from datadog_api_client.v2.api.ci_visibility_pipelines_api import CIVisibilityPipelinesApi from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi from datadog_api_client.v2.api.csm_agents_api import CSMAgentsApi @@ -118,6 +119,7 @@ "ApplicationSecurityApi", "AuditApi", "AuthNMappingsApi", + "BitsAIApi", "CIVisibilityPipelinesApi", "CIVisibilityTestsApi", "CSMAgentsApi", diff --git a/src/datadog_api_client/v2/model/get_investigation_response.py b/src/datadog_api_client/v2/model/get_investigation_response.py new file mode 100644 index 0000000000..8a78ae1878 --- /dev/null +++ b/src/datadog_api_client/v2/model/get_investigation_response.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.get_investigation_response_data import GetInvestigationResponseData + from datadog_api_client.v2.model.get_investigation_response_links import GetInvestigationResponseLinks + + +class GetInvestigationResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.get_investigation_response_data import GetInvestigationResponseData + from datadog_api_client.v2.model.get_investigation_response_links import GetInvestigationResponseLinks + + return { + "data": (GetInvestigationResponseData,), + "links": (GetInvestigationResponseLinks,), + } + + attribute_map = { + "data": "data", + "links": "links", + } + + def __init__(self_, data: GetInvestigationResponseData, links: GetInvestigationResponseLinks, **kwargs): + """ + Response for a single Bits AI investigation. + + :param data: Data for the get investigation response. + :type data: GetInvestigationResponseData + + :param links: Links related to the investigation. + :type links: GetInvestigationResponseLinks + """ + super().__init__(kwargs) + + self_.data = data + self_.links = links diff --git a/src/datadog_api_client/v2/model/get_investigation_response_data.py b/src/datadog_api_client/v2/model/get_investigation_response_data.py new file mode 100644 index 0000000000..86fa193f81 --- /dev/null +++ b/src/datadog_api_client/v2/model/get_investigation_response_data.py @@ -0,0 +1,58 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.get_investigation_response_data_attributes import ( + GetInvestigationResponseDataAttributes, + ) + from datadog_api_client.v2.model.investigation_type import InvestigationType + + +class GetInvestigationResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.get_investigation_response_data_attributes import ( + GetInvestigationResponseDataAttributes, + ) + from datadog_api_client.v2.model.investigation_type import InvestigationType + + return { + "attributes": (GetInvestigationResponseDataAttributes,), + "id": (str,), + "type": (InvestigationType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: GetInvestigationResponseDataAttributes, id: str, type: InvestigationType, **kwargs): + """ + Data for the get investigation response. + + :param attributes: Attributes of the investigation. + :type attributes: GetInvestigationResponseDataAttributes + + :param id: The unique identifier of the investigation. + :type id: str + + :param type: The resource type for investigations. + :type type: InvestigationType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/get_investigation_response_data_attributes.py b/src/datadog_api_client/v2/model/get_investigation_response_data_attributes.py new file mode 100644 index 0000000000..c66210f6db --- /dev/null +++ b/src/datadog_api_client/v2/model/get_investigation_response_data_attributes.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.investigation_conclusion import InvestigationConclusion + + +class GetInvestigationResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.investigation_conclusion import InvestigationConclusion + + return { + "conclusions": ([InvestigationConclusion],), + "status": (str,), + "title": (str,), + } + + attribute_map = { + "conclusions": "conclusions", + "status": "status", + "title": "title", + } + + def __init__(self_, conclusions: List[InvestigationConclusion], status: str, title: str, **kwargs): + """ + Attributes of the investigation. + + :param conclusions: The conclusions drawn from the investigation. + :type conclusions: [InvestigationConclusion] + + :param status: The current status of the investigation. + :type status: str + + :param title: The title of the investigation. + :type title: str + """ + super().__init__(kwargs) + + self_.conclusions = conclusions + self_.status = status + self_.title = title diff --git a/src/datadog_api_client/v2/model/get_investigation_response_links.py b/src/datadog_api_client/v2/model/get_investigation_response_links.py new file mode 100644 index 0000000000..a99dfb4803 --- /dev/null +++ b/src/datadog_api_client/v2/model/get_investigation_response_links.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class GetInvestigationResponseLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "self": (str,), + } + + attribute_map = { + "self": "self", + } + + def __init__(self_, self: str, **kwargs): + """ + Links related to the investigation. + + :param self: The URL to the investigation in the Datadog app. + :type self: str + """ + super().__init__(kwargs) + + self_.self = self diff --git a/src/datadog_api_client/v2/model/investigation_conclusion.py b/src/datadog_api_client/v2/model/investigation_conclusion.py new file mode 100644 index 0000000000..5a9026cbc5 --- /dev/null +++ b/src/datadog_api_client/v2/model/investigation_conclusion.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class InvestigationConclusion(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + "summary": (str,), + "title": (str,), + } + + attribute_map = { + "description": "description", + "summary": "summary", + "title": "title", + } + + def __init__(self_, description: str, summary: str, title: str, **kwargs): + """ + A full explanation of the finding, including root cause analysis and supporting evidence. + + :param description: A full explanation of the finding, including root cause analysis and supporting evidence. + :type description: str + + :param summary: A summary of the finding, including affected components and timeframe. + :type summary: str + + :param title: The title of the conclusion. + :type title: str + """ + super().__init__(kwargs) + + self_.description = description + self_.summary = summary + self_.title = title diff --git a/src/datadog_api_client/v2/model/investigation_type.py b/src/datadog_api_client/v2/model/investigation_type.py new file mode 100644 index 0000000000..bf6df6d698 --- /dev/null +++ b/src/datadog_api_client/v2/model/investigation_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class InvestigationType(ModelSimple): + """ + The resource type for investigations. + + :param value: If omitted defaults to "investigation". Must be one of ["investigation"]. + :type value: str + """ + + allowed_values = { + "investigation", + } + INVESTIGATION: ClassVar["InvestigationType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +InvestigationType.INVESTIGATION = InvestigationType("investigation") diff --git a/src/datadog_api_client/v2/model/list_investigations_response.py b/src/datadog_api_client/v2/model/list_investigations_response.py new file mode 100644 index 0000000000..a98c9bc1f6 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_investigations_response.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_investigations_response_data import ListInvestigationsResponseData + from datadog_api_client.v2.model.list_investigations_response_links import ListInvestigationsResponseLinks + from datadog_api_client.v2.model.list_investigations_response_meta import ListInvestigationsResponseMeta + + +class ListInvestigationsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_investigations_response_data import ListInvestigationsResponseData + from datadog_api_client.v2.model.list_investigations_response_links import ListInvestigationsResponseLinks + from datadog_api_client.v2.model.list_investigations_response_meta import ListInvestigationsResponseMeta + + return { + "data": ([ListInvestigationsResponseData],), + "links": (ListInvestigationsResponseLinks,), + "meta": (ListInvestigationsResponseMeta,), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: List[ListInvestigationsResponseData], + links: ListInvestigationsResponseLinks, + meta: ListInvestigationsResponseMeta, + **kwargs, + ): + """ + Response for listing investigations. + + :param data: List of investigations. + :type data: [ListInvestigationsResponseData] + + :param links: Pagination links for the list investigations response. + :type links: ListInvestigationsResponseLinks + + :param meta: Metadata for the list investigations response. + :type meta: ListInvestigationsResponseMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.links = links + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/list_investigations_response_data.py b/src/datadog_api_client/v2/model/list_investigations_response_data.py new file mode 100644 index 0000000000..8c18664f9f --- /dev/null +++ b/src/datadog_api_client/v2/model/list_investigations_response_data.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_investigations_response_data_attributes import ( + ListInvestigationsResponseDataAttributes, + ) + from datadog_api_client.v2.model.investigation_type import InvestigationType + + +class ListInvestigationsResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_investigations_response_data_attributes import ( + ListInvestigationsResponseDataAttributes, + ) + from datadog_api_client.v2.model.investigation_type import InvestigationType + + return { + "attributes": (ListInvestigationsResponseDataAttributes,), + "id": (str,), + "type": (InvestigationType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: ListInvestigationsResponseDataAttributes, id: str, type: InvestigationType, **kwargs + ): + """ + Data for an investigation list item. + + :param attributes: Attributes of an investigation list item. + :type attributes: ListInvestigationsResponseDataAttributes + + :param id: The unique identifier of the investigation. + :type id: str + + :param type: The resource type for investigations. + :type type: InvestigationType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/list_investigations_response_data_attributes.py b/src/datadog_api_client/v2/model/list_investigations_response_data_attributes.py new file mode 100644 index 0000000000..9a704bc7e3 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_investigations_response_data_attributes.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ListInvestigationsResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "status": (str,), + "title": (str,), + } + + attribute_map = { + "status": "status", + "title": "title", + } + + def __init__(self_, status: str, title: str, **kwargs): + """ + Attributes of an investigation list item. + + :param status: The current status of the investigation. + :type status: str + + :param title: The title of the investigation. + :type title: str + """ + super().__init__(kwargs) + + self_.status = status + self_.title = title diff --git a/src/datadog_api_client/v2/model/list_investigations_response_links.py b/src/datadog_api_client/v2/model/list_investigations_response_links.py new file mode 100644 index 0000000000..fbaef14567 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_investigations_response_links.py @@ -0,0 +1,71 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class ListInvestigationsResponseLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "first": (str,), + "last": (str, none_type), + "next": (str,), + "prev": (str, none_type), + "self": (str,), + } + + attribute_map = { + "first": "first", + "last": "last", + "next": "next", + "prev": "prev", + "self": "self", + } + + def __init__( + self_, + first: str, + next: str, + self: str, + last: Union[str, none_type, UnsetType] = unset, + prev: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Pagination links for the list investigations response. + + :param first: Link to the first page. + :type first: str + + :param last: Link to the last page. + :type last: str, none_type, optional + + :param next: Link to the next page. + :type next: str + + :param prev: Link to the previous page. + :type prev: str, none_type, optional + + :param self: Link to the current page. + :type self: str + """ + if last is not unset: + kwargs["last"] = last + if prev is not unset: + kwargs["prev"] = prev + super().__init__(kwargs) + + self_.first = first + self_.next = next + self_.self = self diff --git a/src/datadog_api_client/v2/model/list_investigations_response_meta.py b/src/datadog_api_client/v2/model/list_investigations_response_meta.py new file mode 100644 index 0000000000..cf6a19f70e --- /dev/null +++ b/src/datadog_api_client/v2/model/list_investigations_response_meta.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_investigations_response_meta_page import ListInvestigationsResponseMetaPage + + +class ListInvestigationsResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_investigations_response_meta_page import ( + ListInvestigationsResponseMetaPage, + ) + + return { + "page": (ListInvestigationsResponseMetaPage,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: ListInvestigationsResponseMetaPage, **kwargs): + """ + Metadata for the list investigations response. + + :param page: Pagination metadata. + :type page: ListInvestigationsResponseMetaPage + """ + super().__init__(kwargs) + + self_.page = page diff --git a/src/datadog_api_client/v2/model/list_investigations_response_meta_page.py b/src/datadog_api_client/v2/model/list_investigations_response_meta_page.py new file mode 100644 index 0000000000..8a70a9664d --- /dev/null +++ b/src/datadog_api_client/v2/model/list_investigations_response_meta_page.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ListInvestigationsResponseMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "limit": (int,), + "offset": (int,), + "total": (int,), + } + + attribute_map = { + "limit": "limit", + "offset": "offset", + "total": "total", + } + + def __init__(self_, limit: int, offset: int, total: int, **kwargs): + """ + Pagination metadata. + + :param limit: Maximum number of results per page. + :type limit: int + + :param offset: Offset of the current page. + :type offset: int + + :param total: Total number of investigations. + :type total: int + """ + super().__init__(kwargs) + + self_.limit = limit + self_.offset = offset + self_.total = total diff --git a/src/datadog_api_client/v2/model/monitor_alert_trigger_attributes.py b/src/datadog_api_client/v2/model/monitor_alert_trigger_attributes.py new file mode 100644 index 0000000000..59a2412307 --- /dev/null +++ b/src/datadog_api_client/v2/model/monitor_alert_trigger_attributes.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class MonitorAlertTriggerAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "event_id": (str,), + "event_ts": (int,), + "monitor_id": (int,), + } + + attribute_map = { + "event_id": "event_id", + "event_ts": "event_ts", + "monitor_id": "monitor_id", + } + + def __init__(self_, event_id: str, event_ts: int, monitor_id: int, **kwargs): + """ + Attributes for a monitor alert trigger. + + :param event_id: The event ID associated with the monitor alert. + :type event_id: str + + :param event_ts: The timestamp of the event in Unix milliseconds. + :type event_ts: int + + :param monitor_id: The monitor ID that triggered the alert. + :type monitor_id: int + """ + super().__init__(kwargs) + + self_.event_id = event_id + self_.event_ts = event_ts + self_.monitor_id = monitor_id diff --git a/src/datadog_api_client/v2/model/trigger_attributes.py b/src/datadog_api_client/v2/model/trigger_attributes.py new file mode 100644 index 0000000000..9fee09f879 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_attributes.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.monitor_alert_trigger_attributes import MonitorAlertTriggerAttributes + from datadog_api_client.v2.model.trigger_type import TriggerType + + +class TriggerAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.monitor_alert_trigger_attributes import MonitorAlertTriggerAttributes + from datadog_api_client.v2.model.trigger_type import TriggerType + + return { + "monitor_alert_trigger": (MonitorAlertTriggerAttributes,), + "type": (TriggerType,), + } + + attribute_map = { + "monitor_alert_trigger": "monitor_alert_trigger", + "type": "type", + } + + def __init__(self_, monitor_alert_trigger: MonitorAlertTriggerAttributes, type: TriggerType, **kwargs): + """ + The trigger definition for starting an investigation. + + :param monitor_alert_trigger: Attributes for a monitor alert trigger. + :type monitor_alert_trigger: MonitorAlertTriggerAttributes + + :param type: The type of trigger for the investigation. + :type type: TriggerType + """ + super().__init__(kwargs) + + self_.monitor_alert_trigger = monitor_alert_trigger + self_.type = type diff --git a/src/datadog_api_client/v2/model/trigger_investigation_request.py b/src/datadog_api_client/v2/model/trigger_investigation_request.py new file mode 100644 index 0000000000..0e3d343897 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.trigger_investigation_request_data import TriggerInvestigationRequestData + + +class TriggerInvestigationRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.trigger_investigation_request_data import TriggerInvestigationRequestData + + return { + "data": (TriggerInvestigationRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TriggerInvestigationRequestData, **kwargs): + """ + Request to trigger a new investigation. + + :param data: Data for the trigger investigation request. + :type data: TriggerInvestigationRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/trigger_investigation_request_data.py b/src/datadog_api_client/v2/model/trigger_investigation_request_data.py new file mode 100644 index 0000000000..de267eb21c --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_request_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.trigger_investigation_request_data_attributes import ( + TriggerInvestigationRequestDataAttributes, + ) + from datadog_api_client.v2.model.trigger_investigation_request_type import TriggerInvestigationRequestType + + +class TriggerInvestigationRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.trigger_investigation_request_data_attributes import ( + TriggerInvestigationRequestDataAttributes, + ) + from datadog_api_client.v2.model.trigger_investigation_request_type import TriggerInvestigationRequestType + + return { + "attributes": (TriggerInvestigationRequestDataAttributes,), + "type": (TriggerInvestigationRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: TriggerInvestigationRequestDataAttributes, type: TriggerInvestigationRequestType, **kwargs + ): + """ + Data for the trigger investigation request. + + :param attributes: Attributes for the trigger investigation request. + :type attributes: TriggerInvestigationRequestDataAttributes + + :param type: The resource type for trigger investigation requests. + :type type: TriggerInvestigationRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/trigger_investigation_request_data_attributes.py b/src/datadog_api_client/v2/model/trigger_investigation_request_data_attributes.py new file mode 100644 index 0000000000..e0c5c0729c --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_request_data_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.trigger_attributes import TriggerAttributes + + +class TriggerInvestigationRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.trigger_attributes import TriggerAttributes + + return { + "trigger": (TriggerAttributes,), + } + + attribute_map = { + "trigger": "trigger", + } + + def __init__(self_, trigger: TriggerAttributes, **kwargs): + """ + Attributes for the trigger investigation request. + + :param trigger: The trigger definition for starting an investigation. + :type trigger: TriggerAttributes + """ + super().__init__(kwargs) + + self_.trigger = trigger diff --git a/src/datadog_api_client/v2/model/trigger_investigation_request_type.py b/src/datadog_api_client/v2/model/trigger_investigation_request_type.py new file mode 100644 index 0000000000..e1dee13498 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_request_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TriggerInvestigationRequestType(ModelSimple): + """ + The resource type for trigger investigation requests. + + :param value: If omitted defaults to "trigger_investigation_request". Must be one of ["trigger_investigation_request"]. + :type value: str + """ + + allowed_values = { + "trigger_investigation_request", + } + TRIGGER_INVESTIGATION_REQUEST: ClassVar["TriggerInvestigationRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TriggerInvestigationRequestType.TRIGGER_INVESTIGATION_REQUEST = TriggerInvestigationRequestType( + "trigger_investigation_request" +) diff --git a/src/datadog_api_client/v2/model/trigger_investigation_response.py b/src/datadog_api_client/v2/model/trigger_investigation_response.py new file mode 100644 index 0000000000..4d6276c915 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.trigger_investigation_response_data import TriggerInvestigationResponseData + + +class TriggerInvestigationResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.trigger_investigation_response_data import TriggerInvestigationResponseData + + return { + "data": (TriggerInvestigationResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TriggerInvestigationResponseData, **kwargs): + """ + Response after triggering an investigation. + + :param data: Data for the trigger investigation response. + :type data: TriggerInvestigationResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/trigger_investigation_response_data.py b/src/datadog_api_client/v2/model/trigger_investigation_response_data.py new file mode 100644 index 0000000000..19603c9714 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_response_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.trigger_investigation_response_data_attributes import ( + TriggerInvestigationResponseDataAttributes, + ) + from datadog_api_client.v2.model.trigger_investigation_response_type import TriggerInvestigationResponseType + + +class TriggerInvestigationResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.trigger_investigation_response_data_attributes import ( + TriggerInvestigationResponseDataAttributes, + ) + from datadog_api_client.v2.model.trigger_investigation_response_type import TriggerInvestigationResponseType + + return { + "attributes": (TriggerInvestigationResponseDataAttributes,), + "id": (str,), + "type": (TriggerInvestigationResponseType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: TriggerInvestigationResponseDataAttributes, + id: str, + type: TriggerInvestigationResponseType, + **kwargs, + ): + """ + Data for the trigger investigation response. + + :param attributes: Attributes for the trigger investigation response. + :type attributes: TriggerInvestigationResponseDataAttributes + + :param id: Unique identifier for the trigger response. + :type id: str + + :param type: The resource type for trigger investigation responses. + :type type: TriggerInvestigationResponseType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/trigger_investigation_response_data_attributes.py b/src/datadog_api_client/v2/model/trigger_investigation_response_data_attributes.py new file mode 100644 index 0000000000..4575718680 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_response_data_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class TriggerInvestigationResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "investigation_id": (str,), + } + + attribute_map = { + "investigation_id": "investigation_id", + } + + def __init__(self_, investigation_id: str, **kwargs): + """ + Attributes for the trigger investigation response. + + :param investigation_id: The ID of the investigation that was created. + :type investigation_id: str + """ + super().__init__(kwargs) + + self_.investigation_id = investigation_id diff --git a/src/datadog_api_client/v2/model/trigger_investigation_response_type.py b/src/datadog_api_client/v2/model/trigger_investigation_response_type.py new file mode 100644 index 0000000000..0071c37689 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_investigation_response_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TriggerInvestigationResponseType(ModelSimple): + """ + The resource type for trigger investigation responses. + + :param value: If omitted defaults to "trigger_investigation_response". Must be one of ["trigger_investigation_response"]. + :type value: str + """ + + allowed_values = { + "trigger_investigation_response", + } + TRIGGER_INVESTIGATION_RESPONSE: ClassVar["TriggerInvestigationResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TriggerInvestigationResponseType.TRIGGER_INVESTIGATION_RESPONSE = TriggerInvestigationResponseType( + "trigger_investigation_response" +) diff --git a/src/datadog_api_client/v2/model/trigger_type.py b/src/datadog_api_client/v2/model/trigger_type.py new file mode 100644 index 0000000000..6e0885aaa5 --- /dev/null +++ b/src/datadog_api_client/v2/model/trigger_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TriggerType(ModelSimple): + """ + The type of trigger for the investigation. + + :param value: If omitted defaults to "monitor_alert_trigger". Must be one of ["monitor_alert_trigger"]. + :type value: str + """ + + allowed_values = { + "monitor_alert_trigger", + } + MONITOR_ALERT_TRIGGER: ClassVar["TriggerType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TriggerType.MONITOR_ALERT_TRIGGER = TriggerType("monitor_alert_trigger") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 22f4a4d800..e2cc85a296 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2343,6 +2343,12 @@ from datadog_api_client.v2.model.get_finding_response import GetFindingResponse from datadog_api_client.v2.model.get_interfaces_data import GetInterfacesData from datadog_api_client.v2.model.get_interfaces_response import GetInterfacesResponse +from datadog_api_client.v2.model.get_investigation_response import GetInvestigationResponse +from datadog_api_client.v2.model.get_investigation_response_data import GetInvestigationResponseData +from datadog_api_client.v2.model.get_investigation_response_data_attributes import ( + GetInvestigationResponseDataAttributes, +) +from datadog_api_client.v2.model.get_investigation_response_links import GetInvestigationResponseLinks from datadog_api_client.v2.model.get_issue_include_query_parameter_item import GetIssueIncludeQueryParameterItem from datadog_api_client.v2.model.get_mapping_response import GetMappingResponse from datadog_api_client.v2.model.get_mapping_response_data import GetMappingResponseData @@ -2835,6 +2841,8 @@ from datadog_api_client.v2.model.integration_type import IntegrationType from datadog_api_client.v2.model.interface_attributes import InterfaceAttributes from datadog_api_client.v2.model.interface_attributes_status import InterfaceAttributesStatus +from datadog_api_client.v2.model.investigation_conclusion import InvestigationConclusion +from datadog_api_client.v2.model.investigation_type import InvestigationType from datadog_api_client.v2.model.issue import Issue from datadog_api_client.v2.model.issue_assignee_relationship import IssueAssigneeRelationship from datadog_api_client.v2.model.issue_attributes import IssueAttributes @@ -3120,6 +3128,14 @@ from datadog_api_client.v2.model.list_integrations_response import ListIntegrationsResponse from datadog_api_client.v2.model.list_interface_tags_response import ListInterfaceTagsResponse from datadog_api_client.v2.model.list_interface_tags_response_data import ListInterfaceTagsResponseData +from datadog_api_client.v2.model.list_investigations_response import ListInvestigationsResponse +from datadog_api_client.v2.model.list_investigations_response_data import ListInvestigationsResponseData +from datadog_api_client.v2.model.list_investigations_response_data_attributes import ( + ListInvestigationsResponseDataAttributes, +) +from datadog_api_client.v2.model.list_investigations_response_links import ListInvestigationsResponseLinks +from datadog_api_client.v2.model.list_investigations_response_meta import ListInvestigationsResponseMeta +from datadog_api_client.v2.model.list_investigations_response_meta_page import ListInvestigationsResponseMetaPage from datadog_api_client.v2.model.list_kind_catalog_response import ListKindCatalogResponse from datadog_api_client.v2.model.list_notification_channels_response import ListNotificationChannelsResponse from datadog_api_client.v2.model.list_on_call_notification_rules_response import ListOnCallNotificationRulesResponse @@ -3449,6 +3465,7 @@ from datadog_api_client.v2.model.microsoft_teams_workflows_webhook_response_attributes import ( MicrosoftTeamsWorkflowsWebhookResponseAttributes, ) +from datadog_api_client.v2.model.monitor_alert_trigger_attributes import MonitorAlertTriggerAttributes from datadog_api_client.v2.model.monitor_config_policy_attribute_create_request import ( MonitorConfigPolicyAttributeCreateRequest, ) @@ -6491,8 +6508,22 @@ from datadog_api_client.v2.model.timeseries_response_values_list import TimeseriesResponseValuesList from datadog_api_client.v2.model.token_type import TokenType from datadog_api_client.v2.model.trigger import Trigger +from datadog_api_client.v2.model.trigger_attributes import TriggerAttributes +from datadog_api_client.v2.model.trigger_investigation_request import TriggerInvestigationRequest +from datadog_api_client.v2.model.trigger_investigation_request_data import TriggerInvestigationRequestData +from datadog_api_client.v2.model.trigger_investigation_request_data_attributes import ( + TriggerInvestigationRequestDataAttributes, +) +from datadog_api_client.v2.model.trigger_investigation_request_type import TriggerInvestigationRequestType +from datadog_api_client.v2.model.trigger_investigation_response import TriggerInvestigationResponse +from datadog_api_client.v2.model.trigger_investigation_response_data import TriggerInvestigationResponseData +from datadog_api_client.v2.model.trigger_investigation_response_data_attributes import ( + TriggerInvestigationResponseDataAttributes, +) +from datadog_api_client.v2.model.trigger_investigation_response_type import TriggerInvestigationResponseType from datadog_api_client.v2.model.trigger_rate_limit import TriggerRateLimit from datadog_api_client.v2.model.trigger_source import TriggerSource +from datadog_api_client.v2.model.trigger_type import TriggerType from datadog_api_client.v2.model.uc_config_pair import UCConfigPair from datadog_api_client.v2.model.uc_config_pair_data import UCConfigPairData from datadog_api_client.v2.model.uc_config_pair_data_attributes import UCConfigPairDataAttributes @@ -8560,6 +8591,10 @@ "GetFindingResponse", "GetInterfacesData", "GetInterfacesResponse", + "GetInvestigationResponse", + "GetInvestigationResponseData", + "GetInvestigationResponseDataAttributes", + "GetInvestigationResponseLinks", "GetIssueIncludeQueryParameterItem", "GetMappingResponse", "GetMappingResponseData", @@ -8930,6 +8965,8 @@ "IntegrationType", "InterfaceAttributes", "InterfaceAttributesStatus", + "InvestigationConclusion", + "InvestigationType", "Issue", "IssueAssigneeRelationship", "IssueAttributes", @@ -9167,6 +9204,12 @@ "ListIntegrationsResponse", "ListInterfaceTagsResponse", "ListInterfaceTagsResponseData", + "ListInvestigationsResponse", + "ListInvestigationsResponseData", + "ListInvestigationsResponseDataAttributes", + "ListInvestigationsResponseLinks", + "ListInvestigationsResponseMeta", + "ListInvestigationsResponseMetaPage", "ListKindCatalogResponse", "ListNotificationChannelsResponse", "ListOnCallNotificationRulesResponse", @@ -9414,6 +9457,7 @@ "MicrosoftTeamsWorkflowsWebhookHandleType", "MicrosoftTeamsWorkflowsWebhookHandlesResponse", "MicrosoftTeamsWorkflowsWebhookResponseAttributes", + "MonitorAlertTriggerAttributes", "MonitorConfigPolicyAttributeCreateRequest", "MonitorConfigPolicyAttributeEditRequest", "MonitorConfigPolicyAttributeResponse", @@ -11362,8 +11406,18 @@ "TimeseriesResponseValuesList", "TokenType", "Trigger", + "TriggerAttributes", + "TriggerInvestigationRequest", + "TriggerInvestigationRequestData", + "TriggerInvestigationRequestDataAttributes", + "TriggerInvestigationRequestType", + "TriggerInvestigationResponse", + "TriggerInvestigationResponseData", + "TriggerInvestigationResponseDataAttributes", + "TriggerInvestigationResponseType", "TriggerRateLimit", "TriggerSource", + "TriggerType", "UCConfigPair", "UCConfigPairData", "UCConfigPairDataAttributes", diff --git a/tests/v2/features/bits_ai.feature b/tests/v2/features/bits_ai.feature new file mode 100644 index 0000000000..bc5ec941d8 --- /dev/null +++ b/tests/v2/features/bits_ai.feature @@ -0,0 +1,69 @@ +@endpoint(bits-ai) @endpoint(bits-ai-v2) +Feature: Bits AI + Use the Bits AI 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 + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 1f11ffb7e7..f1934b08c4 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -650,6 +650,24 @@ "type": "idempotent" } }, + "ListInvestigations": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, + "TriggerInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "unsafe" + } + }, + "GetInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, "SearchCases": { "tag": "Case Management", "undo": {