更新备份合规策略设置
更新指定项目的备份合规性策略设置。要使用此资源,请求的服务帐户或API密钥必须具有项目所有者角色。
路径参数
-
用于标识项目的唯一 24-十六进制数字字符串。 使用 /groups 端点检索身份验证的用户有权访问权限的所有项目。
注意:群组和项目是同义词。您的群组 ID 与项目 ID 相同。对于现有群组,群组/项目 ID 保持不变。资源和相应的端点使用“群组”一词。
格式应符合以下模式:
^([a-f0-9]{24})$
。
查询参数
-
指示应用程序是否将响应包装在
envelope
JSON 对象中的标志。某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,请在查询中设置 Envelope=true。返回结果列表的端点将结果对象用作 envelope。应用程序将状态参数添加到响应正文中。默认值为
false
。 -
该标志指示是否使用新的数据保护设置覆盖不符合要求的备份策略。
默认值为
true
。 -
指示响应正文是否应采用 prettyprint 格式的标记。
默认值为
false
。Prettyprint
body
必需
新的“备份合规性策略”设置。
-
指示是否阻止集群用户删除已复制到其他地区的备份的标志,即使这些附加快照地区已被删除。如果未指定,则此值默认为 False。
默认值为
false
。 -
指示具有备份合规策略的所有集群是否需要使用客户密钥管理进行静态加密的标志。如果未指定,则此值默认为 False。
默认值为
false
。使用客户密钥管理进行静态加密 -
按需策略规范。
-
指示集群是否使用带有备份合规性策略的持续云备份的标志。如果未指定,则此值默认为 False。
默认值为
false
。持续的云备份 -
唯一的 24 位十六进制数字字符串,用于标识“备份合规性策略”的项目。
格式应符合以下模式:
^([a-f0-9]{24})$
。 -
使用带有备份合规性策略的持续云备份可以恢复到以前的天数。必须指定一个正的非零整数,并且最大保留窗口不能超过每小时保留时间。此参数仅适用于具有备份合规性策略的持续云备份。
-
包含一项计划策略的规范的列表。
计划策略的规范。
curl \
--request PUT 'https://cloud.mongodb.com/api/atlas/v1.0/groups/32b6e34b3d91647abb20e7b8/backupCompliancePolicy' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"authorizedEmail":"hello@example.com","authorizedUserFirstName":"string","authorizedUserLastName":"string","copyProtectionEnabled":false,"encryptionAtRestEnabled":false,"onDemandPolicyItem":{"frequencyInterval":0,"frequencyType":"ondemand","retentionUnit":"days","retentionValue":42},"pitEnabled":false,"projectId":"32b6e34b3d91647abb20e7b8","restoreWindowDays":42,"scheduledPolicyItems":[{"frequencyInterval":1,"frequencyType":"daily","retentionUnit":"days","retentionValue":42}]}'
{
"authorizedEmail": "hello@example.com",
"authorizedUserFirstName": "string",
"authorizedUserLastName": "string",
"copyProtectionEnabled": false,
"encryptionAtRestEnabled": false,
"onDemandPolicyItem": {
"frequencyInterval": 0,
"frequencyType": "ondemand",
"retentionUnit": "days",
"retentionValue": 42
},
"pitEnabled": false,
"projectId": "32b6e34b3d91647abb20e7b8",
"restoreWindowDays": 42,
"scheduledPolicyItems": [
{
"frequencyInterval": 1,
"frequencyType": "daily",
"retentionUnit": "days",
"retentionValue": 42
}
]
}
{
"authorizedEmail": "hello@example.com",
"authorizedUserFirstName": "string",
"authorizedUserLastName": "string",
"copyProtectionEnabled": false,
"deletable": false,
"encryptionAtRestEnabled": false,
"onDemandPolicyItem": {
"frequencyInterval": 0,
"frequencyType": "ondemand",
"id": "32b6e34b3d91647abb20e7b8",
"retentionUnit": "days",
"retentionValue": 42
},
"pitEnabled": false,
"projectId": "32b6e34b3d91647abb20e7b8",
"restoreWindowDays": 42,
"scheduledPolicyItems": [
{
"frequencyInterval": 1,
"frequencyType": "daily",
"id": "32b6e34b3d91647abb20e7b8",
"retentionUnit": "days",
"retentionValue": 42
}
],
"state": "ACTIVE",
"updatedDate": "2025-05-04T09:42:00Z",
"updatedUser": "hello@example.com"
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}