Publish a batch migration
https://api.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.us3.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.us5.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.datadoghq.eu/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.ap1.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.ap2.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.uk1.datadoghq.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.ddog-gov.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishhttps://api.us2.ddog-gov.com/api/v2/security_monitoring/batch-migrations/{batch_id}/publishOverview
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.
OAuth apps require the security_monitoring_rules_write authorization scope to access this endpoint.
Arguments
Path Parameters
batch_id [required]The UUID of the batch migration.
Request
Body Data (required)
data [required]Data of the batch migration publish request.
attributes [required]Attributes of the batch migration publish request.
resourceIdsUnique UUIDs of the resources to publish. Up to 1000 IDs. When omitted or empty,
every completed resource of the batch migration is published.
type [required]The type of resource for a batch migration publish request.
batchMigrationPublish{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}Response
OK
Response containing the publication outcome of each resource.
data [required]The publication outcome of each resource.
attributes [required]Attributes of the publication outcome of a batch migration resource.
errorThe reason why the resource could not be published.
ruleIdThe ID of the created Cloud SIEM detection rule.
status [required]The outcome of publishing a batch migration resource.
published, failedid [required]The UUID of the batch migration resource.
type [required]The type of resource for a published batch migration resource.
batchMigrationPublishedResource{
"data": [
{
"attributes": {
"error": "failed to create rule",
"ruleId": "abc-def-ghi",
"status": "published"
},
"id": "c968cf83-56c2-4d54-a993-6c86dfb83527",
"type": "batchMigrationPublishedResource"
}
]
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Unauthorized
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Forbidden
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Found
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Conflict
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF## Publish every completed resource
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {},
"type": "batchMigrationPublish"
}
}
EOF
## default
# Path parameters
export batch_id="7cdb3a75-64fb-46ce-9445-41969e78fe8e"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/batch-migrations/${batch_id}/publish" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"resourceIds": [
"c968cf83-56c2-4d54-a993-6c86dfb83527"
]
},
"type": "batchMigrationPublish"
}
}
EOF