命名空间:microsoft.graph
搜索与 protectionUnit 关联的 restorePoint 对象。 还可以提供 policyId ,以将搜索范围限定为保护策略,并验证指定的保护单元是否属于该策略。
API 可用性
此 API 可用于以下国家级云部署。
| 全局服务 | 美国政府 L4 | 美国政府 L5 (DOD) | 由世纪互联运营的中国 |
|---|---|---|---|
| ✅ | ❌ | ❌ | ❌ |
权限
为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 | 最低特权权限 | 更高特权权限 |
|---|---|---|
| 委派(工作或学校帐户) | BackupRestore-Search.Read.All | 不可用。 |
| 委派(个人 Microsoft 帐户) | 不支持。 | 不支持。 |
| 应用程序 | BackupRestore-Search.Read.All | 不可用。 |
HTTP 请求
POST /solutions/backupRestore/restorePoints/search
请求标头
| 名称 | 说明 |
|---|---|
| Authorization | 持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-Type | application/json. 必需。 |
请求正文
在请求正文中,提供以下参数的 JSON 表示形式。
| 参数 | 类型 | 说明 |
|---|---|---|
| artifactQuery | artifactQuery | 包含指定搜索条件的表达式。 可选。 |
| policyId | String | 包含指定保护单元的保护策略的标识符。 可选。 |
| protectionUnitIds | 字符串集合 | 保护单元的 ID。 必填。 |
| protectionTimePeriod | timePeriod | 保护期的开始和结束日期时间。 必填。 |
| restorePointPreference | restorePointPreference | 指示要返回的还原点。 可能的值为 oldest, 。 latest 可选。 |
| tags | restorePointTags | 还原点的类型。 可能的值为 None、 、 FastRestoreUnknownFutureValue。 可选。 |
restorePointPreference 值
| 成员 | 说明 |
|---|---|
| 最新 | 返回给定保护时间段内的最新还原点。 |
| 最早 | 返回给定保护时间段内最早的还原点。 |
响应
如果成功,此操作将在响应正文中返回 200 OK 响应代码和 restorePointSearchResponse 对象。
注意
- 调用可为每个保护单元返回一个还原点。
- 单个请求中最多可以包含 20 个保护单元,并且响应不分页。
- 为 artifactQuery 属性提供表达式时,在 protectionUnitIds 属性中只能提供一个保护单元 ID。
- 当您提供 policyId 时,服务会验证每个保护单元是否属于指定的策略。
有关可能的错误响应列表,请参阅 备份存储 API 错误响应。
示例
示例 1:搜索请求
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/restorePoints/search
Content-Type: application/json
{
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"protectionUnitIds": ["23014d8c-71fe-4d00-a01a-31850bc5b42a", "43014d8c-71fe-4d00-a01a-31850bc5b42b", "63014d8c-71fe-4d00-a01a-31850bc5b42c", "83014d8c-71fe-4d00-a01a-31850bc5b42d"],
"protectionTimePeriod": {
"startDateTime": "2021-01-01T00:00:00Z",
"endDateTime": "2021-01-08T00:00:00Z"
},
"restorePointPreference": "latest",
"tags": "fastRestore"
}
响应
- 调用最多返回五个还原点。
- 单个请求中最多可以包含 20 个保护单元,并且响应不分页。
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context":"/solutions/backupRestore/$metadata#restorePoints",
"searchResponseId": "M2UyZDAwMDAwMDMxMzkzYTMyNj",
"searchResults": [
{
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id":"1f1fccc3-a642-4f61-bf49-f37b9a888279",
"protectionDateTime":"2023-01-04T00:00:00Z",
"expirationDateTime":"2024-01-04T00:00:00Z",
"protectionUnit":{
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id":"23014d8c-71fe-4d00-a01a-31850bc5b42a",
"siteId":"344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId":"9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
},
{
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id":"cdf4a823-sfde-ki2s-kmsj-clu2nsdk43ga",
"protectionDateTime":"2023-01-03T00:00:00Z",
"expirationDateTime":"2024-01-03T00:00:00Z",
"protectionUnit":{
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id":"43014d8c-71fe-4d00-a01a-31850bc5b42b",
"siteId":"344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId":"9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
},
{
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id":"1f1fccc3-a642-4f61-bf49-f37b9a888280",
"protectionDateTime":"2023-01-02T00:00:00Z",
"expirationDateTime":"2024-01-02T00:00:00Z",
"protectionUnit":{
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id":"83014d8c-71fe-4d00-a01a-31850bc5b42c",
"siteId":"344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId":"9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
}
],
"noResultProtectionUnitIds": ["63014d8c-71fe-4d00-a01a-31850bc5b42c"]
}
示例 2:使用 artifactQuery 表达式搜索
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/restorePoints/search
Content-Type: application/json
{
"artifactQuery": {
"queryExpression": "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')",
"artifactType": "message"
},
"protectionUnitIds": ["23014d8c-71fe-4d00-a01a-31850bc5b42a"],
"protectionTimePeriod": {
"startDateTime": "2021-01-01T00:00:00Z"
},
"restorePointPreference": "oldest"
}
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "/solutions/backupRestore/$metadata#restorePoints",
"searchResponseId": "M2UyZDAwMDAwMDMxMzkzYTMyNj",
"searchResults": [
{
"artifactHitCount": 26,
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id": "1f1fccc3-a642-4f61-bf49-f37b9a888279",
"protectionDateTime": "2023-01-04T00:00:00Z",
"expirationDateTime": "2024-01-04T00:00:00Z",
"protectionUnit": {
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id": "23014d8c-71fe-4d00-a01a-31850bc5b42a",
"siteId": "344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
}
]
}