命名空间:microsoft.graph
更新 sharePointRestoreSession 对象的属性。
API 可用性
此 API 可用于以下国家级云部署。
| 全局服务 | 美国政府 L4 | 美国政府 L5 (DOD) | 由世纪互联运营的中国 |
|---|---|---|---|
| ✅ | ❌ | ❌ | ❌ |
权限
为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 | 最低特权权限 | 更高特权权限 |
|---|---|---|
| 委派(工作或学校帐户) | BackupRestore-Restore.ReadWrite.All | 不可用。 |
| 委派(个人 Microsoft 帐户) | 不支持。 | 不支持。 |
| 应用程序 | BackupRestore-Restore.ReadWrite.All | 不可用。 |
HTTP 请求
PATCH /solutions/backupRestore/sharePointRestoreSessions/{sharePointRestoreSessionId}
请求标头
| 名称 | 说明 |
|---|---|
| Authorization | 持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-Type | application/json. 必需。 |
请求正文
在请求正文中, 仅 提供要更新的属性的值。 请求正文中未包含的现有属性会保留其以前的值,或者会根据其他属性值的更改重新计算。
下表指定可更新的属性。
| 属性 | 类型 | 说明 |
|---|---|---|
| granularSiteRestoreArtifacts | granularSiteRestoreArtifact 集合 | granularSiteRestoreArtifact 对象的集合。 必填。 |
| policyId | String | 限定还原会话范围的保护策略的标识符。 提供后,服务会验证引用的保护单元是否属于此策略。 继承自 restoreSessionBase。 |
| siteRestoreArtifacts | siteRestoreArtifact 集合 | siteRestoreArtifact 对象的集合。 必填。 |
若要从站点还原会话中删除 siteRestoreArtifact ,请在请求正文中为相应的还原点项目指定 @removed 批注以及 siteRestoreArtifact 的 ID。
若要从粒度还原会话中删除 granularSiteRestoreArtifact ,请在请求正文中指定 @removedgranularSiteRestoreArtifact 的相应工件 ID 的批注。
响应
如果成功,此方法将在响应正文中返回 200 OK 响应代码和更新的 sharePointRestoreSession 对象。
有关可能的错误响应列表,请参阅 备份存储 API 错误响应。
示例
示例 1:更新标准还原会话
请求
以下示例显示了一个请求。
PATCH https://graph.microsoft.com/v1.0/solutions/backupRestore/sharepointRestoreSessions/845457dc-4bb2-4815-bef3-8628ebd1952
Content-Type: application/json
{
"policyId": "99999999-aaaa-bbbb-cccc-dddddddddddd",
"siteRestoreArtifacts@delta": [
{
"restorePoint": { "id": "1b014d8c-71fe-4d00-a01a-31850bc5b32c" }, //Create a new site restore artifact and add it under the Restore Session.
"destinationType": "new"
},
{
"restorePoint": { "id": "2b014d8c-71fe-4d00-a01a-31850bc5b32" },
"destinationType": "new"
},
{
"restorePoint": { "id": "3b014d8c-71fe-4d00-a01a-31850bc5b32c" },
"destinationType": "new"
},
{
"restorePoint": { "id": "4b014d8c-71fe-4d00-a01a-31850bc5b32c" },
"destinationType": "new"
},
{
"@removed": {
"reason": "changed"
},
"id": "959ba739-70b5-43c4-8c90-b2c22014f18a"
},
{
"@removed": {
"reason": "changed"
},
"id": "959ba739-70b5-43c4-8c90-b2c22014f18b"
},
{
"@removed": {
"reason": "changed"
},
"id": "959ba739-70b5-43c4-8c90-b2c22014f18c"
}
]
}
响应
以下示例显示了相应的响应。
HTTP/1.1 200 OK
{
"siteRestoreArtifacts@delta": [
{
"id": "89014d8c-71fe-4d00-a01a-31850bc5b32c",
"restorePoint": { "id": "1b014d8c-71fe-4d00-a01a-31850bc5b32c" },
"destinationType": "new",
"status": "added",
"createdDateTime": "2015-06-19T12:01:03.45Z"
},
{
"id": "67014d8c-71fe-4d00-a01a-31850bc5b32c",
"restorePoint": { "id": "2b014d8c-71fe-4d00-a01a-31850bc5b32c" },
"destinationType": "new",
"status": "added",
"createdDateTime": "2015-06-19T12:01:03.45Z"
},
{
"id": "56014d8c-71fe-4d00-a01a-31850bc5b32c",
"restorePoint": { "id": "3b014d8c-71fe-4d00-a01a-31850bc5b32c" },
"destinationType": "new",
"status": "added",
"createdDateTime": "2015-06-19T12:01:03.45Z"
},
{
"id": "32014d8c-71fe-4d00-a01a-31850bc5b32c",
"restorePoint": { "id": "4b014d8c-71fe-4d00-a01a-31850bc5b32c" },
"destinationType": "new",
"status": "added",
"createdDateTime": "2015-06-19T12:01:03.45Z"
},
{
"id": "99954f18-c8ec-4b62-85bf-cdf3b70b140e",
"restorePoint": { "id": "7b014d8c-71fe-4d00-a01a-31850bc5b32c" },
"destinationType": "new",
"status": "added",
"createdDateTime": "2015-06-19T12:01:03.45Z"
},
{
//Error scenario
"@contentId": "3467e382-71a9-4c07-bef7-bda97e09c0d2", // To add context and more traceability.
"@Core.DataModificationException": {
"info": {
"code": "Invalid",
"message": "The identifier to be removed from the Restore Session does not exist"
},
"failedOperation": "remove",
"responseCode": 409
},
"id": "4267e382-71a9-4c07-bef7-bda97e09c0d2"
}
]
}
示例 2:更新粒度还原会话
请求
以下示例显示了一个请求。
PATCH https://graph.microsoft.com/v1.0/solutions/backupRestore/sharePointRestoreSessions/01b9d504-a6a4-464b-b2e1-0085d9fab651
Content-Type: application/json
{
"granularSiteRestoreArtifacts@delta": [
{
"browseSessionId": "m_RtZ8BiiUXOK69cuN6gwubfm9_yeVlDg8s6hci01_cVOAE",
"id": "f3846f8d-80a6-4480-ae20-5966ebdf2009,26380145-c085-4772-b5ef-94de6bc9447e,3be2f282-276a-4a1a-8db0-8bf0849df84d,8d1ba53f-986a-409f-bf90-3bf55dbd7526"
},
{
"@removed": {
"reason": "changed"
},
"id": "a535851e-9fc6-4eb1-90ab-2955fd9117b5,2a8b7eaf-092a-4561-a25a-998ad2e5142e,38eec3f1-b879-44a6-8ae6-05bd46ed4b3d,ce66019f-cdf9-4575-aa81-de3aabe844a2"
}
]
}
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@context": "https://graph.microsoft.com/v1.0/$metadata#solutions/backupRestore/sharePointRestoreSessions/$entity",
"id": "01b9d504-a6a4-464b-b2e1-0085d9fab651",
"granularSiteRestoreArtifacts@delta": [
{
"siteId": null,
"id": "f3846f8d-80a6-4480-ae20-5966ebdf2009,26380145-c085-4772-b5ef-94de6bc9447e,3be2f282-276a-4a1a-8db0-8bf0849df84d,8d1ba53f-986a-409f-bf90-3bf55dbd7526",
"browseSessionId": "m_RtZ8BiiUXOK69cuN6gwubfm9_yeVlDg8s6hci01_cVOAE",
"restoredItemKey": "",
"webUrl": "",
"restoredItemPath": null,
"restoredItemWebUrl": "",
"status": "added",
"restorePointDateTime": "0001-01-01T00:00:00Z",
"startDateTime": "0001-01-01T00:00:00Z",
"completionDateTime": "0001-01-01T00:00:00Z"
},
{
"id": "a535851e-9fc6-4eb1-90ab-2955fd9117b5,2a8b7eaf-092a-4561-a25a-998ad2e5142e,38eec3f1-b879-44a6-8ae6-05bd46ed4b3d,ce66019f-cdf9-4575-aa81-de3aabe844a2",
"@removed": {
"reason": "changed"
}
}
]
}