diff --git a/.apigentools-info b/.apigentools-info index 7ec681136f..55364622ca 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-04-04 20:19:29.358542", - "spec_repo_commit": "3909ab62" + "regenerated": "2025-04-07 18:49:41.536548", + "spec_repo_commit": "d0287df0" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-04-04 20:19:29.373801", - "spec_repo_commit": "3909ab62" + "regenerated": "2025-04-07 18:49:41.551076", + "spec_repo_commit": "d0287df0" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 87935c5f60..4070b85967 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21478,6 +21478,668 @@ components: - id - type type: object + ObservabilityPipeline: + description: Top-level schema representing a pipeline. + properties: + data: + $ref: '#/components/schemas/ObservabilityPipelineData' + required: + - data + type: object + ObservabilityPipelineAddFieldsProcessor: + description: The `add_fields` processor adds static key-value fields to logs. + properties: + fields: + description: A list of static fields (key-value pairs) that is added to + each log event processed by this component. + items: + $ref: '#/components/schemas/ObservabilityPipelineFieldValue' + type: array + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (for example, as the `input` + to downstream components). + example: add-fields-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + inputs: + description: A list of component IDs whose output is used as the `input` + for this component. + example: + - datadog-agent-source + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineAddFieldsProcessorType' + required: + - id + - type + - include + - fields + - inputs + type: object + ObservabilityPipelineAddFieldsProcessorType: + default: add_fields + description: The processor type. The value should always be `add_fields`. + enum: + - add_fields + example: add_fields + type: string + x-enum-varnames: + - ADD_FIELDS + ObservabilityPipelineConfig: + description: Specifies the pipeline's configuration, including its sources, + processors, and destinations. + properties: + destinations: + description: A list of destination components where processed logs are sent. + example: + - id: datadog-logs-destination + inputs: + - filter-processor + type: datadog_logs + items: + $ref: '#/components/schemas/ObservabilityPipelineConfigDestinationItem' + type: array + processors: + description: A list of processors that transform or enrich log data. + example: + - id: filter-processor + include: service:my-service + inputs: + - datadog-agent-source + type: filter + items: + $ref: '#/components/schemas/ObservabilityPipelineConfigProcessorItem' + type: array + sources: + description: A list of configured data sources for the pipeline. + example: + - id: datadog-agent-source + type: datadog_agent + items: + $ref: '#/components/schemas/ObservabilityPipelineConfigSourceItem' + type: array + required: + - sources + - processors + - destinations + type: object + ObservabilityPipelineConfigDestinationItem: + description: A destination for the pipeline. + oneOf: + - $ref: '#/components/schemas/ObservabilityPipelineDatadogLogsDestination' + ObservabilityPipelineConfigProcessorItem: + description: A processor for the pipeline. + oneOf: + - $ref: '#/components/schemas/ObservabilityPipelineFilterProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineParseJSONProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineAddFieldsProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineRemoveFieldsProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineRenameFieldsProcessor' + ObservabilityPipelineConfigSourceItem: + description: A data source for the pipeline. + oneOf: + - $ref: '#/components/schemas/ObservabilityPipelineKafkaSource' + - $ref: '#/components/schemas/ObservabilityPipelineDatadogAgentSource' + ObservabilityPipelineCreateRequest: + description: Top-level schema representing a pipeline. + properties: + data: + $ref: '#/components/schemas/ObservabilityPipelineCreateRequestData' + required: + - data + type: object + ObservabilityPipelineCreateRequestData: + description: "Contains the pipeline\u2019s ID, type, and configuration attributes." + properties: + attributes: + $ref: '#/components/schemas/ObservabilityPipelineDataAttributes' + type: + default: pipelines + description: The resource type identifier. For pipeline resources, this + should always be set to `pipelines`. + example: pipelines + type: string + required: + - type + - attributes + type: object + ObservabilityPipelineData: + description: "Contains the pipeline\u2019s ID, type, and configuration attributes." + properties: + attributes: + $ref: '#/components/schemas/ObservabilityPipelineDataAttributes' + id: + description: Unique identifier for the pipeline. + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: string + type: + default: pipelines + description: The resource type identifier. For pipeline resources, this + should always be set to `pipelines`. + example: pipelines + type: string + required: + - id + - type + - attributes + type: object + ObservabilityPipelineDataAttributes: + description: "Defines the pipeline\u2019s name and its components (sources, + processors, and destinations)." + properties: + config: + $ref: '#/components/schemas/ObservabilityPipelineConfig' + name: + description: Name of the pipeline. + example: Main Observability Pipeline + type: string + required: + - name + - config + type: object + ObservabilityPipelineDatadogAgentSource: + description: The `datadog_agent` source collects logs from the Datadog Agent. + properties: + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (e.g., as input to downstream + components). + example: datadog-agent-source + type: string + tls: + $ref: '#/components/schemas/ObservabilityPipelineTls' + type: + $ref: '#/components/schemas/ObservabilityPipelineDatadogAgentSourceType' + required: + - id + - type + type: object + ObservabilityPipelineDatadogAgentSourceType: + default: datadog_agent + description: The source type. The value should always be `datadog_agent`. + enum: + - datadog_agent + example: datadog_agent + type: string + x-enum-varnames: + - DATADOG_AGENT + ObservabilityPipelineDatadogLogsDestination: + description: The `datadog_logs` destination forwards logs to Datadog Log Management. + properties: + id: + description: The unique identifier for this component. + example: datadog-logs-destination + type: string + inputs: + description: A list of component IDs whose output is used as the `input` + for this component. + example: + - filter-processor + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineDatadogLogsDestinationType' + required: + - id + - type + - inputs + type: object + ObservabilityPipelineDatadogLogsDestinationType: + default: datadog_logs + description: The destination type. The value should always be `datadog_logs`. + enum: + - datadog_logs + example: datadog_logs + type: string + x-enum-varnames: + - DATADOG_LOGS + ObservabilityPipelineFieldValue: + description: Represents a static key-value pair used in various processors. + properties: + name: + description: The field name. + example: field_name + type: string + value: + description: The field value. + example: field_value + type: string + required: + - name + - value + type: object + ObservabilityPipelineFilterProcessor: + description: The `filter` processor allows conditional processing of logs based + on a Datadog search query. Logs that match the `include` query are passed + through; others are discarded. + properties: + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (for example, as the `input` + to downstream components). + example: filter-processor + type: string + include: + description: A Datadog search query used to determine which logs should + pass through the filter. Logs that match this query continue to downstream + components; others are dropped. + example: service:my-service + type: string + inputs: + description: A list of component IDs whose output is used as the `input` + for this component. + example: + - datadog-agent-source + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineFilterProcessorType' + required: + - id + - type + - include + - inputs + type: object + ObservabilityPipelineFilterProcessorType: + default: filter + description: The processor type. The value should always be `filter`. + enum: + - filter + example: filter + type: string + x-enum-varnames: + - FILTER + ObservabilityPipelineKafkaSource: + description: The `kafka` source ingests data from Apache Kafka topics. + properties: + group_id: + description: Consumer group ID used by the Kafka client. + example: consumer-group-0 + type: string + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (e.g., as input to downstream + components). + example: kafka-source + type: string + librdkafka_options: + description: Optional list of advanced Kafka client configuration options, + defined as key-value pairs. + items: + $ref: '#/components/schemas/ObservabilityPipelineKafkaSourceLibrdkafkaOption' + type: array + sasl: + $ref: '#/components/schemas/ObservabilityPipelineKafkaSourceSasl' + tls: + $ref: '#/components/schemas/ObservabilityPipelineTls' + topics: + description: A list of Kafka topic names to subscribe to. The source ingests + messages from each topic specified. + example: + - topic1 + - topic2 + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineKafkaSourceType' + required: + - id + - type + - group_id + - topics + type: object + ObservabilityPipelineKafkaSourceLibrdkafkaOption: + description: Represents a key-value pair used to configure low-level `librdkafka` + client options for Kafka sources, such as timeouts, buffer sizes, and security + settings. + properties: + name: + description: The name of the `librdkafka` configuration option to set. + example: fetch.message.max.bytes + type: string + value: + description: The value assigned to the specified `librdkafka` configuration + option. + example: '1048576' + type: string + required: + - name + - value + type: object + ObservabilityPipelineKafkaSourceSasl: + description: Specifies the SASL mechanism for authenticating with a Kafka cluster. + properties: + mechanism: + $ref: '#/components/schemas/ObservabilityPipelinePipelineKafkaSourceSaslMechanism' + type: object + ObservabilityPipelineKafkaSourceType: + default: kafka + description: The source type. The value should always be `kafka`. + enum: + - kafka + example: kafka + type: string + x-enum-varnames: + - KAFKA + ObservabilityPipelineParseJSONProcessor: + description: The `parse_json` processor extracts JSON from a specified field + and flattens it into the event. This is useful when logs contain embedded + JSON as a string. + properties: + field: + description: The name of the log field that contains a JSON string. + example: message + type: string + id: + description: A unique identifier for this component. Used to reference this + component in other parts of the pipeline (e.g., as input to downstream + components). + example: parse-json-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + inputs: + description: A list of component IDs whose output is used as the `input` + for this component. + example: + - datadog-agent-source + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineParseJSONProcessorType' + required: + - id + - type + - include + - field + - inputs + type: object + ObservabilityPipelineParseJSONProcessorType: + default: parse_json + description: The processor type. The value should always be `parse_json`. + enum: + - parse_json + example: parse_json + type: string + x-enum-varnames: + - PARSE_JSON + ObservabilityPipelinePipelineKafkaSourceSaslMechanism: + description: SASL mechanism used for Kafka authentication. + enum: + - PLAIN + - SCRAM-SHA-256 + - SCRAM-SHA-512 + type: string + x-enum-varnames: + - PLAIN + - SCRAMNOT_SHANOT_256 + - SCRAMNOT_SHANOT_512 + ObservabilityPipelineQuotaProcessor: + description: The Quota Processor measures logging traffic for logs that match + a specified filter. When the configured daily quota is met, the processor + can drop or alert. + properties: + drop_events: + description: If set to `true`, logs that matched the quota filter and sent + after the quota has been met are dropped; only logs that did not match + the filter query continue through the pipeline. + example: false + type: boolean + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (for example, as the `input` + to downstream components). + example: quota-processor + type: string + ignore_when_missing_partitions: + description: If `true`, the processor skips quota checks when partition + fields are missing from the logs. + type: boolean + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + inputs: + description: A list of component IDs whose output is used as the `input` + for this component. + example: + - datadog-agent-source + items: + type: string + type: array + limit: + $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessorLimit' + name: + description: Name for identifying the processor. + example: MyPipelineQuotaProcessor + type: string + overrides: + description: A list of alternate quota rules that apply to specific sets + of events, identified by matching field values. Each override can define + a custom limit. + items: + $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessorOverride' + type: array + partition_fields: + description: A list of fields used to segment log traffic for quota enforcement. + Quotas are tracked independently by unique combinations of these field + values. + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessorType' + required: + - id + - type + - include + - name + - drop_events + - limit + - inputs + type: object + ObservabilityPipelineQuotaProcessorLimit: + description: The maximum amount of data or number of events allowed before the + quota is enforced. Can be specified in bytes or events. + properties: + enforce: + $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessorLimitEnforceType' + limit: + description: The limit for quota enforcement. + example: 1000 + format: int64 + type: integer + required: + - enforce + - limit + type: object + ObservabilityPipelineQuotaProcessorLimitEnforceType: + description: Unit for quota enforcement in bytes for data size or events for + count. + enum: + - bytes + - events + example: bytes + type: string + x-enum-varnames: + - BYTES + - EVENTS + ObservabilityPipelineQuotaProcessorOverride: + description: Defines a custom quota limit that applies to specific log events + based on matching field values. + properties: + fields: + description: A list of field matchers used to apply a specific override. + If an event matches all listed key-value pairs, the corresponding override + limit is enforced. + items: + $ref: '#/components/schemas/ObservabilityPipelineFieldValue' + type: array + limit: + $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessorLimit' + required: + - fields + - limit + type: object + ObservabilityPipelineQuotaProcessorType: + default: quota + description: The processor type. The value should always be `quota`. + enum: + - quota + example: quota + type: string + x-enum-varnames: + - QUOTA + ObservabilityPipelineRemoveFieldsProcessor: + description: The `remove_fields` processor deletes specified fields from logs. + properties: + fields: + description: A list of field names to be removed from each log event. + example: + - field1 + - field2 + items: + type: string + type: array + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (e.g., as input to downstream + components). + example: remove-fields-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + inputs: + description: The `PipelineRemoveFieldsProcessor` `inputs`. + example: + - datadog-agent-source + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineRemoveFieldsProcessorType' + required: + - id + - type + - include + - fields + - inputs + type: object + ObservabilityPipelineRemoveFieldsProcessorType: + default: remove_fields + description: The processor type. The value should always be `remove_fields`. + enum: + - remove_fields + example: remove_fields + type: string + x-enum-varnames: + - REMOVE_FIELDS + ObservabilityPipelineRenameFieldsProcessor: + description: The `rename_fields` processor changes field names. + properties: + fields: + description: A list of rename rules specifying which fields to rename in + the event, what to rename them to, and whether to preserve the original + fields. + items: + $ref: '#/components/schemas/ObservabilityPipelineRenameFieldsProcessorField' + type: array + id: + description: A unique identifier for this component. Used to reference this + component in other parts of the pipeline (e.g., as input to downstream + components). + example: rename-fields-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + inputs: + description: A list of component IDs whose output is used as the `input` + for this component. + example: + - datadog-agent-source + items: + type: string + type: array + type: + $ref: '#/components/schemas/ObservabilityPipelineRenameFieldsProcessorType' + required: + - id + - type + - include + - fields + - inputs + type: object + ObservabilityPipelineRenameFieldsProcessorField: + description: Defines how to rename a field in log events. + properties: + destination: + description: The field name to assign the renamed value to. + example: destination_field + type: string + preserve_source: + description: Indicates whether the original field, that is received from + the source, should be kept (`true`) or removed (`false`) after renaming. + example: false + type: boolean + source: + description: The original field name in the log event that should be renamed. + example: source_field + type: string + required: + - source + - destination + - preserve_source + type: object + ObservabilityPipelineRenameFieldsProcessorType: + default: rename_fields + description: The processor type. The value should always be `rename_fields`. + enum: + - rename_fields + example: rename_fields + type: string + x-enum-varnames: + - RENAME_FIELDS + ObservabilityPipelineTls: + description: Configuration for enabling TLS encryption. + properties: + ca_file: + description: "Path to the Certificate Authority (CA) file used to validate + the server\u2019s TLS certificate." + type: string + crt_file: + description: Path to the TLS client certificate file used to authenticate + the pipeline component with upstream or downstream services. + example: /path/to/cert.crt + type: string + key_file: + description: Path to the private key file associated with the TLS client + certificate. Used for mutual TLS authentication. + type: string + required: + - crt_file + type: object OktaAccount: description: Schema for an Okta account. properties: @@ -45671,6 +46333,167 @@ paths: summary: Get the latest CSM Threats policy tags: - CSM Threats + /api/v2/remote_config/products/obs_pipelines/pipelines: + post: + description: Create a new pipeline. + operationId: CreatePipeline + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObservabilityPipelineCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ObservabilityPipeline' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a new pipeline + tags: + - Observability Pipelines + x-unstable: '**Note**: This endpoint is in Preview.' + /api/v2/remote_config/products/obs_pipelines/pipelines/{pipeline_id}: + delete: + description: Delete a pipeline. + operationId: DeletePipeline + parameters: + - description: The ID of the pipeline to delete. + in: path + name: pipeline_id + required: true + schema: + type: string + responses: + '204': + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a pipeline + tags: + - Observability Pipelines + x-unstable: '**Note**: This endpoint is in Preview.' + get: + description: Get a specific pipeline by its ID. + operationId: GetPipeline + parameters: + - description: The ID of the pipeline to retrieve. + in: path + name: pipeline_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ObservabilityPipeline' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a specific pipeline + tags: + - Observability Pipelines + x-unstable: '**Note**: This endpoint is in Preview.' + put: + description: Update a pipeline. + operationId: UpdatePipeline + parameters: + - description: The ID of the pipeline to update. + in: path + name: pipeline_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObservabilityPipeline' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ObservabilityPipeline' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a pipeline + tags: + - Observability Pipelines + x-unstable: '**Note**: This endpoint is in Preview.' /api/v2/restriction_policy/{resource_id}: delete: description: Deletes the restriction policy associated with a specified resource. @@ -54015,6 +54838,12 @@ tags: and their attributes. See the [Network Device Monitoring page](https://docs.datadoghq.com/network_monitoring/) for more information. name: Network Device Monitoring +- description: Observability Pipelines allows you to collect and process logs within + your own infrastructure, and then route them to downstream integrations. + externalDocs: + description: Find out more at + url: https://docs.datadoghq.com/observability_pipelines/ + name: Observability Pipelines - description: Configure your [Datadog Okta integration](https://docs.datadoghq.com/integrations/okta/) directly through the Datadog API. name: Okta Integration diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index e8c57fd1ca..0fb59f6536 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -305,6 +305,13 @@ datadog\_api\_client.v2.api.network\_device\_monitoring\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.observability\_pipelines\_api module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.observability_pipelines_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.okta\_integration\_api module --------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 4a6a9f4699..40947c52f4 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -9265,6 +9265,258 @@ datadog\_api\_client.v2.model.nullable\_user\_relationship\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.observability\_pipeline module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_add\_fields\_processor module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_add_fields_processor + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_add\_fields\_processor\_type module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_add_fields_processor_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_config module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_config\_destination\_item module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_config_destination_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_config\_processor\_item module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_config_processor_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_config\_source\_item module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_config_source_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_create\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_create\_request\_data module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_create_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_data\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_datadog\_agent\_source module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_datadog_agent_source + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_datadog\_agent\_source\_type module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_datadog\_logs\_destination module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_datadog\_logs\_destination\_type module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_field\_value module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_field_value + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_filter\_processor module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_filter_processor + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_filter\_processor\_type module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_filter_processor_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_kafka\_source module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_kafka_source + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_kafka\_source\_librdkafka\_option module +----------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_kafka_source_librdkafka_option + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_kafka\_source\_sasl module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_kafka_source_sasl + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_kafka\_source\_type module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_kafka_source_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_parse\_json\_processor module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_parse_json_processor + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_parse\_json\_processor\_type module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_parse_json_processor_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_pipeline\_kafka\_source\_sasl\_mechanism module +------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_pipeline_kafka_source_sasl_mechanism + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_quota\_processor module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_quota_processor + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_quota\_processor\_limit module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_quota_processor_limit + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_quota\_processor\_limit\_enforce\_type module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_quota_processor_limit_enforce_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_quota\_processor\_override module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_quota_processor_override + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_quota\_processor\_type module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_quota_processor_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_remove\_fields\_processor module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_remove_fields_processor + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_remove\_fields\_processor\_type module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_remove_fields_processor_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_rename\_fields\_processor module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_rename_fields_processor + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_rename\_fields\_processor\_field module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_rename_fields_processor_field + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_rename\_fields\_processor\_type module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_rename_fields_processor_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_tls module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_tls + :members: + :show-inheritance: + datadog\_api\_client.v2.model.okta\_account module -------------------------------------------------- diff --git a/examples/v2/observability-pipelines/CreatePipeline.py b/examples/v2/observability-pipelines/CreatePipeline.py new file mode 100644 index 0000000000..12008e4acd --- /dev/null +++ b/examples/v2/observability-pipelines/CreatePipeline.py @@ -0,0 +1,72 @@ +""" +Create a new pipeline returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_create_request import ObservabilityPipelineCreateRequest +from datadog_api_client.v2.model.observability_pipeline_create_request_data import ( + ObservabilityPipelineCreateRequestData, +) +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import ( + ObservabilityPipelineDatadogLogsDestination, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import ( + ObservabilityPipelineDatadogLogsDestinationType, +) +from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor +from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import ( + ObservabilityPipelineFilterProcessorType, +) + +body = ObservabilityPipelineCreateRequest( + data=ObservabilityPipelineCreateRequestData( + attributes=ObservabilityPipelineDataAttributes( + config=ObservabilityPipelineConfig( + destinations=[ + ObservabilityPipelineDatadogLogsDestination( + id="datadog-logs-destination", + inputs=[ + "filter-processor", + ], + type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS, + ), + ], + processors=[ + ObservabilityPipelineFilterProcessor( + id="filter-processor", + include="service:my-service", + inputs=[ + "datadog-agent-source", + ], + type=ObservabilityPipelineFilterProcessorType.FILTER, + ), + ], + sources=[ + ObservabilityPipelineDatadogAgentSource( + id="datadog-agent-source", + type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT, + ), + ], + ), + name="Main Observability Pipeline", + ), + type="pipelines", + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_pipeline"] = True +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.create_pipeline(body=body) + + print(response) diff --git a/examples/v2/observability-pipelines/DeletePipeline.py b/examples/v2/observability-pipelines/DeletePipeline.py new file mode 100644 index 0000000000..1375a1e59d --- /dev/null +++ b/examples/v2/observability-pipelines/DeletePipeline.py @@ -0,0 +1,18 @@ +""" +Delete a pipeline returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi + +# there is a valid "pipeline" in the system +PIPELINE_DATA_ID = environ["PIPELINE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_pipeline"] = True +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + api_instance.delete_pipeline( + pipeline_id=PIPELINE_DATA_ID, + ) diff --git a/examples/v2/observability-pipelines/GetPipeline.py b/examples/v2/observability-pipelines/GetPipeline.py new file mode 100644 index 0000000000..d42a432a3b --- /dev/null +++ b/examples/v2/observability-pipelines/GetPipeline.py @@ -0,0 +1,20 @@ +""" +Get a specific pipeline returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi + +# there is a valid "pipeline" in the system +PIPELINE_DATA_ID = environ["PIPELINE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_pipeline"] = True +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.get_pipeline( + pipeline_id=PIPELINE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/observability-pipelines/UpdatePipeline.py b/examples/v2/observability-pipelines/UpdatePipeline.py new file mode 100644 index 0000000000..9d036b867c --- /dev/null +++ b/examples/v2/observability-pipelines/UpdatePipeline.py @@ -0,0 +1,75 @@ +""" +Update a pipeline returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi +from datadog_api_client.v2.model.observability_pipeline import ObservabilityPipeline +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_data import ObservabilityPipelineData +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import ( + ObservabilityPipelineDatadogLogsDestination, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import ( + ObservabilityPipelineDatadogLogsDestinationType, +) +from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor +from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import ( + ObservabilityPipelineFilterProcessorType, +) + +# there is a valid "pipeline" in the system +PIPELINE_DATA_ID = environ["PIPELINE_DATA_ID"] + +body = ObservabilityPipeline( + data=ObservabilityPipelineData( + attributes=ObservabilityPipelineDataAttributes( + config=ObservabilityPipelineConfig( + destinations=[ + ObservabilityPipelineDatadogLogsDestination( + id="updated-datadog-logs-destination-id", + inputs=[ + "filter-processor", + ], + type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS, + ), + ], + processors=[ + ObservabilityPipelineFilterProcessor( + id="filter-processor", + include="service:my-service", + inputs=[ + "datadog-agent-source", + ], + type=ObservabilityPipelineFilterProcessorType.FILTER, + ), + ], + sources=[ + ObservabilityPipelineDatadogAgentSource( + id="datadog-agent-source", + type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT, + ), + ], + ), + name="Updated Pipeline Name", + ), + id=PIPELINE_DATA_ID, + type="pipelines", + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_pipeline"] = True +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.update_pipeline(pipeline_id=PIPELINE_DATA_ID, body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 77b5311c5e..2ee7d6bcff 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -291,6 +291,10 @@ def __init__( "v2.list_vulnerable_assets": False, "v2.mute_findings": False, "v2.run_historical_job": False, + "v2.create_pipeline": False, + "v2.delete_pipeline": False, + "v2.get_pipeline": False, + "v2.update_pipeline": False, "v2.create_scorecard_outcomes_batch": False, "v2.create_scorecard_rule": False, "v2.delete_scorecard_rule": False, diff --git a/src/datadog_api_client/v2/api/observability_pipelines_api.py b/src/datadog_api_client/v2/api/observability_pipelines_api.py new file mode 100644 index 0000000000..40874f39b8 --- /dev/null +++ b/src/datadog_api_client/v2/api/observability_pipelines_api.py @@ -0,0 +1,185 @@ +# 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 Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.observability_pipeline import ObservabilityPipeline +from datadog_api_client.v2.model.observability_pipeline_create_request import ObservabilityPipelineCreateRequest + + +class ObservabilityPipelinesApi: + """ + Observability Pipelines allows you to collect and process logs within your own infrastructure, and then route them to downstream integrations. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_pipeline_endpoint = _Endpoint( + settings={ + "response_type": (ObservabilityPipeline,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/remote_config/products/obs_pipelines/pipelines", + "operation_id": "create_pipeline", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ObservabilityPipelineCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_pipeline_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/remote_config/products/obs_pipelines/pipelines/{pipeline_id}", + "operation_id": "delete_pipeline", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "pipeline_id": { + "required": True, + "openapi_types": (str,), + "attribute": "pipeline_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_pipeline_endpoint = _Endpoint( + settings={ + "response_type": (ObservabilityPipeline,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/remote_config/products/obs_pipelines/pipelines/{pipeline_id}", + "operation_id": "get_pipeline", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "pipeline_id": { + "required": True, + "openapi_types": (str,), + "attribute": "pipeline_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_pipeline_endpoint = _Endpoint( + settings={ + "response_type": (ObservabilityPipeline,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/remote_config/products/obs_pipelines/pipelines/{pipeline_id}", + "operation_id": "update_pipeline", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "pipeline_id": { + "required": True, + "openapi_types": (str,), + "attribute": "pipeline_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ObservabilityPipeline,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_pipeline( + self, + body: ObservabilityPipelineCreateRequest, + ) -> ObservabilityPipeline: + """Create a new pipeline. + + Create a new pipeline. + + :type body: ObservabilityPipelineCreateRequest + :rtype: ObservabilityPipeline + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_pipeline_endpoint.call_with_http_info(**kwargs) + + def delete_pipeline( + self, + pipeline_id: str, + ) -> None: + """Delete a pipeline. + + Delete a pipeline. + + :param pipeline_id: The ID of the pipeline to delete. + :type pipeline_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["pipeline_id"] = pipeline_id + + return self._delete_pipeline_endpoint.call_with_http_info(**kwargs) + + def get_pipeline( + self, + pipeline_id: str, + ) -> ObservabilityPipeline: + """Get a specific pipeline. + + Get a specific pipeline by its ID. + + :param pipeline_id: The ID of the pipeline to retrieve. + :type pipeline_id: str + :rtype: ObservabilityPipeline + """ + kwargs: Dict[str, Any] = {} + kwargs["pipeline_id"] = pipeline_id + + return self._get_pipeline_endpoint.call_with_http_info(**kwargs) + + def update_pipeline( + self, + pipeline_id: str, + body: ObservabilityPipeline, + ) -> ObservabilityPipeline: + """Update a pipeline. + + Update a pipeline. + + :param pipeline_id: The ID of the pipeline to update. + :type pipeline_id: str + :type body: ObservabilityPipeline + :rtype: ObservabilityPipeline + """ + kwargs: Dict[str, Any] = {} + kwargs["pipeline_id"] = pipeline_id + + kwargs["body"] = body + + return self._update_pipeline_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 fd0ed4992f..a09042d16e 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -41,6 +41,7 @@ from datadog_api_client.v2.api.microsoft_teams_integration_api import MicrosoftTeamsIntegrationApi from datadog_api_client.v2.api.monitors_api import MonitorsApi from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi from datadog_api_client.v2.api.okta_integration_api import OktaIntegrationApi from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi from datadog_api_client.v2.api.organizations_api import OrganizationsApi @@ -111,6 +112,7 @@ "MicrosoftTeamsIntegrationApi", "MonitorsApi", "NetworkDeviceMonitoringApi", + "ObservabilityPipelinesApi", "OktaIntegrationApi", "OpsgenieIntegrationApi", "OrganizationsApi", diff --git a/src/datadog_api_client/v2/model/observability_pipeline.py b/src/datadog_api_client/v2/model/observability_pipeline.py new file mode 100644 index 0000000000..2160f6746c --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline.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.observability_pipeline_data import ObservabilityPipelineData + + +class ObservabilityPipeline(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_data import ObservabilityPipelineData + + return { + "data": (ObservabilityPipelineData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ObservabilityPipelineData, **kwargs): + """ + Top-level schema representing a pipeline. + + :param data: Contains the pipeline’s ID, type, and configuration attributes. + :type data: ObservabilityPipelineData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/observability_pipeline_add_fields_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_add_fields_processor.py new file mode 100644 index 0000000000..023b7a6d57 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_add_fields_processor.py @@ -0,0 +1,78 @@ +# 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.observability_pipeline_field_value import ObservabilityPipelineFieldValue + from datadog_api_client.v2.model.observability_pipeline_add_fields_processor_type import ( + ObservabilityPipelineAddFieldsProcessorType, + ) + + +class ObservabilityPipelineAddFieldsProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_field_value import ObservabilityPipelineFieldValue + from datadog_api_client.v2.model.observability_pipeline_add_fields_processor_type import ( + ObservabilityPipelineAddFieldsProcessorType, + ) + + return { + "fields": ([ObservabilityPipelineFieldValue],), + "id": (str,), + "include": (str,), + "inputs": ([str],), + "type": (ObservabilityPipelineAddFieldsProcessorType,), + } + + attribute_map = { + "fields": "fields", + "id": "id", + "include": "include", + "inputs": "inputs", + "type": "type", + } + + def __init__( + self_, + fields: List[ObservabilityPipelineFieldValue], + id: str, + include: str, + inputs: List[str], + type: ObservabilityPipelineAddFieldsProcessorType, + **kwargs, + ): + """ + The ``add_fields`` processor adds static key-value fields to logs. + + :param fields: A list of static fields (key-value pairs) that is added to each log event processed by this component. + :type fields: [ObservabilityPipelineFieldValue] + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the ``input`` to downstream components). + :type id: str + + :param include: A Datadog search query used to determine which logs this processor targets. + :type include: str + + :param inputs: A list of component IDs whose output is used as the ``input`` for this component. + :type inputs: [str] + + :param type: The processor type. The value should always be ``add_fields``. + :type type: ObservabilityPipelineAddFieldsProcessorType + """ + super().__init__(kwargs) + + self_.fields = fields + self_.id = id + self_.include = include + self_.inputs = inputs + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_add_fields_processor_type.py b/src/datadog_api_client/v2/model/observability_pipeline_add_fields_processor_type.py new file mode 100644 index 0000000000..be0dbee821 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_add_fields_processor_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 ObservabilityPipelineAddFieldsProcessorType(ModelSimple): + """ + The processor type. The value should always be `add_fields`. + + :param value: If omitted defaults to "add_fields". Must be one of ["add_fields"]. + :type value: str + """ + + allowed_values = { + "add_fields", + } + ADD_FIELDS: ClassVar["ObservabilityPipelineAddFieldsProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineAddFieldsProcessorType.ADD_FIELDS = ObservabilityPipelineAddFieldsProcessorType("add_fields") diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config.py b/src/datadog_api_client/v2/model/observability_pipeline_config.py new file mode 100644 index 0000000000..af1d64f311 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_config.py @@ -0,0 +1,113 @@ +# 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, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_config_destination_item import ( + ObservabilityPipelineConfigDestinationItem, + ) + from datadog_api_client.v2.model.observability_pipeline_config_processor_item import ( + ObservabilityPipelineConfigProcessorItem, + ) + from datadog_api_client.v2.model.observability_pipeline_config_source_item import ( + ObservabilityPipelineConfigSourceItem, + ) + from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import ( + ObservabilityPipelineDatadogLogsDestination, + ) + from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor + from datadog_api_client.v2.model.observability_pipeline_parse_json_processor import ( + ObservabilityPipelineParseJSONProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_quota_processor import ObservabilityPipelineQuotaProcessor + from datadog_api_client.v2.model.observability_pipeline_add_fields_processor import ( + ObservabilityPipelineAddFieldsProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_remove_fields_processor import ( + ObservabilityPipelineRemoveFieldsProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor import ( + ObservabilityPipelineRenameFieldsProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_kafka_source import ObservabilityPipelineKafkaSource + from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, + ) + + +class ObservabilityPipelineConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_config_destination_item import ( + ObservabilityPipelineConfigDestinationItem, + ) + from datadog_api_client.v2.model.observability_pipeline_config_processor_item import ( + ObservabilityPipelineConfigProcessorItem, + ) + from datadog_api_client.v2.model.observability_pipeline_config_source_item import ( + ObservabilityPipelineConfigSourceItem, + ) + + return { + "destinations": ([ObservabilityPipelineConfigDestinationItem],), + "processors": ([ObservabilityPipelineConfigProcessorItem],), + "sources": ([ObservabilityPipelineConfigSourceItem],), + } + + attribute_map = { + "destinations": "destinations", + "processors": "processors", + "sources": "sources", + } + + def __init__( + self_, + destinations: List[ + Union[ObservabilityPipelineConfigDestinationItem, ObservabilityPipelineDatadogLogsDestination] + ], + processors: List[ + Union[ + ObservabilityPipelineConfigProcessorItem, + ObservabilityPipelineFilterProcessor, + ObservabilityPipelineParseJSONProcessor, + ObservabilityPipelineQuotaProcessor, + ObservabilityPipelineAddFieldsProcessor, + ObservabilityPipelineRemoveFieldsProcessor, + ObservabilityPipelineRenameFieldsProcessor, + ] + ], + sources: List[ + Union[ + ObservabilityPipelineConfigSourceItem, + ObservabilityPipelineKafkaSource, + ObservabilityPipelineDatadogAgentSource, + ] + ], + **kwargs, + ): + """ + Specifies the pipeline's configuration, including its sources, processors, and destinations. + + :param destinations: A list of destination components where processed logs are sent. + :type destinations: [ObservabilityPipelineConfigDestinationItem] + + :param processors: A list of processors that transform or enrich log data. + :type processors: [ObservabilityPipelineConfigProcessorItem] + + :param sources: A list of configured data sources for the pipeline. + :type sources: [ObservabilityPipelineConfigSourceItem] + """ + super().__init__(kwargs) + + self_.destinations = destinations + self_.processors = processors + self_.sources = sources diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py b/src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py new file mode 100644 index 0000000000..01cf940587 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py @@ -0,0 +1,46 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class ObservabilityPipelineConfigDestinationItem(ModelComposed): + def __init__(self, **kwargs): + """ + A destination for the pipeline. + + :param id: The unique identifier for this component. + :type id: str + + :param inputs: A list of component IDs whose output is used as the `input` for this component. + :type inputs: [str] + + :param type: The destination type. The value should always be `datadog_logs`. + :type type: ObservabilityPipelineDatadogLogsDestinationType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import ( + ObservabilityPipelineDatadogLogsDestination, + ) + + return { + "oneOf": [ + ObservabilityPipelineDatadogLogsDestination, + ], + } diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config_processor_item.py b/src/datadog_api_client/v2/model/observability_pipeline_config_processor_item.py new file mode 100644 index 0000000000..174a2ff327 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_config_processor_item.py @@ -0,0 +1,93 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class ObservabilityPipelineConfigProcessorItem(ModelComposed): + def __init__(self, **kwargs): + """ + A processor for the pipeline. + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components). + :type id: str + + :param include: A Datadog search query used to determine which logs should pass through the filter. Logs that match this query continue to downstream components; others are dropped. + :type include: str + + :param inputs: A list of component IDs whose output is used as the `input` for this component. + :type inputs: [str] + + :param type: The processor type. The value should always be `filter`. + :type type: ObservabilityPipelineFilterProcessorType + + :param field: The name of the log field that contains a JSON string. + :type field: str + + :param drop_events: If set to `true`, logs that matched the quota filter and sent after the quota has been met are dropped; only logs that did not match the filter query continue through the pipeline. + :type drop_events: bool + + :param ignore_when_missing_partitions: If `true`, the processor skips quota checks when partition fields are missing from the logs. + :type ignore_when_missing_partitions: bool, optional + + :param limit: The maximum amount of data or number of events allowed before the quota is enforced. Can be specified in bytes or events. + :type limit: ObservabilityPipelineQuotaProcessorLimit + + :param name: Name for identifying the processor. + :type name: str + + :param overrides: A list of alternate quota rules that apply to specific sets of events, identified by matching field values. Each override can define a custom limit. + :type overrides: [ObservabilityPipelineQuotaProcessorOverride], optional + + :param partition_fields: A list of fields used to segment log traffic for quota enforcement. Quotas are tracked independently by unique combinations of these field values. + :type partition_fields: [str], optional + + :param fields: A list of static fields (key-value pairs) that is added to each log event processed by this component. + :type fields: [ObservabilityPipelineFieldValue] + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.observability_pipeline_filter_processor import ( + ObservabilityPipelineFilterProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_parse_json_processor import ( + ObservabilityPipelineParseJSONProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_quota_processor import ( + ObservabilityPipelineQuotaProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_add_fields_processor import ( + ObservabilityPipelineAddFieldsProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_remove_fields_processor import ( + ObservabilityPipelineRemoveFieldsProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor import ( + ObservabilityPipelineRenameFieldsProcessor, + ) + + return { + "oneOf": [ + ObservabilityPipelineFilterProcessor, + ObservabilityPipelineParseJSONProcessor, + ObservabilityPipelineQuotaProcessor, + ObservabilityPipelineAddFieldsProcessor, + ObservabilityPipelineRemoveFieldsProcessor, + ObservabilityPipelineRenameFieldsProcessor, + ], + } diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config_source_item.py b/src/datadog_api_client/v2/model/observability_pipeline_config_source_item.py new file mode 100644 index 0000000000..77d5f5f430 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_config_source_item.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 datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ObservabilityPipelineConfigSourceItem(ModelComposed): + def __init__(self, **kwargs): + """ + A data source for the pipeline. + + :param group_id: Consumer group ID used by the Kafka client. + :type group_id: str + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components). + :type id: str + + :param librdkafka_options: Optional list of advanced Kafka client configuration options, defined as key-value pairs. + :type librdkafka_options: [ObservabilityPipelineKafkaSourceLibrdkafkaOption], optional + + :param sasl: Specifies the SASL mechanism for authenticating with a Kafka cluster. + :type sasl: ObservabilityPipelineKafkaSourceSasl, optional + + :param tls: Configuration for enabling TLS encryption. + :type tls: ObservabilityPipelineTls, optional + + :param topics: A list of Kafka topic names to subscribe to. The source ingests messages from each topic specified. + :type topics: [str] + + :param type: The source type. The value should always be `kafka`. + :type type: ObservabilityPipelineKafkaSourceType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.observability_pipeline_kafka_source import ObservabilityPipelineKafkaSource + from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, + ) + + return { + "oneOf": [ + ObservabilityPipelineKafkaSource, + ObservabilityPipelineDatadogAgentSource, + ], + } diff --git a/src/datadog_api_client/v2/model/observability_pipeline_create_request.py b/src/datadog_api_client/v2/model/observability_pipeline_create_request.py new file mode 100644 index 0000000000..aa6c0a505c --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_create_request.py @@ -0,0 +1,44 @@ +# 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.observability_pipeline_create_request_data import ( + ObservabilityPipelineCreateRequestData, + ) + + +class ObservabilityPipelineCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_create_request_data import ( + ObservabilityPipelineCreateRequestData, + ) + + return { + "data": (ObservabilityPipelineCreateRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ObservabilityPipelineCreateRequestData, **kwargs): + """ + Top-level schema representing a pipeline. + + :param data: Contains the pipeline’s ID, type, and configuration attributes. + :type data: ObservabilityPipelineCreateRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/observability_pipeline_create_request_data.py b/src/datadog_api_client/v2/model/observability_pipeline_create_request_data.py new file mode 100644 index 0000000000..45d2c7b825 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_create_request_data.py @@ -0,0 +1,49 @@ +# 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.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes + + +class ObservabilityPipelineCreateRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_data_attributes import ( + ObservabilityPipelineDataAttributes, + ) + + return { + "attributes": (ObservabilityPipelineDataAttributes,), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: ObservabilityPipelineDataAttributes, **kwargs): + """ + Contains the pipeline’s ID, type, and configuration attributes. + + :param attributes: Defines the pipeline’s name and its components (sources, processors, and destinations). + :type attributes: ObservabilityPipelineDataAttributes + + :param type: The resource type identifier. For pipeline resources, this should always be set to ``pipelines``. + :type type: str + """ + super().__init__(kwargs) + type = kwargs.get("type", "pipelines") + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_data.py b/src/datadog_api_client/v2/model/observability_pipeline_data.py new file mode 100644 index 0000000000..570a1ee05e --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_data.py @@ -0,0 +1,55 @@ +# 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.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes + + +class ObservabilityPipelineData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_data_attributes import ( + ObservabilityPipelineDataAttributes, + ) + + return { + "attributes": (ObservabilityPipelineDataAttributes,), + "id": (str,), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ObservabilityPipelineDataAttributes, id: str, **kwargs): + """ + Contains the pipeline’s ID, type, and configuration attributes. + + :param attributes: Defines the pipeline’s name and its components (sources, processors, and destinations). + :type attributes: ObservabilityPipelineDataAttributes + + :param id: Unique identifier for the pipeline. + :type id: str + + :param type: The resource type identifier. For pipeline resources, this should always be set to ``pipelines``. + :type type: str + """ + super().__init__(kwargs) + type = kwargs.get("type", "pipelines") + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_data_attributes.py b/src/datadog_api_client/v2/model/observability_pipeline_data_attributes.py new file mode 100644 index 0000000000..54166239ff --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_data_attributes.py @@ -0,0 +1,46 @@ +# 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.observability_pipeline_config import ObservabilityPipelineConfig + + +class ObservabilityPipelineDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig + + return { + "config": (ObservabilityPipelineConfig,), + "name": (str,), + } + + attribute_map = { + "config": "config", + "name": "name", + } + + def __init__(self_, config: ObservabilityPipelineConfig, name: str, **kwargs): + """ + Defines the pipeline’s name and its components (sources, processors, and destinations). + + :param config: Specifies the pipeline's configuration, including its sources, processors, and destinations. + :type config: ObservabilityPipelineConfig + + :param name: Name of the pipeline. + :type name: str + """ + super().__init__(kwargs) + + self_.config = config + self_.name = name diff --git a/src/datadog_api_client/v2/model/observability_pipeline_datadog_agent_source.py b/src/datadog_api_client/v2/model/observability_pipeline_datadog_agent_source.py new file mode 100644 index 0000000000..4cb08863d0 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_datadog_agent_source.py @@ -0,0 +1,67 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls + from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, + ) + + +class ObservabilityPipelineDatadogAgentSource(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls + from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, + ) + + return { + "id": (str,), + "tls": (ObservabilityPipelineTls,), + "type": (ObservabilityPipelineDatadogAgentSourceType,), + } + + attribute_map = { + "id": "id", + "tls": "tls", + "type": "type", + } + + def __init__( + self_, + id: str, + type: ObservabilityPipelineDatadogAgentSourceType, + tls: Union[ObservabilityPipelineTls, UnsetType] = unset, + **kwargs, + ): + """ + The ``datadog_agent`` source collects logs from the Datadog Agent. + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components). + :type id: str + + :param tls: Configuration for enabling TLS encryption. + :type tls: ObservabilityPipelineTls, optional + + :param type: The source type. The value should always be ``datadog_agent``. + :type type: ObservabilityPipelineDatadogAgentSourceType + """ + if tls is not unset: + kwargs["tls"] = tls + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_datadog_agent_source_type.py b/src/datadog_api_client/v2/model/observability_pipeline_datadog_agent_source_type.py new file mode 100644 index 0000000000..bfae0a8cf8 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_datadog_agent_source_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 ObservabilityPipelineDatadogAgentSourceType(ModelSimple): + """ + The source type. The value should always be `datadog_agent`. + + :param value: If omitted defaults to "datadog_agent". Must be one of ["datadog_agent"]. + :type value: str + """ + + allowed_values = { + "datadog_agent", + } + DATADOG_AGENT: ClassVar["ObservabilityPipelineDatadogAgentSourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT = ObservabilityPipelineDatadogAgentSourceType("datadog_agent") diff --git a/src/datadog_api_client/v2/model/observability_pipeline_datadog_logs_destination.py b/src/datadog_api_client/v2/model/observability_pipeline_datadog_logs_destination.py new file mode 100644 index 0000000000..b519b48735 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_datadog_logs_destination.py @@ -0,0 +1,56 @@ +# 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.observability_pipeline_datadog_logs_destination_type import ( + ObservabilityPipelineDatadogLogsDestinationType, + ) + + +class ObservabilityPipelineDatadogLogsDestination(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import ( + ObservabilityPipelineDatadogLogsDestinationType, + ) + + return { + "id": (str,), + "inputs": ([str],), + "type": (ObservabilityPipelineDatadogLogsDestinationType,), + } + + attribute_map = { + "id": "id", + "inputs": "inputs", + "type": "type", + } + + def __init__(self_, id: str, inputs: List[str], type: ObservabilityPipelineDatadogLogsDestinationType, **kwargs): + """ + The ``datadog_logs`` destination forwards logs to Datadog Log Management. + + :param id: The unique identifier for this component. + :type id: str + + :param inputs: A list of component IDs whose output is used as the ``input`` for this component. + :type inputs: [str] + + :param type: The destination type. The value should always be ``datadog_logs``. + :type type: ObservabilityPipelineDatadogLogsDestinationType + """ + super().__init__(kwargs) + + self_.id = id + self_.inputs = inputs + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_datadog_logs_destination_type.py b/src/datadog_api_client/v2/model/observability_pipeline_datadog_logs_destination_type.py new file mode 100644 index 0000000000..323101b218 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_datadog_logs_destination_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 ObservabilityPipelineDatadogLogsDestinationType(ModelSimple): + """ + The destination type. The value should always be `datadog_logs`. + + :param value: If omitted defaults to "datadog_logs". Must be one of ["datadog_logs"]. + :type value: str + """ + + allowed_values = { + "datadog_logs", + } + DATADOG_LOGS: ClassVar["ObservabilityPipelineDatadogLogsDestinationType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS = ObservabilityPipelineDatadogLogsDestinationType( + "datadog_logs" +) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_field_value.py b/src/datadog_api_client/v2/model/observability_pipeline_field_value.py new file mode 100644 index 0000000000..e3b3cb381c --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_field_value.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 ObservabilityPipelineFieldValue(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "value": (str,), + } + + attribute_map = { + "name": "name", + "value": "value", + } + + def __init__(self_, name: str, value: str, **kwargs): + """ + Represents a static key-value pair used in various processors. + + :param name: The field name. + :type name: str + + :param value: The field value. + :type value: str + """ + super().__init__(kwargs) + + self_.name = name + self_.value = value diff --git a/src/datadog_api_client/v2/model/observability_pipeline_filter_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_filter_processor.py new file mode 100644 index 0000000000..d7ada2fb81 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_filter_processor.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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import ( + ObservabilityPipelineFilterProcessorType, + ) + + +class ObservabilityPipelineFilterProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import ( + ObservabilityPipelineFilterProcessorType, + ) + + return { + "id": (str,), + "include": (str,), + "inputs": ([str],), + "type": (ObservabilityPipelineFilterProcessorType,), + } + + attribute_map = { + "id": "id", + "include": "include", + "inputs": "inputs", + "type": "type", + } + + def __init__( + self_, id: str, include: str, inputs: List[str], type: ObservabilityPipelineFilterProcessorType, **kwargs + ): + """ + The ``filter`` processor allows conditional processing of logs based on a Datadog search query. Logs that match the ``include`` query are passed through; others are discarded. + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the ``input`` to downstream components). + :type id: str + + :param include: A Datadog search query used to determine which logs should pass through the filter. Logs that match this query continue to downstream components; others are dropped. + :type include: str + + :param inputs: A list of component IDs whose output is used as the ``input`` for this component. + :type inputs: [str] + + :param type: The processor type. The value should always be ``filter``. + :type type: ObservabilityPipelineFilterProcessorType + """ + super().__init__(kwargs) + + self_.id = id + self_.include = include + self_.inputs = inputs + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_filter_processor_type.py b/src/datadog_api_client/v2/model/observability_pipeline_filter_processor_type.py new file mode 100644 index 0000000000..7fc703bd23 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_filter_processor_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 ObservabilityPipelineFilterProcessorType(ModelSimple): + """ + The processor type. The value should always be `filter`. + + :param value: If omitted defaults to "filter". Must be one of ["filter"]. + :type value: str + """ + + allowed_values = { + "filter", + } + FILTER: ClassVar["ObservabilityPipelineFilterProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineFilterProcessorType.FILTER = ObservabilityPipelineFilterProcessorType("filter") diff --git a/src/datadog_api_client/v2/model/observability_pipeline_kafka_source.py b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source.py new file mode 100644 index 0000000000..97994c7b01 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source.py @@ -0,0 +1,109 @@ +# 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, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_kafka_source_librdkafka_option import ( + ObservabilityPipelineKafkaSourceLibrdkafkaOption, + ) + from datadog_api_client.v2.model.observability_pipeline_kafka_source_sasl import ( + ObservabilityPipelineKafkaSourceSasl, + ) + from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls + from datadog_api_client.v2.model.observability_pipeline_kafka_source_type import ( + ObservabilityPipelineKafkaSourceType, + ) + + +class ObservabilityPipelineKafkaSource(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_kafka_source_librdkafka_option import ( + ObservabilityPipelineKafkaSourceLibrdkafkaOption, + ) + from datadog_api_client.v2.model.observability_pipeline_kafka_source_sasl import ( + ObservabilityPipelineKafkaSourceSasl, + ) + from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls + from datadog_api_client.v2.model.observability_pipeline_kafka_source_type import ( + ObservabilityPipelineKafkaSourceType, + ) + + return { + "group_id": (str,), + "id": (str,), + "librdkafka_options": ([ObservabilityPipelineKafkaSourceLibrdkafkaOption],), + "sasl": (ObservabilityPipelineKafkaSourceSasl,), + "tls": (ObservabilityPipelineTls,), + "topics": ([str],), + "type": (ObservabilityPipelineKafkaSourceType,), + } + + attribute_map = { + "group_id": "group_id", + "id": "id", + "librdkafka_options": "librdkafka_options", + "sasl": "sasl", + "tls": "tls", + "topics": "topics", + "type": "type", + } + + def __init__( + self_, + group_id: str, + id: str, + topics: List[str], + type: ObservabilityPipelineKafkaSourceType, + librdkafka_options: Union[List[ObservabilityPipelineKafkaSourceLibrdkafkaOption], UnsetType] = unset, + sasl: Union[ObservabilityPipelineKafkaSourceSasl, UnsetType] = unset, + tls: Union[ObservabilityPipelineTls, UnsetType] = unset, + **kwargs, + ): + """ + The ``kafka`` source ingests data from Apache Kafka topics. + + :param group_id: Consumer group ID used by the Kafka client. + :type group_id: str + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components). + :type id: str + + :param librdkafka_options: Optional list of advanced Kafka client configuration options, defined as key-value pairs. + :type librdkafka_options: [ObservabilityPipelineKafkaSourceLibrdkafkaOption], optional + + :param sasl: Specifies the SASL mechanism for authenticating with a Kafka cluster. + :type sasl: ObservabilityPipelineKafkaSourceSasl, optional + + :param tls: Configuration for enabling TLS encryption. + :type tls: ObservabilityPipelineTls, optional + + :param topics: A list of Kafka topic names to subscribe to. The source ingests messages from each topic specified. + :type topics: [str] + + :param type: The source type. The value should always be ``kafka``. + :type type: ObservabilityPipelineKafkaSourceType + """ + if librdkafka_options is not unset: + kwargs["librdkafka_options"] = librdkafka_options + if sasl is not unset: + kwargs["sasl"] = sasl + if tls is not unset: + kwargs["tls"] = tls + super().__init__(kwargs) + + self_.group_id = group_id + self_.id = id + self_.topics = topics + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_librdkafka_option.py b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_librdkafka_option.py new file mode 100644 index 0000000000..4099a196cd --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_librdkafka_option.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 ObservabilityPipelineKafkaSourceLibrdkafkaOption(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "value": (str,), + } + + attribute_map = { + "name": "name", + "value": "value", + } + + def __init__(self_, name: str, value: str, **kwargs): + """ + Represents a key-value pair used to configure low-level ``librdkafka`` client options for Kafka sources, such as timeouts, buffer sizes, and security settings. + + :param name: The name of the ``librdkafka`` configuration option to set. + :type name: str + + :param value: The value assigned to the specified ``librdkafka`` configuration option. + :type value: str + """ + super().__init__(kwargs) + + self_.name = name + self_.value = value diff --git a/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_sasl.py b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_sasl.py new file mode 100644 index 0000000000..88f6e0aaab --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_sasl.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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_pipeline_kafka_source_sasl_mechanism import ( + ObservabilityPipelinePipelineKafkaSourceSaslMechanism, + ) + + +class ObservabilityPipelineKafkaSourceSasl(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_pipeline_kafka_source_sasl_mechanism import ( + ObservabilityPipelinePipelineKafkaSourceSaslMechanism, + ) + + return { + "mechanism": (ObservabilityPipelinePipelineKafkaSourceSaslMechanism,), + } + + attribute_map = { + "mechanism": "mechanism", + } + + def __init__( + self_, mechanism: Union[ObservabilityPipelinePipelineKafkaSourceSaslMechanism, UnsetType] = unset, **kwargs + ): + """ + Specifies the SASL mechanism for authenticating with a Kafka cluster. + + :param mechanism: SASL mechanism used for Kafka authentication. + :type mechanism: ObservabilityPipelinePipelineKafkaSourceSaslMechanism, optional + """ + if mechanism is not unset: + kwargs["mechanism"] = mechanism + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_type.py b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_type.py new file mode 100644 index 0000000000..26ad99dffe --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_kafka_source_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 ObservabilityPipelineKafkaSourceType(ModelSimple): + """ + The source type. The value should always be `kafka`. + + :param value: If omitted defaults to "kafka". Must be one of ["kafka"]. + :type value: str + """ + + allowed_values = { + "kafka", + } + KAFKA: ClassVar["ObservabilityPipelineKafkaSourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineKafkaSourceType.KAFKA = ObservabilityPipelineKafkaSourceType("kafka") diff --git a/src/datadog_api_client/v2/model/observability_pipeline_parse_json_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_parse_json_processor.py new file mode 100644 index 0000000000..ec3357b625 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_parse_json_processor.py @@ -0,0 +1,76 @@ +# 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.observability_pipeline_parse_json_processor_type import ( + ObservabilityPipelineParseJSONProcessorType, + ) + + +class ObservabilityPipelineParseJSONProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_parse_json_processor_type import ( + ObservabilityPipelineParseJSONProcessorType, + ) + + return { + "field": (str,), + "id": (str,), + "include": (str,), + "inputs": ([str],), + "type": (ObservabilityPipelineParseJSONProcessorType,), + } + + attribute_map = { + "field": "field", + "id": "id", + "include": "include", + "inputs": "inputs", + "type": "type", + } + + def __init__( + self_, + field: str, + id: str, + include: str, + inputs: List[str], + type: ObservabilityPipelineParseJSONProcessorType, + **kwargs, + ): + """ + The ``parse_json`` processor extracts JSON from a specified field and flattens it into the event. This is useful when logs contain embedded JSON as a string. + + :param field: The name of the log field that contains a JSON string. + :type field: str + + :param id: A unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components). + :type id: str + + :param include: A Datadog search query used to determine which logs this processor targets. + :type include: str + + :param inputs: A list of component IDs whose output is used as the ``input`` for this component. + :type inputs: [str] + + :param type: The processor type. The value should always be ``parse_json``. + :type type: ObservabilityPipelineParseJSONProcessorType + """ + super().__init__(kwargs) + + self_.field = field + self_.id = id + self_.include = include + self_.inputs = inputs + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_parse_json_processor_type.py b/src/datadog_api_client/v2/model/observability_pipeline_parse_json_processor_type.py new file mode 100644 index 0000000000..1076de2f9c --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_parse_json_processor_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 ObservabilityPipelineParseJSONProcessorType(ModelSimple): + """ + The processor type. The value should always be `parse_json`. + + :param value: If omitted defaults to "parse_json". Must be one of ["parse_json"]. + :type value: str + """ + + allowed_values = { + "parse_json", + } + PARSE_JSON: ClassVar["ObservabilityPipelineParseJSONProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineParseJSONProcessorType.PARSE_JSON = ObservabilityPipelineParseJSONProcessorType("parse_json") diff --git a/src/datadog_api_client/v2/model/observability_pipeline_pipeline_kafka_source_sasl_mechanism.py b/src/datadog_api_client/v2/model/observability_pipeline_pipeline_kafka_source_sasl_mechanism.py new file mode 100644 index 0000000000..db414b0a6f --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_pipeline_kafka_source_sasl_mechanism.py @@ -0,0 +1,47 @@ +# 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 ObservabilityPipelinePipelineKafkaSourceSaslMechanism(ModelSimple): + """ + SASL mechanism used for Kafka authentication. + + :param value: Must be one of ["PLAIN", "SCRAM-SHA-256", "SCRAM-SHA-512"]. + :type value: str + """ + + allowed_values = { + "PLAIN", + "SCRAM-SHA-256", + "SCRAM-SHA-512", + } + PLAIN: ClassVar["ObservabilityPipelinePipelineKafkaSourceSaslMechanism"] + SCRAMNOT_SHANOT_256: ClassVar["ObservabilityPipelinePipelineKafkaSourceSaslMechanism"] + SCRAMNOT_SHANOT_512: ClassVar["ObservabilityPipelinePipelineKafkaSourceSaslMechanism"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelinePipelineKafkaSourceSaslMechanism.PLAIN = ObservabilityPipelinePipelineKafkaSourceSaslMechanism( + "PLAIN" +) +ObservabilityPipelinePipelineKafkaSourceSaslMechanism.SCRAMNOT_SHANOT_256 = ( + ObservabilityPipelinePipelineKafkaSourceSaslMechanism("SCRAM-SHA-256") +) +ObservabilityPipelinePipelineKafkaSourceSaslMechanism.SCRAMNOT_SHANOT_512 = ( + ObservabilityPipelinePipelineKafkaSourceSaslMechanism("SCRAM-SHA-512") +) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_quota_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor.py new file mode 100644 index 0000000000..f30e26077a --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor.py @@ -0,0 +1,128 @@ +# 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, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_quota_processor_limit import ( + ObservabilityPipelineQuotaProcessorLimit, + ) + from datadog_api_client.v2.model.observability_pipeline_quota_processor_override import ( + ObservabilityPipelineQuotaProcessorOverride, + ) + from datadog_api_client.v2.model.observability_pipeline_quota_processor_type import ( + ObservabilityPipelineQuotaProcessorType, + ) + + +class ObservabilityPipelineQuotaProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_quota_processor_limit import ( + ObservabilityPipelineQuotaProcessorLimit, + ) + from datadog_api_client.v2.model.observability_pipeline_quota_processor_override import ( + ObservabilityPipelineQuotaProcessorOverride, + ) + from datadog_api_client.v2.model.observability_pipeline_quota_processor_type import ( + ObservabilityPipelineQuotaProcessorType, + ) + + return { + "drop_events": (bool,), + "id": (str,), + "ignore_when_missing_partitions": (bool,), + "include": (str,), + "inputs": ([str],), + "limit": (ObservabilityPipelineQuotaProcessorLimit,), + "name": (str,), + "overrides": ([ObservabilityPipelineQuotaProcessorOverride],), + "partition_fields": ([str],), + "type": (ObservabilityPipelineQuotaProcessorType,), + } + + attribute_map = { + "drop_events": "drop_events", + "id": "id", + "ignore_when_missing_partitions": "ignore_when_missing_partitions", + "include": "include", + "inputs": "inputs", + "limit": "limit", + "name": "name", + "overrides": "overrides", + "partition_fields": "partition_fields", + "type": "type", + } + + def __init__( + self_, + drop_events: bool, + id: str, + include: str, + inputs: List[str], + limit: ObservabilityPipelineQuotaProcessorLimit, + name: str, + type: ObservabilityPipelineQuotaProcessorType, + ignore_when_missing_partitions: Union[bool, UnsetType] = unset, + overrides: Union[List[ObservabilityPipelineQuotaProcessorOverride], UnsetType] = unset, + partition_fields: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + The Quota Processor measures logging traffic for logs that match a specified filter. When the configured daily quota is met, the processor can drop or alert. + + :param drop_events: If set to ``true`` , logs that matched the quota filter and sent after the quota has been met are dropped; only logs that did not match the filter query continue through the pipeline. + :type drop_events: bool + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the ``input`` to downstream components). + :type id: str + + :param ignore_when_missing_partitions: If ``true`` , the processor skips quota checks when partition fields are missing from the logs. + :type ignore_when_missing_partitions: bool, optional + + :param include: A Datadog search query used to determine which logs this processor targets. + :type include: str + + :param inputs: A list of component IDs whose output is used as the ``input`` for this component. + :type inputs: [str] + + :param limit: The maximum amount of data or number of events allowed before the quota is enforced. Can be specified in bytes or events. + :type limit: ObservabilityPipelineQuotaProcessorLimit + + :param name: Name for identifying the processor. + :type name: str + + :param overrides: A list of alternate quota rules that apply to specific sets of events, identified by matching field values. Each override can define a custom limit. + :type overrides: [ObservabilityPipelineQuotaProcessorOverride], optional + + :param partition_fields: A list of fields used to segment log traffic for quota enforcement. Quotas are tracked independently by unique combinations of these field values. + :type partition_fields: [str], optional + + :param type: The processor type. The value should always be ``quota``. + :type type: ObservabilityPipelineQuotaProcessorType + """ + if ignore_when_missing_partitions is not unset: + kwargs["ignore_when_missing_partitions"] = ignore_when_missing_partitions + if overrides is not unset: + kwargs["overrides"] = overrides + if partition_fields is not unset: + kwargs["partition_fields"] = partition_fields + super().__init__(kwargs) + + self_.drop_events = drop_events + self_.id = id + self_.include = include + self_.inputs = inputs + self_.limit = limit + self_.name = name + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_limit.py b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_limit.py new file mode 100644 index 0000000000..051d87b863 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_limit.py @@ -0,0 +1,50 @@ +# 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.observability_pipeline_quota_processor_limit_enforce_type import ( + ObservabilityPipelineQuotaProcessorLimitEnforceType, + ) + + +class ObservabilityPipelineQuotaProcessorLimit(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_quota_processor_limit_enforce_type import ( + ObservabilityPipelineQuotaProcessorLimitEnforceType, + ) + + return { + "enforce": (ObservabilityPipelineQuotaProcessorLimitEnforceType,), + "limit": (int,), + } + + attribute_map = { + "enforce": "enforce", + "limit": "limit", + } + + def __init__(self_, enforce: ObservabilityPipelineQuotaProcessorLimitEnforceType, limit: int, **kwargs): + """ + The maximum amount of data or number of events allowed before the quota is enforced. Can be specified in bytes or events. + + :param enforce: Unit for quota enforcement in bytes for data size or events for count. + :type enforce: ObservabilityPipelineQuotaProcessorLimitEnforceType + + :param limit: The limit for quota enforcement. + :type limit: int + """ + super().__init__(kwargs) + + self_.enforce = enforce + self_.limit = limit diff --git a/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_limit_enforce_type.py b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_limit_enforce_type.py new file mode 100644 index 0000000000..5aff6cdc2d --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_limit_enforce_type.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ObservabilityPipelineQuotaProcessorLimitEnforceType(ModelSimple): + """ + Unit for quota enforcement in bytes for data size or events for count. + + :param value: Must be one of ["bytes", "events"]. + :type value: str + """ + + allowed_values = { + "bytes", + "events", + } + BYTES: ClassVar["ObservabilityPipelineQuotaProcessorLimitEnforceType"] + EVENTS: ClassVar["ObservabilityPipelineQuotaProcessorLimitEnforceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineQuotaProcessorLimitEnforceType.BYTES = ObservabilityPipelineQuotaProcessorLimitEnforceType("bytes") +ObservabilityPipelineQuotaProcessorLimitEnforceType.EVENTS = ObservabilityPipelineQuotaProcessorLimitEnforceType( + "events" +) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_override.py b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_override.py new file mode 100644 index 0000000000..5eff7a3a5b --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_override.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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_field_value import ObservabilityPipelineFieldValue + from datadog_api_client.v2.model.observability_pipeline_quota_processor_limit import ( + ObservabilityPipelineQuotaProcessorLimit, + ) + + +class ObservabilityPipelineQuotaProcessorOverride(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_field_value import ObservabilityPipelineFieldValue + from datadog_api_client.v2.model.observability_pipeline_quota_processor_limit import ( + ObservabilityPipelineQuotaProcessorLimit, + ) + + return { + "fields": ([ObservabilityPipelineFieldValue],), + "limit": (ObservabilityPipelineQuotaProcessorLimit,), + } + + attribute_map = { + "fields": "fields", + "limit": "limit", + } + + def __init__( + self_, fields: List[ObservabilityPipelineFieldValue], limit: ObservabilityPipelineQuotaProcessorLimit, **kwargs + ): + """ + Defines a custom quota limit that applies to specific log events based on matching field values. + + :param fields: A list of field matchers used to apply a specific override. If an event matches all listed key-value pairs, the corresponding override limit is enforced. + :type fields: [ObservabilityPipelineFieldValue] + + :param limit: The maximum amount of data or number of events allowed before the quota is enforced. Can be specified in bytes or events. + :type limit: ObservabilityPipelineQuotaProcessorLimit + """ + super().__init__(kwargs) + + self_.fields = fields + self_.limit = limit diff --git a/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_type.py b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_type.py new file mode 100644 index 0000000000..b03eaddfc7 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_quota_processor_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 ObservabilityPipelineQuotaProcessorType(ModelSimple): + """ + The processor type. The value should always be `quota`. + + :param value: If omitted defaults to "quota". Must be one of ["quota"]. + :type value: str + """ + + allowed_values = { + "quota", + } + QUOTA: ClassVar["ObservabilityPipelineQuotaProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineQuotaProcessorType.QUOTA = ObservabilityPipelineQuotaProcessorType("quota") diff --git a/src/datadog_api_client/v2/model/observability_pipeline_remove_fields_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_remove_fields_processor.py new file mode 100644 index 0000000000..c8a0d89bc0 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_remove_fields_processor.py @@ -0,0 +1,76 @@ +# 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.observability_pipeline_remove_fields_processor_type import ( + ObservabilityPipelineRemoveFieldsProcessorType, + ) + + +class ObservabilityPipelineRemoveFieldsProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_remove_fields_processor_type import ( + ObservabilityPipelineRemoveFieldsProcessorType, + ) + + return { + "fields": ([str],), + "id": (str,), + "include": (str,), + "inputs": ([str],), + "type": (ObservabilityPipelineRemoveFieldsProcessorType,), + } + + attribute_map = { + "fields": "fields", + "id": "id", + "include": "include", + "inputs": "inputs", + "type": "type", + } + + def __init__( + self_, + fields: List[str], + id: str, + include: str, + inputs: List[str], + type: ObservabilityPipelineRemoveFieldsProcessorType, + **kwargs, + ): + """ + The ``remove_fields`` processor deletes specified fields from logs. + + :param fields: A list of field names to be removed from each log event. + :type fields: [str] + + :param id: The unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components). + :type id: str + + :param include: A Datadog search query used to determine which logs this processor targets. + :type include: str + + :param inputs: The ``PipelineRemoveFieldsProcessor`` ``inputs``. + :type inputs: [str] + + :param type: The processor type. The value should always be ``remove_fields``. + :type type: ObservabilityPipelineRemoveFieldsProcessorType + """ + super().__init__(kwargs) + + self_.fields = fields + self_.id = id + self_.include = include + self_.inputs = inputs + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_remove_fields_processor_type.py b/src/datadog_api_client/v2/model/observability_pipeline_remove_fields_processor_type.py new file mode 100644 index 0000000000..15142d20c5 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_remove_fields_processor_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 ObservabilityPipelineRemoveFieldsProcessorType(ModelSimple): + """ + The processor type. The value should always be `remove_fields`. + + :param value: If omitted defaults to "remove_fields". Must be one of ["remove_fields"]. + :type value: str + """ + + allowed_values = { + "remove_fields", + } + REMOVE_FIELDS: ClassVar["ObservabilityPipelineRemoveFieldsProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineRemoveFieldsProcessorType.REMOVE_FIELDS = ObservabilityPipelineRemoveFieldsProcessorType( + "remove_fields" +) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor.py new file mode 100644 index 0000000000..ae737aceb1 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor.py @@ -0,0 +1,82 @@ +# 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.observability_pipeline_rename_fields_processor_field import ( + ObservabilityPipelineRenameFieldsProcessorField, + ) + from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor_type import ( + ObservabilityPipelineRenameFieldsProcessorType, + ) + + +class ObservabilityPipelineRenameFieldsProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor_field import ( + ObservabilityPipelineRenameFieldsProcessorField, + ) + from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor_type import ( + ObservabilityPipelineRenameFieldsProcessorType, + ) + + return { + "fields": ([ObservabilityPipelineRenameFieldsProcessorField],), + "id": (str,), + "include": (str,), + "inputs": ([str],), + "type": (ObservabilityPipelineRenameFieldsProcessorType,), + } + + attribute_map = { + "fields": "fields", + "id": "id", + "include": "include", + "inputs": "inputs", + "type": "type", + } + + def __init__( + self_, + fields: List[ObservabilityPipelineRenameFieldsProcessorField], + id: str, + include: str, + inputs: List[str], + type: ObservabilityPipelineRenameFieldsProcessorType, + **kwargs, + ): + """ + The ``rename_fields`` processor changes field names. + + :param fields: A list of rename rules specifying which fields to rename in the event, what to rename them to, and whether to preserve the original fields. + :type fields: [ObservabilityPipelineRenameFieldsProcessorField] + + :param id: A unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components). + :type id: str + + :param include: A Datadog search query used to determine which logs this processor targets. + :type include: str + + :param inputs: A list of component IDs whose output is used as the ``input`` for this component. + :type inputs: [str] + + :param type: The processor type. The value should always be ``rename_fields``. + :type type: ObservabilityPipelineRenameFieldsProcessorType + """ + super().__init__(kwargs) + + self_.fields = fields + self_.id = id + self_.include = include + self_.inputs = inputs + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor_field.py b/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor_field.py new file mode 100644 index 0000000000..07e2b91338 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor_field.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 ObservabilityPipelineRenameFieldsProcessorField(ModelNormal): + @cached_property + def openapi_types(_): + return { + "destination": (str,), + "preserve_source": (bool,), + "source": (str,), + } + + attribute_map = { + "destination": "destination", + "preserve_source": "preserve_source", + "source": "source", + } + + def __init__(self_, destination: str, preserve_source: bool, source: str, **kwargs): + """ + Defines how to rename a field in log events. + + :param destination: The field name to assign the renamed value to. + :type destination: str + + :param preserve_source: Indicates whether the original field, that is received from the source, should be kept ( ``true`` ) or removed ( ``false`` ) after renaming. + :type preserve_source: bool + + :param source: The original field name in the log event that should be renamed. + :type source: str + """ + super().__init__(kwargs) + + self_.destination = destination + self_.preserve_source = preserve_source + self_.source = source diff --git a/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor_type.py b/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor_type.py new file mode 100644 index 0000000000..fdee01ce9c --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_rename_fields_processor_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 ObservabilityPipelineRenameFieldsProcessorType(ModelSimple): + """ + The processor type. The value should always be `rename_fields`. + + :param value: If omitted defaults to "rename_fields". Must be one of ["rename_fields"]. + :type value: str + """ + + allowed_values = { + "rename_fields", + } + RENAME_FIELDS: ClassVar["ObservabilityPipelineRenameFieldsProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineRenameFieldsProcessorType.RENAME_FIELDS = ObservabilityPipelineRenameFieldsProcessorType( + "rename_fields" +) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_tls.py b/src/datadog_api_client/v2/model/observability_pipeline_tls.py new file mode 100644 index 0000000000..46aec65a60 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_tls.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 Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ObservabilityPipelineTls(ModelNormal): + @cached_property + def openapi_types(_): + return { + "ca_file": (str,), + "crt_file": (str,), + "key_file": (str,), + } + + attribute_map = { + "ca_file": "ca_file", + "crt_file": "crt_file", + "key_file": "key_file", + } + + def __init__( + self_, crt_file: str, ca_file: Union[str, UnsetType] = unset, key_file: Union[str, UnsetType] = unset, **kwargs + ): + """ + Configuration for enabling TLS encryption. + + :param ca_file: Path to the Certificate Authority (CA) file used to validate the server’s TLS certificate. + :type ca_file: str, optional + + :param crt_file: Path to the TLS client certificate file used to authenticate the pipeline component with upstream or downstream services. + :type crt_file: str + + :param key_file: Path to the private key file associated with the TLS client certificate. Used for mutual TLS authentication. + :type key_file: str, optional + """ + if ca_file is not unset: + kwargs["ca_file"] = ca_file + if key_file is not unset: + kwargs["key_file"] = key_file + super().__init__(kwargs) + + self_.crt_file = crt_file diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 447e4733cf..866d15ae8d 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1677,6 +1677,88 @@ from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData +from datadog_api_client.v2.model.observability_pipeline import ObservabilityPipeline +from datadog_api_client.v2.model.observability_pipeline_add_fields_processor import ( + ObservabilityPipelineAddFieldsProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_add_fields_processor_type import ( + ObservabilityPipelineAddFieldsProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_config_destination_item import ( + ObservabilityPipelineConfigDestinationItem, +) +from datadog_api_client.v2.model.observability_pipeline_config_processor_item import ( + ObservabilityPipelineConfigProcessorItem, +) +from datadog_api_client.v2.model.observability_pipeline_config_source_item import ObservabilityPipelineConfigSourceItem +from datadog_api_client.v2.model.observability_pipeline_create_request import ObservabilityPipelineCreateRequest +from datadog_api_client.v2.model.observability_pipeline_create_request_data import ( + ObservabilityPipelineCreateRequestData, +) +from datadog_api_client.v2.model.observability_pipeline_data import ObservabilityPipelineData +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import ( + ObservabilityPipelineDatadogLogsDestination, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import ( + ObservabilityPipelineDatadogLogsDestinationType, +) +from datadog_api_client.v2.model.observability_pipeline_field_value import ObservabilityPipelineFieldValue +from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor +from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import ( + ObservabilityPipelineFilterProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_kafka_source import ObservabilityPipelineKafkaSource +from datadog_api_client.v2.model.observability_pipeline_kafka_source_librdkafka_option import ( + ObservabilityPipelineKafkaSourceLibrdkafkaOption, +) +from datadog_api_client.v2.model.observability_pipeline_kafka_source_sasl import ObservabilityPipelineKafkaSourceSasl +from datadog_api_client.v2.model.observability_pipeline_kafka_source_type import ObservabilityPipelineKafkaSourceType +from datadog_api_client.v2.model.observability_pipeline_parse_json_processor import ( + ObservabilityPipelineParseJSONProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_parse_json_processor_type import ( + ObservabilityPipelineParseJSONProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_pipeline_kafka_source_sasl_mechanism import ( + ObservabilityPipelinePipelineKafkaSourceSaslMechanism, +) +from datadog_api_client.v2.model.observability_pipeline_quota_processor import ObservabilityPipelineQuotaProcessor +from datadog_api_client.v2.model.observability_pipeline_quota_processor_limit import ( + ObservabilityPipelineQuotaProcessorLimit, +) +from datadog_api_client.v2.model.observability_pipeline_quota_processor_limit_enforce_type import ( + ObservabilityPipelineQuotaProcessorLimitEnforceType, +) +from datadog_api_client.v2.model.observability_pipeline_quota_processor_override import ( + ObservabilityPipelineQuotaProcessorOverride, +) +from datadog_api_client.v2.model.observability_pipeline_quota_processor_type import ( + ObservabilityPipelineQuotaProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_remove_fields_processor import ( + ObservabilityPipelineRemoveFieldsProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_remove_fields_processor_type import ( + ObservabilityPipelineRemoveFieldsProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor import ( + ObservabilityPipelineRenameFieldsProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor_field import ( + ObservabilityPipelineRenameFieldsProcessorField, +) +from datadog_api_client.v2.model.observability_pipeline_rename_fields_processor_type import ( + ObservabilityPipelineRenameFieldsProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls from datadog_api_client.v2.model.okta_account import OktaAccount from datadog_api_client.v2.model.okta_account_attributes import OktaAccountAttributes from datadog_api_client.v2.model.okta_account_request import OktaAccountRequest @@ -3989,6 +4071,42 @@ "NullableRelationshipToUserData", "NullableUserRelationship", "NullableUserRelationshipData", + "ObservabilityPipeline", + "ObservabilityPipelineAddFieldsProcessor", + "ObservabilityPipelineAddFieldsProcessorType", + "ObservabilityPipelineConfig", + "ObservabilityPipelineConfigDestinationItem", + "ObservabilityPipelineConfigProcessorItem", + "ObservabilityPipelineConfigSourceItem", + "ObservabilityPipelineCreateRequest", + "ObservabilityPipelineCreateRequestData", + "ObservabilityPipelineData", + "ObservabilityPipelineDataAttributes", + "ObservabilityPipelineDatadogAgentSource", + "ObservabilityPipelineDatadogAgentSourceType", + "ObservabilityPipelineDatadogLogsDestination", + "ObservabilityPipelineDatadogLogsDestinationType", + "ObservabilityPipelineFieldValue", + "ObservabilityPipelineFilterProcessor", + "ObservabilityPipelineFilterProcessorType", + "ObservabilityPipelineKafkaSource", + "ObservabilityPipelineKafkaSourceLibrdkafkaOption", + "ObservabilityPipelineKafkaSourceSasl", + "ObservabilityPipelineKafkaSourceType", + "ObservabilityPipelineParseJSONProcessor", + "ObservabilityPipelineParseJSONProcessorType", + "ObservabilityPipelinePipelineKafkaSourceSaslMechanism", + "ObservabilityPipelineQuotaProcessor", + "ObservabilityPipelineQuotaProcessorLimit", + "ObservabilityPipelineQuotaProcessorLimitEnforceType", + "ObservabilityPipelineQuotaProcessorOverride", + "ObservabilityPipelineQuotaProcessorType", + "ObservabilityPipelineRemoveFieldsProcessor", + "ObservabilityPipelineRemoveFieldsProcessorType", + "ObservabilityPipelineRenameFieldsProcessor", + "ObservabilityPipelineRenameFieldsProcessorField", + "ObservabilityPipelineRenameFieldsProcessorType", + "ObservabilityPipelineTls", "OktaAccount", "OktaAccountAttributes", "OktaAccountRequest", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_bad_request_response.frozen new file mode 100644 index 0000000000..d1b8c94c60 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:36:58.031Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_bad_request_response.yaml new file mode 100644 index 0000000000..fd22432688 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_bad_request_response.yaml @@ -0,0 +1,27 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"unknown-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines + response: + body: + string: '{"errors":[{"title":"Component with ID filter-processor is an unknown + component","meta":{"message":"Component with ID filter-processor is an unknown + component"}},{"title":"The following components are unused: [datadog-agent-source + unknown-processor]","meta":{"message":"The following components are unused: + [datadog-agent-source unknown-processor]"}}]} + + ' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_ok_response.frozen new file mode 100644 index 0000000000..0fc9b398ff --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:36:58.537Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_ok_response.yaml new file mode 100644 index 0000000000..888fd4a49c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_pipeline_returns_ok_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines + response: + body: + string: '{"data":{"id":"be354bf0-1140-11f0-9a6b-da7ad0900002","type":"pipelines","attributes":{"name":"Main + Observability Pipeline","config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/be354bf0-1140-11f0-9a6b-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - application/json + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_not_found_response.frozen new file mode 100644 index 0000000000..4f32c245d6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:36:59.510Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_not_found_response.yaml new file mode 100644 index 0000000000..95dbe0e11a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/3fa85f64-5717-4562-b3fc-2c963f66afa6 + response: + body: + string: '{"errors":[{"title":"Resource Not Found"}]} + + ' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_ok_response.frozen new file mode 100644 index 0000000000..5489af2d1a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:37:00.184Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_ok_response.yaml new file mode 100644 index 0000000000..f184ed4e96 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_pipeline_returns_ok_response.yaml @@ -0,0 +1,58 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines + response: + body: + string: '{"data":{"id":"bf2c23da-1140-11f0-9a95-da7ad0900002","type":"pipelines","attributes":{"name":"Main + Observability Pipeline","config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/bf2c23da-1140-11f0-9a95-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - application/json + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/bf2c23da-1140-11f0-9a95-da7ad0900002 + response: + body: + string: '{"errors":[{"title":"Resource Not Found"}]} + + ' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_specific_pipeline_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_specific_pipeline_returns_ok_response.frozen new file mode 100644 index 0000000000..5002994582 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_specific_pipeline_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:37:02.118Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_specific_pipeline_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_specific_pipeline_returns_ok_response.yaml new file mode 100644 index 0000000000..274bc14412 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_specific_pipeline_returns_ok_response.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines + response: + body: + string: '{"data":{"id":"c06831ee-1140-11f0-9fe5-da7ad0900002","type":"pipelines","attributes":{"name":"Main + Observability Pipeline","config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/c06831ee-1140-11f0-9fe5-da7ad0900002 + response: + body: + string: '{"data":{"id":"c06831ee-1140-11f0-9fe5-da7ad0900002","type":"pipelines","attributes":{"name":"Main + Observability Pipeline","config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/c06831ee-1140-11f0-9fe5-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - application/json + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_bad_request_response.frozen new file mode 100644 index 0000000000..01305de98f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:37:04.190Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_bad_request_response.yaml new file mode 100644 index 0000000000..9a861c39a7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_bad_request_response.yaml @@ -0,0 +1,65 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines + response: + body: + string: '{"data":{"id":"c193d7da-1140-11f0-9a6d-da7ad0900002","type":"pipelines","attributes":{"name":"Main + Observability Pipeline","config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"unknown-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/c193d7da-1140-11f0-9a6d-da7ad0900002 + response: + body: + string: '{"errors":[{"title":"Component with ID filter-processor is an unknown + component","meta":{"message":"Component with ID filter-processor is an unknown + component"}},{"title":"The following components are unused: [datadog-agent-source + unknown-processor]","meta":{"message":"The following components are unused: + [datadog-agent-source unknown-processor]"}}]} + + ' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/c193d7da-1140-11f0-9a6d-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - application/json + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_not_found_response.frozen new file mode 100644 index 0000000000..b453d330d3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:37:06.031Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_not_found_response.yaml new file mode 100644 index 0000000000..7a8efada66 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_not_found_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/3fa85f64-5717-4562-b3fc-2c963f66afa6 + response: + body: + string: '{"errors":[{"title":"Not Found"}]} + + ' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_ok_response.frozen new file mode 100644 index 0000000000..4fba4617c1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-04-04T10:37:06.485Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_ok_response.yaml new file mode 100644 index 0000000000..176f7aff9e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_pipeline_returns_ok_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Main + Observability Pipeline"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines + response: + body: + string: '{"data":{"id":"c2ee25ae-1140-11f0-9fe7-da7ad0900002","type":"pipelines","attributes":{"name":"Main + Observability Pipeline","config":{"destinations":[{"id":"datadog-logs-destination","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"updated-datadog-logs-destination-id","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Updated + Pipeline Name"},"id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/c2ee25ae-1140-11f0-9fe7-da7ad0900002 + response: + body: + string: '{"data":{"id":"c2ee25ae-1140-11f0-9fe7-da7ad0900002","type":"pipelines","attributes":{"name":"Updated + Pipeline Name","config":{"destinations":[{"id":"updated-datadog-logs-destination-id","inputs":["filter-processor"],"type":"datadog_logs"}],"processors":[{"id":"filter-processor","include":"service:my-service","inputs":["datadog-agent-source"],"type":"filter"}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/c2ee25ae-1140-11f0-9fe7-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - application/json + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 3355eda9ed..3a41fda169 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -503,6 +503,18 @@ "tag": "CSM Threats", "operationId": "CreateCSMThreatsAgentRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\":{\n \"attributes\":{\n \"config\":{\n \"destinations\":[\n {\n \"id\":\"datadog-logs-destination\",\n \"inputs\":[\n \"filter-processor\"\n ],\n \"type\":\"datadog_logs\"\n }\n ],\n \"processors\":[\n {\n \"id\":\"filter-processor\",\n \"include\":\"service:my-service\",\n \"inputs\":[\n \"datadog-agent-source\"\n ],\n \"type\":\"filter\"\n }\n ],\n \"sources\":[\n {\n \"id\":\"datadog-agent-source\",\n \"type\":\"datadog_agent\"\n }\n ]\n },\n \"name\":\"Main Observability Pipeline\"\n },\n \"type\":\"pipelines\"\n }\n}" + } + ], + "step": "there is a valid \"pipeline\" in the system", + "key": "pipeline", + "tag": "Observability Pipelines", + "operationId": "CreatePipeline" + }, { "parameters": [ { diff --git a/tests/v2/features/observability_pipelines.feature b/tests/v2/features/observability_pipelines.feature new file mode 100644 index 0000000000..f66f9bc618 --- /dev/null +++ b/tests/v2/features/observability_pipelines.feature @@ -0,0 +1,124 @@ +@endpoint(observability-pipelines) @endpoint(observability-pipelines-v2) +Feature: Observability Pipelines + Observability Pipelines allows you to collect and process logs within your + own infrastructure, and then route them to downstream integrations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ObservabilityPipelines" API + + @team:DataDog/observability-pipelines + Scenario: Create a new pipeline returns "Bad Request" response + Given operation "CreatePipeline" enabled + And new "CreatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["filter-processor"], "type": "datadog_logs"}], "processors": [{"id": "unknown-processor", "include": "service:my-service", "inputs": ["datadog-agent-source"], "type": "filter"}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "type": "pipelines"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/observability-pipelines + Scenario: Create a new pipeline returns "Conflict" response + Given operation "CreatePipeline" enabled + And new "CreatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["filter-processor"], "type": "datadog_logs"}], "processors": [{"id": "filter-processor", "include": "service:my-service", "inputs": ["datadog-agent-source"], "type": "filter"}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "type": "pipelines"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/observability-pipelines + Scenario: Create a new pipeline returns "OK" response + Given operation "CreatePipeline" enabled + And new "CreatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["filter-processor"], "type": "datadog_logs"}], "processors": [{"id": "filter-processor", "include": "service:my-service", "inputs": ["datadog-agent-source"], "type": "filter"}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "type": "pipelines"}} + When the request is sent + Then the response status is 201 OK + And the response "data" has field "id" + And the response "data.type" is equal to "pipelines" + And the response "data.attributes.name" is equal to "Main Observability Pipeline" + And the response "data.attributes.config.sources" has length 1 + And the response "data.attributes.config.processors" has length 1 + And the response "data.attributes.config.destinations" has length 1 + + @generated @skip @team:DataDog/observability-pipelines + Scenario: Delete a pipeline returns "Conflict" response + Given operation "DeletePipeline" enabled + And new "DeletePipeline" request + And request contains "pipeline_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/observability-pipelines + Scenario: Delete a pipeline returns "Not Found" response + Given operation "DeletePipeline" enabled + And new "DeletePipeline" request + And request contains "pipeline_id" parameter with value "3fa85f64-5717-4562-b3fc-2c963f66afa6" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/observability-pipelines + Scenario: Delete a pipeline returns "OK" response + Given operation "DeletePipeline" enabled + And there is a valid "pipeline" in the system + And new "DeletePipeline" request + And request contains "pipeline_id" parameter from "pipeline.data.id" + When the request is sent + Then the response status is 204 OK + + @team:DataDog/observability-pipelines + Scenario: Get a specific pipeline returns "OK" response + Given operation "GetPipeline" enabled + And there is a valid "pipeline" in the system + And new "GetPipeline" request + And request contains "pipeline_id" parameter from "pipeline.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data" has field "id" + And the response "data.type" is equal to "pipelines" + And the response "data.attributes.name" is equal to "Main Observability Pipeline" + And the response "data.attributes.config.sources" has length 1 + And the response "data.attributes.config.processors" has length 1 + And the response "data.attributes.config.destinations" has length 1 + + @team:DataDog/observability-pipelines + Scenario: Update a pipeline returns "Bad Request" response + Given operation "UpdatePipeline" enabled + And new "UpdatePipeline" request + And there is a valid "pipeline" in the system + And request contains "pipeline_id" parameter from "pipeline.data.id" + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["filter-processor"], "type": "datadog_logs"}], "processors": [{"id": "unknown-processor", "include": "service:my-service", "inputs": ["datadog-agent-source"], "type": "filter"}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/observability-pipelines + Scenario: Update a pipeline returns "Conflict" response + Given operation "UpdatePipeline" enabled + And new "UpdatePipeline" request + And request contains "pipeline_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["filter-processor"], "type": "datadog_logs"}], "processors": [{"id": "filter-processor", "include": "service:my-service", "inputs": ["datadog-agent-source"], "type": "filter"}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/observability-pipelines + Scenario: Update a pipeline returns "Not Found" response + Given operation "UpdatePipeline" enabled + And new "UpdatePipeline" request + And request contains "pipeline_id" parameter with value "3fa85f64-5717-4562-b3fc-2c963f66afa6" + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["filter-processor"], "type": "datadog_logs"}], "processors": [{"id": "filter-processor", "include": "service:my-service", "inputs": ["datadog-agent-source"], "type": "filter"}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/observability-pipelines + Scenario: Update a pipeline returns "OK" response + Given operation "UpdatePipeline" enabled + And there is a valid "pipeline" in the system + And new "UpdatePipeline" request + And request contains "pipeline_id" parameter from "pipeline.data.id" + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "updated-datadog-logs-destination-id", "inputs": ["filter-processor"], "type": "datadog_logs"}], "processors": [{"id": "filter-processor", "include": "service:my-service", "inputs": ["datadog-agent-source"], "type": "filter"}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Updated Pipeline Name"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "data" has field "id" + And the response "data.type" is equal to "pipelines" + And the response "data.attributes.name" is equal to "Updated Pipeline Name" + And the response "data.attributes.config.sources" has length 1 + And the response "data.attributes.config.processors" has length 1 + And the response "data.attributes.config.destinations" has length 1 + And the response "data.attributes.config.destinations[0].id" is equal to "updated-datadog-logs-destination-id" diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index f8e2c4ef1b..72669c55ba 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1964,6 +1964,37 @@ "type": "safe" } }, + "CreatePipeline": { + "tag": "Observability Pipelines", + "undo": { + "operationId": "DeletePipeline", + "parameters": [ + { + "name": "pipeline_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeletePipeline": { + "tag": "Observability Pipelines", + "undo": { + "type": "idempotent" + } + }, + "GetPipeline": { + "tag": "Observability Pipelines", + "undo": { + "type": "safe" + } + }, + "UpdatePipeline": { + "tag": "Observability Pipelines", + "undo": { + "type": "idempotent" + } + }, "DeleteRestrictionPolicy": { "tag": "Restriction Policies", "undo": {