From 74545f59386009c9995a062c0bc0330b66bbc77f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 16 Oct 2026 16:33:54 +0000 Subject: [PATCH] Regenerate client from commit d1ba91a of spec repo --- .generator/schemas/v2/openapi.yaml | 1572 +++++++++++++++++ .../CancelSecurityMonitoringBatchMigration.rb | 9 + .../CreateSecurityMonitoringBatchMigration.rb | 30 + ...curityMonitoringBatchMigrationResources.rb | 27 + .../DeleteSecurityMonitoringBatchMigration.rb | 12 + ...curityMonitoringBatchMigrationResources.rb | 26 + ...curityMonitoringBatchMigrationResources.rb | 12 + .../ListSecurityMonitoringBatchMigrations.rb | 15 + ...PublishSecurityMonitoringBatchMigration.rb | 20 + .../StartSecurityMonitoringBatchMigration.rb | 9 + .../UpdateSecurityMonitoringBatchMigration.rb | 25 + ...ecurityMonitoringBatchMigrationResource.rb | 24 + features/scenarios_model_mapping.rb | 44 + features/v2/given.json | 25 + features/v2/security_monitoring.feature | 352 ++++ features/v2/undo.json | 81 + generated-test/test-runner-data/manifest.json | 56 + ...ch-migration-returns-created-response.json | 56 + ...ch-migration-returns-created-response.json | 45 + ...migration-returns-no-content-response.json | 35 + ...migration-returns-no-content-response.json | 52 + ...gration-resources-returns-ok-response.json | 35 + ...-batch-migrations-returns-ok-response.json | 35 + ...igration-resource-returns-ok-response.json | 66 + ...a-batch-migration-returns-ok-response.json | 54 + .../v2/security-monitoring.json | 850 ++++++++- lib/datadog_api_client/configuration.rb | 11 + lib/datadog_api_client/inflector.rb | 43 + .../v2/api/security_monitoring_api.rb | 950 +++++++++- ...y_monitoring_batch_migration_attributes.rb | 310 ++++ ...oring_batch_migration_create_attributes.rb | 198 +++ ..._monitoring_batch_migration_create_data.rb | 144 ++ ...nitoring_batch_migration_create_request.rb | 123 ++ ...ecurity_monitoring_batch_migration_data.rb | 165 ++ ...monitoring_batch_migration_input_source.rb | 29 + ...ty_monitoring_batch_migration_list_meta.rb | 123 ++ ...ring_batch_migration_publish_attributes.rb | 126 ++ ...monitoring_batch_migration_publish_data.rb | 144 ++ ...itoring_batch_migration_publish_request.rb | 123 ++ ...toring_batch_migration_publish_response.rb | 125 ++ ...monitoring_batch_migration_publish_type.rb | 26 + ...migration_published_resource_attributes.rb | 143 ++ ...batch_migration_published_resource_data.rb | 165 ++ ...tch_migration_published_resource_status.rb | 27 + ...batch_migration_published_resource_type.rb | 26 + ...ing_batch_migration_resource_attributes.rb | 336 ++++ ...ng_batch_migration_resource_create_item.rb | 202 +++ ...onitoring_batch_migration_resource_data.rb | 165 ++ ...ing_batch_migration_resource_input_type.rb | 30 + ...oring_batch_migration_resource_response.rb | 123 ++ ...itoring_batch_migration_resource_status.rb | 35 + ..._batch_migration_resource_status_counts.rb | 270 +++ ...onitoring_batch_migration_resource_type.rb | 26 + ...ch_migration_resource_update_attributes.rb | 162 ++ ...ng_batch_migration_resource_update_data.rb | 144 ++ ...batch_migration_resource_update_request.rb | 123 ++ ...h_migration_resources_create_attributes.rb | 133 ++ ...g_batch_migration_resources_create_data.rb | 144 ++ ...atch_migration_resources_create_request.rb | 123 ++ ...tch_migration_resources_create_response.rb | 125 ++ ...h_migration_resources_delete_attributes.rb | 133 ++ ...g_batch_migration_resources_delete_data.rb | 144 ++ ...atch_migration_resources_delete_request.rb | 123 ++ ...batch_migration_resources_list_response.rb | 146 ++ ...nitoring_batch_migration_resources_type.rb | 26 + ...ity_monitoring_batch_migration_response.rb | 123 ++ ...urity_monitoring_batch_migration_status.rb | 31 + ...ecurity_monitoring_batch_migration_type.rb | 26 + ...oring_batch_migration_update_attributes.rb | 142 ++ ..._monitoring_batch_migration_update_data.rb | 144 ++ ...nitoring_batch_migration_update_request.rb | 123 ++ ...nitoring_batch_migrations_list_response.rb | 146 ++ 72 files changed, 9982 insertions(+), 34 deletions(-) create mode 100644 examples/v2/security-monitoring/CancelSecurityMonitoringBatchMigration.rb create mode 100644 examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigration.rb create mode 100644 examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigrationResources.rb create mode 100644 examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigration.rb create mode 100644 examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigrationResources.rb create mode 100644 examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrationResources.rb create mode 100644 examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrations.rb create mode 100644 examples/v2/security-monitoring/PublishSecurityMonitoringBatchMigration.rb create mode 100644 examples/v2/security-monitoring/StartSecurityMonitoringBatchMigration.rb create mode 100644 examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigration.rb create mode 100644 examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigrationResource.rb create mode 100644 generated-test/test-runner-data/v2/security-monitoring/add-resources-to-a-batch-migration-returns-created-response.json create mode 100644 generated-test/test-runner-data/v2/security-monitoring/create-a-batch-migration-returns-created-response.json create mode 100644 generated-test/test-runner-data/v2/security-monitoring/delete-a-batch-migration-returns-no-content-response.json create mode 100644 generated-test/test-runner-data/v2/security-monitoring/delete-resources-from-a-batch-migration-returns-no-content-response.json create mode 100644 generated-test/test-runner-data/v2/security-monitoring/list-batch-migration-resources-returns-ok-response.json create mode 100644 generated-test/test-runner-data/v2/security-monitoring/list-batch-migrations-returns-ok-response.json create mode 100644 generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-resource-returns-ok-response.json create mode 100644 generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-returns-ok-response.json create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_input_source.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_list_meta.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_status.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_create_item.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_input_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status_counts.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_status.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_batch_migrations_list_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8e540e2cff55..f94599b971af 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1942,6 +1942,47 @@ components: required: true schema: type: string + SecurityMonitoringBatchMigrationID: + description: The UUID of the batch migration. + in: path + name: batch_id + required: true + schema: + example: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + format: uuid + type: string + SecurityMonitoringBatchMigrationPageNumber: + description: Specific page number to return, starting at 1. + in: query + name: page[number] + required: false + schema: + default: 1 + example: 1 + format: int64 + minimum: 1 + type: integer + SecurityMonitoringBatchMigrationPageSize: + description: Size for a given page. The maximum allowed value is 500. + in: query + name: page[size] + required: false + schema: + default: 50 + example: 50 + format: int64 + maximum: 500 + minimum: 1 + type: integer + SecurityMonitoringBatchMigrationResourceID: + description: The UUID of the batch migration resource. + in: path + name: resource_id + required: true + schema: + example: c968cf83-56c2-4d54-a993-6c86dfb83527 + format: uuid + type: string SecurityMonitoringCriticalAssetID: description: The ID of the critical asset. in: path @@ -2370,6 +2411,42 @@ components: schema: $ref: "#/components/schemas/APIErrorResponse" description: Method Not Allowed + SecurityMonitoringBatchMigrationBadRequestResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + SecurityMonitoringBatchMigrationConflictResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + SecurityMonitoringBatchMigrationForbiddenResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + SecurityMonitoringBatchMigrationInternalServerErrorResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + SecurityMonitoringBatchMigrationNotFoundResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + SecurityMonitoringBatchMigrationUnauthorizedResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized SpansBadRequestResponse: content: application/json: @@ -112057,6 +112134,725 @@ components: - subscription_count - error_count type: object + SecurityMonitoringBatchMigrationAttributes: + description: Attributes of a batch migration. + properties: + createdAt: + description: The creation date of the batch migration, in RFC 3339 format. + example: "2026-09-21T12:00:00Z" + format: date-time + type: string + createdBy: + description: The UUID of the user or service account who created the batch migration. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + description: + description: The description of the batch migration. + example: Rules imported from Splunk + type: string + inputSource: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationInputSource" + lastUpdatedAt: + description: The last update date of the batch migration, in RFC 3339 format. + example: "2026-09-21T12:00:00Z" + format: date-time + type: string + lastUpdatedBy: + description: |- + The UUID of the user or service account who last updated the batch migration, + or the name of a system actor. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + name: + description: The name of the batch migration. + example: Splunk migration + type: string + orgId: + description: The ID of the organization that owns the batch migration. + example: 123456 + format: int64 + type: integer + resourceStatusCounts: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceStatusCounts" + status: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationStatus" + tags: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationTags" + required: + - orgId + - name + - inputSource + - status + - createdAt + - lastUpdatedAt + - tags + - resourceStatusCounts + type: object + SecurityMonitoringBatchMigrationCreateAttributes: + description: Attributes of the batch migration to create. + properties: + description: + description: The description of the batch migration. + example: Rules imported from Splunk + maxLength: 4096 + type: string + name: + description: The name of the batch migration. + example: Splunk migration + maxLength: 512 + type: string + resources: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationCreateResources" + tags: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationTags" + required: + - resources + type: object + SecurityMonitoringBatchMigrationCreateData: + description: Data of the batch migration to create. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationCreateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationType" + required: + - type + - attributes + type: object + SecurityMonitoringBatchMigrationCreateRequest: + description: Request to create a batch migration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationCreateData" + required: + - data + type: object + SecurityMonitoringBatchMigrationCreateResources: + description: The initial resources of the batch migration. From 1 to 100 resources. + items: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceCreateItem" + maxItems: 100 + minItems: 1 + type: array + SecurityMonitoringBatchMigrationData: + description: A batch migration. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationAttributes" + id: + description: The UUID of the batch migration. + example: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + format: uuid + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringBatchMigrationInputSource: + description: |- + The origin of a batch migration. Always `batch_migration` for batch migrations + created through this API. + enum: + - batch_migration + - threat_hunting + - user + example: batch_migration + type: string + x-enum-varnames: + - BATCH_MIGRATION + - THREAT_HUNTING + - USER + SecurityMonitoringBatchMigrationListMeta: + description: Metadata of a list response. + properties: + totalCount: + description: Total number of items matching the request. + example: 1 + format: int64 + type: integer + required: + - totalCount + type: object + SecurityMonitoringBatchMigrationPublishAttributes: + description: Attributes of the batch migration publish request. + properties: + resourceIds: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishResourceIDs" + type: object + SecurityMonitoringBatchMigrationPublishData: + description: Data of the batch migration publish request. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishType" + required: + - type + - attributes + type: object + SecurityMonitoringBatchMigrationPublishRequest: + description: Request to publish the resources of a batch migration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishData" + required: + - data + type: object + SecurityMonitoringBatchMigrationPublishResourceIDs: + description: |- + Unique UUIDs of the resources to publish. Up to 1000 IDs. When omitted or empty, + every `completed` resource of the batch migration is published. + example: + - c968cf83-56c2-4d54-a993-6c86dfb83527 + items: + format: uuid + type: string + maxItems: 1000 + type: array + uniqueItems: true + SecurityMonitoringBatchMigrationPublishResponse: + description: Response containing the publication outcome of each resource. + properties: + data: + description: The publication outcome of each resource. + items: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishedResourceData" + type: array + required: + - data + type: object + SecurityMonitoringBatchMigrationPublishType: + description: The type of resource for a batch migration publish request. + enum: + - batchMigrationPublish + example: batchMigrationPublish + type: string + x-enum-varnames: + - BATCH_MIGRATION_PUBLISH + SecurityMonitoringBatchMigrationPublishedResourceAttributes: + description: Attributes of the publication outcome of a batch migration resource. + properties: + error: + description: The reason why the resource could not be published. + example: failed to create rule + type: string + ruleId: + description: The ID of the created Cloud SIEM detection rule. + example: abc-def-ghi + type: string + status: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishedResourceStatus" + required: + - status + type: object + SecurityMonitoringBatchMigrationPublishedResourceData: + description: The publication outcome of a batch migration resource. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishedResourceAttributes" + id: + description: The UUID of the batch migration resource. + example: c968cf83-56c2-4d54-a993-6c86dfb83527 + format: uuid + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishedResourceType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringBatchMigrationPublishedResourceStatus: + description: The outcome of publishing a batch migration resource. + enum: + - published + - failed + example: published + type: string + x-enum-varnames: + - PUBLISHED + - FAILED + SecurityMonitoringBatchMigrationPublishedResourceType: + description: The type of resource for a published batch migration resource. + enum: + - batchMigrationPublishedResource + example: batchMigrationPublishedResource + type: string + x-enum-varnames: + - BATCH_MIGRATION_PUBLISHED_RESOURCE + SecurityMonitoringBatchMigrationResourceAttributes: + description: Attributes of a batch migration resource. + properties: + batchId: + description: The UUID of the batch migration that contains the resource. + example: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + format: uuid + type: string + createdAt: + description: The creation date of the resource, in RFC 3339 format. + example: "2026-09-21T12:00:00Z" + format: date-time + type: string + createdBy: + description: The UUID of the user or service account who created the resource. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + description: + description: The description of the resource. + example: Detects repeated failed Windows authentication attempts. + type: string + input: + description: The source query or natural language description to translate. + example: index=wineventlog EventCode=4625 + type: string + inputType: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceInputType" + lastUpdatedAt: + description: The last update date of the resource, in RFC 3339 format. + example: "2026-09-21T12:02:00Z" + format: date-time + type: string + lastUpdatedBy: + description: |- + The UUID of the user or service account who last updated the resource, + or the name of a system actor. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + name: + description: The name of the resource. + example: Repeated Windows login failures + type: string + output: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceOutput" + outputType: + description: The type of the translation output. Currently always `siem_rule`. + example: siem_rule + type: string + ruleId: + description: The ID of the Cloud SIEM detection rule created when the resource was published. + example: abc-def-ghi + type: string + status: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceStatus" + required: + - batchId + - name + - inputType + - outputType + - status + - input + - output + - createdAt + - lastUpdatedAt + type: object + SecurityMonitoringBatchMigrationResourceCreateItem: + description: A source rule to translate into a Cloud SIEM detection rule. + properties: + description: + description: The description of the resource. + example: Detects repeated failed Windows authentication attempts. + maxLength: 4096 + type: string + input: + description: The source query or natural language description to translate. Must not be blank. + example: index=wineventlog EventCode=4625 + maxLength: 65536 + minLength: 1 + pattern: '^[\s\S]*\S[\s\S]*$' + type: string + inputType: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceInputType" + name: + description: The name of the resource. + example: Repeated Windows login failures + maxLength: 512 + type: string + required: + - inputType + - input + type: object + SecurityMonitoringBatchMigrationResourceCreateItems: + description: The resources to add. From 1 to 1000 resources. + items: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceCreateItem" + maxItems: 1000 + minItems: 1 + type: array + SecurityMonitoringBatchMigrationResourceData: + description: A batch migration resource. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceAttributes" + id: + description: The UUID of the batch migration resource. + example: c968cf83-56c2-4d54-a993-6c86dfb83527 + format: uuid + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringBatchMigrationResourceIDs: + description: Unique UUIDs of batch migration resources. From 1 to 1000 IDs. + example: + - c968cf83-56c2-4d54-a993-6c86dfb83527 + items: + format: uuid + type: string + maxItems: 1000 + minItems: 1 + type: array + SecurityMonitoringBatchMigrationResourceInputType: + description: |- + The type of the source rule: `spl` for a Splunk SPL search or saved search definition, + `natural_language` for a plain-English description of the behavior to detect, or `kql` + for a Microsoft KQL query. SPL inputs must be self-contained, with search macros expanded. + enum: + - natural_language + - spl + - kql + example: spl + type: string + x-enum-varnames: + - NATURAL_LANGUAGE + - SPL + - KQL + SecurityMonitoringBatchMigrationResourceOutput: + additionalProperties: {} + description: |- + The translation output. When the resource is `completed`, a Cloud SIEM detection rule + definition in the same format as the create detection rule API. When the resource is + `failed`, an object with an `error` describing the failure, with `kind` set to + `translation_error` or `internal_error`, and optional `type` and `message`. Otherwise, null. + example: + name: Repeated Windows login failures + type: log_detection + nullable: true + type: object + SecurityMonitoringBatchMigrationResourceResponse: + description: Response containing a batch migration resource. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceData" + required: + - data + type: object + SecurityMonitoringBatchMigrationResourceStatus: + description: |- + The status of a batch migration resource. `completed` resources have a translation in + `output` that is ready to be published. `duplicate` is reserved for future duplicate rule + detection. + enum: + - pending + - in_progress + - completed + - canceled + - failed + - publishing + - published + - duplicate + example: completed + type: string + x-enum-varnames: + - PENDING + - IN_PROGRESS + - COMPLETED + - CANCELED + - FAILED + - PUBLISHING + - PUBLISHED + - DUPLICATE + SecurityMonitoringBatchMigrationResourceStatusCounts: + description: The number of resources of a batch migration in each status. + properties: + canceled: + description: Number of resources whose translation was canceled. + example: 0 + format: int64 + type: integer + completed: + description: Number of resources translated and ready to be published. + example: 0 + format: int64 + type: integer + duplicate: + description: Number of resources identified as duplicates of an existing rule. Reserved for future use. + example: 0 + format: int64 + type: integer + failed: + description: Number of resources whose translation failed. + example: 0 + format: int64 + type: integer + inProgress: + description: Number of resources being translated. + example: 0 + format: int64 + type: integer + pending: + description: Number of resources waiting to be translated. + example: 1 + format: int64 + type: integer + published: + description: Number of resources published as Cloud SIEM detection rules. + example: 0 + format: int64 + type: integer + publishing: + description: Number of resources being published. + example: 0 + format: int64 + type: integer + required: + - pending + - inProgress + - completed + - canceled + - failed + - publishing + - published + - duplicate + type: object + SecurityMonitoringBatchMigrationResourceType: + description: The type of resource for a batch migration resource. + enum: + - batchMigrationResource + example: batchMigrationResource + type: string + x-enum-varnames: + - BATCH_MIGRATION_RESOURCE + SecurityMonitoringBatchMigrationResourceUpdateAttributes: + additionalProperties: false + description: Attributes of the batch migration resource to update. At least one attribute is required. + minProperties: 1 + properties: + description: + description: The description of the resource. + example: Detects repeated failed Windows authentication attempts. + maxLength: 4096 + type: string + input: + description: The source query or natural language description to translate. Must not be blank. + example: index=wineventlog EventCode=4625 | stats count by user + maxLength: 65536 + minLength: 1 + pattern: '^[\s\S]*\S[\s\S]*$' + type: string + inputType: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceInputType" + name: + description: The name of the resource. + example: Repeated Windows login failures + maxLength: 512 + type: string + type: object + SecurityMonitoringBatchMigrationResourceUpdateData: + description: Data of the batch migration resource to update. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceUpdateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceType" + required: + - type + - attributes + type: object + SecurityMonitoringBatchMigrationResourceUpdateRequest: + description: Request to update a batch migration resource. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceUpdateData" + required: + - data + type: object + SecurityMonitoringBatchMigrationResourcesCreateAttributes: + description: Attributes of the resources to add to a batch migration. + properties: + resources: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceCreateItems" + required: + - resources + type: object + SecurityMonitoringBatchMigrationResourcesCreateData: + description: Data of the resources to add to a batch migration. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesCreateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesType" + required: + - type + - attributes + type: object + SecurityMonitoringBatchMigrationResourcesCreateRequest: + description: Request to add resources to a batch migration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesCreateData" + required: + - data + type: object + SecurityMonitoringBatchMigrationResourcesCreateResponse: + description: Response containing the batch migration resources that were added. + properties: + data: + description: The added batch migration resources. + items: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceData" + type: array + required: + - data + type: object + SecurityMonitoringBatchMigrationResourcesDeleteAttributes: + description: Attributes of the resources to delete from a batch migration. + properties: + resourceIds: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceIDs" + required: + - resourceIds + type: object + SecurityMonitoringBatchMigrationResourcesDeleteData: + description: Data of the resources to delete from a batch migration. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesDeleteAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesType" + required: + - type + - attributes + type: object + SecurityMonitoringBatchMigrationResourcesDeleteRequest: + description: Request to delete resources from a batch migration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesDeleteData" + required: + - data + type: object + SecurityMonitoringBatchMigrationResourcesListResponse: + description: Response containing batch migration resources. + properties: + data: + description: The batch migration resources. + items: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceData" + type: array + meta: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationListMeta" + required: + - data + - meta + type: object + SecurityMonitoringBatchMigrationResourcesType: + description: The type of resource for a request on a set of batch migration resources. + enum: + - batchMigrationResources + example: batchMigrationResources + type: string + x-enum-varnames: + - BATCH_MIGRATION_RESOURCES + SecurityMonitoringBatchMigrationResponse: + description: Response containing a batch migration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationData" + required: + - data + type: object + SecurityMonitoringBatchMigrationStatus: + description: |- + The status of a batch migration. A batch migration is created as `draft` and moves to + `in_progress` when started. It moves to `completed` once no resource is `pending` or + `in_progress`, or to `canceled` when canceled. + enum: + - draft + - in_progress + - canceled + - completed + example: draft + type: string + x-enum-varnames: + - DRAFT + - IN_PROGRESS + - CANCELED + - COMPLETED + SecurityMonitoringBatchMigrationTags: + description: Tags of the batch migration. Up to 50 tags, each up to 256 characters. + example: + - source:splunk + items: + maxLength: 256 + type: string + maxItems: 50 + type: array + SecurityMonitoringBatchMigrationType: + description: The type of resource for a batch migration. + enum: + - batchMigration + example: batchMigration + type: string + x-enum-varnames: + - BATCH_MIGRATION + SecurityMonitoringBatchMigrationUpdateAttributes: + additionalProperties: false + description: Attributes of the batch migration to update. At least one attribute is required. + minProperties: 1 + properties: + description: + description: The description of the batch migration. + example: Rules imported from Splunk + maxLength: 4096 + type: string + name: + description: The name of the batch migration. + example: Splunk migration - Windows + maxLength: 512 + type: string + tags: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationTags" + type: object + SecurityMonitoringBatchMigrationUpdateData: + description: Data of the batch migration to update. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationUpdateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationType" + required: + - type + - attributes + type: object + SecurityMonitoringBatchMigrationUpdateRequest: + description: Request to update a batch migration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationUpdateData" + required: + - data + type: object + SecurityMonitoringBatchMigrationsListResponse: + description: Response containing a page of batch migrations. + properties: + data: + description: The batch migrations. + items: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationData" + type: array + meta: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationListMeta" + required: + - data + - meta + type: object SecurityMonitoringContentPackActivation: description: The activation status of a content pack. enum: @@ -226113,6 +226909,782 @@ paths: x-unstable: |- **Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9). + /api/v2/security_monitoring/batch-migrations: + get: + description: |- + List the batch migrations of your organization. A batch migration groups detection + rules from another SIEM that the Datadog Detection Agent translates into Cloud SIEM + detection rules. To retrieve a single batch migration, filter by its ID with + `filter[query]=id:`. Poll this endpoint to follow the progress of a batch + migration through its `status` and `resourceStatusCounts`. + operationId: ListSecurityMonitoringBatchMigrations + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationPageSize" + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationPageNumber" + - description: |- + A search query in Datadog search syntax to filter batch migrations, such as + `status:completed`. Filterable attributes are `id`, `name`, `description`, `status`, + `createdBy`, and `lastUpdatedBy`. Free text matches the batch migration name. + in: query + name: filter[query] + required: false + schema: + example: "status:draft" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + createdAt: "2026-09-21T12:00:00Z" + createdBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + description: Rules imported from Splunk + inputSource: batch_migration + lastUpdatedAt: "2026-09-21T12:00:00Z" + lastUpdatedBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + name: Splunk migration + orgId: 123456 + resourceStatusCounts: + canceled: 0 + completed: 0 + duplicate: 0 + failed: 0 + inProgress: 0 + pending: 1 + published: 0 + publishing: 0 + status: draft + tags: + - source:splunk + id: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + type: batchMigration + meta: + totalCount: 1 + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationsListResponse" + description: OK + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: List batch migrations + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + post: + description: |- + Create a batch migration in the `draft` status, together with 1 to 100 initial + resources. Each resource holds one source rule to translate into a Cloud SIEM detection + rule. To load more rules, add them with the add resources endpoint before starting the + batch migration. A batch migration can hold up to 1000 resources. The response does not + include the created resources: list the resources of the batch migration to retrieve them. + operationId: CreateSecurityMonitoringBatchMigration + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Rules imported from Splunk + name: Splunk migration + resources: + - description: Detects repeated failed Windows authentication attempts. + input: index=wineventlog EventCode=4625 + inputType: spl + name: Repeated Windows login failures + - input: >- + Alert when PowerShell is launched with a command line that downloads and executes a remote script, such as IEX with Net.WebClient or Invoke-WebRequest. + inputType: natural_language + name: Suspicious PowerShell download cradle + tags: + - source:splunk + type: batchMigration + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2026-09-21T12:00:00Z" + createdBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + description: Rules imported from Splunk + inputSource: batch_migration + lastUpdatedAt: "2026-09-21T12:00:00Z" + lastUpdatedBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + name: Splunk migration + orgId: 123456 + resourceStatusCounts: + canceled: 0 + completed: 0 + duplicate: 0 + failed: 0 + inProgress: 0 + pending: 2 + published: 0 + publishing: 0 + status: draft + tags: + - source:splunk + id: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + type: batchMigration + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResponse" + description: Created + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Create a batch migration + tags: + - Security Monitoring + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + /api/v2/security_monitoring/batch-migrations/{batch_id}: + delete: + description: |- + Delete a batch migration and its resources. Detection rules that were already + published are not deleted. Returns `409 Conflict` while any resource is `in_progress` + or `publishing`: cancel the batch migration, or wait for publishing to finish, and + then try again. + operationId: DeleteSecurityMonitoringBatchMigration + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "409": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Delete a batch migration + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + patch: + description: |- + Update the name, description, or tags of a batch migration, in any status. At least + one of these attributes must be provided. Omitted attributes are left unchanged, and + `tags` replaces the full list of tags. + operationId: UpdateSecurityMonitoringBatchMigration + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: Splunk migration - Windows + tags: + - source:splunk + - team:secops + type: batchMigration + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2026-09-21T12:00:00Z" + createdBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + description: Rules imported from Splunk + inputSource: batch_migration + lastUpdatedAt: "2026-09-21T12:05:00Z" + lastUpdatedBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + name: Splunk migration - Windows + orgId: 123456 + resourceStatusCounts: + canceled: 0 + completed: 0 + duplicate: 0 + failed: 0 + inProgress: 0 + pending: 1 + published: 0 + publishing: 0 + status: draft + tags: + - source:splunk + - team:secops + id: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + type: batchMigration + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResponse" + description: OK + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Update a batch migration + tags: + - Security Monitoring + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + /api/v2/security_monitoring/batch-migrations/{batch_id}/cancel: + post: + description: |- + Cancel an `in_progress` batch migration. Resources that are `pending` or `in_progress` + become `canceled`. Resources that are already `completed` or `failed` keep their status + and output, so completed resources can still be published. Canceling a `canceled` batch + migration succeeds, so the request can be safely retried. Returns `409 Conflict` if the + batch migration is `draft` or `completed`. + operationId: CancelSecurityMonitoringBatchMigration + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + responses: + "202": + description: Accepted + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "409": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Cancel a batch migration + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + /api/v2/security_monitoring/batch-migrations/{batch_id}/publish: + post: + description: |- + Create a Cloud SIEM detection rule from the `output` of each selected `completed` + resource of a batch migration. Completed resources can be published while the rest of + the batch migration is still being translated. When `resourceIds` is omitted or empty, + every `completed` resource is published. Published rules are created disabled. + + Every requested resource must be publishable: `completed`, or left in `publishing` for + more than one minute after an uncertain result. Otherwise, the request returns + `409 Conflict` and nothing is published. Already published resources are not publishable. + + The response reports the outcome of each resource, and some resources can be published + while others fail. A `failed` result that contains a `ruleId` means the rule was created: + do not retry that resource. Publishing a rule with a `block_ip` or `block_user` action + requires the `appsec_protect_write` permission. + operationId: PublishSecurityMonitoringBatchMigration + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + requestBody: + content: + application/json: + examples: + all_completed: + summary: Publish every completed resource + value: + data: + attributes: {} + type: batchMigrationPublish + default: + value: + data: + attributes: + resourceIds: + - c968cf83-56c2-4d54-a993-6c86dfb83527 + type: batchMigrationPublish + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + ruleId: abc-def-ghi + status: published + id: c968cf83-56c2-4d54-a993-6c86dfb83527 + type: batchMigrationPublishedResource + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishResponse" + description: OK + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "409": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Publish a batch migration + tags: + - Security Monitoring + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + /api/v2/security_monitoring/batch-migrations/{batch_id}/resources: + delete: + description: |- + Delete resources from a batch migration. The request is all-or-nothing: it returns + `404 Not Found` if any resource does not exist, and `409 Conflict` if any resource is + `in_progress` or `publishing`. In both cases nothing is deleted. Duplicate resource IDs + are ignored. Detection rules already published from the deleted resources are not deleted. + operationId: DeleteSecurityMonitoringBatchMigrationResources + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + resourceIds: + - c968cf83-56c2-4d54-a993-6c86dfb83527 + type: batchMigrationResources + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesDeleteRequest" + required: true + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "409": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Delete resources from a batch migration + tags: + - Security Monitoring + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + get: + description: |- + List the resources of a batch migration, including the input of each source rule and, + once translated, the proposed Cloud SIEM detection rule in `output`. + operationId: ListSecurityMonitoringBatchMigrationResources + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationPageSize" + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationPageNumber" + - description: |- + A search query in Datadog search syntax to filter resources, such as + `status:completed`. Filterable attributes are `id`, `name`, `description`, `inputType`, + `status`, `input`, `createdBy`, and `lastUpdatedBy`. Free text matches the resource name. + in: query + name: filter[query] + required: false + schema: + example: "status:completed inputType:spl" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + batchId: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + createdAt: "2026-09-21T12:00:00Z" + createdBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + description: Detects repeated failed Windows authentication attempts. + input: index=wineventlog EventCode=4625 + inputType: spl + lastUpdatedAt: "2026-09-21T12:02:00Z" + lastUpdatedBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + name: Repeated Windows login failures + output: + cases: + - condition: failed_logins >= 5 + name: Repeated failures + notifications: [] + status: medium + isEnabled: false + message: Repeated failed Windows login attempts were detected. + name: Repeated Windows login failures + options: + evaluationWindow: 300 + keepAlive: 3600 + maxSignalDuration: 86400 + queries: + - aggregation: count + groupByFields: + - "@usr.name" + - "@network.client.ip" + name: failed_logins + query: "source:windows @evt.id:4625" + tags: + - source:windows + - migration:splunk + type: log_detection + outputType: siem_rule + status: completed + id: c968cf83-56c2-4d54-a993-6c86dfb83527 + type: batchMigrationResource + meta: + totalCount: 1 + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesListResponse" + description: OK + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: List batch migration resources + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + post: + description: |- + Add 1 to 1000 resources to a `draft` batch migration. Returns `409 Conflict` if the + batch migration is not `draft`, and `400 Bad Request` if the batch migration would + contain more than 1000 resources. + operationId: CreateSecurityMonitoringBatchMigrationResources + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + resources: + - input: index=linux process=sudo "authentication failure" | stats count by user, host + inputType: spl + name: Linux sudo abuse + type: batchMigrationResources + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + - attributes: + batchId: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + createdAt: "2026-09-21T12:10:00Z" + createdBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + input: index=linux process=sudo "authentication failure" | stats count by user, host + inputType: spl + lastUpdatedAt: "2026-09-21T12:10:00Z" + lastUpdatedBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + name: Linux sudo abuse + output: + outputType: siem_rule + status: pending + id: 0b3f5e5c-8a2b-4a8f-9f0e-3c1d2e4f5a6b + type: batchMigrationResource + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourcesCreateResponse" + description: Created + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "409": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Add resources to a batch migration + tags: + - Security Monitoring + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + /api/v2/security_monitoring/batch-migrations/{batch_id}/resources/{resource_id}: + patch: + description: |- + Update a resource of a batch migration. At least one of `name`, `description`, + `inputType`, or `input` must be provided. `name` and `description` can be updated at + any time. `inputType` and `input` can only be updated while the resource is `pending`; + otherwise, the request returns `409 Conflict`. The translated `output` cannot be edited. + operationId: UpdateSecurityMonitoringBatchMigrationResource + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationResourceID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + input: index=wineventlog EventCode=4625 | stats count by user + type: batchMigrationResource + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + batchId: 7cdb3a75-64fb-46ce-9445-41969e78fe8e + createdAt: "2026-09-21T12:00:00Z" + createdBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + input: index=wineventlog EventCode=4625 | stats count by user + inputType: spl + lastUpdatedAt: "2026-09-21T12:15:00Z" + lastUpdatedBy: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + name: Repeated Windows login failures + output: + outputType: siem_rule + status: pending + id: c968cf83-56c2-4d54-a993-6c86dfb83527 + type: batchMigrationResource + schema: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationResourceResponse" + description: OK + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "409": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Update a batch migration resource + tags: + - Security Monitoring + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. + /api/v2/security_monitoring/batch-migrations/{batch_id}/start: + post: + description: |- + Start translating the `pending` resources of a `draft` batch migration into Cloud SIEM + detection rules. The batch migration moves to `in_progress`, and its resources are + translated asynchronously. Once no resource is `pending` or `in_progress`, the batch + migration moves to `completed`. Starting an `in_progress` batch migration again does not + queue duplicate work, so the request can be safely retried, including after a timeout or + a `5xx` error. Returns `409 Conflict` if the batch migration is `completed` or `canceled`. + + An organization can translate up to 2000 resources in total across all of its batch + migrations. Resources that were already processed count toward this limit even after + they are deleted, and `pending` resources of `in_progress` batch migrations reserve + capacity. Returns `409 Conflict` if starting the batch migration would exceed this limit. + To request a higher limit for your organization, contact + [Datadog support](https://docs.datadoghq.com/help/). + operationId: StartSecurityMonitoringBatchMigration + parameters: + - $ref: "#/components/parameters/SecurityMonitoringBatchMigrationID" + responses: + "202": + description: Accepted + "400": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationBadRequestResponse" + "401": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationUnauthorizedResponse" + "403": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationForbiddenResponse" + "404": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationNotFoundResponse" + "409": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + $ref: "#/components/responses/SecurityMonitoringBatchMigrationInternalServerErrorResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Start a batch migration + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + To request access, contact [Datadog support](https://docs.datadoghq.com/help/) or your Customer Success Manager. /api/v2/security_monitoring/cloud_workload_security/agent_rules: get: description: |- diff --git a/examples/v2/security-monitoring/CancelSecurityMonitoringBatchMigration.rb b/examples/v2/security-monitoring/CancelSecurityMonitoringBatchMigration.rb new file mode 100644 index 000000000000..fd0dc2302a31 --- /dev/null +++ b/examples/v2/security-monitoring/CancelSecurityMonitoringBatchMigration.rb @@ -0,0 +1,9 @@ +# Cancel a batch migration returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.cancel_security_monitoring_batch_migration".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.cancel_security_monitoring_batch_migration("7cdb3a75-64fb-46ce-9445-41969e78fe8e") diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigration.rb b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigration.rb new file mode 100644 index 000000000000..36cbf1160d96 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigration.rb @@ -0,0 +1,30 @@ +# Create a batch migration returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.create_security_monitoring_batch_migration".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringBatchMigrationCreateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationCreateData.new({ + type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationType::BATCH_MIGRATION, + attributes: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationCreateAttributes.new({ + name: "Example-Security-Monitoring", + description: "Rules imported from Splunk", + tags: [ + "source:splunk", + ], + resources: [ + DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceCreateItem.new({ + name: "Repeated Windows login failures", + description: "Detects repeated failed Windows authentication attempts.", + input_type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceInputType::SPL, + input: "index=wineventlog EventCode=4625", + }), + ], + }), + }), +}) +p api_instance.create_security_monitoring_batch_migration(body) diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigrationResources.rb b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigrationResources.rb new file mode 100644 index 000000000000..8fc31198328d --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigrationResources.rb @@ -0,0 +1,27 @@ +# Add resources to a batch migration returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.create_security_monitoring_batch_migration_resources".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "batch_migration" in the system +BATCH_MIGRATION_DATA_ID = ENV["BATCH_MIGRATION_DATA_ID"] + +body = DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesCreateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesCreateData.new({ + type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesType::BATCH_MIGRATION_RESOURCES, + attributes: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesCreateAttributes.new({ + resources: [ + DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceCreateItem.new({ + name: "Linux sudo abuse", + input_type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceInputType::SPL, + input: 'index=linux process=sudo "authentication failure" | stats count by user, host', + }), + ], + }), + }), +}) +p api_instance.create_security_monitoring_batch_migration_resources(BATCH_MIGRATION_DATA_ID, body) diff --git a/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigration.rb b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigration.rb new file mode 100644 index 000000000000..f607c48c1e61 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigration.rb @@ -0,0 +1,12 @@ +# Delete a batch migration returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.delete_security_monitoring_batch_migration".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "batch_migration" in the system +BATCH_MIGRATION_DATA_ID = ENV["BATCH_MIGRATION_DATA_ID"] +api_instance.delete_security_monitoring_batch_migration(BATCH_MIGRATION_DATA_ID) diff --git a/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigrationResources.rb b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigrationResources.rb new file mode 100644 index 000000000000..c3f995be13b9 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigrationResources.rb @@ -0,0 +1,26 @@ +# Delete resources from a batch migration returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.delete_security_monitoring_batch_migration_resources".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "batch_migration" in the system +BATCH_MIGRATION_DATA_ID = ENV["BATCH_MIGRATION_DATA_ID"] + +# there is a valid "batch_migration_resource" in the system +BATCH_MIGRATION_RESOURCE_ID = ENV["BATCH_MIGRATION_RESOURCE_ID"] + +body = DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesDeleteRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesDeleteData.new({ + type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesType::BATCH_MIGRATION_RESOURCES, + attributes: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesDeleteAttributes.new({ + resource_ids: [ + BATCH_MIGRATION_RESOURCE_ID, + ], + }), + }), +}) +api_instance.delete_security_monitoring_batch_migration_resources(BATCH_MIGRATION_DATA_ID, body) diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrationResources.rb b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrationResources.rb new file mode 100644 index 000000000000..0bfa6b37d23f --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrationResources.rb @@ -0,0 +1,12 @@ +# List batch migration resources returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.list_security_monitoring_batch_migration_resources".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "batch_migration" in the system +BATCH_MIGRATION_DATA_ID = ENV["BATCH_MIGRATION_DATA_ID"] +p api_instance.list_security_monitoring_batch_migration_resources(BATCH_MIGRATION_DATA_ID) diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrations.rb b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrations.rb new file mode 100644 index 000000000000..2ca235f354b9 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrations.rb @@ -0,0 +1,15 @@ +# List batch migrations returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.list_security_monitoring_batch_migrations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "batch_migration" in the system +BATCH_MIGRATION_DATA_ID = ENV["BATCH_MIGRATION_DATA_ID"] +opts = { + filter_query: "id:7cdb3a75-64fb-46ce-9445-41969e78fe8e", +} +p api_instance.list_security_monitoring_batch_migrations(opts) diff --git a/examples/v2/security-monitoring/PublishSecurityMonitoringBatchMigration.rb b/examples/v2/security-monitoring/PublishSecurityMonitoringBatchMigration.rb new file mode 100644 index 000000000000..17beeed76fdf --- /dev/null +++ b/examples/v2/security-monitoring/PublishSecurityMonitoringBatchMigration.rb @@ -0,0 +1,20 @@ +# Publish a batch migration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.publish_security_monitoring_batch_migration".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishAttributes.new({ + resource_ids: [ + "c968cf83-56c2-4d54-a993-6c86dfb83527", + ], + }), + type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishType::BATCH_MIGRATION_PUBLISH, + }), +}) +p api_instance.publish_security_monitoring_batch_migration("7cdb3a75-64fb-46ce-9445-41969e78fe8e", body) diff --git a/examples/v2/security-monitoring/StartSecurityMonitoringBatchMigration.rb b/examples/v2/security-monitoring/StartSecurityMonitoringBatchMigration.rb new file mode 100644 index 000000000000..47945b308720 --- /dev/null +++ b/examples/v2/security-monitoring/StartSecurityMonitoringBatchMigration.rb @@ -0,0 +1,9 @@ +# Start a batch migration returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.start_security_monitoring_batch_migration".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.start_security_monitoring_batch_migration("7cdb3a75-64fb-46ce-9445-41969e78fe8e") diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigration.rb b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigration.rb new file mode 100644 index 000000000000..4766f18298de --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigration.rb @@ -0,0 +1,25 @@ +# Update a batch migration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.update_security_monitoring_batch_migration".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "batch_migration" in the system +BATCH_MIGRATION_DATA_ID = ENV["BATCH_MIGRATION_DATA_ID"] + +body = DatadogAPIClient::V2::SecurityMonitoringBatchMigrationUpdateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationUpdateData.new({ + type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationType::BATCH_MIGRATION, + attributes: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationUpdateAttributes.new({ + name: "Example-Security-Monitoring-updated", + tags: [ + "source:splunk", + "team:secops", + ], + }), + }), +}) +p api_instance.update_security_monitoring_batch_migration(BATCH_MIGRATION_DATA_ID, body) diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigrationResource.rb b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigrationResource.rb new file mode 100644 index 000000000000..ff230ded5198 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigrationResource.rb @@ -0,0 +1,24 @@ +# Update a batch migration resource returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.update_security_monitoring_batch_migration_resource".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "batch_migration" in the system +BATCH_MIGRATION_DATA_ID = ENV["BATCH_MIGRATION_DATA_ID"] + +# there is a valid "batch_migration_resource" in the system +BATCH_MIGRATION_RESOURCE_ID = ENV["BATCH_MIGRATION_RESOURCE_ID"] + +body = DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceUpdateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceUpdateData.new({ + type: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceType::BATCH_MIGRATION_RESOURCE, + attributes: DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceUpdateAttributes.new({ + input: "index=wineventlog EventCode=4625 | stats count by user", + }), + }), +}) +p api_instance.update_security_monitoring_batch_migration_resource(BATCH_MIGRATION_DATA_ID, BATCH_MIGRATION_RESOURCE_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 1377d926590b..fb600bb3a53e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2465,6 +2465,50 @@ "filter_operating_system_name" => "String", "filter_operating_system_version" => "String", }, + "v2.ListSecurityMonitoringBatchMigrations" => { + "page_size" => "Integer", + "page_number" => "Integer", + "filter_query" => "String", + }, + "v2.CreateSecurityMonitoringBatchMigration" => { + "body" => "SecurityMonitoringBatchMigrationCreateRequest", + }, + "v2.DeleteSecurityMonitoringBatchMigration" => { + "batch_id" => "UUID", + }, + "v2.UpdateSecurityMonitoringBatchMigration" => { + "batch_id" => "UUID", + "body" => "SecurityMonitoringBatchMigrationUpdateRequest", + }, + "v2.CancelSecurityMonitoringBatchMigration" => { + "batch_id" => "UUID", + }, + "v2.PublishSecurityMonitoringBatchMigration" => { + "batch_id" => "UUID", + "body" => "SecurityMonitoringBatchMigrationPublishRequest", + }, + "v2.DeleteSecurityMonitoringBatchMigrationResources" => { + "batch_id" => "UUID", + "body" => "SecurityMonitoringBatchMigrationResourcesDeleteRequest", + }, + "v2.ListSecurityMonitoringBatchMigrationResources" => { + "batch_id" => "UUID", + "page_size" => "Integer", + "page_number" => "Integer", + "filter_query" => "String", + }, + "v2.CreateSecurityMonitoringBatchMigrationResources" => { + "batch_id" => "UUID", + "body" => "SecurityMonitoringBatchMigrationResourcesCreateRequest", + }, + "v2.UpdateSecurityMonitoringBatchMigrationResource" => { + "batch_id" => "UUID", + "resource_id" => "UUID", + "body" => "SecurityMonitoringBatchMigrationResourceUpdateRequest", + }, + "v2.StartSecurityMonitoringBatchMigration" => { + "batch_id" => "UUID", + }, "v2.CreateSecurityMonitoringCriticalAsset" => { "body" => "SecurityMonitoringCriticalAssetCreateRequest", }, diff --git a/features/v2/given.json b/features/v2/given.json index b307445fc2cc..e20aaeae64f7 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1618,6 +1618,31 @@ "tag": "Security Monitoring", "operationId": "CreateVulnerabilityNotificationRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"batchMigration\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"description\": \"Rules imported from Splunk\",\n \"tags\": [\"source:splunk\"],\n \"resources\": [\n {\n \"name\": \"Repeated Windows login failures\",\n \"inputType\": \"spl\",\n \"input\": \"index=wineventlog EventCode=4625\"\n }\n ]\n }\n }\n}" + } + ], + "step": "there is a valid \"batch_migration\" in the system", + "key": "batch_migration", + "tag": "Security Monitoring", + "operationId": "CreateSecurityMonitoringBatchMigration" + }, + { + "parameters": [ + { + "name": "batch_id", + "value": "\"{{ batch_migration.data.id }}\"" + } + ], + "source": "data[0]", + "step": "there is a valid \"batch_migration_resource\" in the system", + "key": "batch_migration_resource", + "tag": "Security Monitoring", + "operationId": "ListSecurityMonitoringBatchMigrationResources" + }, { "parameters": [ { diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 3a2ac120f418..49b1f7aeecdd 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -52,6 +52,46 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/cloud-siem + Scenario: Add resources to a batch migration returns "Bad Request" response + Given operation "CreateSecurityMonitoringBatchMigrationResources" enabled + And new "CreateSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resources": [{"description": "Detects repeated failed Windows authentication attempts.", "input": "index=wineventlog EventCode=4625", "inputType": "spl", "name": "Repeated Windows login failures"}]}, "type": "batchMigrationResources"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Add resources to a batch migration returns "Conflict" response + Given operation "CreateSecurityMonitoringBatchMigrationResources" enabled + And new "CreateSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resources": [{"description": "Detects repeated failed Windows authentication attempts.", "input": "index=wineventlog EventCode=4625", "inputType": "spl", "name": "Repeated Windows login failures"}]}, "type": "batchMigrationResources"}} + When the request is sent + Then the response status is 409 Conflict + + @team:ddoghq/cloud-siem + Scenario: Add resources to a batch migration returns "Created" response + Given operation "CreateSecurityMonitoringBatchMigrationResources" enabled + And there is a valid "batch_migration" in the system + And new "CreateSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "batch_migration.data.id" + And body with value {"data": {"type": "batchMigrationResources", "attributes": {"resources": [{"name": "Linux sudo abuse", "inputType": "spl", "input": "index=linux process=sudo \"authentication failure\" | stats count by user, host"}]}}} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0].attributes.name" is equal to "Linux sudo abuse" + And the response "data[0].attributes.status" is equal to "pending" + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Add resources to a batch migration returns "Not Found" response + Given operation "CreateSecurityMonitoringBatchMigrationResources" enabled + And new "CreateSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resources": [{"description": "Detects repeated failed Windows authentication attempts.", "input": "index=wineventlog EventCode=4625", "inputType": "spl", "name": "Repeated Windows login failures"}]}, "type": "batchMigrationResources"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:ddoghq/k9-vm-ast Scenario: Analyze code returns "Bad Request" response Given operation "CreateStaticAnalysisServerAnalysis" enabled @@ -357,6 +397,38 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/cloud-siem + Scenario: Cancel a batch migration returns "Accepted" response + Given operation "CancelSecurityMonitoringBatchMigration" enabled + And new "CancelSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Cancel a batch migration returns "Bad Request" response + Given operation "CancelSecurityMonitoringBatchMigration" enabled + And new "CancelSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Cancel a batch migration returns "Conflict" response + Given operation "CancelSecurityMonitoringBatchMigration" enabled + And new "CancelSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Cancel a batch migration returns "Not Found" response + Given operation "CancelSecurityMonitoringBatchMigration" enabled + And new "CancelSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:ddoghq/cloud-siem Scenario: Cancel a historical job returns "Bad Request" response Given operation "CancelHistoricalJob" enabled @@ -651,6 +723,26 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/cloud-siem + Scenario: Create a batch migration returns "Bad Request" response + Given operation "CreateSecurityMonitoringBatchMigration" enabled + And new "CreateSecurityMonitoringBatchMigration" request + And body with value {"data": {"attributes": {"description": "Rules imported from Splunk", "name": "Splunk migration", "resources": [{"description": "Detects repeated failed Windows authentication attempts.", "input": "index=wineventlog EventCode=4625", "inputType": "spl", "name": "Repeated Windows login failures"}], "tags": ["source:splunk"]}, "type": "batchMigration"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/cloud-siem + Scenario: Create a batch migration returns "Created" response + Given operation "CreateSecurityMonitoringBatchMigration" enabled + And new "CreateSecurityMonitoringBatchMigration" request + And body with value {"data": {"type": "batchMigration", "attributes": {"name": "{{ unique }}", "description": "Rules imported from Splunk", "tags": ["source:splunk"], "resources": [{"name": "Repeated Windows login failures", "description": "Detects repeated failed Windows authentication attempts.", "inputType": "spl", "input": "index=wineventlog EventCode=4625"}]}}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "batchMigration" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.status" is equal to "draft" + And the response "data.attributes.resourceStatusCounts.pending" is equal to 1 + @skip-validation @team:ddoghq/cloud-siem Scenario: Create a cloud_configuration rule returns "OK" response Given new "CreateSecurityMonitoringRule" request @@ -1218,6 +1310,39 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/cloud-siem + Scenario: Delete a batch migration returns "Bad Request" response + Given operation "DeleteSecurityMonitoringBatchMigration" enabled + And new "DeleteSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Delete a batch migration returns "Conflict" response + Given operation "DeleteSecurityMonitoringBatchMigration" enabled + And new "DeleteSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @team:ddoghq/cloud-siem + Scenario: Delete a batch migration returns "No Content" response + Given operation "DeleteSecurityMonitoringBatchMigration" enabled + And there is a valid "batch_migration" in the system + And new "DeleteSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "batch_migration.data.id" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Delete a batch migration returns "Not Found" response + Given operation "DeleteSecurityMonitoringBatchMigration" enabled + And new "DeleteSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:ddoghq/cloud-siem Scenario: Delete a critical asset returns "Not Found" response Given new "DeleteSecurityMonitoringCriticalAsset" request @@ -1536,6 +1661,44 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 Successfully deleted the inbox rule + @generated @skip @team:ddoghq/cloud-siem + Scenario: Delete resources from a batch migration returns "Bad Request" response + Given operation "DeleteSecurityMonitoringBatchMigrationResources" enabled + And new "DeleteSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resourceIds": ["c968cf83-56c2-4d54-a993-6c86dfb83527"]}, "type": "batchMigrationResources"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Delete resources from a batch migration returns "Conflict" response + Given operation "DeleteSecurityMonitoringBatchMigrationResources" enabled + And new "DeleteSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resourceIds": ["c968cf83-56c2-4d54-a993-6c86dfb83527"]}, "type": "batchMigrationResources"}} + When the request is sent + Then the response status is 409 Conflict + + @team:ddoghq/cloud-siem + Scenario: Delete resources from a batch migration returns "No Content" response + Given operation "DeleteSecurityMonitoringBatchMigrationResources" enabled + And there is a valid "batch_migration" in the system + And there is a valid "batch_migration_resource" in the system + And new "DeleteSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "batch_migration.data.id" + And body with value {"data": {"type": "batchMigrationResources", "attributes": {"resourceIds": ["{{ batch_migration_resource.id }}"]}}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Delete resources from a batch migration returns "Not Found" response + Given operation "DeleteSecurityMonitoringBatchMigrationResources" enabled + And new "DeleteSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resourceIds": ["c968cf83-56c2-4d54-a993-6c86dfb83527"]}, "type": "batchMigrationResources"}} + When the request is sent + Then the response status is 404 Not Found + @team:ddoghq/k9-investigation Scenario: Detach security findings from their case returns "Bad Request" response Given new "DetachCase" request @@ -2763,6 +2926,52 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/cloud-siem + Scenario: List batch migration resources returns "Bad Request" response + Given operation "ListSecurityMonitoringBatchMigrationResources" enabled + And new "ListSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: List batch migration resources returns "Not Found" response + Given operation "ListSecurityMonitoringBatchMigrationResources" enabled + And new "ListSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:ddoghq/cloud-siem + Scenario: List batch migration resources returns "OK" response + Given operation "ListSecurityMonitoringBatchMigrationResources" enabled + And there is a valid "batch_migration" in the system + And new "ListSecurityMonitoringBatchMigrationResources" request + And request contains "batch_id" parameter from "batch_migration.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].attributes.batchId" has the same value as "batch_migration.data.id" + And the response "data[0].attributes.status" is equal to "pending" + + @generated @skip @team:ddoghq/cloud-siem + Scenario: List batch migrations returns "Bad Request" response + Given operation "ListSecurityMonitoringBatchMigrations" enabled + And new "ListSecurityMonitoringBatchMigrations" request + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/cloud-siem + Scenario: List batch migrations returns "OK" response + Given operation "ListSecurityMonitoringBatchMigrations" enabled + And there is a valid "batch_migration" in the system + And new "ListSecurityMonitoringBatchMigrations" request + And request contains "filter[query]" parameter with value "id:{{ batch_migration.data.id }}" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" has the same value as "batch_migration.data.id" + @generated @skip @team:ddoghq/k9-vm-ast Scenario: List codegen rulesets returns "Bad Request" response Given operation "ListStaticAnalysisCodegenRulesets" enabled @@ -3213,6 +3422,42 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:ddoghq/cloud-siem + Scenario: Publish a batch migration returns "Bad Request" response + Given operation "PublishSecurityMonitoringBatchMigration" enabled + And new "PublishSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resourceIds": ["c968cf83-56c2-4d54-a993-6c86dfb83527"]}, "type": "batchMigrationPublish"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Publish a batch migration returns "Conflict" response + Given operation "PublishSecurityMonitoringBatchMigration" enabled + And new "PublishSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resourceIds": ["c968cf83-56c2-4d54-a993-6c86dfb83527"]}, "type": "batchMigrationPublish"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Publish a batch migration returns "Not Found" response + Given operation "PublishSecurityMonitoringBatchMigration" enabled + And new "PublishSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resourceIds": ["c968cf83-56c2-4d54-a993-6c86dfb83527"]}, "type": "batchMigrationPublish"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Publish a batch migration returns "OK" response + Given operation "PublishSecurityMonitoringBatchMigration" enabled + And new "PublishSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resourceIds": ["c968cf83-56c2-4d54-a993-6c86dfb83527"]}, "type": "batchMigrationPublish"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/k9-automation Scenario: Reorder due date rules returns "Bad Request" response Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled @@ -3467,6 +3712,38 @@ Feature: Security Monitoring And the response "meta.page" has field "after" And the response "links" has field "next" + @generated @skip @team:ddoghq/cloud-siem + Scenario: Start a batch migration returns "Accepted" response + Given operation "StartSecurityMonitoringBatchMigration" enabled + And new "StartSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Start a batch migration returns "Bad Request" response + Given operation "StartSecurityMonitoringBatchMigration" enabled + And new "StartSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Start a batch migration returns "Conflict" response + Given operation "StartSecurityMonitoringBatchMigration" enabled + And new "StartSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Start a batch migration returns "Not Found" response + Given operation "StartSecurityMonitoringBatchMigration" enabled + And new "StartSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:ddoghq/cloud-siem Scenario: Subscribe to sample log generation returns "Bad Request" response Given operation "CreateSampleLogGenerationSubscription" enabled @@ -3580,6 +3857,81 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/cloud-siem + Scenario: Update a batch migration resource returns "Bad Request" response + Given operation "UpdateSecurityMonitoringBatchMigrationResource" enabled + And new "UpdateSecurityMonitoringBatchMigrationResource" request + And request contains "batch_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Detects repeated failed Windows authentication attempts.", "input": "index=wineventlog EventCode=4625 | stats count by user", "inputType": "spl", "name": "Repeated Windows login failures"}, "type": "batchMigrationResource"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Update a batch migration resource returns "Conflict" response + Given operation "UpdateSecurityMonitoringBatchMigrationResource" enabled + And new "UpdateSecurityMonitoringBatchMigrationResource" request + And request contains "batch_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Detects repeated failed Windows authentication attempts.", "input": "index=wineventlog EventCode=4625 | stats count by user", "inputType": "spl", "name": "Repeated Windows login failures"}, "type": "batchMigrationResource"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Update a batch migration resource returns "Not Found" response + Given operation "UpdateSecurityMonitoringBatchMigrationResource" enabled + And new "UpdateSecurityMonitoringBatchMigrationResource" request + And request contains "batch_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Detects repeated failed Windows authentication attempts.", "input": "index=wineventlog EventCode=4625 | stats count by user", "inputType": "spl", "name": "Repeated Windows login failures"}, "type": "batchMigrationResource"}} + When the request is sent + Then the response status is 404 Not Found + + @team:ddoghq/cloud-siem + Scenario: Update a batch migration resource returns "OK" response + Given operation "UpdateSecurityMonitoringBatchMigrationResource" enabled + And there is a valid "batch_migration" in the system + And there is a valid "batch_migration_resource" in the system + And new "UpdateSecurityMonitoringBatchMigrationResource" request + And request contains "batch_id" parameter from "batch_migration.data.id" + And request contains "resource_id" parameter from "batch_migration_resource.id" + And body with value {"data": {"type": "batchMigrationResource", "attributes": {"input": "index=wineventlog EventCode=4625 | stats count by user"}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "batch_migration_resource.id" + And the response "data.attributes.input" is equal to "index=wineventlog EventCode=4625 | stats count by user" + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Update a batch migration returns "Bad Request" response + Given operation "UpdateSecurityMonitoringBatchMigration" enabled + And new "UpdateSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Rules imported from Splunk", "name": "Splunk migration - Windows", "tags": ["source:splunk"]}, "type": "batchMigration"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/cloud-siem + Scenario: Update a batch migration returns "Not Found" response + Given operation "UpdateSecurityMonitoringBatchMigration" enabled + And new "UpdateSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Rules imported from Splunk", "name": "Splunk migration - Windows", "tags": ["source:splunk"]}, "type": "batchMigration"}} + When the request is sent + Then the response status is 404 Not Found + + @team:ddoghq/cloud-siem + Scenario: Update a batch migration returns "OK" response + Given operation "UpdateSecurityMonitoringBatchMigration" enabled + And there is a valid "batch_migration" in the system + And new "UpdateSecurityMonitoringBatchMigration" request + And request contains "batch_id" parameter from "batch_migration.data.id" + And body with value {"data": {"type": "batchMigration", "attributes": {"name": "{{ unique }}-updated", "tags": ["source:splunk", "team:secops"]}}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "{{ unique }}-updated" + And the response "data.attributes.tags" is equal to ["source:splunk", "team:secops"] + And the response "data.attributes.description" has the same value as "batch_migration.data.attributes.description" + @skip-validation @team:ddoghq/cloud-siem Scenario: Update a cloud configuration rule's details returns "OK" response Given new "UpdateSecurityMonitoringRule" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 8b44c9415758..b467adbbf53a 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -8960,6 +8960,87 @@ "type": "safe" } }, + "ListSecurityMonitoringBatchMigrations": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityMonitoringBatchMigration": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityMonitoringBatchMigration", + "parameters": [ + { + "name": "batch_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteSecurityMonitoringBatchMigration": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateSecurityMonitoringBatchMigration": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "CancelSecurityMonitoringBatchMigration": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "PublishSecurityMonitoringBatchMigration": { + "tag": "Security Monitoring", + "undo": { + "type": "unsafe" + } + }, + "DeleteSecurityMonitoringBatchMigrationResources": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ListSecurityMonitoringBatchMigrationResources": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityMonitoringBatchMigrationResources": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityMonitoringBatchMigration", + "parameters": [ + { + "name": "batch_id", + "origin": "path", + "source": "batch_id" + } + ], + "type": "unsafe" + } + }, + "UpdateSecurityMonitoringBatchMigrationResource": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "StartSecurityMonitoringBatchMigration": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListCloudWorkloadSecurityAgentRules": { "tag": "CSM Threats", "undo": { diff --git a/generated-test/test-runner-data/manifest.json b/generated-test/test-runner-data/manifest.json index b761a83eefcc..5ea5815f45c6 100644 --- a/generated-test/test-runner-data/manifest.json +++ b/generated-test/test-runner-data/manifest.json @@ -9723,6 +9723,13 @@ "scenario": "Unassign seats from users returns \"Unprocessable Entity\" response when user_uuids is empty", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/add-resources-to-a-batch-migration-returns-created-response.json", + "scenario": "Add resources to a batch migration returns \"Created\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "feature_file": "../../features/v2/security_monitoring.feature", @@ -9912,6 +9919,13 @@ "scenario": "Create Jira issues for security findings returns \"Not Found\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/create-a-batch-migration-returns-created-response.json", + "scenario": "Create a batch migration returns \"Created\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "feature_file": "../../features/v2/security_monitoring.feature", @@ -10150,6 +10164,13 @@ "scenario": "Create or update an indicator triage state returns \"Created\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/delete-a-batch-migration-returns-no-content-response.json", + "scenario": "Delete a batch migration returns \"No Content\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "feature_file": "../../features/v2/security_monitoring.feature", @@ -10276,6 +10297,13 @@ "scenario": "Delete an inbox rule returns \"Successfully deleted the inbox rule\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/delete-resources-from-a-batch-migration-returns-no-content-response.json", + "scenario": "Delete resources from a batch migration returns \"No Content\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "feature_file": "../../features/v2/security_monitoring.feature", @@ -10710,6 +10738,20 @@ "scenario": "List assets SBOMs returns \"OK\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/list-batch-migration-resources-returns-ok-response.json", + "scenario": "List batch migration resources returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/list-batch-migrations-returns-ok-response.json", + "scenario": "List batch migrations returns \"OK\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "feature_file": "../../features/v2/security_monitoring.feature", @@ -11032,6 +11074,20 @@ "scenario": "Unmute security findings returns \"Unprocessable Entity\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/update-a-batch-migration-resource-returns-ok-response.json", + "scenario": "Update a batch migration resource returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Security Monitoring", + "feature_file": "../../features/v2/security_monitoring.feature", + "file": "v2/security-monitoring/update-a-batch-migration-returns-ok-response.json", + "scenario": "Update a batch migration returns \"OK\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "feature_file": "../../features/v2/security_monitoring.feature", diff --git a/generated-test/test-runner-data/v2/security-monitoring/add-resources-to-a-batch-migration-returns-created-response.json b/generated-test/test-runner-data/v2/security-monitoring/add-resources-to-a-batch-migration-returns-created-response.json new file mode 100644 index 000000000000..c704e45d8545 --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/add-resources-to-a-batch-migration-returns-created-response.json @@ -0,0 +1,56 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 201, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/Add resources to a batch migration returns \"Created\" response", + "operation_id": "CreateSecurityMonitoringBatchMigrationResources", + "request": { + "body": { + "schema": { + "format": null, + "ref": "SecurityMonitoringBatchMigrationResourcesCreateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "resources": [ + { + "input": "index=linux process=sudo \"authentication failure\" | stats count by user, host", + "inputType": "spl", + "name": "Linux sudo abuse" + } + ] + }, + "type": "batchMigrationResources" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "batch_migration.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources" + }, + "scenario": "Add resources to a batch migration returns \"Created\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-runner-data/v2/security-monitoring/create-a-batch-migration-returns-created-response.json b/generated-test/test-runner-data/v2/security-monitoring/create-a-batch-migration-returns-created-response.json new file mode 100644 index 000000000000..f400718abd00 --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/create-a-batch-migration-returns-created-response.json @@ -0,0 +1,45 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 201, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/Create a batch migration returns \"Created\" response", + "operation_id": "CreateSecurityMonitoringBatchMigration", + "request": { + "body": { + "schema": { + "format": null, + "ref": "SecurityMonitoringBatchMigrationCreateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "{{ unique }}", + "resources": [ + { + "description": "Detects repeated failed Windows authentication attempts.", + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/security_monitoring/batch-migrations" + }, + "scenario": "Create a batch migration returns \"Created\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-runner-data/v2/security-monitoring/delete-a-batch-migration-returns-no-content-response.json b/generated-test/test-runner-data/v2/security-monitoring/delete-a-batch-migration-returns-no-content-response.json new file mode 100644 index 000000000000..2ee775a52e22 --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/delete-a-batch-migration-returns-no-content-response.json @@ -0,0 +1,35 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 204, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/Delete a batch migration returns \"No Content\" response", + "operation_id": "DeleteSecurityMonitoringBatchMigration", + "request": { + "body": null, + "content_type": null, + "method": "DELETE", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "batch_migration.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/security_monitoring/batch-migrations/{batch_id}" + }, + "scenario": "Delete a batch migration returns \"No Content\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-runner-data/v2/security-monitoring/delete-resources-from-a-batch-migration-returns-no-content-response.json b/generated-test/test-runner-data/v2/security-monitoring/delete-resources-from-a-batch-migration-returns-no-content-response.json new file mode 100644 index 000000000000..96f23357f93c --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/delete-resources-from-a-batch-migration-returns-no-content-response.json @@ -0,0 +1,52 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 204, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/Delete resources from a batch migration returns \"No Content\" response", + "operation_id": "DeleteSecurityMonitoringBatchMigrationResources", + "request": { + "body": { + "schema": { + "format": null, + "ref": "SecurityMonitoringBatchMigrationResourcesDeleteRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "resourceIds": [ + "{{ batch_migration_resource.id }}" + ] + }, + "type": "batchMigrationResources" + } + } + }, + "content_type": "application/json", + "method": "DELETE", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "batch_migration.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources" + }, + "scenario": "Delete resources from a batch migration returns \"No Content\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-runner-data/v2/security-monitoring/list-batch-migration-resources-returns-ok-response.json b/generated-test/test-runner-data/v2/security-monitoring/list-batch-migration-resources-returns-ok-response.json new file mode 100644 index 000000000000..bb3a1ea43270 --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/list-batch-migration-resources-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 200, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/List batch migration resources returns \"OK\" response", + "operation_id": "ListSecurityMonitoringBatchMigrationResources", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "batch_migration.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources" + }, + "scenario": "List batch migration resources returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-runner-data/v2/security-monitoring/list-batch-migrations-returns-ok-response.json b/generated-test/test-runner-data/v2/security-monitoring/list-batch-migrations-returns-ok-response.json new file mode 100644 index 000000000000..a92497acb9d3 --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/list-batch-migrations-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 200, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/List batch migrations returns \"OK\" response", + "operation_id": "ListSecurityMonitoringBatchMigrations", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "query", + "name": "filter[query]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "id:{{ batch_migration.data.id }}" + }, + "style": null + } + ], + "path": "/api/v2/security_monitoring/batch-migrations" + }, + "scenario": "List batch migrations returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-resource-returns-ok-response.json b/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-resource-returns-ok-response.json new file mode 100644 index 000000000000..38916579d02e --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-resource-returns-ok-response.json @@ -0,0 +1,66 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 200, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/Update a batch migration resource returns \"OK\" response", + "operation_id": "UpdateSecurityMonitoringBatchMigrationResource", + "request": { + "body": { + "schema": { + "format": null, + "ref": "SecurityMonitoringBatchMigrationResourceUpdateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "input": "index=wineventlog EventCode=4625 | stats count by user" + }, + "type": "batchMigrationResource" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "batch_migration.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "path", + "name": "resource_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "batch_migration_resource.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources/{resource_id}" + }, + "scenario": "Update a batch migration resource returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-returns-ok-response.json b/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-returns-ok-response.json new file mode 100644 index 000000000000..8b8c8a4526f4 --- /dev/null +++ b/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-returns-ok-response.json @@ -0,0 +1,54 @@ +{ + "api": "SecurityMonitoring", + "expected_status": 200, + "feature": "Security Monitoring", + "id": "v2/Security Monitoring/Update a batch migration returns \"OK\" response", + "operation_id": "UpdateSecurityMonitoringBatchMigration", + "request": { + "body": { + "schema": { + "format": null, + "ref": "SecurityMonitoringBatchMigrationUpdateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "name": "{{ unique }}-updated", + "tags": [ + "source:splunk", + "team:secops" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "batch_migration.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/security_monitoring/batch-migrations/{batch_id}" + }, + "scenario": "Update a batch migration returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-server-data/v2/security-monitoring.json b/generated-test/test-server-data/v2/security-monitoring.json index 43e65f4bef5a..a1d8f896f0ce 100644 --- a/generated-test/test-server-data/v2/security-monitoring.json +++ b/generated-test/test-server-data/v2/security-monitoring.json @@ -1,6 +1,135 @@ { "feature": "Security Monitoring", "recordings": [ + { + "feature": "Security Monitoring", + "frozen_at": "2026-10-16T11:40:25.719Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-Add_resources_to_a_batch_migration_returns_Created_response-1792150825", + "resources": [ + { + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"c8acb77f-ab3f-4d81-ba8c-7a63ce5ad84e\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:27.371898Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:27.371898Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-Add_resources_to_a_batch_migration_returns_Created_response-1792150825\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "resources": [ + { + "input": "index=linux process=sudo \"authentication failure\" | stats count by user, host", + "inputType": "spl", + "name": "Linux sudo abuse" + } + ] + }, + "type": "batchMigrationResources" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations/c8acb77f-ab3f-4d81-ba8c-7a63ce5ad84e/resources", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"ed73ea28-42dc-4313-8340-a62ccddff61b\",\"type\":\"batchMigrationResource\",\"attributes\":{\"batchId\":\"c8acb77f-ab3f-4d81-ba8c-7a63ce5ad84e\",\"createdAt\":\"2026-10-16T11:40:27.543286Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"input\":\"index=linux process=sudo \\\"authentication failure\\\" | stats count by user, host\",\"inputType\":\"spl\",\"lastUpdatedAt\":\"2026-10-16T11:40:27.543286Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Linux sudo abuse\",\"output\":null,\"outputType\":\"siem_rule\",\"status\":\"pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/c8acb77f-ab3f-4d81-ba8c-7a63ce5ad84e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/c8acb77f-ab3f-4d81-ba8c-7a63ce5ad84e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"detail\":\"batch migration not found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Add resources to a batch migration returns \"Created\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "frozen_at": "2026-10-08T12:23:32.869Z", @@ -1601,6 +1730,77 @@ "scenario": "Create Jira issues for security findings returns \"Not Found\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "frozen_at": "2026-10-16T11:40:27.944Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-Create_a_batch_migration_returns_Created_response-1792150827", + "resources": [ + { + "description": "Detects repeated failed Windows authentication attempts.", + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"1d186fc0-0dee-47c1-8a42-6f1626b46253\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:28.064962Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:28.064962Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-Create_a_batch_migration_returns_Created_response-1792150827\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/1d186fc0-0dee-47c1-8a42-6f1626b46253", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Create a batch migration returns \"Created\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "frozen_at": "2024-05-10T16:34:27.362Z", @@ -4328,6 +4528,99 @@ "scenario": "Create or update an indicator triage state returns \"Created\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "frozen_at": "2026-10-16T11:40:28.297Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-Delete_a_batch_migration_returns_No_Content_response-1792150828", + "resources": [ + { + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"5e372cc3-56e1-48e0-9628-8f94c8486483\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:28.408635Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:28.408635Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-Delete_a_batch_migration_returns_No_Content_response-1792150828\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/5e372cc3-56e1-48e0-9628-8f94c8486483", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/5e372cc3-56e1-48e0-9628-8f94c8486483", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"detail\":\"batch migration not found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Delete a batch migration returns \"No Content\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "frozen_at": "2026-01-02T19:09:07.983Z", @@ -5653,7 +5946,7 @@ }, { "feature": "Security Monitoring", - "frozen_at": "2025-11-20T16:07:27.292Z", + "frozen_at": "2026-10-16T11:40:28.793Z", "interactions": [ { "request": { @@ -5661,18 +5954,141 @@ "type": "json", "value": { "data": { - "relationships": { - "findings": { - "data": [] - } + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-Delete_resources_from_a_batch_migration_returns_No_Content_response-1792150828", + "resources": [ + { + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] }, - "type": "cases" + "type": "batchMigration" } } }, "content_type": "application/json", - "method": "DELETE", - "path": "/api/v2/security/findings/cases", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"41c9062b-cc72-4892-9edd-e12d063e1b3e\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:28.894065Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:28.894065Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-Delete_resources_from_a_batch_migration_returns_No_Content_response-1792150828\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/security_monitoring/batch-migrations/41c9062b-cc72-4892-9edd-e12d063e1b3e/resources", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"3ac8ef63-32f5-421a-ba9c-5e13cf538aab\",\"type\":\"batchMigrationResource\",\"attributes\":{\"batchId\":\"41c9062b-cc72-4892-9edd-e12d063e1b3e\",\"createdAt\":\"2026-10-16T11:40:28.894065Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"input\":\"index=wineventlog EventCode=4625\",\"inputType\":\"spl\",\"lastUpdatedAt\":\"2026-10-16T11:40:28.894065Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Repeated Windows login failures\",\"output\":null,\"outputType\":\"siem_rule\",\"status\":\"pending\"}}],\"meta\":{\"totalCount\":1}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "resourceIds": [ + "3ac8ef63-32f5-421a-ba9c-5e13cf538aab" + ] + }, + "type": "batchMigrationResources" + } + } + }, + "content_type": "application/json", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/41c9062b-cc72-4892-9edd-e12d063e1b3e/resources", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/41c9062b-cc72-4892-9edd-e12d063e1b3e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Delete resources from a batch migration returns \"No Content\" response", + "version": "v2" + }, + { + "feature": "Security Monitoring", + "frozen_at": "2025-11-20T16:07:27.292Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "findings": { + "data": [] + } + }, + "type": "cases" + } + } + }, + "content_type": "application/json", + "method": "DELETE", + "path": "/api/v2/security/findings/cases", "query": [] }, "response": { @@ -10038,6 +10454,197 @@ "scenario": "List assets SBOMs returns \"OK\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "frozen_at": "2026-10-16T11:40:29.430Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-List_batch_migration_resources_returns_OK_response-1792150829", + "resources": [ + { + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"98125ff6-2691-4222-b62d-01a146ca7314\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:29.536705Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:29.536705Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-List_batch_migration_resources_returns_OK_response-1792150829\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/security_monitoring/batch-migrations/98125ff6-2691-4222-b62d-01a146ca7314/resources", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"b34397f1-e95a-486c-8960-409bfa6989db\",\"type\":\"batchMigrationResource\",\"attributes\":{\"batchId\":\"98125ff6-2691-4222-b62d-01a146ca7314\",\"createdAt\":\"2026-10-16T11:40:29.536705Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"input\":\"index=wineventlog EventCode=4625\",\"inputType\":\"spl\",\"lastUpdatedAt\":\"2026-10-16T11:40:29.536705Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Repeated Windows login failures\",\"output\":null,\"outputType\":\"siem_rule\",\"status\":\"pending\"}}],\"meta\":{\"totalCount\":1}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/98125ff6-2691-4222-b62d-01a146ca7314", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "List batch migration resources returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Security Monitoring", + "frozen_at": "2026-10-16T11:40:29.908Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-List_batch_migrations_returns_OK_response-1792150829", + "resources": [ + { + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"80b4557e-efc6-45ce-84b9-2ce4d2b8bd58\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:30.025529Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:30.025529Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-List_batch_migrations_returns_OK_response-1792150829\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [ + [ + "filter[query]", + "id:80b4557e-efc6-45ce-84b9-2ce4d2b8bd58" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"80b4557e-efc6-45ce-84b9-2ce4d2b8bd58\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:30.025529Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:30.025529Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-List_batch_migrations_returns_OK_response-1792150829\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}],\"meta\":{\"totalCount\":1}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/80b4557e-efc6-45ce-84b9-2ce4d2b8bd58", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "List batch migrations returns \"OK\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "frozen_at": "2023-04-13T12:26:02.750Z", @@ -13058,6 +13665,233 @@ "scenario": "Unmute security findings returns \"Unprocessable Entity\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "frozen_at": "2026-10-16T11:40:30.425Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-Update_a_batch_migration_resource_returns_OK_response-1792150830", + "resources": [ + { + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"e0d9aff4-46cb-4ffd-8e72-7752878e09ec\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:30.529101Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:30.529101Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-Update_a_batch_migration_resource_returns_OK_response-1792150830\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/security_monitoring/batch-migrations/e0d9aff4-46cb-4ffd-8e72-7752878e09ec/resources", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"968512c2-fbbe-43ed-8ec1-c718cf97b19b\",\"type\":\"batchMigrationResource\",\"attributes\":{\"batchId\":\"e0d9aff4-46cb-4ffd-8e72-7752878e09ec\",\"createdAt\":\"2026-10-16T11:40:30.529101Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"input\":\"index=wineventlog EventCode=4625\",\"inputType\":\"spl\",\"lastUpdatedAt\":\"2026-10-16T11:40:30.529101Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Repeated Windows login failures\",\"output\":null,\"outputType\":\"siem_rule\",\"status\":\"pending\"}}],\"meta\":{\"totalCount\":1}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "input": "index=wineventlog EventCode=4625 | stats count by user" + }, + "type": "batchMigrationResource" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/security_monitoring/batch-migrations/e0d9aff4-46cb-4ffd-8e72-7752878e09ec/resources/968512c2-fbbe-43ed-8ec1-c718cf97b19b", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"968512c2-fbbe-43ed-8ec1-c718cf97b19b\",\"type\":\"batchMigrationResource\",\"attributes\":{\"batchId\":\"e0d9aff4-46cb-4ffd-8e72-7752878e09ec\",\"createdAt\":\"2026-10-16T11:40:30.529101Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"input\":\"index=wineventlog EventCode=4625 | stats count by user\",\"inputType\":\"spl\",\"lastUpdatedAt\":\"2026-10-16T11:40:30.854488Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Repeated Windows login failures\",\"output\":null,\"outputType\":\"siem_rule\",\"status\":\"pending\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/e0d9aff4-46cb-4ffd-8e72-7752878e09ec", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Update a batch migration resource returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Security Monitoring", + "frozen_at": "2026-10-16T11:40:31.062Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Rules imported from Splunk", + "name": "Test-Update_a_batch_migration_returns_OK_response-1792150831", + "resources": [ + { + "input": "index=wineventlog EventCode=4625", + "inputType": "spl", + "name": "Repeated Windows login failures" + } + ], + "tags": [ + "source:splunk" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/security_monitoring/batch-migrations", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"6ec704f1-29d6-47a3-b0ed-1a68ae58ee8b\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:31.174851Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:31.174851Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-Update_a_batch_migration_returns_OK_response-1792150831\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "Test-Update_a_batch_migration_returns_OK_response-1792150831-updated", + "tags": [ + "source:splunk", + "team:secops" + ] + }, + "type": "batchMigration" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/security_monitoring/batch-migrations/6ec704f1-29d6-47a3-b0ed-1a68ae58ee8b", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"6ec704f1-29d6-47a3-b0ed-1a68ae58ee8b\",\"type\":\"batchMigration\",\"attributes\":{\"createdAt\":\"2026-10-16T11:40:31.174851Z\",\"createdBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"description\":\"Rules imported from Splunk\",\"inputSource\":\"batch_migration\",\"lastUpdatedAt\":\"2026-10-16T11:40:31.344792Z\",\"lastUpdatedBy\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"name\":\"Test-Update_a_batch_migration_returns_OK_response-1792150831-updated\",\"orgId\":321813,\"resourceStatusCounts\":{\"pending\":1,\"inProgress\":0,\"completed\":0,\"canceled\":0,\"failed\":0,\"publishing\":0,\"published\":0,\"duplicate\":0},\"status\":\"draft\",\"tags\":[\"source:splunk\",\"team:secops\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/security_monitoring/batch-migrations/6ec704f1-29d6-47a3-b0ed-1a68ae58ee8b", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Update a batch migration returns \"OK\" response", + "version": "v2" + }, { "feature": "Security Monitoring", "frozen_at": "2024-11-22T13:52:07.331Z", diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 941ac5ce9f0f..c09b5a78ee70 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -318,6 +318,7 @@ def initialize "v2.bulk_create_sample_log_generation_subscriptions": false, "v2.bulk_export_security_monitoring_terraform_resources": false, "v2.cancel_historical_job": false, + "v2.cancel_security_monitoring_batch_migration": false, "v2.convert_job_result_to_signal": false, "v2.convert_security_monitoring_terraform_resource": false, "v2.create_io_c_triage_state": false, @@ -327,6 +328,8 @@ def initialize "v2.create_security_findings_automation_mute_rule": false, "v2.create_security_findings_automation_severity_modifier_rule": false, "v2.create_security_findings_automation_ticket_creation_rule": false, + "v2.create_security_monitoring_batch_migration": false, + "v2.create_security_monitoring_batch_migration_resources": false, "v2.create_security_monitoring_dataset": false, "v2.create_security_monitoring_integration_config": false, "v2.create_static_analysis_ast": false, @@ -340,6 +343,8 @@ def initialize "v2.delete_security_findings_automation_mute_rule": false, "v2.delete_security_findings_automation_severity_modifier_rule": false, "v2.delete_security_findings_automation_ticket_creation_rule": false, + "v2.delete_security_monitoring_batch_migration": false, + "v2.delete_security_monitoring_batch_migration_resources": false, "v2.delete_security_monitoring_dataset": false, "v2.delete_security_monitoring_integration_config": false, "v2.disable_security_findings_automation_default_inbox_rule": false, @@ -386,12 +391,15 @@ def initialize "v2.list_security_findings_automation_mute_rules": false, "v2.list_security_findings_automation_severity_modifier_rules": false, "v2.list_security_findings_automation_ticket_creation_rules": false, + "v2.list_security_monitoring_batch_migration_resources": false, + "v2.list_security_monitoring_batch_migrations": false, "v2.list_security_monitoring_datasets": false, "v2.list_security_monitoring_histsignals": false, "v2.list_security_monitoring_integration_configs": false, "v2.list_static_analysis_codegen_rulesets": false, "v2.list_vulnerabilities": false, "v2.list_vulnerable_assets": false, + "v2.publish_security_monitoring_batch_migration": false, "v2.reorder_security_findings_automation_due_date_rules": false, "v2.reorder_security_findings_automation_inbox_rules": false, "v2.reorder_security_findings_automation_mute_rules": false, @@ -400,6 +408,7 @@ def initialize "v2.restore_security_monitoring_rule": false, "v2.run_historical_job": false, "v2.search_security_monitoring_histsignals": false, + "v2.start_security_monitoring_batch_migration": false, "v2.update_findings_assignee": false, "v2.update_findings_severity": false, "v2.update_security_findings_automation_due_date_rule": false, @@ -407,6 +416,8 @@ def initialize "v2.update_security_findings_automation_mute_rule": false, "v2.update_security_findings_automation_severity_modifier_rule": false, "v2.update_security_findings_automation_ticket_creation_rule": false, + "v2.update_security_monitoring_batch_migration": false, + "v2.update_security_monitoring_batch_migration_resource": false, "v2.update_security_monitoring_dataset": false, "v2.update_security_monitoring_integration_config": false, "v2.validate_security_monitoring_integration_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b6deb90e82d8..04fa388f4dce 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -7800,6 +7800,49 @@ def overrides "v2.security_findings_status" => "SecurityFindingsStatus", "v2.security_finding_type" => "SecurityFindingType", "v2.security_monitoring_azure_app_registration" => "SecurityMonitoringAzureAppRegistration", + "v2.security_monitoring_batch_migration_attributes" => "SecurityMonitoringBatchMigrationAttributes", + "v2.security_monitoring_batch_migration_create_attributes" => "SecurityMonitoringBatchMigrationCreateAttributes", + "v2.security_monitoring_batch_migration_create_data" => "SecurityMonitoringBatchMigrationCreateData", + "v2.security_monitoring_batch_migration_create_request" => "SecurityMonitoringBatchMigrationCreateRequest", + "v2.security_monitoring_batch_migration_data" => "SecurityMonitoringBatchMigrationData", + "v2.security_monitoring_batch_migration_input_source" => "SecurityMonitoringBatchMigrationInputSource", + "v2.security_monitoring_batch_migration_list_meta" => "SecurityMonitoringBatchMigrationListMeta", + "v2.security_monitoring_batch_migration_publish_attributes" => "SecurityMonitoringBatchMigrationPublishAttributes", + "v2.security_monitoring_batch_migration_publish_data" => "SecurityMonitoringBatchMigrationPublishData", + "v2.security_monitoring_batch_migration_published_resource_attributes" => "SecurityMonitoringBatchMigrationPublishedResourceAttributes", + "v2.security_monitoring_batch_migration_published_resource_data" => "SecurityMonitoringBatchMigrationPublishedResourceData", + "v2.security_monitoring_batch_migration_published_resource_status" => "SecurityMonitoringBatchMigrationPublishedResourceStatus", + "v2.security_monitoring_batch_migration_published_resource_type" => "SecurityMonitoringBatchMigrationPublishedResourceType", + "v2.security_monitoring_batch_migration_publish_request" => "SecurityMonitoringBatchMigrationPublishRequest", + "v2.security_monitoring_batch_migration_publish_response" => "SecurityMonitoringBatchMigrationPublishResponse", + "v2.security_monitoring_batch_migration_publish_type" => "SecurityMonitoringBatchMigrationPublishType", + "v2.security_monitoring_batch_migration_resource_attributes" => "SecurityMonitoringBatchMigrationResourceAttributes", + "v2.security_monitoring_batch_migration_resource_create_item" => "SecurityMonitoringBatchMigrationResourceCreateItem", + "v2.security_monitoring_batch_migration_resource_data" => "SecurityMonitoringBatchMigrationResourceData", + "v2.security_monitoring_batch_migration_resource_input_type" => "SecurityMonitoringBatchMigrationResourceInputType", + "v2.security_monitoring_batch_migration_resource_response" => "SecurityMonitoringBatchMigrationResourceResponse", + "v2.security_monitoring_batch_migration_resources_create_attributes" => "SecurityMonitoringBatchMigrationResourcesCreateAttributes", + "v2.security_monitoring_batch_migration_resources_create_data" => "SecurityMonitoringBatchMigrationResourcesCreateData", + "v2.security_monitoring_batch_migration_resources_create_request" => "SecurityMonitoringBatchMigrationResourcesCreateRequest", + "v2.security_monitoring_batch_migration_resources_create_response" => "SecurityMonitoringBatchMigrationResourcesCreateResponse", + "v2.security_monitoring_batch_migration_resources_delete_attributes" => "SecurityMonitoringBatchMigrationResourcesDeleteAttributes", + "v2.security_monitoring_batch_migration_resources_delete_data" => "SecurityMonitoringBatchMigrationResourcesDeleteData", + "v2.security_monitoring_batch_migration_resources_delete_request" => "SecurityMonitoringBatchMigrationResourcesDeleteRequest", + "v2.security_monitoring_batch_migration_resources_list_response" => "SecurityMonitoringBatchMigrationResourcesListResponse", + "v2.security_monitoring_batch_migration_resource_status" => "SecurityMonitoringBatchMigrationResourceStatus", + "v2.security_monitoring_batch_migration_resource_status_counts" => "SecurityMonitoringBatchMigrationResourceStatusCounts", + "v2.security_monitoring_batch_migration_resources_type" => "SecurityMonitoringBatchMigrationResourcesType", + "v2.security_monitoring_batch_migration_resource_type" => "SecurityMonitoringBatchMigrationResourceType", + "v2.security_monitoring_batch_migration_resource_update_attributes" => "SecurityMonitoringBatchMigrationResourceUpdateAttributes", + "v2.security_monitoring_batch_migration_resource_update_data" => "SecurityMonitoringBatchMigrationResourceUpdateData", + "v2.security_monitoring_batch_migration_resource_update_request" => "SecurityMonitoringBatchMigrationResourceUpdateRequest", + "v2.security_monitoring_batch_migration_response" => "SecurityMonitoringBatchMigrationResponse", + "v2.security_monitoring_batch_migrations_list_response" => "SecurityMonitoringBatchMigrationsListResponse", + "v2.security_monitoring_batch_migration_status" => "SecurityMonitoringBatchMigrationStatus", + "v2.security_monitoring_batch_migration_type" => "SecurityMonitoringBatchMigrationType", + "v2.security_monitoring_batch_migration_update_attributes" => "SecurityMonitoringBatchMigrationUpdateAttributes", + "v2.security_monitoring_batch_migration_update_data" => "SecurityMonitoringBatchMigrationUpdateData", + "v2.security_monitoring_batch_migration_update_request" => "SecurityMonitoringBatchMigrationUpdateRequest", "v2.security_monitoring_content_pack_activation" => "SecurityMonitoringContentPackActivation", "v2.security_monitoring_content_pack_app_sec_details" => "SecurityMonitoringContentPackAppSecDetails", "v2.security_monitoring_content_pack_app_sec_details_type" => "SecurityMonitoringContentPackAppSecDetailsType", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 24d803d4bbfd..45acd1b26034 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -1172,6 +1172,81 @@ def cancel_historical_job_with_http_info(job_id, opts = {}) return data, status_code, headers end + # Cancel a batch migration. + # + # @see #cancel_security_monitoring_batch_migration_with_http_info + def cancel_security_monitoring_batch_migration(batch_id, opts = {}) + cancel_security_monitoring_batch_migration_with_http_info(batch_id, opts) + nil + end + + # Cancel a batch migration. + # + # Cancel an `in_progress` batch migration. Resources that are `pending` or `in_progress` + # become `canceled`. Resources that are already `completed` or `failed` keep their status + # and output, so completed resources can still be published. Canceling a `canceled` batch + # migration succeeds, so the request can be safely retried. Returns `409 Conflict` if the + # batch migration is `draft` or `completed`. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def cancel_security_monitoring_batch_migration_with_http_info(batch_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.cancel_security_monitoring_batch_migration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_security_monitoring_batch_migration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_security_monitoring_batch_migration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.cancel_security_monitoring_batch_migration ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.cancel_security_monitoring_batch_migration" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}/cancel'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :cancel_security_monitoring_batch_migration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#cancel_security_monitoring_batch_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Convert an existing rule from JSON to Terraform. # # @see #convert_existing_security_monitoring_rule_with_http_info @@ -2333,6 +2408,163 @@ def create_security_findings_automation_ticket_creation_rule_with_http_info(body return data, status_code, headers end + # Create a batch migration. + # + # @see #create_security_monitoring_batch_migration_with_http_info + def create_security_monitoring_batch_migration(body, opts = {}) + data, _status_code, _headers = create_security_monitoring_batch_migration_with_http_info(body, opts) + data + end + + # Create a batch migration. + # + # Create a batch migration in the `draft` status, together with 1 to 100 initial + # resources. Each resource holds one source rule to translate into a Cloud SIEM detection + # rule. To load more rules, add them with the add resources endpoint before starting the + # batch migration. A batch migration can hold up to 1000 resources. The response does not + # include the created resources: list the resources of the batch migration to retrieve them. + # + # @param body [SecurityMonitoringBatchMigrationCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringBatchMigrationResponse, Integer, Hash)>] SecurityMonitoringBatchMigrationResponse data, response status code and response headers + def create_security_monitoring_batch_migration_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_security_monitoring_batch_migration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_security_monitoring_batch_migration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_security_monitoring_batch_migration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_monitoring_batch_migration ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_monitoring_batch_migration" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringBatchMigrationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_security_monitoring_batch_migration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_monitoring_batch_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Add resources to a batch migration. + # + # @see #create_security_monitoring_batch_migration_resources_with_http_info + def create_security_monitoring_batch_migration_resources(batch_id, body, opts = {}) + data, _status_code, _headers = create_security_monitoring_batch_migration_resources_with_http_info(batch_id, body, opts) + data + end + + # Add resources to a batch migration. + # + # Add 1 to 1000 resources to a `draft` batch migration. Returns `409 Conflict` if the + # batch migration is not `draft`, and `400 Bad Request` if the batch migration would + # contain more than 1000 resources. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param body [SecurityMonitoringBatchMigrationResourcesCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringBatchMigrationResourcesCreateResponse, Integer, Hash)>] SecurityMonitoringBatchMigrationResourcesCreateResponse data, response status code and response headers + def create_security_monitoring_batch_migration_resources_with_http_info(batch_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_security_monitoring_batch_migration_resources".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_security_monitoring_batch_migration_resources") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_security_monitoring_batch_migration_resources")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_monitoring_batch_migration_resources ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.create_security_monitoring_batch_migration_resources" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_monitoring_batch_migration_resources" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}/resources'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringBatchMigrationResourcesCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_security_monitoring_batch_migration_resources, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_monitoring_batch_migration_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a critical asset. # # @see #create_security_monitoring_critical_asset_with_http_info @@ -3811,6 +4043,161 @@ def delete_security_findings_automation_ticket_creation_rule_with_http_info(rule return data, status_code, headers end + # Delete a batch migration. + # + # @see #delete_security_monitoring_batch_migration_with_http_info + def delete_security_monitoring_batch_migration(batch_id, opts = {}) + delete_security_monitoring_batch_migration_with_http_info(batch_id, opts) + nil + end + + # Delete a batch migration. + # + # Delete a batch migration and its resources. Detection rules that were already + # published are not deleted. Returns `409 Conflict` while any resource is `in_progress` + # or `publishing`: cancel the batch migration, or wait for publishing to finish, and + # then try again. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_security_monitoring_batch_migration_with_http_info(batch_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_batch_migration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_batch_migration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_batch_migration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_batch_migration ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.delete_security_monitoring_batch_migration" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_security_monitoring_batch_migration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_batch_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete resources from a batch migration. + # + # @see #delete_security_monitoring_batch_migration_resources_with_http_info + def delete_security_monitoring_batch_migration_resources(batch_id, body, opts = {}) + delete_security_monitoring_batch_migration_resources_with_http_info(batch_id, body, opts) + nil + end + + # Delete resources from a batch migration. + # + # Delete resources from a batch migration. The request is all-or-nothing: it returns + # `404 Not Found` if any resource does not exist, and `409 Conflict` if any resource is + # `in_progress` or `publishing`. In both cases nothing is deleted. Duplicate resource IDs + # are ignored. Detection rules already published from the deleted resources are not deleted. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param body [SecurityMonitoringBatchMigrationResourcesDeleteRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_security_monitoring_batch_migration_resources_with_http_info(batch_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_batch_migration_resources".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_batch_migration_resources") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_batch_migration_resources")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_batch_migration_resources ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.delete_security_monitoring_batch_migration_resources" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.delete_security_monitoring_batch_migration_resources" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}/resources'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_security_monitoring_batch_migration_resources, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_batch_migration_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a critical asset. # # @see #delete_security_monitoring_critical_asset_with_http_info @@ -9564,13 +9951,179 @@ def list_security_findings_automation_severity_modifier_rules_with_http_info(opt post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'SeverityModifierRulesResponse' + return_type = opts[:debug_return_type] || 'SeverityModifierRulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_security_findings_automation_severity_modifier_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_findings_automation_severity_modifier_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all ticket creation rules. + # + # @see #list_security_findings_automation_ticket_creation_rules_with_http_info + def list_security_findings_automation_ticket_creation_rules(opts = {}) + data, _status_code, _headers = list_security_findings_automation_ticket_creation_rules_with_http_info(opts) + data + end + + # Get all ticket creation rules. + # + # Get all ticket creation rules for the current organization. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size The number of rules per page. Maximum is 1000. + # @option opts [Integer] :page_number The page number to return. + # @return [Array<(TicketCreationRulesResponse, Integer, Hash)>] TicketCreationRulesResponse data, response status code and response headers + def list_security_findings_automation_ticket_creation_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_findings_automation_ticket_creation_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_findings_automation_ticket_creation_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_findings_automation_ticket_creation_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules ...' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be greater than or equal to 0.' + end + # resource path + local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TicketCreationRulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_security_findings_automation_ticket_creation_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_findings_automation_ticket_creation_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List batch migration resources. + # + # @see #list_security_monitoring_batch_migration_resources_with_http_info + def list_security_monitoring_batch_migration_resources(batch_id, opts = {}) + data, _status_code, _headers = list_security_monitoring_batch_migration_resources_with_http_info(batch_id, opts) + data + end + + # List batch migration resources. + # + # List the resources of a batch migration, including the input of each source rule and, + # once translated, the proposed Cloud SIEM detection rule in `output`. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 500. + # @option opts [Integer] :page_number Specific page number to return, starting at 1. + # @option opts [String] :filter_query A search query in Datadog search syntax to filter resources, such as `status:completed`. Filterable attributes are `id`, `name`, `description`, `inputType`, `status`, `input`, `createdBy`, and `lastUpdatedBy`. Free text matches the resource name. + # @return [Array<(SecurityMonitoringBatchMigrationResourcesListResponse, Integer, Hash)>] SecurityMonitoringBatchMigrationResourcesListResponse data, response status code and response headers + def list_security_monitoring_batch_migration_resources_with_http_info(batch_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_batch_migration_resources".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_batch_migration_resources") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_batch_migration_resources")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_batch_migration_resources ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.list_security_monitoring_batch_migration_resources" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_monitoring_batch_migration_resources, must be smaller than or equal to 500.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_monitoring_batch_migration_resources, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_security_monitoring_batch_migration_resources, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}/resources'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringBatchMigrationResourcesListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_security_findings_automation_severity_modifier_rules, + :operation => :list_security_monitoring_batch_migration_resources, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -9582,54 +10135,60 @@ def list_security_findings_automation_severity_modifier_rules_with_http_info(opt data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_findings_automation_severity_modifier_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_monitoring_batch_migration_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get all ticket creation rules. + # List batch migrations. # - # @see #list_security_findings_automation_ticket_creation_rules_with_http_info - def list_security_findings_automation_ticket_creation_rules(opts = {}) - data, _status_code, _headers = list_security_findings_automation_ticket_creation_rules_with_http_info(opts) + # @see #list_security_monitoring_batch_migrations_with_http_info + def list_security_monitoring_batch_migrations(opts = {}) + data, _status_code, _headers = list_security_monitoring_batch_migrations_with_http_info(opts) data end - # Get all ticket creation rules. + # List batch migrations. # - # Get all ticket creation rules for the current organization. + # List the batch migrations of your organization. A batch migration groups detection + # rules from another SIEM that the Datadog Detection Agent translates into Cloud SIEM + # detection rules. To retrieve a single batch migration, filter by its ID with + # `filter[query]=id:`. Poll this endpoint to follow the progress of a batch + # migration through its `status` and `resourceStatusCounts`. # # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_size The number of rules per page. Maximum is 1000. - # @option opts [Integer] :page_number The page number to return. - # @return [Array<(TicketCreationRulesResponse, Integer, Hash)>] TicketCreationRulesResponse data, response status code and response headers - def list_security_findings_automation_ticket_creation_rules_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_security_findings_automation_ticket_creation_rules".to_sym] + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 500. + # @option opts [Integer] :page_number Specific page number to return, starting at 1. + # @option opts [String] :filter_query A search query in Datadog search syntax to filter batch migrations, such as `status:completed`. Filterable attributes are `id`, `name`, `description`, `status`, `createdBy`, and `lastUpdatedBy`. Free text matches the batch migration name. + # @return [Array<(SecurityMonitoringBatchMigrationsListResponse, Integer, Hash)>] SecurityMonitoringBatchMigrationsListResponse data, response status code and response headers + def list_security_monitoring_batch_migrations_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_batch_migrations".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_findings_automation_ticket_creation_rules") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_batch_migrations") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_findings_automation_ticket_creation_rules")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_batch_migrations")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_batch_migrations ...' end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be smaller than or equal to 1000.' + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_monitoring_batch_migrations, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be greater than or equal to 1.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_monitoring_batch_migrations, must be greater than or equal to 1.' end - if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 - fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be greater than or equal to 0.' + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_security_monitoring_batch_migrations, must be greater than or equal to 1.' end # resource path - local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules' + local_var_path = '/api/v2/security_monitoring/batch-migrations' # query parameters query_params = opts[:query_params] || {} query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil? # header parameters header_params = opts[:header_params] || {} @@ -9643,13 +10202,13 @@ def list_security_findings_automation_ticket_creation_rules_with_http_info(opts post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'TicketCreationRulesResponse' + return_type = opts[:debug_return_type] || 'SecurityMonitoringBatchMigrationsListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_security_findings_automation_ticket_creation_rules, + :operation => :list_security_monitoring_batch_migrations, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -9661,7 +10220,7 @@ def list_security_findings_automation_ticket_creation_rules_with_http_info(opts data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_findings_automation_ticket_creation_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_monitoring_batch_migrations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -10901,6 +11460,96 @@ def patch_vulnerability_notification_rule_with_http_info(id, body, opts = {}) return data, status_code, headers end + # Publish a batch migration. + # + # @see #publish_security_monitoring_batch_migration_with_http_info + def publish_security_monitoring_batch_migration(batch_id, body, opts = {}) + data, _status_code, _headers = publish_security_monitoring_batch_migration_with_http_info(batch_id, body, opts) + data + end + + # Publish a batch migration. + # + # Create a Cloud SIEM detection rule from the `output` of each selected `completed` + # resource of a batch migration. Completed resources can be published while the rest of + # the batch migration is still being translated. When `resourceIds` is omitted or empty, + # every `completed` resource is published. Published rules are created disabled. + # + # Every requested resource must be publishable: `completed`, or left in `publishing` for + # more than one minute after an uncertain result. Otherwise, the request returns + # `409 Conflict` and nothing is published. Already published resources are not publishable. + # + # The response reports the outcome of each resource, and some resources can be published + # while others fail. A `failed` result that contains a `ruleId` means the rule was created: + # do not retry that resource. Publishing a rule with a `block_ip` or `block_user` action + # requires the `appsec_protect_write` permission. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param body [SecurityMonitoringBatchMigrationPublishRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringBatchMigrationPublishResponse, Integer, Hash)>] SecurityMonitoringBatchMigrationPublishResponse data, response status code and response headers + def publish_security_monitoring_batch_migration_with_http_info(batch_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.publish_security_monitoring_batch_migration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.publish_security_monitoring_batch_migration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.publish_security_monitoring_batch_migration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.publish_security_monitoring_batch_migration ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.publish_security_monitoring_batch_migration" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.publish_security_monitoring_batch_migration" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}/publish'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringBatchMigrationPublishResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :publish_security_monitoring_batch_migration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#publish_security_monitoring_batch_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Reorder due date rules. # # @see #reorder_security_findings_automation_due_date_rules_with_http_info @@ -11733,6 +12382,89 @@ def send_security_monitoring_notification_preview_with_http_info(body, opts = {} return data, status_code, headers end + # Start a batch migration. + # + # @see #start_security_monitoring_batch_migration_with_http_info + def start_security_monitoring_batch_migration(batch_id, opts = {}) + start_security_monitoring_batch_migration_with_http_info(batch_id, opts) + nil + end + + # Start a batch migration. + # + # Start translating the `pending` resources of a `draft` batch migration into Cloud SIEM + # detection rules. The batch migration moves to `in_progress`, and its resources are + # translated asynchronously. Once no resource is `pending` or `in_progress`, the batch + # migration moves to `completed`. Starting an `in_progress` batch migration again does not + # queue duplicate work, so the request can be safely retried, including after a timeout or + # a `5xx` error. Returns `409 Conflict` if the batch migration is `completed` or `canceled`. + # + # An organization can translate up to 2000 resources in total across all of its batch + # migrations. Resources that were already processed count toward this limit even after + # they are deleted, and `pending` resources of `in_progress` batch migrations reserve + # capacity. Returns `409 Conflict` if starting the batch migration would exceed this limit. + # To request a higher limit for your organization, contact + # [Datadog support](https://docs.datadoghq.com/help/). + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def start_security_monitoring_batch_migration_with_http_info(batch_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.start_security_monitoring_batch_migration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.start_security_monitoring_batch_migration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.start_security_monitoring_batch_migration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.start_security_monitoring_batch_migration ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.start_security_monitoring_batch_migration" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}/start'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :start_security_monitoring_batch_migration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#start_security_monitoring_batch_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Test an existing rule. # # @see #test_existing_security_monitoring_rule_with_http_info @@ -12640,6 +13372,172 @@ def update_security_findings_automation_ticket_creation_rule_with_http_info(rule return data, status_code, headers end + # Update a batch migration. + # + # @see #update_security_monitoring_batch_migration_with_http_info + def update_security_monitoring_batch_migration(batch_id, body, opts = {}) + data, _status_code, _headers = update_security_monitoring_batch_migration_with_http_info(batch_id, body, opts) + data + end + + # Update a batch migration. + # + # Update the name, description, or tags of a batch migration, in any status. At least + # one of these attributes must be provided. Omitted attributes are left unchanged, and + # `tags` replaces the full list of tags. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param body [SecurityMonitoringBatchMigrationUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringBatchMigrationResponse, Integer, Hash)>] SecurityMonitoringBatchMigrationResponse data, response status code and response headers + def update_security_monitoring_batch_migration_with_http_info(batch_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_security_monitoring_batch_migration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_security_monitoring_batch_migration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_security_monitoring_batch_migration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_monitoring_batch_migration ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.update_security_monitoring_batch_migration" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_monitoring_batch_migration" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringBatchMigrationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_security_monitoring_batch_migration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_monitoring_batch_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a batch migration resource. + # + # @see #update_security_monitoring_batch_migration_resource_with_http_info + def update_security_monitoring_batch_migration_resource(batch_id, resource_id, body, opts = {}) + data, _status_code, _headers = update_security_monitoring_batch_migration_resource_with_http_info(batch_id, resource_id, body, opts) + data + end + + # Update a batch migration resource. + # + # Update a resource of a batch migration. At least one of `name`, `description`, + # `inputType`, or `input` must be provided. `name` and `description` can be updated at + # any time. `inputType` and `input` can only be updated while the resource is `pending`; + # otherwise, the request returns `409 Conflict`. The translated `output` cannot be edited. + # + # @param batch_id [UUID] The UUID of the batch migration. + # @param resource_id [UUID] The UUID of the batch migration resource. + # @param body [SecurityMonitoringBatchMigrationResourceUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringBatchMigrationResourceResponse, Integer, Hash)>] SecurityMonitoringBatchMigrationResourceResponse data, response status code and response headers + def update_security_monitoring_batch_migration_resource_with_http_info(batch_id, resource_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_security_monitoring_batch_migration_resource".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_security_monitoring_batch_migration_resource") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_security_monitoring_batch_migration_resource")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_monitoring_batch_migration_resource ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling SecurityMonitoringAPI.update_security_monitoring_batch_migration_resource" + end + # verify the required parameter 'resource_id' is set + if @api_client.config.client_side_validation && resource_id.nil? + fail ArgumentError, "Missing the required parameter 'resource_id' when calling SecurityMonitoringAPI.update_security_monitoring_batch_migration_resource" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_monitoring_batch_migration_resource" + end + # resource path + local_var_path = '/api/v2/security_monitoring/batch-migrations/{batch_id}/resources/{resource_id}'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')).sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringBatchMigrationResourceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_security_monitoring_batch_migration_resource, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_monitoring_batch_migration_resource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a critical asset. # # @see #update_security_monitoring_critical_asset_with_http_info diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_attributes.rb new file mode 100644 index 000000000000..816a89e845f2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_attributes.rb @@ -0,0 +1,310 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a batch migration. + class SecurityMonitoringBatchMigrationAttributes + include BaseGenericModel + + # The creation date of the batch migration, in RFC 3339 format. + attr_reader :created_at + + # The UUID of the user or service account who created the batch migration. + attr_accessor :created_by + + # The description of the batch migration. + attr_accessor :description + + # The origin of a batch migration. Always `batch_migration` for batch migrations + # created through this API. + attr_reader :input_source + + # The last update date of the batch migration, in RFC 3339 format. + attr_reader :last_updated_at + + # The UUID of the user or service account who last updated the batch migration, + # or the name of a system actor. + attr_accessor :last_updated_by + + # The name of the batch migration. + attr_reader :name + + # The ID of the organization that owns the batch migration. + attr_reader :org_id + + # The number of resources of a batch migration in each status. + attr_reader :resource_status_counts + + # The status of a batch migration. A batch migration is created as `draft` and moves to + # `in_progress` when started. It moves to `completed` once no resource is `pending` or + # `in_progress`, or to `canceled` when canceled. + attr_reader :status + + # Tags of the batch migration. Up to 50 tags, each up to 256 characters. + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'createdAt', + :'created_by' => :'createdBy', + :'description' => :'description', + :'input_source' => :'inputSource', + :'last_updated_at' => :'lastUpdatedAt', + :'last_updated_by' => :'lastUpdatedBy', + :'name' => :'name', + :'org_id' => :'orgId', + :'resource_status_counts' => :'resourceStatusCounts', + :'status' => :'status', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by' => :'String', + :'description' => :'String', + :'input_source' => :'SecurityMonitoringBatchMigrationInputSource', + :'last_updated_at' => :'Time', + :'last_updated_by' => :'String', + :'name' => :'String', + :'org_id' => :'Integer', + :'resource_status_counts' => :'SecurityMonitoringBatchMigrationResourceStatusCounts', + :'status' => :'SecurityMonitoringBatchMigrationStatus', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'input_source') + self.input_source = attributes[:'input_source'] + end + + if attributes.key?(:'last_updated_at') + self.last_updated_at = attributes[:'last_updated_at'] + end + + if attributes.key?(:'last_updated_by') + self.last_updated_by = attributes[:'last_updated_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'resource_status_counts') + self.resource_status_counts = attributes[:'resource_status_counts'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @input_source.nil? + return false if @last_updated_at.nil? + return false if @name.nil? + return false if @org_id.nil? + return false if @resource_status_counts.nil? + return false if @status.nil? + return false if @tags.nil? + return false if @tags.length > 50 + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param input_source [Object] Object to be assigned + # @!visibility private + def input_source=(input_source) + if input_source.nil? + fail ArgumentError, 'invalid value for "input_source", input_source cannot be nil.' + end + @input_source = input_source + end + + # Custom attribute writer method with validation + # @param last_updated_at [Object] Object to be assigned + # @!visibility private + def last_updated_at=(last_updated_at) + if last_updated_at.nil? + fail ArgumentError, 'invalid value for "last_updated_at", last_updated_at cannot be nil.' + end + @last_updated_at = last_updated_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param resource_status_counts [Object] Object to be assigned + # @!visibility private + def resource_status_counts=(resource_status_counts) + if resource_status_counts.nil? + fail ArgumentError, 'invalid value for "resource_status_counts", resource_status_counts cannot be nil.' + end + @resource_status_counts = resource_status_counts + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + if tags.length > 50 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 50.' + end + @tags = tags + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by == o.created_by && + description == o.description && + input_source == o.input_source && + last_updated_at == o.last_updated_at && + last_updated_by == o.last_updated_by && + name == o.name && + org_id == o.org_id && + resource_status_counts == o.resource_status_counts && + status == o.status && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, description, input_source, last_updated_at, last_updated_by, name, org_id, resource_status_counts, status, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_attributes.rb new file mode 100644 index 000000000000..959a6d64de34 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_attributes.rb @@ -0,0 +1,198 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the batch migration to create. + class SecurityMonitoringBatchMigrationCreateAttributes + include BaseGenericModel + + # The description of the batch migration. + attr_reader :description + + # The name of the batch migration. + attr_reader :name + + # The initial resources of the batch migration. From 1 to 100 resources. + attr_reader :resources + + # Tags of the batch migration. Up to 50 tags, each up to 256 characters. + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'resources' => :'resources', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'resources' => :'Array', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'resources') + if (value = attributes[:'resources']).is_a?(Array) + self.resources = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@description.nil? && @description.to_s.length > 4096 + return false if !@name.nil? && @name.to_s.length > 512 + return false if @resources.nil? + return false if @resources.length > 100 + return false if @resources.length < 1 + return false if !@tags.nil? && @tags.length > 50 + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if !description.nil? && description.to_s.length > 4096 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4096.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 512 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 512.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param resources [Object] Object to be assigned + # @!visibility private + def resources=(resources) + if resources.nil? + fail ArgumentError, 'invalid value for "resources", resources cannot be nil.' + end + if resources.length > 100 + fail ArgumentError, 'invalid value for "resources", number of items must be less than or equal to 100.' + end + if resources.length < 1 + fail ArgumentError, 'invalid value for "resources", number of items must be greater than or equal to 1.' + end + @resources = resources + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if !tags.nil? && tags.length > 50 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 50.' + end + @tags = tags + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + resources == o.resources && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, resources, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_data.rb new file mode 100644 index 000000000000..c1bc9b1d1607 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the batch migration to create. + class SecurityMonitoringBatchMigrationCreateData + include BaseGenericModel + + # Attributes of the batch migration to create. + attr_reader :attributes + + # The type of resource for a batch migration. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationCreateAttributes', + :'type' => :'SecurityMonitoringBatchMigrationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_request.rb new file mode 100644 index 000000000000..aedef28e5a97 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a batch migration. + class SecurityMonitoringBatchMigrationCreateRequest + include BaseGenericModel + + # Data of the batch migration to create. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_data.rb new file mode 100644 index 000000000000..4f41834ec3f3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A batch migration. + class SecurityMonitoringBatchMigrationData + include BaseGenericModel + + # Attributes of a batch migration. + attr_reader :attributes + + # The UUID of the batch migration. + attr_reader :id + + # The type of resource for a batch migration. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationAttributes', + :'id' => :'UUID', + :'type' => :'SecurityMonitoringBatchMigrationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_input_source.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_input_source.rb new file mode 100644 index 000000000000..4055d0e08f2b --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_input_source.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The origin of a batch migration. Always `batch_migration` for batch migrations + # created through this API. + class SecurityMonitoringBatchMigrationInputSource + include BaseEnumModel + + BATCH_MIGRATION = "batch_migration".freeze + THREAT_HUNTING = "threat_hunting".freeze + USER = "user".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_list_meta.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_list_meta.rb new file mode 100644 index 000000000000..ce677b6626e8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_list_meta.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata of a list response. + class SecurityMonitoringBatchMigrationListMeta + include BaseGenericModel + + # Total number of items matching the request. + attr_reader :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'totalCount' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationListMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @total_count.nil? + true + end + + # Custom attribute writer method with validation + # @param total_count [Object] Object to be assigned + # @!visibility private + def total_count=(total_count) + if total_count.nil? + fail ArgumentError, 'invalid value for "total_count", total_count cannot be nil.' + end + @total_count = total_count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_attributes.rb new file mode 100644 index 000000000000..6ebdbaf755cf --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_attributes.rb @@ -0,0 +1,126 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the batch migration publish request. + class SecurityMonitoringBatchMigrationPublishAttributes + include BaseGenericModel + + # Unique UUIDs of the resources to publish. Up to 1000 IDs. When omitted or empty, + # every `completed` resource of the batch migration is published. + attr_reader :resource_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'resource_ids' => :'resourceIds' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'resource_ids' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'resource_ids') + if (value = attributes[:'resource_ids']).is_a?(Array) + self.resource_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@resource_ids.nil? && @resource_ids.length > 1000 + true + end + + # Custom attribute writer method with validation + # @param resource_ids [Object] Object to be assigned + # @!visibility private + def resource_ids=(resource_ids) + if !resource_ids.nil? && resource_ids.length > 1000 + fail ArgumentError, 'invalid value for "resource_ids", number of items must be less than or equal to 1000.' + end + @resource_ids = resource_ids + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + resource_ids == o.resource_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [resource_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_data.rb new file mode 100644 index 000000000000..2374955b6702 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the batch migration publish request. + class SecurityMonitoringBatchMigrationPublishData + include BaseGenericModel + + # Attributes of the batch migration publish request. + attr_reader :attributes + + # The type of resource for a batch migration publish request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationPublishAttributes', + :'type' => :'SecurityMonitoringBatchMigrationPublishType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_request.rb new file mode 100644 index 000000000000..708b07818ea5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to publish the resources of a batch migration. + class SecurityMonitoringBatchMigrationPublishRequest + include BaseGenericModel + + # Data of the batch migration publish request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationPublishData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_response.rb new file mode 100644 index 000000000000..967d4ab84207 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the publication outcome of each resource. + class SecurityMonitoringBatchMigrationPublishResponse + include BaseGenericModel + + # The publication outcome of each resource. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_type.rb new file mode 100644 index 000000000000..827b3a80c9d9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_publish_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a batch migration publish request. + class SecurityMonitoringBatchMigrationPublishType + include BaseEnumModel + + BATCH_MIGRATION_PUBLISH = "batchMigrationPublish".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_attributes.rb new file mode 100644 index 000000000000..abb0fa631049 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_attributes.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the publication outcome of a batch migration resource. + class SecurityMonitoringBatchMigrationPublishedResourceAttributes + include BaseGenericModel + + # The reason why the resource could not be published. + attr_accessor :error + + # The ID of the created Cloud SIEM detection rule. + attr_accessor :rule_id + + # The outcome of publishing a batch migration resource. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error' => :'error', + :'rule_id' => :'ruleId', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error' => :'String', + :'rule_id' => :'String', + :'status' => :'SecurityMonitoringBatchMigrationPublishedResourceStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishedResourceAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'rule_id') + self.rule_id = attributes[:'rule_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + rule_id == o.rule_id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error, rule_id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_data.rb new file mode 100644 index 000000000000..6d1bb36efa30 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The publication outcome of a batch migration resource. + class SecurityMonitoringBatchMigrationPublishedResourceData + include BaseGenericModel + + # Attributes of the publication outcome of a batch migration resource. + attr_reader :attributes + + # The UUID of the batch migration resource. + attr_reader :id + + # The type of resource for a published batch migration resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationPublishedResourceAttributes', + :'id' => :'UUID', + :'type' => :'SecurityMonitoringBatchMigrationPublishedResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationPublishedResourceData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_status.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_status.rb new file mode 100644 index 000000000000..3a7352a4e9ec --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_status.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The outcome of publishing a batch migration resource. + class SecurityMonitoringBatchMigrationPublishedResourceStatus + include BaseEnumModel + + PUBLISHED = "published".freeze + FAILED = "failed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_type.rb new file mode 100644 index 000000000000..c7c90de4e967 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_published_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a published batch migration resource. + class SecurityMonitoringBatchMigrationPublishedResourceType + include BaseEnumModel + + BATCH_MIGRATION_PUBLISHED_RESOURCE = "batchMigrationPublishedResource".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_attributes.rb new file mode 100644 index 000000000000..9ac851fec623 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_attributes.rb @@ -0,0 +1,336 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a batch migration resource. + class SecurityMonitoringBatchMigrationResourceAttributes + include BaseGenericModel + + # The UUID of the batch migration that contains the resource. + attr_reader :batch_id + + # The creation date of the resource, in RFC 3339 format. + attr_reader :created_at + + # The UUID of the user or service account who created the resource. + attr_accessor :created_by + + # The description of the resource. + attr_accessor :description + + # The source query or natural language description to translate. + attr_reader :input + + # The type of the source rule: `spl` for a Splunk SPL search or saved search definition, + # `natural_language` for a plain-English description of the behavior to detect, or `kql` + # for a Microsoft KQL query. SPL inputs must be self-contained, with search macros expanded. + attr_reader :input_type + + # The last update date of the resource, in RFC 3339 format. + attr_reader :last_updated_at + + # The UUID of the user or service account who last updated the resource, + # or the name of a system actor. + attr_accessor :last_updated_by + + # The name of the resource. + attr_reader :name + + # The translation output. When the resource is `completed`, a Cloud SIEM detection rule + # definition in the same format as the create detection rule API. When the resource is + # `failed`, an object with an `error` describing the failure, with `kind` set to + # `translation_error` or `internal_error`, and optional `type` and `message`. Otherwise, null. + attr_accessor :output + + # The type of the translation output. Currently always `siem_rule`. + attr_reader :output_type + + # The ID of the Cloud SIEM detection rule created when the resource was published. + attr_accessor :rule_id + + # The status of a batch migration resource. `completed` resources have a translation in + # `output` that is ready to be published. `duplicate` is reserved for future duplicate rule + # detection. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'batch_id' => :'batchId', + :'created_at' => :'createdAt', + :'created_by' => :'createdBy', + :'description' => :'description', + :'input' => :'input', + :'input_type' => :'inputType', + :'last_updated_at' => :'lastUpdatedAt', + :'last_updated_by' => :'lastUpdatedBy', + :'name' => :'name', + :'output' => :'output', + :'output_type' => :'outputType', + :'rule_id' => :'ruleId', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'batch_id' => :'UUID', + :'created_at' => :'Time', + :'created_by' => :'String', + :'description' => :'String', + :'input' => :'String', + :'input_type' => :'SecurityMonitoringBatchMigrationResourceInputType', + :'last_updated_at' => :'Time', + :'last_updated_by' => :'String', + :'name' => :'String', + :'output' => :'Hash', + :'output_type' => :'String', + :'rule_id' => :'String', + :'status' => :'SecurityMonitoringBatchMigrationResourceStatus' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'output', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'batch_id') + self.batch_id = attributes[:'batch_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'input_type') + self.input_type = attributes[:'input_type'] + end + + if attributes.key?(:'last_updated_at') + self.last_updated_at = attributes[:'last_updated_at'] + end + + if attributes.key?(:'last_updated_by') + self.last_updated_by = attributes[:'last_updated_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'output') + self.output = attributes[:'output'] + end + + if attributes.key?(:'output_type') + self.output_type = attributes[:'output_type'] + end + + if attributes.key?(:'rule_id') + self.rule_id = attributes[:'rule_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @batch_id.nil? + return false if @created_at.nil? + return false if @input.nil? + return false if @input_type.nil? + return false if @last_updated_at.nil? + return false if @name.nil? + return false if @output_type.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param batch_id [Object] Object to be assigned + # @!visibility private + def batch_id=(batch_id) + if batch_id.nil? + fail ArgumentError, 'invalid value for "batch_id", batch_id cannot be nil.' + end + @batch_id = batch_id + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param input [Object] Object to be assigned + # @!visibility private + def input=(input) + if input.nil? + fail ArgumentError, 'invalid value for "input", input cannot be nil.' + end + @input = input + end + + # Custom attribute writer method with validation + # @param input_type [Object] Object to be assigned + # @!visibility private + def input_type=(input_type) + if input_type.nil? + fail ArgumentError, 'invalid value for "input_type", input_type cannot be nil.' + end + @input_type = input_type + end + + # Custom attribute writer method with validation + # @param last_updated_at [Object] Object to be assigned + # @!visibility private + def last_updated_at=(last_updated_at) + if last_updated_at.nil? + fail ArgumentError, 'invalid value for "last_updated_at", last_updated_at cannot be nil.' + end + @last_updated_at = last_updated_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param output_type [Object] Object to be assigned + # @!visibility private + def output_type=(output_type) + if output_type.nil? + fail ArgumentError, 'invalid value for "output_type", output_type cannot be nil.' + end + @output_type = output_type + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + batch_id == o.batch_id && + created_at == o.created_at && + created_by == o.created_by && + description == o.description && + input == o.input && + input_type == o.input_type && + last_updated_at == o.last_updated_at && + last_updated_by == o.last_updated_by && + name == o.name && + output == o.output && + output_type == o.output_type && + rule_id == o.rule_id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [batch_id, created_at, created_by, description, input, input_type, last_updated_at, last_updated_by, name, output, output_type, rule_id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_create_item.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_create_item.rb new file mode 100644 index 000000000000..5c0a3fcda41b --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_create_item.rb @@ -0,0 +1,202 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A source rule to translate into a Cloud SIEM detection rule. + class SecurityMonitoringBatchMigrationResourceCreateItem + include BaseGenericModel + + # The description of the resource. + attr_reader :description + + # The source query or natural language description to translate. Must not be blank. + attr_reader :input + + # The type of the source rule: `spl` for a Splunk SPL search or saved search definition, + # `natural_language` for a plain-English description of the behavior to detect, or `kql` + # for a Microsoft KQL query. SPL inputs must be self-contained, with search macros expanded. + attr_reader :input_type + + # The name of the resource. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'input' => :'input', + :'input_type' => :'inputType', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'input' => :'String', + :'input_type' => :'SecurityMonitoringBatchMigrationResourceInputType', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceCreateItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'input_type') + self.input_type = attributes[:'input_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@description.nil? && @description.to_s.length > 4096 + return false if @input.nil? + return false if @input.to_s.length > 65536 + return false if @input.to_s.length < 1 + pattern = Regexp.new(/^[\s\S]*\S[\s\S]*$/) + return false if @input !~ pattern + return false if @input_type.nil? + return false if !@name.nil? && @name.to_s.length > 512 + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if !description.nil? && description.to_s.length > 4096 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4096.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param input [Object] Object to be assigned + # @!visibility private + def input=(input) + if input.nil? + fail ArgumentError, 'invalid value for "input", input cannot be nil.' + end + if input.to_s.length > 65536 + fail ArgumentError, 'invalid value for "input", the character length must be smaller than or equal to 65536.' + end + if input.to_s.length < 1 + fail ArgumentError, 'invalid value for "input", the character length must be great than or equal to 1.' + end + pattern = Regexp.new(/^[\s\S]*\S[\s\S]*$/) + if input !~ pattern + fail ArgumentError, "invalid value for \"input\", must conform to the pattern #{pattern}." + end + @input = input + end + + # Custom attribute writer method with validation + # @param input_type [Object] Object to be assigned + # @!visibility private + def input_type=(input_type) + if input_type.nil? + fail ArgumentError, 'invalid value for "input_type", input_type cannot be nil.' + end + @input_type = input_type + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 512 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 512.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + input == o.input && + input_type == o.input_type && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, input, input_type, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_data.rb new file mode 100644 index 000000000000..63a716b456c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A batch migration resource. + class SecurityMonitoringBatchMigrationResourceData + include BaseGenericModel + + # Attributes of a batch migration resource. + attr_reader :attributes + + # The UUID of the batch migration resource. + attr_reader :id + + # The type of resource for a batch migration resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationResourceAttributes', + :'id' => :'UUID', + :'type' => :'SecurityMonitoringBatchMigrationResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_input_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_input_type.rb new file mode 100644 index 000000000000..387c448a74e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_input_type.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the source rule: `spl` for a Splunk SPL search or saved search definition, + # `natural_language` for a plain-English description of the behavior to detect, or `kql` + # for a Microsoft KQL query. SPL inputs must be self-contained, with search macros expanded. + class SecurityMonitoringBatchMigrationResourceInputType + include BaseEnumModel + + NATURAL_LANGUAGE = "natural_language".freeze + SPL = "spl".freeze + KQL = "kql".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_response.rb new file mode 100644 index 000000000000..5331ffc48acd --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a batch migration resource. + class SecurityMonitoringBatchMigrationResourceResponse + include BaseGenericModel + + # A batch migration resource. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationResourceData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status.rb new file mode 100644 index 000000000000..3bff2b308dde --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status.rb @@ -0,0 +1,35 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The status of a batch migration resource. `completed` resources have a translation in + # `output` that is ready to be published. `duplicate` is reserved for future duplicate rule + # detection. + class SecurityMonitoringBatchMigrationResourceStatus + include BaseEnumModel + + PENDING = "pending".freeze + IN_PROGRESS = "in_progress".freeze + COMPLETED = "completed".freeze + CANCELED = "canceled".freeze + FAILED = "failed".freeze + PUBLISHING = "publishing".freeze + PUBLISHED = "published".freeze + DUPLICATE = "duplicate".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status_counts.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status_counts.rb new file mode 100644 index 000000000000..4bf65b00eed2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_status_counts.rb @@ -0,0 +1,270 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The number of resources of a batch migration in each status. + class SecurityMonitoringBatchMigrationResourceStatusCounts + include BaseGenericModel + + # Number of resources whose translation was canceled. + attr_reader :canceled + + # Number of resources translated and ready to be published. + attr_reader :completed + + # Number of resources identified as duplicates of an existing rule. Reserved for future use. + attr_reader :duplicate + + # Number of resources whose translation failed. + attr_reader :failed + + # Number of resources being translated. + attr_reader :in_progress + + # Number of resources waiting to be translated. + attr_reader :pending + + # Number of resources published as Cloud SIEM detection rules. + attr_reader :published + + # Number of resources being published. + attr_reader :publishing + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'canceled' => :'canceled', + :'completed' => :'completed', + :'duplicate' => :'duplicate', + :'failed' => :'failed', + :'in_progress' => :'inProgress', + :'pending' => :'pending', + :'published' => :'published', + :'publishing' => :'publishing' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'canceled' => :'Integer', + :'completed' => :'Integer', + :'duplicate' => :'Integer', + :'failed' => :'Integer', + :'in_progress' => :'Integer', + :'pending' => :'Integer', + :'published' => :'Integer', + :'publishing' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceStatusCounts` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'canceled') + self.canceled = attributes[:'canceled'] + end + + if attributes.key?(:'completed') + self.completed = attributes[:'completed'] + end + + if attributes.key?(:'duplicate') + self.duplicate = attributes[:'duplicate'] + end + + if attributes.key?(:'failed') + self.failed = attributes[:'failed'] + end + + if attributes.key?(:'in_progress') + self.in_progress = attributes[:'in_progress'] + end + + if attributes.key?(:'pending') + self.pending = attributes[:'pending'] + end + + if attributes.key?(:'published') + self.published = attributes[:'published'] + end + + if attributes.key?(:'publishing') + self.publishing = attributes[:'publishing'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @canceled.nil? + return false if @completed.nil? + return false if @duplicate.nil? + return false if @failed.nil? + return false if @in_progress.nil? + return false if @pending.nil? + return false if @published.nil? + return false if @publishing.nil? + true + end + + # Custom attribute writer method with validation + # @param canceled [Object] Object to be assigned + # @!visibility private + def canceled=(canceled) + if canceled.nil? + fail ArgumentError, 'invalid value for "canceled", canceled cannot be nil.' + end + @canceled = canceled + end + + # Custom attribute writer method with validation + # @param completed [Object] Object to be assigned + # @!visibility private + def completed=(completed) + if completed.nil? + fail ArgumentError, 'invalid value for "completed", completed cannot be nil.' + end + @completed = completed + end + + # Custom attribute writer method with validation + # @param duplicate [Object] Object to be assigned + # @!visibility private + def duplicate=(duplicate) + if duplicate.nil? + fail ArgumentError, 'invalid value for "duplicate", duplicate cannot be nil.' + end + @duplicate = duplicate + end + + # Custom attribute writer method with validation + # @param failed [Object] Object to be assigned + # @!visibility private + def failed=(failed) + if failed.nil? + fail ArgumentError, 'invalid value for "failed", failed cannot be nil.' + end + @failed = failed + end + + # Custom attribute writer method with validation + # @param in_progress [Object] Object to be assigned + # @!visibility private + def in_progress=(in_progress) + if in_progress.nil? + fail ArgumentError, 'invalid value for "in_progress", in_progress cannot be nil.' + end + @in_progress = in_progress + end + + # Custom attribute writer method with validation + # @param pending [Object] Object to be assigned + # @!visibility private + def pending=(pending) + if pending.nil? + fail ArgumentError, 'invalid value for "pending", pending cannot be nil.' + end + @pending = pending + end + + # Custom attribute writer method with validation + # @param published [Object] Object to be assigned + # @!visibility private + def published=(published) + if published.nil? + fail ArgumentError, 'invalid value for "published", published cannot be nil.' + end + @published = published + end + + # Custom attribute writer method with validation + # @param publishing [Object] Object to be assigned + # @!visibility private + def publishing=(publishing) + if publishing.nil? + fail ArgumentError, 'invalid value for "publishing", publishing cannot be nil.' + end + @publishing = publishing + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + canceled == o.canceled && + completed == o.completed && + duplicate == o.duplicate && + failed == o.failed && + in_progress == o.in_progress && + pending == o.pending && + published == o.published && + publishing == o.publishing && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [canceled, completed, duplicate, failed, in_progress, pending, published, publishing, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_type.rb new file mode 100644 index 000000000000..9932c59e5148 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a batch migration resource. + class SecurityMonitoringBatchMigrationResourceType + include BaseEnumModel + + BATCH_MIGRATION_RESOURCE = "batchMigrationResource".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_attributes.rb new file mode 100644 index 000000000000..d6105d9714de --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_attributes.rb @@ -0,0 +1,162 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the batch migration resource to update. At least one attribute is required. + class SecurityMonitoringBatchMigrationResourceUpdateAttributes + include BaseGenericModel + + # The description of the resource. + attr_reader :description + + # The source query or natural language description to translate. Must not be blank. + attr_reader :input + + # The type of the source rule: `spl` for a Splunk SPL search or saved search definition, + # `natural_language` for a plain-English description of the behavior to detect, or `kql` + # for a Microsoft KQL query. SPL inputs must be self-contained, with search macros expanded. + attr_accessor :input_type + + # The name of the resource. + attr_reader :name + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'input' => :'input', + :'input_type' => :'inputType', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'input' => :'String', + :'input_type' => :'SecurityMonitoringBatchMigrationResourceInputType', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceUpdateAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceUpdateAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'input_type') + self.input_type = attributes[:'input_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@description.nil? && @description.to_s.length > 4096 + return false if !@input.nil? && @input.to_s.length > 65536 + return false if !@input.nil? && @input.to_s.length < 1 + pattern = Regexp.new(/^[\s\S]*\S[\s\S]*$/) + return false if !@input.nil? && @input !~ pattern + return false if !@name.nil? && @name.to_s.length > 512 + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if !description.nil? && description.to_s.length > 4096 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4096.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param input [Object] Object to be assigned + # @!visibility private + def input=(input) + if !input.nil? && input.to_s.length > 65536 + fail ArgumentError, 'invalid value for "input", the character length must be smaller than or equal to 65536.' + end + if !input.nil? && input.to_s.length < 1 + fail ArgumentError, 'invalid value for "input", the character length must be great than or equal to 1.' + end + pattern = Regexp.new(/^[\s\S]*\S[\s\S]*$/) + if !input.nil? && input !~ pattern + fail ArgumentError, "invalid value for \"input\", must conform to the pattern #{pattern}." + end + @input = input + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 512 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 512.' + end + @name = name + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + input == o.input && + input_type == o.input_type && + name == o.name + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, input, input_type, name].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_data.rb new file mode 100644 index 000000000000..7751c7de646f --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the batch migration resource to update. + class SecurityMonitoringBatchMigrationResourceUpdateData + include BaseGenericModel + + # Attributes of the batch migration resource to update. At least one attribute is required. + attr_reader :attributes + + # The type of resource for a batch migration resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationResourceUpdateAttributes', + :'type' => :'SecurityMonitoringBatchMigrationResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_request.rb new file mode 100644 index 000000000000..50bb7f7f3734 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resource_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update a batch migration resource. + class SecurityMonitoringBatchMigrationResourceUpdateRequest + include BaseGenericModel + + # Data of the batch migration resource to update. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationResourceUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourceUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_attributes.rb new file mode 100644 index 000000000000..76e7bbf15925 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_attributes.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the resources to add to a batch migration. + class SecurityMonitoringBatchMigrationResourcesCreateAttributes + include BaseGenericModel + + # The resources to add. From 1 to 1000 resources. + attr_reader :resources + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'resources' => :'resources' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'resources' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'resources') + if (value = attributes[:'resources']).is_a?(Array) + self.resources = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @resources.nil? + return false if @resources.length > 1000 + return false if @resources.length < 1 + true + end + + # Custom attribute writer method with validation + # @param resources [Object] Object to be assigned + # @!visibility private + def resources=(resources) + if resources.nil? + fail ArgumentError, 'invalid value for "resources", resources cannot be nil.' + end + if resources.length > 1000 + fail ArgumentError, 'invalid value for "resources", number of items must be less than or equal to 1000.' + end + if resources.length < 1 + fail ArgumentError, 'invalid value for "resources", number of items must be greater than or equal to 1.' + end + @resources = resources + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + resources == o.resources && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [resources, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_data.rb new file mode 100644 index 000000000000..e5f2f55a0eeb --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the resources to add to a batch migration. + class SecurityMonitoringBatchMigrationResourcesCreateData + include BaseGenericModel + + # Attributes of the resources to add to a batch migration. + attr_reader :attributes + + # The type of resource for a request on a set of batch migration resources. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationResourcesCreateAttributes', + :'type' => :'SecurityMonitoringBatchMigrationResourcesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_request.rb new file mode 100644 index 000000000000..0803cfd630b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to add resources to a batch migration. + class SecurityMonitoringBatchMigrationResourcesCreateRequest + include BaseGenericModel + + # Data of the resources to add to a batch migration. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationResourcesCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_response.rb new file mode 100644 index 000000000000..1684a844bc61 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_create_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the batch migration resources that were added. + class SecurityMonitoringBatchMigrationResourcesCreateResponse + include BaseGenericModel + + # The added batch migration resources. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesCreateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_attributes.rb new file mode 100644 index 000000000000..8a9a8ae041e8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_attributes.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the resources to delete from a batch migration. + class SecurityMonitoringBatchMigrationResourcesDeleteAttributes + include BaseGenericModel + + # Unique UUIDs of batch migration resources. From 1 to 1000 IDs. + attr_reader :resource_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'resource_ids' => :'resourceIds' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'resource_ids' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesDeleteAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'resource_ids') + if (value = attributes[:'resource_ids']).is_a?(Array) + self.resource_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @resource_ids.nil? + return false if @resource_ids.length > 1000 + return false if @resource_ids.length < 1 + true + end + + # Custom attribute writer method with validation + # @param resource_ids [Object] Object to be assigned + # @!visibility private + def resource_ids=(resource_ids) + if resource_ids.nil? + fail ArgumentError, 'invalid value for "resource_ids", resource_ids cannot be nil.' + end + if resource_ids.length > 1000 + fail ArgumentError, 'invalid value for "resource_ids", number of items must be less than or equal to 1000.' + end + if resource_ids.length < 1 + fail ArgumentError, 'invalid value for "resource_ids", number of items must be greater than or equal to 1.' + end + @resource_ids = resource_ids + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + resource_ids == o.resource_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [resource_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_data.rb new file mode 100644 index 000000000000..17ce8a4d2bc5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the resources to delete from a batch migration. + class SecurityMonitoringBatchMigrationResourcesDeleteData + include BaseGenericModel + + # Attributes of the resources to delete from a batch migration. + attr_reader :attributes + + # The type of resource for a request on a set of batch migration resources. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationResourcesDeleteAttributes', + :'type' => :'SecurityMonitoringBatchMigrationResourcesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesDeleteData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_request.rb new file mode 100644 index 000000000000..5963d6f03108 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_delete_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to delete resources from a batch migration. + class SecurityMonitoringBatchMigrationResourcesDeleteRequest + include BaseGenericModel + + # Data of the resources to delete from a batch migration. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationResourcesDeleteData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesDeleteRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_list_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_list_response.rb new file mode 100644 index 000000000000..d11d16060185 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_list_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing batch migration resources. + class SecurityMonitoringBatchMigrationResourcesListResponse + include BaseGenericModel + + # The batch migration resources. + attr_reader :data + + # Metadata of a list response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'SecurityMonitoringBatchMigrationListMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResourcesListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_type.rb new file mode 100644 index 000000000000..9244e345937a --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_resources_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a request on a set of batch migration resources. + class SecurityMonitoringBatchMigrationResourcesType + include BaseEnumModel + + BATCH_MIGRATION_RESOURCES = "batchMigrationResources".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_response.rb new file mode 100644 index 000000000000..52ff9694f0eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a batch migration. + class SecurityMonitoringBatchMigrationResponse + include BaseGenericModel + + # A batch migration. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_status.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_status.rb new file mode 100644 index 000000000000..e54410b82e92 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_status.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The status of a batch migration. A batch migration is created as `draft` and moves to + # `in_progress` when started. It moves to `completed` once no resource is `pending` or + # `in_progress`, or to `canceled` when canceled. + class SecurityMonitoringBatchMigrationStatus + include BaseEnumModel + + DRAFT = "draft".freeze + IN_PROGRESS = "in_progress".freeze + CANCELED = "canceled".freeze + COMPLETED = "completed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_type.rb new file mode 100644 index 000000000000..493ed5461e04 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a batch migration. + class SecurityMonitoringBatchMigrationType + include BaseEnumModel + + BATCH_MIGRATION = "batchMigration".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_attributes.rb new file mode 100644 index 000000000000..bd930cd19b8e --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_attributes.rb @@ -0,0 +1,142 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the batch migration to update. At least one attribute is required. + class SecurityMonitoringBatchMigrationUpdateAttributes + include BaseGenericModel + + # The description of the batch migration. + attr_reader :description + + # The name of the batch migration. + attr_reader :name + + # Tags of the batch migration. Up to 50 tags, each up to 256 characters. + attr_reader :tags + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationUpdateAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationUpdateAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@description.nil? && @description.to_s.length > 4096 + return false if !@name.nil? && @name.to_s.length > 512 + return false if !@tags.nil? && @tags.length > 50 + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if !description.nil? && description.to_s.length > 4096 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4096.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 512 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 512.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if !tags.nil? && tags.length > 50 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 50.' + end + @tags = tags + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + tags == o.tags + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, tags].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_data.rb new file mode 100644 index 000000000000..25599e9d7f33 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the batch migration to update. + class SecurityMonitoringBatchMigrationUpdateData + include BaseGenericModel + + # Attributes of the batch migration to update. At least one attribute is required. + attr_reader :attributes + + # The type of resource for a batch migration. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringBatchMigrationUpdateAttributes', + :'type' => :'SecurityMonitoringBatchMigrationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_request.rb new file mode 100644 index 000000000000..cf866d0da53d --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migration_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update a batch migration. + class SecurityMonitoringBatchMigrationUpdateRequest + include BaseGenericModel + + # Data of the batch migration to update. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringBatchMigrationUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_batch_migrations_list_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_batch_migrations_list_response.rb new file mode 100644 index 000000000000..85f6ee8edd71 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_batch_migrations_list_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a page of batch migrations. + class SecurityMonitoringBatchMigrationsListResponse + include BaseGenericModel + + # The batch migrations. + attr_reader :data + + # Metadata of a list response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'SecurityMonitoringBatchMigrationListMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringBatchMigrationsListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end