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.ts b/examples/v2/security-monitoring/CancelSecurityMonitoringBatchMigration.ts new file mode 100644 index 000000000000..ad1e014dae98 --- /dev/null +++ b/examples/v2/security-monitoring/CancelSecurityMonitoringBatchMigration.ts @@ -0,0 +1,30 @@ +/** + * Cancel a batch migration returns "Accepted" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.cancelSecurityMonitoringBatchMigration"] = + true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +const params: v2.SecurityMonitoringApiCancelSecurityMonitoringBatchMigrationRequest = + { + batchId: "7cdb3a75-64fb-46ce-9445-41969e78fe8e", + }; + +apiInstance + .cancelSecurityMonitoringBatchMigration(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigration.ts b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigration.ts new file mode 100644 index 000000000000..589385631434 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigration.ts @@ -0,0 +1,48 @@ +/** + * Create a batch migration returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.createSecurityMonitoringBatchMigration"] = + true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +const params: v2.SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationRequest = + { + body: { + data: { + type: "batchMigration", + attributes: { + name: "Example-Security-Monitoring", + 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", + }, + ], + }, + }, + }, + }; + +apiInstance + .createSecurityMonitoringBatchMigration(params) + .then((data: v2.SecurityMonitoringBatchMigrationResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigrationResources.ts b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigrationResources.ts new file mode 100644 index 000000000000..4ca473bb3a83 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringBatchMigrationResources.ts @@ -0,0 +1,48 @@ +/** + * Add resources to a batch migration returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations[ + "v2.createSecurityMonitoringBatchMigrationResources" +] = true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "batch_migration" in the system +const BATCH_MIGRATION_DATA_ID = process.env.BATCH_MIGRATION_DATA_ID as string; + +const params: v2.SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationResourcesRequest = + { + body: { + data: { + type: "batchMigrationResources", + attributes: { + resources: [ + { + name: "Linux sudo abuse", + inputType: "spl", + input: `index=linux process=sudo "authentication failure" | stats count by user, host`, + }, + ], + }, + }, + }, + batchId: BATCH_MIGRATION_DATA_ID, + }; + +apiInstance + .createSecurityMonitoringBatchMigrationResources(params) + .then((data: v2.SecurityMonitoringBatchMigrationResourcesCreateResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigration.ts b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigration.ts new file mode 100644 index 000000000000..1b20df0a8306 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigration.ts @@ -0,0 +1,33 @@ +/** + * Delete a batch migration returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.deleteSecurityMonitoringBatchMigration"] = + true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "batch_migration" in the system +const BATCH_MIGRATION_DATA_ID = process.env.BATCH_MIGRATION_DATA_ID as string; + +const params: v2.SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationRequest = + { + batchId: BATCH_MIGRATION_DATA_ID, + }; + +apiInstance + .deleteSecurityMonitoringBatchMigration(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigrationResources.ts b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigrationResources.ts new file mode 100644 index 000000000000..e24a4ad0ccba --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityMonitoringBatchMigrationResources.ts @@ -0,0 +1,46 @@ +/** + * Delete resources from a batch migration returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations[ + "v2.deleteSecurityMonitoringBatchMigrationResources" +] = true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "batch_migration" in the system +const BATCH_MIGRATION_DATA_ID = process.env.BATCH_MIGRATION_DATA_ID as string; + +// there is a valid "batch_migration_resource" in the system +const BATCH_MIGRATION_RESOURCE_ID = process.env + .BATCH_MIGRATION_RESOURCE_ID as string; + +const params: v2.SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationResourcesRequest = + { + body: { + data: { + type: "batchMigrationResources", + attributes: { + resourceIds: [BATCH_MIGRATION_RESOURCE_ID], + }, + }, + }, + batchId: BATCH_MIGRATION_DATA_ID, + }; + +apiInstance + .deleteSecurityMonitoringBatchMigrationResources(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrationResources.ts b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrationResources.ts new file mode 100644 index 000000000000..6ac68ccf6460 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrationResources.ts @@ -0,0 +1,34 @@ +/** + * List batch migration resources returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations[ + "v2.listSecurityMonitoringBatchMigrationResources" +] = true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "batch_migration" in the system +const BATCH_MIGRATION_DATA_ID = process.env.BATCH_MIGRATION_DATA_ID as string; + +const params: v2.SecurityMonitoringApiListSecurityMonitoringBatchMigrationResourcesRequest = + { + batchId: BATCH_MIGRATION_DATA_ID, + }; + +apiInstance + .listSecurityMonitoringBatchMigrationResources(params) + .then((data: v2.SecurityMonitoringBatchMigrationResourcesListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrations.ts b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrations.ts new file mode 100644 index 000000000000..220f4b50c241 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringBatchMigrations.ts @@ -0,0 +1,32 @@ +/** + * List batch migrations returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listSecurityMonitoringBatchMigrations"] = + true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "batch_migration" in the system + +const params: v2.SecurityMonitoringApiListSecurityMonitoringBatchMigrationsRequest = + { + filterQuery: "id:7cdb3a75-64fb-46ce-9445-41969e78fe8e", + }; + +apiInstance + .listSecurityMonitoringBatchMigrations(params) + .then((data: v2.SecurityMonitoringBatchMigrationsListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/PublishSecurityMonitoringBatchMigration.ts b/examples/v2/security-monitoring/PublishSecurityMonitoringBatchMigration.ts new file mode 100644 index 000000000000..06b2f15195a0 --- /dev/null +++ b/examples/v2/security-monitoring/PublishSecurityMonitoringBatchMigration.ts @@ -0,0 +1,38 @@ +/** + * Publish a batch migration returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.publishSecurityMonitoringBatchMigration"] = + true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +const params: v2.SecurityMonitoringApiPublishSecurityMonitoringBatchMigrationRequest = + { + body: { + data: { + attributes: { + resourceIds: ["c968cf83-56c2-4d54-a993-6c86dfb83527"], + }, + type: "batchMigrationPublish", + }, + }, + batchId: "7cdb3a75-64fb-46ce-9445-41969e78fe8e", + }; + +apiInstance + .publishSecurityMonitoringBatchMigration(params) + .then((data: v2.SecurityMonitoringBatchMigrationPublishResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/StartSecurityMonitoringBatchMigration.ts b/examples/v2/security-monitoring/StartSecurityMonitoringBatchMigration.ts new file mode 100644 index 000000000000..332bf9a51a24 --- /dev/null +++ b/examples/v2/security-monitoring/StartSecurityMonitoringBatchMigration.ts @@ -0,0 +1,30 @@ +/** + * Start a batch migration returns "Accepted" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.startSecurityMonitoringBatchMigration"] = + true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +const params: v2.SecurityMonitoringApiStartSecurityMonitoringBatchMigrationRequest = + { + batchId: "7cdb3a75-64fb-46ce-9445-41969e78fe8e", + }; + +apiInstance + .startSecurityMonitoringBatchMigration(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigration.ts b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigration.ts new file mode 100644 index 000000000000..e4ba8bdaacbd --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigration.ts @@ -0,0 +1,42 @@ +/** + * Update a batch migration returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.updateSecurityMonitoringBatchMigration"] = + true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "batch_migration" in the system +const BATCH_MIGRATION_DATA_ID = process.env.BATCH_MIGRATION_DATA_ID as string; + +const params: v2.SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationRequest = + { + body: { + data: { + type: "batchMigration", + attributes: { + name: "Example-Security-Monitoring-updated", + tags: ["source:splunk", "team:secops"], + }, + }, + }, + batchId: BATCH_MIGRATION_DATA_ID, + }; + +apiInstance + .updateSecurityMonitoringBatchMigration(params) + .then((data: v2.SecurityMonitoringBatchMigrationResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigrationResource.ts b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigrationResource.ts new file mode 100644 index 000000000000..bb6e7534afe4 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringBatchMigrationResource.ts @@ -0,0 +1,47 @@ +/** + * Update a batch migration resource returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations[ + "v2.updateSecurityMonitoringBatchMigrationResource" +] = true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "batch_migration" in the system +const BATCH_MIGRATION_DATA_ID = process.env.BATCH_MIGRATION_DATA_ID as string; + +// there is a valid "batch_migration_resource" in the system +const BATCH_MIGRATION_RESOURCE_ID = process.env + .BATCH_MIGRATION_RESOURCE_ID as string; + +const params: v2.SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationResourceRequest = + { + body: { + data: { + type: "batchMigrationResource", + attributes: { + input: "index=wineventlog EventCode=4625 | stats count by user", + }, + }, + }, + batchId: BATCH_MIGRATION_DATA_ID, + resourceId: BATCH_MIGRATION_RESOURCE_ID, + }; + +apiInstance + .updateSecurityMonitoringBatchMigrationResource(params) + .then((data: v2.SecurityMonitoringBatchMigrationResourceResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/generated-test/test-runner-data/manifest.json b/features/generated-test/test-runner-data/manifest.json index 244ba23525d1..0006b5cc1b97 100644 --- a/features/generated-test/test-runner-data/manifest.json +++ b/features/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": "../../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": "../../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": "../../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": "../../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": "../../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": "../../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": "../../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": "../../v2/security_monitoring.feature", @@ -10710,6 +10738,20 @@ "scenario": "List assets SBOMs returns \"OK\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../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": "../../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": "../../v2/security_monitoring.feature", @@ -11032,6 +11074,20 @@ "scenario": "Unmute security findings returns \"Unprocessable Entity\" response", "version": "v2" }, + { + "feature": "Security Monitoring", + "feature_file": "../../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": "../../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": "../../v2/security_monitoring.feature", diff --git a/features/generated-test/test-runner-data/v2/security-monitoring/add-resources-to-a-batch-migration-returns-created-response.json b/features/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/features/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/features/generated-test/test-runner-data/v2/security-monitoring/create-a-batch-migration-returns-created-response.json b/features/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/features/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/features/generated-test/test-runner-data/v2/security-monitoring/delete-a-batch-migration-returns-no-content-response.json b/features/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/features/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/features/generated-test/test-runner-data/v2/security-monitoring/delete-resources-from-a-batch-migration-returns-no-content-response.json b/features/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/features/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/features/generated-test/test-runner-data/v2/security-monitoring/list-batch-migration-resources-returns-ok-response.json b/features/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/features/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/features/generated-test/test-runner-data/v2/security-monitoring/list-batch-migrations-returns-ok-response.json b/features/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/features/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/features/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-resource-returns-ok-response.json b/features/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/features/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/features/generated-test/test-runner-data/v2/security-monitoring/update-a-batch-migration-returns-ok-response.json b/features/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/features/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/features/generated-test/test-server-data/v2/security-monitoring.json b/features/generated-test/test-server-data/v2/security-monitoring.json index 43e65f4bef5a..a1d8f896f0ce 100644 --- a/features/generated-test/test-server-data/v2/security-monitoring.json +++ b/features/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/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index bdb8640d989e..835c1cee0bd6 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -6963,6 +6963,127 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "ListVulnerableAssetsResponse", }, + "v2.ListSecurityMonitoringBatchMigrations": { + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "filterQuery": { + "type": "string", + "format": "", + }, + "operationResponseType": "SecurityMonitoringBatchMigrationsListResponse", + }, + "v2.CreateSecurityMonitoringBatchMigration": { + "body": { + "type": "SecurityMonitoringBatchMigrationCreateRequest", + "format": "", + }, + "operationResponseType": "SecurityMonitoringBatchMigrationResponse", + }, + "v2.DeleteSecurityMonitoringBatchMigration": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "{}", + }, + "v2.UpdateSecurityMonitoringBatchMigration": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "body": { + "type": "SecurityMonitoringBatchMigrationUpdateRequest", + "format": "", + }, + "operationResponseType": "SecurityMonitoringBatchMigrationResponse", + }, + "v2.CancelSecurityMonitoringBatchMigration": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "{}", + }, + "v2.PublishSecurityMonitoringBatchMigration": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "body": { + "type": "SecurityMonitoringBatchMigrationPublishRequest", + "format": "", + }, + "operationResponseType": "SecurityMonitoringBatchMigrationPublishResponse", + }, + "v2.ListSecurityMonitoringBatchMigrationResources": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "filterQuery": { + "type": "string", + "format": "", + }, + "operationResponseType": "SecurityMonitoringBatchMigrationResourcesListResponse", + }, + "v2.CreateSecurityMonitoringBatchMigrationResources": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "body": { + "type": "SecurityMonitoringBatchMigrationResourcesCreateRequest", + "format": "", + }, + "operationResponseType": "SecurityMonitoringBatchMigrationResourcesCreateResponse", + }, + "v2.DeleteSecurityMonitoringBatchMigrationResources": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "body": { + "type": "SecurityMonitoringBatchMigrationResourcesDeleteRequest", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.UpdateSecurityMonitoringBatchMigrationResource": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "resourceId": { + "type": "string", + "format": "uuid", + }, + "body": { + "type": "SecurityMonitoringBatchMigrationResourceUpdateRequest", + "format": "", + }, + "operationResponseType": "SecurityMonitoringBatchMigrationResourceResponse", + }, + "v2.StartSecurityMonitoringBatchMigration": { + "batchId": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "{}", + }, "v2.ListSecurityMonitoringCriticalAssets": { "operationResponseType": "SecurityMonitoringCriticalAssetsResponse", }, 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/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 4106cba489f9..43280c09c711 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -351,6 +351,7 @@ export function createConfiguration( "v2.bulkCreateSampleLogGenerationSubscriptions": false, "v2.bulkExportSecurityMonitoringTerraformResources": false, "v2.cancelHistoricalJob": false, + "v2.cancelSecurityMonitoringBatchMigration": false, "v2.convertJobResultToSignal": false, "v2.convertSecurityMonitoringTerraformResource": false, "v2.createIoCTriageState": false, @@ -360,6 +361,8 @@ export function createConfiguration( "v2.createSecurityFindingsAutomationMuteRule": false, "v2.createSecurityFindingsAutomationSeverityModifierRule": false, "v2.createSecurityFindingsAutomationTicketCreationRule": false, + "v2.createSecurityMonitoringBatchMigration": false, + "v2.createSecurityMonitoringBatchMigrationResources": false, "v2.createSecurityMonitoringDataset": false, "v2.createSecurityMonitoringIntegrationConfig": false, "v2.createStaticAnalysisAst": false, @@ -373,6 +376,8 @@ export function createConfiguration( "v2.deleteSecurityFindingsAutomationMuteRule": false, "v2.deleteSecurityFindingsAutomationSeverityModifierRule": false, "v2.deleteSecurityFindingsAutomationTicketCreationRule": false, + "v2.deleteSecurityMonitoringBatchMigration": false, + "v2.deleteSecurityMonitoringBatchMigrationResources": false, "v2.deleteSecurityMonitoringDataset": false, "v2.deleteSecurityMonitoringIntegrationConfig": false, "v2.disableSecurityFindingsAutomationDefaultInboxRule": false, @@ -419,12 +424,15 @@ export function createConfiguration( "v2.listSecurityFindingsAutomationMuteRules": false, "v2.listSecurityFindingsAutomationSeverityModifierRules": false, "v2.listSecurityFindingsAutomationTicketCreationRules": false, + "v2.listSecurityMonitoringBatchMigrationResources": false, + "v2.listSecurityMonitoringBatchMigrations": false, "v2.listSecurityMonitoringDatasets": false, "v2.listSecurityMonitoringHistsignals": false, "v2.listSecurityMonitoringIntegrationConfigs": false, "v2.listStaticAnalysisCodegenRulesets": false, "v2.listVulnerabilities": false, "v2.listVulnerableAssets": false, + "v2.publishSecurityMonitoringBatchMigration": false, "v2.reorderSecurityFindingsAutomationDueDateRules": false, "v2.reorderSecurityFindingsAutomationInboxRules": false, "v2.reorderSecurityFindingsAutomationMuteRules": false, @@ -433,6 +441,7 @@ export function createConfiguration( "v2.restoreSecurityMonitoringRule": false, "v2.runHistoricalJob": false, "v2.searchSecurityMonitoringHistsignals": false, + "v2.startSecurityMonitoringBatchMigration": false, "v2.updateFindingsAssignee": false, "v2.updateFindingsSeverity": false, "v2.updateSecurityFindingsAutomationDueDateRule": false, @@ -440,6 +449,8 @@ export function createConfiguration( "v2.updateSecurityFindingsAutomationMuteRule": false, "v2.updateSecurityFindingsAutomationSeverityModifierRule": false, "v2.updateSecurityFindingsAutomationTicketCreationRule": false, + "v2.updateSecurityMonitoringBatchMigration": false, + "v2.updateSecurityMonitoringBatchMigrationResource": false, "v2.updateSecurityMonitoringDataset": false, "v2.updateSecurityMonitoringIntegrationConfig": false, "v2.validateSecurityMonitoringIntegrationConfig": false, diff --git a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts index 1f770e63fdf7..ceab20255a48 100644 --- a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts @@ -126,6 +126,18 @@ import { SecurityFindingsSearchRequestData } from "../models/SecurityFindingsSea import { SecurityFindingsSearchRequestDataAttributes } from "../models/SecurityFindingsSearchRequestDataAttributes"; import { SecurityFindingsSearchRequestPage } from "../models/SecurityFindingsSearchRequestPage"; import { SecurityFindingsSort } from "../models/SecurityFindingsSort"; +import { SecurityMonitoringBatchMigrationCreateRequest } from "../models/SecurityMonitoringBatchMigrationCreateRequest"; +import { SecurityMonitoringBatchMigrationPublishRequest } from "../models/SecurityMonitoringBatchMigrationPublishRequest"; +import { SecurityMonitoringBatchMigrationPublishResponse } from "../models/SecurityMonitoringBatchMigrationPublishResponse"; +import { SecurityMonitoringBatchMigrationResourceResponse } from "../models/SecurityMonitoringBatchMigrationResourceResponse"; +import { SecurityMonitoringBatchMigrationResourcesCreateRequest } from "../models/SecurityMonitoringBatchMigrationResourcesCreateRequest"; +import { SecurityMonitoringBatchMigrationResourcesCreateResponse } from "../models/SecurityMonitoringBatchMigrationResourcesCreateResponse"; +import { SecurityMonitoringBatchMigrationResourcesDeleteRequest } from "../models/SecurityMonitoringBatchMigrationResourcesDeleteRequest"; +import { SecurityMonitoringBatchMigrationResourcesListResponse } from "../models/SecurityMonitoringBatchMigrationResourcesListResponse"; +import { SecurityMonitoringBatchMigrationResourceUpdateRequest } from "../models/SecurityMonitoringBatchMigrationResourceUpdateRequest"; +import { SecurityMonitoringBatchMigrationResponse } from "../models/SecurityMonitoringBatchMigrationResponse"; +import { SecurityMonitoringBatchMigrationsListResponse } from "../models/SecurityMonitoringBatchMigrationsListResponse"; +import { SecurityMonitoringBatchMigrationUpdateRequest } from "../models/SecurityMonitoringBatchMigrationUpdateRequest"; import { SecurityMonitoringContentPackStatesResponse } from "../models/SecurityMonitoringContentPackStatesResponse"; import { SecurityMonitoringCriticalAssetCreateRequest } from "../models/SecurityMonitoringCriticalAssetCreateRequest"; import { SecurityMonitoringCriticalAssetResponse } from "../models/SecurityMonitoringCriticalAssetResponse"; @@ -1110,6 +1122,62 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async cancelSecurityMonitoringBatchMigration( + batchId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'cancelSecurityMonitoringBatchMigration'" + ); + if ( + !_config.unstableOperations["v2.cancelSecurityMonitoringBatchMigration"] + ) { + throw new Error( + "Unstable operation 'cancelSecurityMonitoringBatchMigration' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "cancelSecurityMonitoringBatchMigration" + ); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/batch-migrations/{batch_id}/cancel".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) + ); + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.cancelSecurityMonitoringBatchMigration" + ) + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async convertExistingSecurityMonitoringRule( ruleId: string, _options?: Configuration @@ -2026,6 +2094,152 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createSecurityMonitoringBatchMigration( + body: SecurityMonitoringBatchMigrationCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'createSecurityMonitoringBatchMigration'" + ); + if ( + !_config.unstableOperations["v2.createSecurityMonitoringBatchMigration"] + ) { + throw new Error( + "Unstable operation 'createSecurityMonitoringBatchMigration' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createSecurityMonitoringBatchMigration"); + } + + // Path Params + const localVarPath = "/api/v2/security_monitoring/batch-migrations"; + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.createSecurityMonitoringBatchMigration" + ) + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "SecurityMonitoringBatchMigrationCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async createSecurityMonitoringBatchMigrationResources( + batchId: string, + body: SecurityMonitoringBatchMigrationResourcesCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'createSecurityMonitoringBatchMigrationResources'" + ); + if ( + !_config.unstableOperations[ + "v2.createSecurityMonitoringBatchMigrationResources" + ] + ) { + throw new Error( + "Unstable operation 'createSecurityMonitoringBatchMigrationResources' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "createSecurityMonitoringBatchMigrationResources" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + "body", + "createSecurityMonitoringBatchMigrationResources" + ); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) + ); + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.createSecurityMonitoringBatchMigrationResources" + ) + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "SecurityMonitoringBatchMigrationResourcesCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async createSecurityMonitoringCriticalAsset( body: SecurityMonitoringCriticalAssetCreateRequest, _options?: Configuration @@ -3132,31 +3346,42 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } - public async deleteSecurityMonitoringCriticalAsset( - criticalAssetId: string, + public async deleteSecurityMonitoringBatchMigration( + batchId: string, _options?: Configuration ): Promise { const _config = _options || this.configuration; - // verify required parameter 'criticalAssetId' is not null or undefined - if (criticalAssetId === null || criticalAssetId === undefined) { + logger.warn( + "Using unstable operation 'deleteSecurityMonitoringBatchMigration'" + ); + if ( + !_config.unstableOperations["v2.deleteSecurityMonitoringBatchMigration"] + ) { + throw new Error( + "Unstable operation 'deleteSecurityMonitoringBatchMigration' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { throw new RequiredError( - "criticalAssetId", - "deleteSecurityMonitoringCriticalAsset" + "batchId", + "deleteSecurityMonitoringBatchMigration" ); } // Path Params const localVarPath = - "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}".replace( - "{critical_asset_id}", - encodeURIComponent(String(criticalAssetId)) + "/api/v2/security_monitoring/batch-migrations/{batch_id}".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) ); // Make Request Context const requestContext = _config .getServer( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringCriticalAsset" + "v2.SecurityMonitoringApi.deleteSecurityMonitoringBatchMigration" ) .makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); @@ -3177,34 +3402,54 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } - public async deleteSecurityMonitoringDataset( - datasetId: string, + public async deleteSecurityMonitoringBatchMigrationResources( + batchId: string, + body: SecurityMonitoringBatchMigrationResourcesDeleteRequest, _options?: Configuration ): Promise { const _config = _options || this.configuration; - logger.warn("Using unstable operation 'deleteSecurityMonitoringDataset'"); - if (!_config.unstableOperations["v2.deleteSecurityMonitoringDataset"]) { + logger.warn( + "Using unstable operation 'deleteSecurityMonitoringBatchMigrationResources'" + ); + if ( + !_config.unstableOperations[ + "v2.deleteSecurityMonitoringBatchMigrationResources" + ] + ) { throw new Error( - "Unstable operation 'deleteSecurityMonitoringDataset' is disabled" + "Unstable operation 'deleteSecurityMonitoringBatchMigrationResources' is disabled" ); } - // verify required parameter 'datasetId' is not null or undefined - if (datasetId === null || datasetId === undefined) { - throw new RequiredError("datasetId", "deleteSecurityMonitoringDataset"); + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "deleteSecurityMonitoringBatchMigrationResources" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + "body", + "deleteSecurityMonitoringBatchMigrationResources" + ); } // Path Params const localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}".replace( - "{dataset_id}", - encodeURIComponent(String(datasetId)) + "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) ); // Make Request Context const requestContext = _config - .getServer("v2.SecurityMonitoringApi.deleteSecurityMonitoringDataset") + .getServer( + "v2.SecurityMonitoringApi.deleteSecurityMonitoringBatchMigrationResources" + ) .makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "*/*"); requestContext.setHttpConfig(_config.httpConfig); @@ -3214,6 +3459,21 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); } + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "SecurityMonitoringBatchMigrationResourcesDeleteRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + // Apply auth methods applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", @@ -3224,38 +3484,130 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } - public async deleteSecurityMonitoringIntegrationConfig( - integrationConfigId: string, + public async deleteSecurityMonitoringCriticalAsset( + criticalAssetId: string, _options?: Configuration ): Promise { const _config = _options || this.configuration; - logger.warn( - "Using unstable operation 'deleteSecurityMonitoringIntegrationConfig'" - ); - if ( - !_config.unstableOperations[ - "v2.deleteSecurityMonitoringIntegrationConfig" - ] - ) { - throw new Error( - "Unstable operation 'deleteSecurityMonitoringIntegrationConfig' is disabled" - ); - } - - // verify required parameter 'integrationConfigId' is not null or undefined - if (integrationConfigId === null || integrationConfigId === undefined) { + // verify required parameter 'criticalAssetId' is not null or undefined + if (criticalAssetId === null || criticalAssetId === undefined) { throw new RequiredError( - "integrationConfigId", - "deleteSecurityMonitoringIntegrationConfig" + "criticalAssetId", + "deleteSecurityMonitoringCriticalAsset" ); } // Path Params const localVarPath = - "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}".replace( - "{integration_config_id}", - encodeURIComponent(String(integrationConfigId)) + "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}".replace( + "{critical_asset_id}", + encodeURIComponent(String(criticalAssetId)) + ); + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.deleteSecurityMonitoringCriticalAsset" + ) + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async deleteSecurityMonitoringDataset( + datasetId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteSecurityMonitoringDataset'"); + if (!_config.unstableOperations["v2.deleteSecurityMonitoringDataset"]) { + throw new Error( + "Unstable operation 'deleteSecurityMonitoringDataset' is disabled" + ); + } + + // verify required parameter 'datasetId' is not null or undefined + if (datasetId === null || datasetId === undefined) { + throw new RequiredError("datasetId", "deleteSecurityMonitoringDataset"); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/datasets/{dataset_id}".replace( + "{dataset_id}", + encodeURIComponent(String(datasetId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SecurityMonitoringApi.deleteSecurityMonitoringDataset") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async deleteSecurityMonitoringIntegrationConfig( + integrationConfigId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'deleteSecurityMonitoringIntegrationConfig'" + ); + if ( + !_config.unstableOperations[ + "v2.deleteSecurityMonitoringIntegrationConfig" + ] + ) { + throw new Error( + "Unstable operation 'deleteSecurityMonitoringIntegrationConfig' is disabled" + ); + } + + // verify required parameter 'integrationConfigId' is not null or undefined + if (integrationConfigId === null || integrationConfigId === undefined) { + throw new RequiredError( + "integrationConfigId", + "deleteSecurityMonitoringIntegrationConfig" + ); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}".replace( + "{integration_config_id}", + encodeURIComponent(String(integrationConfigId)) ); // Make Request Context @@ -7585,6 +7937,159 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listSecurityMonitoringBatchMigrationResources( + batchId: string, + pageSize?: number, + pageNumber?: number, + filterQuery?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'listSecurityMonitoringBatchMigrationResources'" + ); + if ( + !_config.unstableOperations[ + "v2.listSecurityMonitoringBatchMigrationResources" + ] + ) { + throw new Error( + "Unstable operation 'listSecurityMonitoringBatchMigrationResources' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "listSecurityMonitoringBatchMigrationResources" + ); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) + ); + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.listSecurityMonitoringBatchMigrationResources" + ) + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (filterQuery !== undefined) { + requestContext.setQueryParam( + "filter[query]", + ObjectSerializer.serialize(filterQuery, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async listSecurityMonitoringBatchMigrations( + pageSize?: number, + pageNumber?: number, + filterQuery?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'listSecurityMonitoringBatchMigrations'" + ); + if ( + !_config.unstableOperations["v2.listSecurityMonitoringBatchMigrations"] + ) { + throw new Error( + "Unstable operation 'listSecurityMonitoringBatchMigrations' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/security_monitoring/batch-migrations"; + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.listSecurityMonitoringBatchMigrations" + ) + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (filterQuery !== undefined) { + requestContext.setQueryParam( + "filter[query]", + ObjectSerializer.serialize(filterQuery, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async listSecurityMonitoringCriticalAssets( _options?: Configuration ): Promise { @@ -8859,22 +9364,29 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } - public async reorderSecurityFindingsAutomationDueDateRules( - body: DueDateRuleReorderRequest, + public async publishSecurityMonitoringBatchMigration( + batchId: string, + body: SecurityMonitoringBatchMigrationPublishRequest, _options?: Configuration ): Promise { const _config = _options || this.configuration; logger.warn( - "Using unstable operation 'reorderSecurityFindingsAutomationDueDateRules'" + "Using unstable operation 'publishSecurityMonitoringBatchMigration'" ); if ( - !_config.unstableOperations[ - "v2.reorderSecurityFindingsAutomationDueDateRules" - ] + !_config.unstableOperations["v2.publishSecurityMonitoringBatchMigration"] ) { throw new Error( - "Unstable operation 'reorderSecurityFindingsAutomationDueDateRules' is disabled" + "Unstable operation 'publishSecurityMonitoringBatchMigration' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "publishSecurityMonitoringBatchMigration" ); } @@ -8882,18 +9394,21 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { if (body === null || body === undefined) { throw new RequiredError( "body", - "reorderSecurityFindingsAutomationDueDateRules" + "publishSecurityMonitoringBatchMigration" ); } // Path Params const localVarPath = - "/api/v2/security/findings/automation/due_date_rules/reorder"; + "/api/v2/security_monitoring/batch-migrations/{batch_id}/publish".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) + ); // Make Request Context const requestContext = _config .getServer( - "v2.SecurityMonitoringApi.reorderSecurityFindingsAutomationDueDateRules" + "v2.SecurityMonitoringApi.publishSecurityMonitoringBatchMigration" ) .makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json"); @@ -8910,8 +9425,78 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(body, "DueDateRuleReorderRequest", ""), - contentType + ObjectSerializer.serialize( + body, + "SecurityMonitoringBatchMigrationPublishRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async reorderSecurityFindingsAutomationDueDateRules( + body: DueDateRuleReorderRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'reorderSecurityFindingsAutomationDueDateRules'" + ); + if ( + !_config.unstableOperations[ + "v2.reorderSecurityFindingsAutomationDueDateRules" + ] + ) { + throw new Error( + "Unstable operation 'reorderSecurityFindingsAutomationDueDateRules' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + "body", + "reorderSecurityFindingsAutomationDueDateRules" + ); + } + + // Path Params + const localVarPath = + "/api/v2/security/findings/automation/due_date_rules/reorder"; + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.reorderSecurityFindingsAutomationDueDateRules" + ) + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "DueDateRuleReorderRequest", ""), + contentType ); requestContext.setBody(serializedBody); @@ -9499,6 +10084,62 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async startSecurityMonitoringBatchMigration( + batchId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'startSecurityMonitoringBatchMigration'" + ); + if ( + !_config.unstableOperations["v2.startSecurityMonitoringBatchMigration"] + ) { + throw new Error( + "Unstable operation 'startSecurityMonitoringBatchMigration' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "startSecurityMonitoringBatchMigration" + ); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/batch-migrations/{batch_id}/start".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) + ); + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.startSecurityMonitoringBatchMigration" + ) + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async testExistingSecurityMonitoringRule( ruleId: string, body: SecurityMonitoringRuleTestRequest, @@ -10269,6 +10910,173 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async updateSecurityMonitoringBatchMigration( + batchId: string, + body: SecurityMonitoringBatchMigrationUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'updateSecurityMonitoringBatchMigration'" + ); + if ( + !_config.unstableOperations["v2.updateSecurityMonitoringBatchMigration"] + ) { + throw new Error( + "Unstable operation 'updateSecurityMonitoringBatchMigration' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "updateSecurityMonitoringBatchMigration" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateSecurityMonitoringBatchMigration"); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/batch-migrations/{batch_id}".replace( + "{batch_id}", + encodeURIComponent(String(batchId)) + ); + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.updateSecurityMonitoringBatchMigration" + ) + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "SecurityMonitoringBatchMigrationUpdateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async updateSecurityMonitoringBatchMigrationResource( + batchId: string, + resourceId: string, + body: SecurityMonitoringBatchMigrationResourceUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'updateSecurityMonitoringBatchMigrationResource'" + ); + if ( + !_config.unstableOperations[ + "v2.updateSecurityMonitoringBatchMigrationResource" + ] + ) { + throw new Error( + "Unstable operation 'updateSecurityMonitoringBatchMigrationResource' is disabled" + ); + } + + // verify required parameter 'batchId' is not null or undefined + if (batchId === null || batchId === undefined) { + throw new RequiredError( + "batchId", + "updateSecurityMonitoringBatchMigrationResource" + ); + } + + // verify required parameter 'resourceId' is not null or undefined + if (resourceId === null || resourceId === undefined) { + throw new RequiredError( + "resourceId", + "updateSecurityMonitoringBatchMigrationResource" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + "body", + "updateSecurityMonitoringBatchMigrationResource" + ); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/batch-migrations/{batch_id}/resources/{resource_id}" + .replace("{batch_id}", encodeURIComponent(String(batchId))) + .replace("{resource_id}", encodeURIComponent(String(resourceId))); + + // Make Request Context + const requestContext = _config + .getServer( + "v2.SecurityMonitoringApi.updateSecurityMonitoringBatchMigrationResource" + ) + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "SecurityMonitoringBatchMigrationResourceUpdateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async updateSecurityMonitoringCriticalAsset( criticalAssetId: string, body: SecurityMonitoringCriticalAssetUpdateRequest, @@ -11917,18 +12725,96 @@ export class SecurityMonitoringApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to convertExistingSecurityMonitoringRule + * @params response Response returned by the server for a request to cancelSecurityMonitoringBatchMigration * @throws ApiException if the response code was not in [200, 299] */ - public async convertExistingSecurityMonitoringRule( + public async cancelSecurityMonitoringBatchMigration( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 200) { - const body: SecurityMonitoringRuleConvertResponse = - ObjectSerializer.deserialize( + if (response.httpStatusCode === 202) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to convertExistingSecurityMonitoringRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async convertExistingSecurityMonitoringRule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SecurityMonitoringRuleConvertResponse = + ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "SecurityMonitoringRuleConvertResponse" ) as SecurityMonitoringRuleConvertResponse; @@ -13006,6 +13892,182 @@ export class SecurityMonitoringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createSecurityMonitoringBatchMigration + * @throws ApiException if the response code was not in [200, 299] + */ + public async createSecurityMonitoringBatchMigration( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: SecurityMonitoringBatchMigrationResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResponse" + ) as SecurityMonitoringBatchMigrationResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringBatchMigrationResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResponse", + "" + ) as SecurityMonitoringBatchMigrationResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createSecurityMonitoringBatchMigrationResources + * @throws ApiException if the response code was not in [200, 299] + */ + public async createSecurityMonitoringBatchMigrationResources( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: SecurityMonitoringBatchMigrationResourcesCreateResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResourcesCreateResponse" + ) as SecurityMonitoringBatchMigrationResourcesCreateResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringBatchMigrationResourcesCreateResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResourcesCreateResponse", + "" + ) as SecurityMonitoringBatchMigrationResourcesCreateResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -14354,10 +15416,10 @@ export class SecurityMonitoringApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteSecurityMonitoringCriticalAsset + * @params response Response returned by the server for a request to deleteSecurityMonitoringBatchMigration * @throws ApiException if the response code was not in [200, 299] */ - public async deleteSecurityMonitoringCriticalAsset( + public async deleteSecurityMonitoringBatchMigration( response: ResponseContext ): Promise { const contentType = ObjectSerializer.normalizeMediaType( @@ -14367,31 +15429,187 @@ export class SecurityMonitoringApiResponseProcessor { return; } if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || response.httpStatusCode === 403 || response.httpStatusCode === 404 || - response.httpStatusCode === 429 + response.httpStatusCode === 409 ) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType ); - let body: APIErrorResponse; + let body: JSONAPIErrorResponse; try { body = ObjectSerializer.deserialize( bodyText, - "APIErrorResponse" - ) as APIErrorResponse; + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; } catch (error) { logger.debug(`Got error deserializing error: ${error}`); - throw new ApiException( + throw new ApiException( response.httpStatusCode, bodyText ); } - throw new ApiException(response.httpStatusCode, body); - } - - // Work around for missing responses in specification, e.g. for petstore.yaml + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteSecurityMonitoringBatchMigrationResources + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteSecurityMonitoringBatchMigrationResources( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteSecurityMonitoringCriticalAsset + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteSecurityMonitoringCriticalAsset( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { return; } @@ -19419,6 +20637,181 @@ export class SecurityMonitoringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listSecurityMonitoringBatchMigrationResources + * @throws ApiException if the response code was not in [200, 299] + */ + public async listSecurityMonitoringBatchMigrationResources( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SecurityMonitoringBatchMigrationResourcesListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResourcesListResponse" + ) as SecurityMonitoringBatchMigrationResourcesListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringBatchMigrationResourcesListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResourcesListResponse", + "" + ) as SecurityMonitoringBatchMigrationResourcesListResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listSecurityMonitoringBatchMigrations + * @throws ApiException if the response code was not in [200, 299] + */ + public async listSecurityMonitoringBatchMigrations( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SecurityMonitoringBatchMigrationsListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationsListResponse" + ) as SecurityMonitoringBatchMigrationsListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringBatchMigrationsListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationsListResponse", + "" + ) as SecurityMonitoringBatchMigrationsListResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -20380,6 +21773,95 @@ export class SecurityMonitoringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to publishSecurityMonitoringBatchMigration + * @throws ApiException if the response code was not in [200, 299] + */ + public async publishSecurityMonitoringBatchMigration( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SecurityMonitoringBatchMigrationPublishResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationPublishResponse" + ) as SecurityMonitoringBatchMigrationPublishResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringBatchMigrationPublishResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationPublishResponse", + "" + ) as SecurityMonitoringBatchMigrationPublishResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -21092,12 +22574,95 @@ export class SecurityMonitoringApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: SecurityMonitoringSignalsListResponse = + const body: SecurityMonitoringSignalsListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringSignalsListResponse", + "" + ) as SecurityMonitoringSignalsListResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to sendSecurityMonitoringNotificationPreview + * @throws ApiException if the response code was not in [200, 299] + */ + public async sendSecurityMonitoringNotificationPreview( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: NotificationRulePreviewResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "NotificationRulePreviewResponse" + ) as NotificationRulePreviewResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: NotificationRulePreviewResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringSignalsListResponse", + "NotificationRulePreviewResponse", "" - ) as SecurityMonitoringSignalsListResponse; + ) as NotificationRulePreviewResponse; return body; } @@ -21112,24 +22677,26 @@ export class SecurityMonitoringApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to sendSecurityMonitoringNotificationPreview + * @params response Response returned by the server for a request to startSecurityMonitoringBatchMigration * @throws ApiException if the response code was not in [200, 299] */ - public async sendSecurityMonitoringNotificationPreview( + public async startSecurityMonitoringBatchMigration( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 200) { - const body: NotificationRulePreviewResponse = - ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "NotificationRulePreviewResponse" - ) as NotificationRulePreviewResponse; - return body; + if (response.httpStatusCode === 202) { + return; } - if (response.httpStatusCode === 400) { + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 500 + ) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -21152,7 +22719,7 @@ export class SecurityMonitoringApiResponseProcessor { body ); } - if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + if (response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -21175,13 +22742,7 @@ export class SecurityMonitoringApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: NotificationRulePreviewResponse = - ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "NotificationRulePreviewResponse", - "" - ) as NotificationRulePreviewResponse; - return body; + return; } const body = (await response.body.text()) || ""; @@ -22089,6 +23650,183 @@ export class SecurityMonitoringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateSecurityMonitoringBatchMigration + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateSecurityMonitoringBatchMigration( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SecurityMonitoringBatchMigrationResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResponse" + ) as SecurityMonitoringBatchMigrationResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringBatchMigrationResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResponse", + "" + ) as SecurityMonitoringBatchMigrationResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateSecurityMonitoringBatchMigrationResource + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateSecurityMonitoringBatchMigrationResource( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SecurityMonitoringBatchMigrationResourceResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResourceResponse" + ) as SecurityMonitoringBatchMigrationResourceResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringBatchMigrationResourceResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringBatchMigrationResourceResponse", + "" + ) as SecurityMonitoringBatchMigrationResourceResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -22776,6 +24514,14 @@ export interface SecurityMonitoringApiCancelHistoricalJobRequest { jobId: string; } +export interface SecurityMonitoringApiCancelSecurityMonitoringBatchMigrationRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; +} + export interface SecurityMonitoringApiConvertExistingSecurityMonitoringRuleRequest { /** * The ID of the rule. @@ -22898,6 +24644,25 @@ export interface SecurityMonitoringApiCreateSecurityFindingsAutomationTicketCrea body: TicketCreationRuleCreateRequest; } +export interface SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationRequest { + /** + * @type SecurityMonitoringBatchMigrationCreateRequest + */ + body: SecurityMonitoringBatchMigrationCreateRequest; +} + +export interface SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationResourcesRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; + /** + * @type SecurityMonitoringBatchMigrationResourcesCreateRequest + */ + body: SecurityMonitoringBatchMigrationResourcesCreateRequest; +} + export interface SecurityMonitoringApiCreateSecurityMonitoringCriticalAssetRequest { /** * The definition of the new critical asset. @@ -23068,6 +24833,26 @@ export interface SecurityMonitoringApiDeleteSecurityFindingsAutomationTicketCrea ruleId: string; } +export interface SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; +} + +export interface SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationResourcesRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; + /** + * @type SecurityMonitoringBatchMigrationResourcesDeleteRequest + */ + body: SecurityMonitoringBatchMigrationResourcesDeleteRequest; +} + export interface SecurityMonitoringApiDeleteSecurityMonitoringCriticalAssetRequest { /** * The ID of the critical asset. @@ -24092,7 +25877,33 @@ export interface SecurityMonitoringApiListSecurityFindingsAutomationInboxRulesRe pageNumber?: number; } -export interface SecurityMonitoringApiListSecurityFindingsAutomationMuteRulesRequest { +export interface SecurityMonitoringApiListSecurityFindingsAutomationMuteRulesRequest { + /** + * The number of rules per page. Maximum is 1000. + * @type number + */ + pageSize?: number; + /** + * The page number to return. + * @type number + */ + pageNumber?: number; +} + +export interface SecurityMonitoringApiListSecurityFindingsAutomationSeverityModifierRulesRequest { + /** + * The number of rules per page. Maximum is 1000. + * @type number + */ + pageSize?: number; + /** + * The page number to return. + * @type number + */ + pageNumber?: number; +} + +export interface SecurityMonitoringApiListSecurityFindingsAutomationTicketCreationRulesRequest { /** * The number of rules per page. Maximum is 1000. * @type number @@ -24105,30 +25916,49 @@ export interface SecurityMonitoringApiListSecurityFindingsAutomationMuteRulesReq pageNumber?: number; } -export interface SecurityMonitoringApiListSecurityFindingsAutomationSeverityModifierRulesRequest { +export interface SecurityMonitoringApiListSecurityMonitoringBatchMigrationResourcesRequest { /** - * The number of rules per page. Maximum is 1000. + * The UUID of the batch migration. + * @type string + */ + batchId: string; + /** + * Size for a given page. The maximum allowed value is 500. * @type number */ pageSize?: number; /** - * The page number to return. + * Specific page number to return, starting at 1. * @type number */ pageNumber?: number; + /** + * 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. + * @type string + */ + filterQuery?: string; } -export interface SecurityMonitoringApiListSecurityFindingsAutomationTicketCreationRulesRequest { +export interface SecurityMonitoringApiListSecurityMonitoringBatchMigrationsRequest { /** - * The number of rules per page. Maximum is 1000. + * Size for a given page. The maximum allowed value is 500. * @type number */ pageSize?: number; /** - * The page number to return. + * Specific page number to return, starting at 1. * @type number */ pageNumber?: number; + /** + * 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. + * @type string + */ + filterQuery?: string; } export interface SecurityMonitoringApiListSecurityMonitoringDatasetsRequest { @@ -24611,6 +26441,18 @@ export interface SecurityMonitoringApiPatchVulnerabilityNotificationRuleRequest body: PatchNotificationRuleParameters; } +export interface SecurityMonitoringApiPublishSecurityMonitoringBatchMigrationRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; + /** + * @type SecurityMonitoringBatchMigrationPublishRequest + */ + body: SecurityMonitoringBatchMigrationPublishRequest; +} + export interface SecurityMonitoringApiReorderSecurityFindingsAutomationDueDateRulesRequest { /** * @type DueDateRuleReorderRequest @@ -24694,6 +26536,14 @@ export interface SecurityMonitoringApiSendSecurityMonitoringNotificationPreviewR body: CreateNotificationRuleParameters; } +export interface SecurityMonitoringApiStartSecurityMonitoringBatchMigrationRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; +} + export interface SecurityMonitoringApiTestExistingSecurityMonitoringRuleRequest { /** * The ID of the rule. @@ -24824,6 +26674,35 @@ export interface SecurityMonitoringApiUpdateSecurityFindingsAutomationTicketCrea body: TicketCreationRuleUpdateRequest; } +export interface SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; + /** + * @type SecurityMonitoringBatchMigrationUpdateRequest + */ + body: SecurityMonitoringBatchMigrationUpdateRequest; +} + +export interface SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationResourceRequest { + /** + * The UUID of the batch migration. + * @type string + */ + batchId: string; + /** + * The UUID of the batch migration resource. + * @type string + */ + resourceId: string; + /** + * @type SecurityMonitoringBatchMigrationResourceUpdateRequest + */ + body: SecurityMonitoringBatchMigrationResourceUpdateRequest; +} + export interface SecurityMonitoringApiUpdateSecurityMonitoringCriticalAssetRequest { /** * The ID of the critical asset. @@ -25329,6 +27208,34 @@ export class SecurityMonitoringApi { }); } + /** + * 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 param The request object + */ + public cancelSecurityMonitoringBatchMigration( + param: SecurityMonitoringApiCancelSecurityMonitoringBatchMigrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.cancelSecurityMonitoringBatchMigration( + param.batchId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.cancelSecurityMonitoringBatchMigration( + responseContext + ); + }); + }); + } + /** * Convert an existing rule from JSON to Terraform for Datadog provider * resource `datadog_security_monitoring_rule`. You can do so for the following rule types: @@ -25722,6 +27629,61 @@ export class SecurityMonitoringApi { }); } + /** + * 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 param The request object + */ + public createSecurityMonitoringBatchMigration( + param: SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createSecurityMonitoringBatchMigration( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createSecurityMonitoringBatchMigration( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public createSecurityMonitoringBatchMigrationResources( + param: SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationResourcesRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createSecurityMonitoringBatchMigrationResources( + param.batchId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createSecurityMonitoringBatchMigrationResources( + responseContext + ); + }); + }); + } + /** * Create a new critical asset. * @param param The request object @@ -26211,6 +28173,61 @@ export class SecurityMonitoringApi { }); } + /** + * 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 param The request object + */ + public deleteSecurityMonitoringBatchMigration( + param: SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteSecurityMonitoringBatchMigration( + param.batchId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteSecurityMonitoringBatchMigration( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public deleteSecurityMonitoringBatchMigrationResources( + param: SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationResourcesRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteSecurityMonitoringBatchMigrationResources( + param.batchId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteSecurityMonitoringBatchMigrationResources( + responseContext + ); + }); + }); + } + /** * Delete a specific critical asset. * @param param The request object @@ -28334,6 +30351,64 @@ export class SecurityMonitoringApi { }); } + /** + * 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 param The request object + */ + public listSecurityMonitoringBatchMigrationResources( + param: SecurityMonitoringApiListSecurityMonitoringBatchMigrationResourcesRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listSecurityMonitoringBatchMigrationResources( + param.batchId, + param.pageSize, + param.pageNumber, + param.filterQuery, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listSecurityMonitoringBatchMigrationResources( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public listSecurityMonitoringBatchMigrations( + param: SecurityMonitoringApiListSecurityMonitoringBatchMigrationsRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listSecurityMonitoringBatchMigrations( + param.pageSize, + param.pageNumber, + param.filterQuery, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listSecurityMonitoringBatchMigrations( + responseContext + ); + }); + }); + } + /** * Get the list of all critical assets. * @param param The request object @@ -28875,6 +30950,43 @@ export class SecurityMonitoringApi { }); } + /** + * 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 param The request object + */ + public publishSecurityMonitoringBatchMigration( + param: SecurityMonitoringApiPublishSecurityMonitoringBatchMigrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.publishSecurityMonitoringBatchMigration( + param.batchId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.publishSecurityMonitoringBatchMigration( + responseContext + ); + }); + }); + } + /** * Reorder the list of due date rules for the current organization. * @param param The request object @@ -29264,6 +31376,42 @@ export class SecurityMonitoringApi { }); } + /** + * 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 param The request object + */ + public startSecurityMonitoringBatchMigration( + param: SecurityMonitoringApiStartSecurityMonitoringBatchMigrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.startSecurityMonitoringBatchMigration( + param.batchId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.startSecurityMonitoringBatchMigration( + responseContext + ); + }); + }); + } + /** * Test an existing rule. * @param param The request object @@ -29559,6 +31707,62 @@ export class SecurityMonitoringApi { }); } + /** + * 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 param The request object + */ + public updateSecurityMonitoringBatchMigration( + param: SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.updateSecurityMonitoringBatchMigration( + param.batchId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateSecurityMonitoringBatchMigration( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public updateSecurityMonitoringBatchMigrationResource( + param: SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationResourceRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.updateSecurityMonitoringBatchMigrationResource( + param.batchId, + param.resourceId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateSecurityMonitoringBatchMigrationResource( + responseContext + ); + }); + }); + } + /** * Update a specific critical asset. * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index ef565f298abb..1895c3798b6e 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1600,6 +1600,7 @@ export { SecurityMonitoringApiBulkExportSecurityMonitoringRulesRequest, SecurityMonitoringApiBulkExportSecurityMonitoringTerraformResourcesRequest, SecurityMonitoringApiCancelHistoricalJobRequest, + SecurityMonitoringApiCancelSecurityMonitoringBatchMigrationRequest, SecurityMonitoringApiConvertExistingSecurityMonitoringRuleRequest, SecurityMonitoringApiConvertJobResultToSignalRequest, SecurityMonitoringApiConvertSecurityMonitoringRuleFromJSONToTerraformRequest, @@ -1616,6 +1617,8 @@ export { SecurityMonitoringApiCreateSecurityFindingsAutomationMuteRuleRequest, SecurityMonitoringApiCreateSecurityFindingsAutomationSeverityModifierRuleRequest, SecurityMonitoringApiCreateSecurityFindingsAutomationTicketCreationRuleRequest, + SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationRequest, + SecurityMonitoringApiCreateSecurityMonitoringBatchMigrationResourcesRequest, SecurityMonitoringApiCreateSecurityMonitoringCriticalAssetRequest, SecurityMonitoringApiCreateSecurityMonitoringDatasetRequest, SecurityMonitoringApiCreateSecurityMonitoringIntegrationConfigRequest, @@ -1637,6 +1640,8 @@ export { SecurityMonitoringApiDeleteSecurityFindingsAutomationMuteRuleRequest, SecurityMonitoringApiDeleteSecurityFindingsAutomationSeverityModifierRuleRequest, SecurityMonitoringApiDeleteSecurityFindingsAutomationTicketCreationRuleRequest, + SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationRequest, + SecurityMonitoringApiDeleteSecurityMonitoringBatchMigrationResourcesRequest, SecurityMonitoringApiDeleteSecurityMonitoringCriticalAssetRequest, SecurityMonitoringApiDeleteSecurityMonitoringDatasetRequest, SecurityMonitoringApiDeleteSecurityMonitoringIntegrationConfigRequest, @@ -1707,6 +1712,8 @@ export { SecurityMonitoringApiListSecurityFindingsAutomationMuteRulesRequest, SecurityMonitoringApiListSecurityFindingsAutomationSeverityModifierRulesRequest, SecurityMonitoringApiListSecurityFindingsAutomationTicketCreationRulesRequest, + SecurityMonitoringApiListSecurityMonitoringBatchMigrationResourcesRequest, + SecurityMonitoringApiListSecurityMonitoringBatchMigrationsRequest, SecurityMonitoringApiListSecurityMonitoringDatasetsRequest, SecurityMonitoringApiListSecurityMonitoringHistsignalsRequest, SecurityMonitoringApiListSecurityMonitoringIntegrationConfigsRequest, @@ -1718,6 +1725,7 @@ export { SecurityMonitoringApiMuteSecurityFindingsRequest, SecurityMonitoringApiPatchSignalNotificationRuleRequest, SecurityMonitoringApiPatchVulnerabilityNotificationRuleRequest, + SecurityMonitoringApiPublishSecurityMonitoringBatchMigrationRequest, SecurityMonitoringApiReorderSecurityFindingsAutomationDueDateRulesRequest, SecurityMonitoringApiReorderSecurityFindingsAutomationInboxRulesRequest, SecurityMonitoringApiReorderSecurityFindingsAutomationMuteRulesRequest, @@ -1729,6 +1737,7 @@ export { SecurityMonitoringApiSearchSecurityMonitoringHistsignalsRequest, SecurityMonitoringApiSearchSecurityMonitoringSignalsRequest, SecurityMonitoringApiSendSecurityMonitoringNotificationPreviewRequest, + SecurityMonitoringApiStartSecurityMonitoringBatchMigrationRequest, SecurityMonitoringApiTestExistingSecurityMonitoringRuleRequest, SecurityMonitoringApiTestSecurityMonitoringRuleRequest, SecurityMonitoringApiUpdateCustomFrameworkRequest, @@ -1741,6 +1750,8 @@ export { SecurityMonitoringApiUpdateSecurityFindingsAutomationMuteRuleRequest, SecurityMonitoringApiUpdateSecurityFindingsAutomationSeverityModifierRuleRequest, SecurityMonitoringApiUpdateSecurityFindingsAutomationTicketCreationRuleRequest, + SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationRequest, + SecurityMonitoringApiUpdateSecurityMonitoringBatchMigrationResourceRequest, SecurityMonitoringApiUpdateSecurityMonitoringCriticalAssetRequest, SecurityMonitoringApiUpdateSecurityMonitoringDatasetRequest, SecurityMonitoringApiUpdateSecurityMonitoringIntegrationConfigRequest, @@ -8727,6 +8738,49 @@ export { SecurityFindingsSort } from "./models/SecurityFindingsSort"; export { SecurityFindingsStatus } from "./models/SecurityFindingsStatus"; export { SecurityFindingType } from "./models/SecurityFindingType"; export { SecurityMonitoringAzureAppRegistration } from "./models/SecurityMonitoringAzureAppRegistration"; +export { SecurityMonitoringBatchMigrationAttributes } from "./models/SecurityMonitoringBatchMigrationAttributes"; +export { SecurityMonitoringBatchMigrationCreateAttributes } from "./models/SecurityMonitoringBatchMigrationCreateAttributes"; +export { SecurityMonitoringBatchMigrationCreateData } from "./models/SecurityMonitoringBatchMigrationCreateData"; +export { SecurityMonitoringBatchMigrationCreateRequest } from "./models/SecurityMonitoringBatchMigrationCreateRequest"; +export { SecurityMonitoringBatchMigrationData } from "./models/SecurityMonitoringBatchMigrationData"; +export { SecurityMonitoringBatchMigrationInputSource } from "./models/SecurityMonitoringBatchMigrationInputSource"; +export { SecurityMonitoringBatchMigrationListMeta } from "./models/SecurityMonitoringBatchMigrationListMeta"; +export { SecurityMonitoringBatchMigrationPublishAttributes } from "./models/SecurityMonitoringBatchMigrationPublishAttributes"; +export { SecurityMonitoringBatchMigrationPublishData } from "./models/SecurityMonitoringBatchMigrationPublishData"; +export { SecurityMonitoringBatchMigrationPublishedResourceAttributes } from "./models/SecurityMonitoringBatchMigrationPublishedResourceAttributes"; +export { SecurityMonitoringBatchMigrationPublishedResourceData } from "./models/SecurityMonitoringBatchMigrationPublishedResourceData"; +export { SecurityMonitoringBatchMigrationPublishedResourceStatus } from "./models/SecurityMonitoringBatchMigrationPublishedResourceStatus"; +export { SecurityMonitoringBatchMigrationPublishedResourceType } from "./models/SecurityMonitoringBatchMigrationPublishedResourceType"; +export { SecurityMonitoringBatchMigrationPublishRequest } from "./models/SecurityMonitoringBatchMigrationPublishRequest"; +export { SecurityMonitoringBatchMigrationPublishResponse } from "./models/SecurityMonitoringBatchMigrationPublishResponse"; +export { SecurityMonitoringBatchMigrationPublishType } from "./models/SecurityMonitoringBatchMigrationPublishType"; +export { SecurityMonitoringBatchMigrationResourceAttributes } from "./models/SecurityMonitoringBatchMigrationResourceAttributes"; +export { SecurityMonitoringBatchMigrationResourceCreateItem } from "./models/SecurityMonitoringBatchMigrationResourceCreateItem"; +export { SecurityMonitoringBatchMigrationResourceData } from "./models/SecurityMonitoringBatchMigrationResourceData"; +export { SecurityMonitoringBatchMigrationResourceInputType } from "./models/SecurityMonitoringBatchMigrationResourceInputType"; +export { SecurityMonitoringBatchMigrationResourceResponse } from "./models/SecurityMonitoringBatchMigrationResourceResponse"; +export { SecurityMonitoringBatchMigrationResourcesCreateAttributes } from "./models/SecurityMonitoringBatchMigrationResourcesCreateAttributes"; +export { SecurityMonitoringBatchMigrationResourcesCreateData } from "./models/SecurityMonitoringBatchMigrationResourcesCreateData"; +export { SecurityMonitoringBatchMigrationResourcesCreateRequest } from "./models/SecurityMonitoringBatchMigrationResourcesCreateRequest"; +export { SecurityMonitoringBatchMigrationResourcesCreateResponse } from "./models/SecurityMonitoringBatchMigrationResourcesCreateResponse"; +export { SecurityMonitoringBatchMigrationResourcesDeleteAttributes } from "./models/SecurityMonitoringBatchMigrationResourcesDeleteAttributes"; +export { SecurityMonitoringBatchMigrationResourcesDeleteData } from "./models/SecurityMonitoringBatchMigrationResourcesDeleteData"; +export { SecurityMonitoringBatchMigrationResourcesDeleteRequest } from "./models/SecurityMonitoringBatchMigrationResourcesDeleteRequest"; +export { SecurityMonitoringBatchMigrationResourcesListResponse } from "./models/SecurityMonitoringBatchMigrationResourcesListResponse"; +export { SecurityMonitoringBatchMigrationResourceStatus } from "./models/SecurityMonitoringBatchMigrationResourceStatus"; +export { SecurityMonitoringBatchMigrationResourceStatusCounts } from "./models/SecurityMonitoringBatchMigrationResourceStatusCounts"; +export { SecurityMonitoringBatchMigrationResourcesType } from "./models/SecurityMonitoringBatchMigrationResourcesType"; +export { SecurityMonitoringBatchMigrationResourceType } from "./models/SecurityMonitoringBatchMigrationResourceType"; +export { SecurityMonitoringBatchMigrationResourceUpdateAttributes } from "./models/SecurityMonitoringBatchMigrationResourceUpdateAttributes"; +export { SecurityMonitoringBatchMigrationResourceUpdateData } from "./models/SecurityMonitoringBatchMigrationResourceUpdateData"; +export { SecurityMonitoringBatchMigrationResourceUpdateRequest } from "./models/SecurityMonitoringBatchMigrationResourceUpdateRequest"; +export { SecurityMonitoringBatchMigrationResponse } from "./models/SecurityMonitoringBatchMigrationResponse"; +export { SecurityMonitoringBatchMigrationsListResponse } from "./models/SecurityMonitoringBatchMigrationsListResponse"; +export { SecurityMonitoringBatchMigrationStatus } from "./models/SecurityMonitoringBatchMigrationStatus"; +export { SecurityMonitoringBatchMigrationType } from "./models/SecurityMonitoringBatchMigrationType"; +export { SecurityMonitoringBatchMigrationUpdateAttributes } from "./models/SecurityMonitoringBatchMigrationUpdateAttributes"; +export { SecurityMonitoringBatchMigrationUpdateData } from "./models/SecurityMonitoringBatchMigrationUpdateData"; +export { SecurityMonitoringBatchMigrationUpdateRequest } from "./models/SecurityMonitoringBatchMigrationUpdateRequest"; export { SecurityMonitoringContentPackActivation } from "./models/SecurityMonitoringContentPackActivation"; export { SecurityMonitoringContentPackAppSecDetails } from "./models/SecurityMonitoringContentPackAppSecDetails"; export { SecurityMonitoringContentPackAppSecDetailsType } from "./models/SecurityMonitoringContentPackAppSecDetailsType"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index d1a93788b088..66c75aadd7b2 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -5101,6 +5101,39 @@ import { SecurityFindingsSearchRequestData } from "./SecurityFindingsSearchReque import { SecurityFindingsSearchRequestDataAttributes } from "./SecurityFindingsSearchRequestDataAttributes"; import { SecurityFindingsSearchRequestPage } from "./SecurityFindingsSearchRequestPage"; import { SecurityMonitoringAzureAppRegistration } from "./SecurityMonitoringAzureAppRegistration"; +import { SecurityMonitoringBatchMigrationAttributes } from "./SecurityMonitoringBatchMigrationAttributes"; +import { SecurityMonitoringBatchMigrationCreateAttributes } from "./SecurityMonitoringBatchMigrationCreateAttributes"; +import { SecurityMonitoringBatchMigrationCreateData } from "./SecurityMonitoringBatchMigrationCreateData"; +import { SecurityMonitoringBatchMigrationCreateRequest } from "./SecurityMonitoringBatchMigrationCreateRequest"; +import { SecurityMonitoringBatchMigrationData } from "./SecurityMonitoringBatchMigrationData"; +import { SecurityMonitoringBatchMigrationListMeta } from "./SecurityMonitoringBatchMigrationListMeta"; +import { SecurityMonitoringBatchMigrationPublishAttributes } from "./SecurityMonitoringBatchMigrationPublishAttributes"; +import { SecurityMonitoringBatchMigrationPublishData } from "./SecurityMonitoringBatchMigrationPublishData"; +import { SecurityMonitoringBatchMigrationPublishRequest } from "./SecurityMonitoringBatchMigrationPublishRequest"; +import { SecurityMonitoringBatchMigrationPublishResponse } from "./SecurityMonitoringBatchMigrationPublishResponse"; +import { SecurityMonitoringBatchMigrationPublishedResourceAttributes } from "./SecurityMonitoringBatchMigrationPublishedResourceAttributes"; +import { SecurityMonitoringBatchMigrationPublishedResourceData } from "./SecurityMonitoringBatchMigrationPublishedResourceData"; +import { SecurityMonitoringBatchMigrationResourceAttributes } from "./SecurityMonitoringBatchMigrationResourceAttributes"; +import { SecurityMonitoringBatchMigrationResourceCreateItem } from "./SecurityMonitoringBatchMigrationResourceCreateItem"; +import { SecurityMonitoringBatchMigrationResourceData } from "./SecurityMonitoringBatchMigrationResourceData"; +import { SecurityMonitoringBatchMigrationResourceResponse } from "./SecurityMonitoringBatchMigrationResourceResponse"; +import { SecurityMonitoringBatchMigrationResourceStatusCounts } from "./SecurityMonitoringBatchMigrationResourceStatusCounts"; +import { SecurityMonitoringBatchMigrationResourceUpdateAttributes } from "./SecurityMonitoringBatchMigrationResourceUpdateAttributes"; +import { SecurityMonitoringBatchMigrationResourceUpdateData } from "./SecurityMonitoringBatchMigrationResourceUpdateData"; +import { SecurityMonitoringBatchMigrationResourceUpdateRequest } from "./SecurityMonitoringBatchMigrationResourceUpdateRequest"; +import { SecurityMonitoringBatchMigrationResourcesCreateAttributes } from "./SecurityMonitoringBatchMigrationResourcesCreateAttributes"; +import { SecurityMonitoringBatchMigrationResourcesCreateData } from "./SecurityMonitoringBatchMigrationResourcesCreateData"; +import { SecurityMonitoringBatchMigrationResourcesCreateRequest } from "./SecurityMonitoringBatchMigrationResourcesCreateRequest"; +import { SecurityMonitoringBatchMigrationResourcesCreateResponse } from "./SecurityMonitoringBatchMigrationResourcesCreateResponse"; +import { SecurityMonitoringBatchMigrationResourcesDeleteAttributes } from "./SecurityMonitoringBatchMigrationResourcesDeleteAttributes"; +import { SecurityMonitoringBatchMigrationResourcesDeleteData } from "./SecurityMonitoringBatchMigrationResourcesDeleteData"; +import { SecurityMonitoringBatchMigrationResourcesDeleteRequest } from "./SecurityMonitoringBatchMigrationResourcesDeleteRequest"; +import { SecurityMonitoringBatchMigrationResourcesListResponse } from "./SecurityMonitoringBatchMigrationResourcesListResponse"; +import { SecurityMonitoringBatchMigrationResponse } from "./SecurityMonitoringBatchMigrationResponse"; +import { SecurityMonitoringBatchMigrationUpdateAttributes } from "./SecurityMonitoringBatchMigrationUpdateAttributes"; +import { SecurityMonitoringBatchMigrationUpdateData } from "./SecurityMonitoringBatchMigrationUpdateData"; +import { SecurityMonitoringBatchMigrationUpdateRequest } from "./SecurityMonitoringBatchMigrationUpdateRequest"; +import { SecurityMonitoringBatchMigrationsListResponse } from "./SecurityMonitoringBatchMigrationsListResponse"; import { SecurityMonitoringContentPackAppSecDetails } from "./SecurityMonitoringContentPackAppSecDetails"; import { SecurityMonitoringContentPackAuditDetails } from "./SecurityMonitoringContentPackAuditDetails"; import { SecurityMonitoringContentPackEntityDetails } from "./SecurityMonitoringContentPackEntityDetails"; @@ -9351,6 +9384,43 @@ const enumsMap: { [key: string]: any[] } = { SecurityFindingsDataType: ["finding"], SecurityFindingsSort: ["@detection_changed_at", "-@detection_changed_at"], SecurityFindingsStatus: ["done", "timeout"], + SecurityMonitoringBatchMigrationInputSource: [ + "batch_migration", + "threat_hunting", + "user", + ], + SecurityMonitoringBatchMigrationPublishType: ["batchMigrationPublish"], + SecurityMonitoringBatchMigrationPublishedResourceStatus: [ + "published", + "failed", + ], + SecurityMonitoringBatchMigrationPublishedResourceType: [ + "batchMigrationPublishedResource", + ], + SecurityMonitoringBatchMigrationResourceInputType: [ + "natural_language", + "spl", + "kql", + ], + SecurityMonitoringBatchMigrationResourceStatus: [ + "pending", + "in_progress", + "completed", + "canceled", + "failed", + "publishing", + "published", + "duplicate", + ], + SecurityMonitoringBatchMigrationResourceType: ["batchMigrationResource"], + SecurityMonitoringBatchMigrationResourcesType: ["batchMigrationResources"], + SecurityMonitoringBatchMigrationStatus: [ + "draft", + "in_progress", + "canceled", + "completed", + ], + SecurityMonitoringBatchMigrationType: ["batchMigration"], SecurityMonitoringContentPackActivation: [ "never_activated", "activated", @@ -16458,6 +16528,71 @@ const typeMap: { [index: string]: any } = { SecurityFindingsSearchRequestPage: SecurityFindingsSearchRequestPage, SecurityMonitoringAzureAppRegistration: SecurityMonitoringAzureAppRegistration, + SecurityMonitoringBatchMigrationAttributes: + SecurityMonitoringBatchMigrationAttributes, + SecurityMonitoringBatchMigrationCreateAttributes: + SecurityMonitoringBatchMigrationCreateAttributes, + SecurityMonitoringBatchMigrationCreateData: + SecurityMonitoringBatchMigrationCreateData, + SecurityMonitoringBatchMigrationCreateRequest: + SecurityMonitoringBatchMigrationCreateRequest, + SecurityMonitoringBatchMigrationData: SecurityMonitoringBatchMigrationData, + SecurityMonitoringBatchMigrationListMeta: + SecurityMonitoringBatchMigrationListMeta, + SecurityMonitoringBatchMigrationPublishAttributes: + SecurityMonitoringBatchMigrationPublishAttributes, + SecurityMonitoringBatchMigrationPublishData: + SecurityMonitoringBatchMigrationPublishData, + SecurityMonitoringBatchMigrationPublishRequest: + SecurityMonitoringBatchMigrationPublishRequest, + SecurityMonitoringBatchMigrationPublishResponse: + SecurityMonitoringBatchMigrationPublishResponse, + SecurityMonitoringBatchMigrationPublishedResourceAttributes: + SecurityMonitoringBatchMigrationPublishedResourceAttributes, + SecurityMonitoringBatchMigrationPublishedResourceData: + SecurityMonitoringBatchMigrationPublishedResourceData, + SecurityMonitoringBatchMigrationResourceAttributes: + SecurityMonitoringBatchMigrationResourceAttributes, + SecurityMonitoringBatchMigrationResourceCreateItem: + SecurityMonitoringBatchMigrationResourceCreateItem, + SecurityMonitoringBatchMigrationResourceData: + SecurityMonitoringBatchMigrationResourceData, + SecurityMonitoringBatchMigrationResourceResponse: + SecurityMonitoringBatchMigrationResourceResponse, + SecurityMonitoringBatchMigrationResourceStatusCounts: + SecurityMonitoringBatchMigrationResourceStatusCounts, + SecurityMonitoringBatchMigrationResourceUpdateAttributes: + SecurityMonitoringBatchMigrationResourceUpdateAttributes, + SecurityMonitoringBatchMigrationResourceUpdateData: + SecurityMonitoringBatchMigrationResourceUpdateData, + SecurityMonitoringBatchMigrationResourceUpdateRequest: + SecurityMonitoringBatchMigrationResourceUpdateRequest, + SecurityMonitoringBatchMigrationResourcesCreateAttributes: + SecurityMonitoringBatchMigrationResourcesCreateAttributes, + SecurityMonitoringBatchMigrationResourcesCreateData: + SecurityMonitoringBatchMigrationResourcesCreateData, + SecurityMonitoringBatchMigrationResourcesCreateRequest: + SecurityMonitoringBatchMigrationResourcesCreateRequest, + SecurityMonitoringBatchMigrationResourcesCreateResponse: + SecurityMonitoringBatchMigrationResourcesCreateResponse, + SecurityMonitoringBatchMigrationResourcesDeleteAttributes: + SecurityMonitoringBatchMigrationResourcesDeleteAttributes, + SecurityMonitoringBatchMigrationResourcesDeleteData: + SecurityMonitoringBatchMigrationResourcesDeleteData, + SecurityMonitoringBatchMigrationResourcesDeleteRequest: + SecurityMonitoringBatchMigrationResourcesDeleteRequest, + SecurityMonitoringBatchMigrationResourcesListResponse: + SecurityMonitoringBatchMigrationResourcesListResponse, + SecurityMonitoringBatchMigrationResponse: + SecurityMonitoringBatchMigrationResponse, + SecurityMonitoringBatchMigrationUpdateAttributes: + SecurityMonitoringBatchMigrationUpdateAttributes, + SecurityMonitoringBatchMigrationUpdateData: + SecurityMonitoringBatchMigrationUpdateData, + SecurityMonitoringBatchMigrationUpdateRequest: + SecurityMonitoringBatchMigrationUpdateRequest, + SecurityMonitoringBatchMigrationsListResponse: + SecurityMonitoringBatchMigrationsListResponse, SecurityMonitoringContentPackAppSecDetails: SecurityMonitoringContentPackAppSecDetails, SecurityMonitoringContentPackAuditDetails: diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationAttributes.ts new file mode 100644 index 000000000000..da0ee0149fd6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationAttributes.ts @@ -0,0 +1,150 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationInputSource } from "./SecurityMonitoringBatchMigrationInputSource"; +import { SecurityMonitoringBatchMigrationResourceStatusCounts } from "./SecurityMonitoringBatchMigrationResourceStatusCounts"; +import { SecurityMonitoringBatchMigrationStatus } from "./SecurityMonitoringBatchMigrationStatus"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a batch migration. + */ +export class SecurityMonitoringBatchMigrationAttributes { + /** + * The creation date of the batch migration, in RFC 3339 format. + */ + "createdAt": Date; + /** + * The UUID of the user or service account who created the batch migration. + */ + "createdBy"?: string; + /** + * The description of the batch migration. + */ + "description"?: string; + /** + * The origin of a batch migration. Always `batch_migration` for batch migrations + * created through this API. + */ + "inputSource": SecurityMonitoringBatchMigrationInputSource; + /** + * The last update date of the batch migration, in RFC 3339 format. + */ + "lastUpdatedAt": Date; + /** + * The UUID of the user or service account who last updated the batch migration, + * or the name of a system actor. + */ + "lastUpdatedBy"?: string; + /** + * The name of the batch migration. + */ + "name": string; + /** + * The ID of the organization that owns the batch migration. + */ + "orgId": number; + /** + * The number of resources of a batch migration in each status. + */ + "resourceStatusCounts": SecurityMonitoringBatchMigrationResourceStatusCounts; + /** + * 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. + */ + "status": SecurityMonitoringBatchMigrationStatus; + /** + * Tags of the batch migration. Up to 50 tags, each up to 256 characters. + */ + "tags": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "createdAt", + type: "Date", + required: true, + format: "date-time", + }, + createdBy: { + baseName: "createdBy", + type: "string", + }, + description: { + baseName: "description", + type: "string", + }, + inputSource: { + baseName: "inputSource", + type: "SecurityMonitoringBatchMigrationInputSource", + required: true, + }, + lastUpdatedAt: { + baseName: "lastUpdatedAt", + type: "Date", + required: true, + format: "date-time", + }, + lastUpdatedBy: { + baseName: "lastUpdatedBy", + type: "string", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + orgId: { + baseName: "orgId", + type: "number", + required: true, + format: "int64", + }, + resourceStatusCounts: { + baseName: "resourceStatusCounts", + type: "SecurityMonitoringBatchMigrationResourceStatusCounts", + required: true, + }, + status: { + baseName: "status", + type: "SecurityMonitoringBatchMigrationStatus", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateAttributes.ts new file mode 100644 index 000000000000..a5e6bfda8ea2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateAttributes.ts @@ -0,0 +1,78 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourceCreateItem } from "./SecurityMonitoringBatchMigrationResourceCreateItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the batch migration to create. + */ +export class SecurityMonitoringBatchMigrationCreateAttributes { + /** + * The description of the batch migration. + */ + "description"?: string; + /** + * The name of the batch migration. + */ + "name"?: string; + /** + * The initial resources of the batch migration. From 1 to 100 resources. + */ + "resources": Array; + /** + * Tags of the batch migration. Up to 50 tags, each up to 256 characters. + */ + "tags"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + description: { + baseName: "description", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + resources: { + baseName: "resources", + type: "Array", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateData.ts new file mode 100644 index 000000000000..df8a7118768e --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationCreateAttributes } from "./SecurityMonitoringBatchMigrationCreateAttributes"; +import { SecurityMonitoringBatchMigrationType } from "./SecurityMonitoringBatchMigrationType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data of the batch migration to create. + */ +export class SecurityMonitoringBatchMigrationCreateData { + /** + * Attributes of the batch migration to create. + */ + "attributes": SecurityMonitoringBatchMigrationCreateAttributes; + /** + * The type of resource for a batch migration. + */ + "type": SecurityMonitoringBatchMigrationType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationCreateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateRequest.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateRequest.ts new file mode 100644 index 000000000000..a8338bcf5007 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationCreateData } from "./SecurityMonitoringBatchMigrationCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to create a batch migration. + */ +export class SecurityMonitoringBatchMigrationCreateRequest { + /** + * Data of the batch migration to create. + */ + "data": SecurityMonitoringBatchMigrationCreateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationData.ts new file mode 100644 index 000000000000..eadf86f67295 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationData.ts @@ -0,0 +1,74 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationAttributes } from "./SecurityMonitoringBatchMigrationAttributes"; +import { SecurityMonitoringBatchMigrationType } from "./SecurityMonitoringBatchMigrationType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A batch migration. + */ +export class SecurityMonitoringBatchMigrationData { + /** + * Attributes of a batch migration. + */ + "attributes": SecurityMonitoringBatchMigrationAttributes; + /** + * The UUID of the batch migration. + */ + "id": string; + /** + * The type of resource for a batch migration. + */ + "type": SecurityMonitoringBatchMigrationType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationInputSource.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationInputSource.ts new file mode 100644 index 000000000000..c4acbf27a94b --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationInputSource.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The origin of a batch migration. Always `batch_migration` for batch migrations + * created through this API. + */ + +export type SecurityMonitoringBatchMigrationInputSource = + | typeof BATCH_MIGRATION + | typeof THREAT_HUNTING + | typeof USER + | UnparsedObject; +export const BATCH_MIGRATION = "batch_migration"; +export const THREAT_HUNTING = "threat_hunting"; +export const USER = "user"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationListMeta.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationListMeta.ts new file mode 100644 index 000000000000..d09eda208559 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationListMeta.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Metadata of a list response. + */ +export class SecurityMonitoringBatchMigrationListMeta { + /** + * Total number of items matching the request. + */ + "totalCount": number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + totalCount: { + baseName: "totalCount", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationListMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishAttributes.ts new file mode 100644 index 000000000000..f0ba35cc3ed2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishAttributes.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the batch migration publish request. + */ +export class SecurityMonitoringBatchMigrationPublishAttributes { + /** + * Unique UUIDs of the resources to publish. Up to 1000 IDs. When omitted or empty, + * every `completed` resource of the batch migration is published. + */ + "resourceIds"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + resourceIds: { + baseName: "resourceIds", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationPublishAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishData.ts new file mode 100644 index 000000000000..30aa9236c56a --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationPublishAttributes } from "./SecurityMonitoringBatchMigrationPublishAttributes"; +import { SecurityMonitoringBatchMigrationPublishType } from "./SecurityMonitoringBatchMigrationPublishType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data of the batch migration publish request. + */ +export class SecurityMonitoringBatchMigrationPublishData { + /** + * Attributes of the batch migration publish request. + */ + "attributes": SecurityMonitoringBatchMigrationPublishAttributes; + /** + * The type of resource for a batch migration publish request. + */ + "type": SecurityMonitoringBatchMigrationPublishType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationPublishAttributes", + required: true, + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationPublishType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationPublishData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishRequest.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishRequest.ts new file mode 100644 index 000000000000..c06c8b33cf1e --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationPublishData } from "./SecurityMonitoringBatchMigrationPublishData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to publish the resources of a batch migration. + */ +export class SecurityMonitoringBatchMigrationPublishRequest { + /** + * Data of the batch migration publish request. + */ + "data": SecurityMonitoringBatchMigrationPublishData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationPublishData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationPublishRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishResponse.ts new file mode 100644 index 000000000000..820e1a638e1d --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationPublishedResourceData } from "./SecurityMonitoringBatchMigrationPublishedResourceData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the publication outcome of each resource. + */ +export class SecurityMonitoringBatchMigrationPublishResponse { + /** + * The publication outcome of each resource. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationPublishResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishType.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishType.ts new file mode 100644 index 000000000000..e0ee244f0d65 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishType.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of resource for a batch migration publish request. + */ + +export type SecurityMonitoringBatchMigrationPublishType = + | typeof BATCH_MIGRATION_PUBLISH + | UnparsedObject; +export const BATCH_MIGRATION_PUBLISH = "batchMigrationPublish"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceAttributes.ts new file mode 100644 index 000000000000..d7ac4b973838 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceAttributes.ts @@ -0,0 +1,70 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationPublishedResourceStatus } from "./SecurityMonitoringBatchMigrationPublishedResourceStatus"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the publication outcome of a batch migration resource. + */ +export class SecurityMonitoringBatchMigrationPublishedResourceAttributes { + /** + * The reason why the resource could not be published. + */ + "error"?: string; + /** + * The ID of the created Cloud SIEM detection rule. + */ + "ruleId"?: string; + /** + * The outcome of publishing a batch migration resource. + */ + "status": SecurityMonitoringBatchMigrationPublishedResourceStatus; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + error: { + baseName: "error", + type: "string", + }, + ruleId: { + baseName: "ruleId", + type: "string", + }, + status: { + baseName: "status", + type: "SecurityMonitoringBatchMigrationPublishedResourceStatus", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationPublishedResourceAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceData.ts new file mode 100644 index 000000000000..eef16836df6e --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceData.ts @@ -0,0 +1,74 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationPublishedResourceAttributes } from "./SecurityMonitoringBatchMigrationPublishedResourceAttributes"; +import { SecurityMonitoringBatchMigrationPublishedResourceType } from "./SecurityMonitoringBatchMigrationPublishedResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The publication outcome of a batch migration resource. + */ +export class SecurityMonitoringBatchMigrationPublishedResourceData { + /** + * Attributes of the publication outcome of a batch migration resource. + */ + "attributes": SecurityMonitoringBatchMigrationPublishedResourceAttributes; + /** + * The UUID of the batch migration resource. + */ + "id": string; + /** + * The type of resource for a published batch migration resource. + */ + "type": SecurityMonitoringBatchMigrationPublishedResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationPublishedResourceAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationPublishedResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationPublishedResourceData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceStatus.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceStatus.ts new file mode 100644 index 000000000000..94cec5705209 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceStatus.ts @@ -0,0 +1,18 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The outcome of publishing a batch migration resource. + */ + +export type SecurityMonitoringBatchMigrationPublishedResourceStatus = + | typeof PUBLISHED + | typeof FAILED + | UnparsedObject; +export const PUBLISHED = "published"; +export const FAILED = "failed"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceType.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceType.ts new file mode 100644 index 000000000000..b0b8107c8fe4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationPublishedResourceType.ts @@ -0,0 +1,17 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of resource for a published batch migration resource. + */ + +export type SecurityMonitoringBatchMigrationPublishedResourceType = + | typeof BATCH_MIGRATION_PUBLISHED_RESOURCE + | UnparsedObject; +export const BATCH_MIGRATION_PUBLISHED_RESOURCE = + "batchMigrationPublishedResource"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceAttributes.ts new file mode 100644 index 000000000000..4197353815e2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceAttributes.ts @@ -0,0 +1,170 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationResourceInputType } from "./SecurityMonitoringBatchMigrationResourceInputType"; +import { SecurityMonitoringBatchMigrationResourceStatus } from "./SecurityMonitoringBatchMigrationResourceStatus"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a batch migration resource. + */ +export class SecurityMonitoringBatchMigrationResourceAttributes { + /** + * The UUID of the batch migration that contains the resource. + */ + "batchId": string; + /** + * The creation date of the resource, in RFC 3339 format. + */ + "createdAt": Date; + /** + * The UUID of the user or service account who created the resource. + */ + "createdBy"?: string; + /** + * The description of the resource. + */ + "description"?: string; + /** + * The source query or natural language description to translate. + */ + "input": string; + /** + * 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. + */ + "inputType": SecurityMonitoringBatchMigrationResourceInputType; + /** + * The last update date of the resource, in RFC 3339 format. + */ + "lastUpdatedAt": Date; + /** + * The UUID of the user or service account who last updated the resource, + * or the name of a system actor. + */ + "lastUpdatedBy"?: string; + /** + * The name of the resource. + */ + "name": string; + /** + * 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. + */ + "output": { [key: string]: any } | null; + /** + * The type of the translation output. Currently always `siem_rule`. + */ + "outputType": string; + /** + * The ID of the Cloud SIEM detection rule created when the resource was published. + */ + "ruleId"?: string; + /** + * 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. + */ + "status": SecurityMonitoringBatchMigrationResourceStatus; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + batchId: { + baseName: "batchId", + type: "string", + required: true, + format: "uuid", + }, + createdAt: { + baseName: "createdAt", + type: "Date", + required: true, + format: "date-time", + }, + createdBy: { + baseName: "createdBy", + type: "string", + }, + description: { + baseName: "description", + type: "string", + }, + input: { + baseName: "input", + type: "string", + required: true, + }, + inputType: { + baseName: "inputType", + type: "SecurityMonitoringBatchMigrationResourceInputType", + required: true, + }, + lastUpdatedAt: { + baseName: "lastUpdatedAt", + type: "Date", + required: true, + format: "date-time", + }, + lastUpdatedBy: { + baseName: "lastUpdatedBy", + type: "string", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + output: { + baseName: "output", + type: "{ [key: string]: any; }", + required: true, + }, + outputType: { + baseName: "outputType", + type: "string", + required: true, + }, + ruleId: { + baseName: "ruleId", + type: "string", + }, + status: { + baseName: "status", + type: "SecurityMonitoringBatchMigrationResourceStatus", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceCreateItem.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceCreateItem.ts new file mode 100644 index 000000000000..3000e456b56d --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceCreateItem.ts @@ -0,0 +1,81 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationResourceInputType } from "./SecurityMonitoringBatchMigrationResourceInputType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A source rule to translate into a Cloud SIEM detection rule. + */ +export class SecurityMonitoringBatchMigrationResourceCreateItem { + /** + * The description of the resource. + */ + "description"?: string; + /** + * The source query or natural language description to translate. Must not be blank. + */ + "input": string; + /** + * 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. + */ + "inputType": SecurityMonitoringBatchMigrationResourceInputType; + /** + * The name of the resource. + */ + "name"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + description: { + baseName: "description", + type: "string", + }, + input: { + baseName: "input", + type: "string", + required: true, + }, + inputType: { + baseName: "inputType", + type: "SecurityMonitoringBatchMigrationResourceInputType", + required: true, + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceCreateItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceData.ts new file mode 100644 index 000000000000..d05abec1a6b8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceData.ts @@ -0,0 +1,74 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationResourceAttributes } from "./SecurityMonitoringBatchMigrationResourceAttributes"; +import { SecurityMonitoringBatchMigrationResourceType } from "./SecurityMonitoringBatchMigrationResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A batch migration resource. + */ +export class SecurityMonitoringBatchMigrationResourceData { + /** + * Attributes of a batch migration resource. + */ + "attributes": SecurityMonitoringBatchMigrationResourceAttributes; + /** + * The UUID of the batch migration resource. + */ + "id": string; + /** + * The type of resource for a batch migration resource. + */ + "type": SecurityMonitoringBatchMigrationResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationResourceAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceInputType.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceInputType.ts new file mode 100644 index 000000000000..88f82d242810 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceInputType.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ + +export type SecurityMonitoringBatchMigrationResourceInputType = + | typeof NATURAL_LANGUAGE + | typeof SPL + | typeof KQL + | UnparsedObject; +export const NATURAL_LANGUAGE = "natural_language"; +export const SPL = "spl"; +export const KQL = "kql"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceResponse.ts new file mode 100644 index 000000000000..d515b0a45460 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourceData } from "./SecurityMonitoringBatchMigrationResourceData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a batch migration resource. + */ +export class SecurityMonitoringBatchMigrationResourceResponse { + /** + * A batch migration resource. + */ + "data": SecurityMonitoringBatchMigrationResourceData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationResourceData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceStatus.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceStatus.ts new file mode 100644 index 000000000000..816723de7423 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceStatus.ts @@ -0,0 +1,32 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ + +export type SecurityMonitoringBatchMigrationResourceStatus = + | typeof PENDING + | typeof IN_PROGRESS + | typeof COMPLETED + | typeof CANCELED + | typeof FAILED + | typeof PUBLISHING + | typeof PUBLISHED + | typeof DUPLICATE + | UnparsedObject; +export const PENDING = "pending"; +export const IN_PROGRESS = "in_progress"; +export const COMPLETED = "completed"; +export const CANCELED = "canceled"; +export const FAILED = "failed"; +export const PUBLISHING = "publishing"; +export const PUBLISHED = "published"; +export const DUPLICATE = "duplicate"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceStatusCounts.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceStatusCounts.ts new file mode 100644 index 000000000000..aa17c2a50f65 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceStatusCounts.ts @@ -0,0 +1,124 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The number of resources of a batch migration in each status. + */ +export class SecurityMonitoringBatchMigrationResourceStatusCounts { + /** + * Number of resources whose translation was canceled. + */ + "canceled": number; + /** + * Number of resources translated and ready to be published. + */ + "completed": number; + /** + * Number of resources identified as duplicates of an existing rule. Reserved for future use. + */ + "duplicate": number; + /** + * Number of resources whose translation failed. + */ + "failed": number; + /** + * Number of resources being translated. + */ + "inProgress": number; + /** + * Number of resources waiting to be translated. + */ + "pending": number; + /** + * Number of resources published as Cloud SIEM detection rules. + */ + "published": number; + /** + * Number of resources being published. + */ + "publishing": number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + canceled: { + baseName: "canceled", + type: "number", + required: true, + format: "int64", + }, + completed: { + baseName: "completed", + type: "number", + required: true, + format: "int64", + }, + duplicate: { + baseName: "duplicate", + type: "number", + required: true, + format: "int64", + }, + failed: { + baseName: "failed", + type: "number", + required: true, + format: "int64", + }, + inProgress: { + baseName: "inProgress", + type: "number", + required: true, + format: "int64", + }, + pending: { + baseName: "pending", + type: "number", + required: true, + format: "int64", + }, + published: { + baseName: "published", + type: "number", + required: true, + format: "int64", + }, + publishing: { + baseName: "publishing", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceStatusCounts.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceType.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceType.ts new file mode 100644 index 000000000000..f02078ca3181 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceType.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of resource for a batch migration resource. + */ + +export type SecurityMonitoringBatchMigrationResourceType = + | typeof BATCH_MIGRATION_RESOURCE + | UnparsedObject; +export const BATCH_MIGRATION_RESOURCE = "batchMigrationResource"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateAttributes.ts new file mode 100644 index 000000000000..d389e1588af8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateAttributes.ts @@ -0,0 +1,68 @@ +/** + * 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. + */ +import { SecurityMonitoringBatchMigrationResourceInputType } from "./SecurityMonitoringBatchMigrationResourceInputType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the batch migration resource to update. At least one attribute is required. + */ +export class SecurityMonitoringBatchMigrationResourceUpdateAttributes { + /** + * The description of the resource. + */ + "description"?: string; + /** + * The source query or natural language description to translate. Must not be blank. + */ + "input"?: string; + /** + * 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. + */ + "inputType"?: SecurityMonitoringBatchMigrationResourceInputType; + /** + * The name of the resource. + */ + "name"?: string; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + description: { + baseName: "description", + type: "string", + }, + input: { + baseName: "input", + type: "string", + }, + inputType: { + baseName: "inputType", + type: "SecurityMonitoringBatchMigrationResourceInputType", + }, + name: { + baseName: "name", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateData.ts new file mode 100644 index 000000000000..e3db4a5afdee --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourceType } from "./SecurityMonitoringBatchMigrationResourceType"; +import { SecurityMonitoringBatchMigrationResourceUpdateAttributes } from "./SecurityMonitoringBatchMigrationResourceUpdateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data of the batch migration resource to update. + */ +export class SecurityMonitoringBatchMigrationResourceUpdateData { + /** + * Attributes of the batch migration resource to update. At least one attribute is required. + */ + "attributes": SecurityMonitoringBatchMigrationResourceUpdateAttributes; + /** + * The type of resource for a batch migration resource. + */ + "type": SecurityMonitoringBatchMigrationResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationResourceUpdateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateRequest.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateRequest.ts new file mode 100644 index 000000000000..5aeee3e86381 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourceUpdateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourceUpdateData } from "./SecurityMonitoringBatchMigrationResourceUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to update a batch migration resource. + */ +export class SecurityMonitoringBatchMigrationResourceUpdateRequest { + /** + * Data of the batch migration resource to update. + */ + "data": SecurityMonitoringBatchMigrationResourceUpdateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationResourceUpdateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourceUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateAttributes.ts new file mode 100644 index 000000000000..a8ef7bdf55ac --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateAttributes.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourceCreateItem } from "./SecurityMonitoringBatchMigrationResourceCreateItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the resources to add to a batch migration. + */ +export class SecurityMonitoringBatchMigrationResourcesCreateAttributes { + /** + * The resources to add. From 1 to 1000 resources. + */ + "resources": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + resources: { + baseName: "resources", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateData.ts new file mode 100644 index 000000000000..1dfdbae40398 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourcesCreateAttributes } from "./SecurityMonitoringBatchMigrationResourcesCreateAttributes"; +import { SecurityMonitoringBatchMigrationResourcesType } from "./SecurityMonitoringBatchMigrationResourcesType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data of the resources to add to a batch migration. + */ +export class SecurityMonitoringBatchMigrationResourcesCreateData { + /** + * Attributes of the resources to add to a batch migration. + */ + "attributes": SecurityMonitoringBatchMigrationResourcesCreateAttributes; + /** + * The type of resource for a request on a set of batch migration resources. + */ + "type": SecurityMonitoringBatchMigrationResourcesType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationResourcesCreateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationResourcesType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateRequest.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateRequest.ts new file mode 100644 index 000000000000..5ebea6fabb3e --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourcesCreateData } from "./SecurityMonitoringBatchMigrationResourcesCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to add resources to a batch migration. + */ +export class SecurityMonitoringBatchMigrationResourcesCreateRequest { + /** + * Data of the resources to add to a batch migration. + */ + "data": SecurityMonitoringBatchMigrationResourcesCreateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationResourcesCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateResponse.ts new file mode 100644 index 000000000000..9c826b9d7477 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesCreateResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourceData } from "./SecurityMonitoringBatchMigrationResourceData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the batch migration resources that were added. + */ +export class SecurityMonitoringBatchMigrationResourcesCreateResponse { + /** + * The added batch migration resources. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesCreateResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteAttributes.ts new file mode 100644 index 000000000000..4db17012c1d7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteAttributes.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the resources to delete from a batch migration. + */ +export class SecurityMonitoringBatchMigrationResourcesDeleteAttributes { + /** + * Unique UUIDs of batch migration resources. From 1 to 1000 IDs. + */ + "resourceIds": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + resourceIds: { + baseName: "resourceIds", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesDeleteAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteData.ts new file mode 100644 index 000000000000..dcccbd68c751 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourcesDeleteAttributes } from "./SecurityMonitoringBatchMigrationResourcesDeleteAttributes"; +import { SecurityMonitoringBatchMigrationResourcesType } from "./SecurityMonitoringBatchMigrationResourcesType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data of the resources to delete from a batch migration. + */ +export class SecurityMonitoringBatchMigrationResourcesDeleteData { + /** + * Attributes of the resources to delete from a batch migration. + */ + "attributes": SecurityMonitoringBatchMigrationResourcesDeleteAttributes; + /** + * The type of resource for a request on a set of batch migration resources. + */ + "type": SecurityMonitoringBatchMigrationResourcesType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationResourcesDeleteAttributes", + required: true, + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationResourcesType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesDeleteData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteRequest.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteRequest.ts new file mode 100644 index 000000000000..517f46897aa5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesDeleteRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationResourcesDeleteData } from "./SecurityMonitoringBatchMigrationResourcesDeleteData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to delete resources from a batch migration. + */ +export class SecurityMonitoringBatchMigrationResourcesDeleteRequest { + /** + * Data of the resources to delete from a batch migration. + */ + "data": SecurityMonitoringBatchMigrationResourcesDeleteData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationResourcesDeleteData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesDeleteRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesListResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesListResponse.ts new file mode 100644 index 000000000000..2ecc1851d1a3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesListResponse.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationListMeta } from "./SecurityMonitoringBatchMigrationListMeta"; +import { SecurityMonitoringBatchMigrationResourceData } from "./SecurityMonitoringBatchMigrationResourceData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing batch migration resources. + */ +export class SecurityMonitoringBatchMigrationResourcesListResponse { + /** + * The batch migration resources. + */ + "data": Array; + /** + * Metadata of a list response. + */ + "meta": SecurityMonitoringBatchMigrationListMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + meta: { + baseName: "meta", + type: "SecurityMonitoringBatchMigrationListMeta", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResourcesListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesType.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesType.ts new file mode 100644 index 000000000000..67fe4997e22e --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResourcesType.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of resource for a request on a set of batch migration resources. + */ + +export type SecurityMonitoringBatchMigrationResourcesType = + | typeof BATCH_MIGRATION_RESOURCES + | UnparsedObject; +export const BATCH_MIGRATION_RESOURCES = "batchMigrationResources"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResponse.ts new file mode 100644 index 000000000000..fb07ba9e753c --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationData } from "./SecurityMonitoringBatchMigrationData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a batch migration. + */ +export class SecurityMonitoringBatchMigrationResponse { + /** + * A batch migration. + */ + "data": SecurityMonitoringBatchMigrationData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationStatus.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationStatus.ts new file mode 100644 index 000000000000..b77c032e7c15 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationStatus.ts @@ -0,0 +1,24 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ + +export type SecurityMonitoringBatchMigrationStatus = + | typeof DRAFT + | typeof IN_PROGRESS + | typeof CANCELED + | typeof COMPLETED + | UnparsedObject; +export const DRAFT = "draft"; +export const IN_PROGRESS = "in_progress"; +export const CANCELED = "canceled"; +export const COMPLETED = "completed"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationType.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationType.ts new file mode 100644 index 000000000000..d472d3294ded --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationType.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of resource for a batch migration. + */ + +export type SecurityMonitoringBatchMigrationType = + | typeof BATCH_MIGRATION + | UnparsedObject; +export const BATCH_MIGRATION = "batchMigration"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateAttributes.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateAttributes.ts new file mode 100644 index 000000000000..7690159ecc91 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateAttributes.ts @@ -0,0 +1,57 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the batch migration to update. At least one attribute is required. + */ +export class SecurityMonitoringBatchMigrationUpdateAttributes { + /** + * The description of the batch migration. + */ + "description"?: string; + /** + * The name of the batch migration. + */ + "name"?: string; + /** + * Tags of the batch migration. Up to 50 tags, each up to 256 characters. + */ + "tags"?: Array; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + description: { + baseName: "description", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateData.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateData.ts new file mode 100644 index 000000000000..db403024fec0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationType } from "./SecurityMonitoringBatchMigrationType"; +import { SecurityMonitoringBatchMigrationUpdateAttributes } from "./SecurityMonitoringBatchMigrationUpdateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data of the batch migration to update. + */ +export class SecurityMonitoringBatchMigrationUpdateData { + /** + * Attributes of the batch migration to update. At least one attribute is required. + */ + "attributes": SecurityMonitoringBatchMigrationUpdateAttributes; + /** + * The type of resource for a batch migration. + */ + "type": SecurityMonitoringBatchMigrationType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SecurityMonitoringBatchMigrationUpdateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "SecurityMonitoringBatchMigrationType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateRequest.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateRequest.ts new file mode 100644 index 000000000000..7487cba9cda3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationUpdateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationUpdateData } from "./SecurityMonitoringBatchMigrationUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to update a batch migration. + */ +export class SecurityMonitoringBatchMigrationUpdateRequest { + /** + * Data of the batch migration to update. + */ + "data": SecurityMonitoringBatchMigrationUpdateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SecurityMonitoringBatchMigrationUpdateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationsListResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationsListResponse.ts new file mode 100644 index 000000000000..4b2b4c79d5e0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringBatchMigrationsListResponse.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SecurityMonitoringBatchMigrationData } from "./SecurityMonitoringBatchMigrationData"; +import { SecurityMonitoringBatchMigrationListMeta } from "./SecurityMonitoringBatchMigrationListMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a page of batch migrations. + */ +export class SecurityMonitoringBatchMigrationsListResponse { + /** + * The batch migrations. + */ + "data": Array; + /** + * Metadata of a list response. + */ + "meta": SecurityMonitoringBatchMigrationListMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + meta: { + baseName: "meta", + type: "SecurityMonitoringBatchMigrationListMeta", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringBatchMigrationsListResponse.attributeTypeMap; + } + + public constructor() {} +}