名前空間: microsoft.graph
sharePointRestoreSession に関連付けられた新しい siteRestoreArtifactsBulkAdditionRequest オブジェクトを作成します。
次の手順では、一括成果物を追加して sharePointRestoreSession を作成および管理する方法について説明します。
- 空のペイロードを使用して新しい sharePointRestoreSession を作成します。
-
sharePointRestoreSession に関連付けられた新しい siteRestoreArtifactsBulkAdditionRequest オブジェクトを作成します。
- SharePoint 復元セッションの siteRestoreArtifactsBulkAdditionRequest の状態を取得します。 作成時の初期状態は
active され、 sharePointRestoreSession がアクティブになるまでこの状態のままです。
- 最初の手順で作成した sharePointRestoreSession をアクティブにします。
-
siteRestoreArtifactsBulkAdditionRequest の状態を監視します。 すべてのサイトが対応する sharePointRestoreSession に追加されると、 siteRestoreArtifactsBulkAdditionRequest の 状態が
completedに変わります。 リソースの解決中にエラーが発生した場合、状態は completedWithErrorsに変わります。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
BackupRestore-Restore.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
BackupRestore-Restore.ReadWrite.All |
注意事項なし。 |
HTTP 要求
POST /solutions/backupRestore/sharePointRestoreSessions/{sharePointRestoreSessionId}/siteRestoreArtifactsBulkAdditionRequests
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、 siteRestoreArtifactsBulkAdditionRequest オブジェクトの JSON 表現を指定します。
siteRestoreArtifactsBulkAdditionRequest オブジェクトを作成するときに、次のプロパティを指定できます。
| プロパティ |
型 |
説明 |
| siteIds |
String collection |
SharePoint サイト ID の一覧。 省略可能。 |
| siteWebUrls |
String collection |
SharePoint サイト URL の一覧。 省略可能。 |
応答
成功した場合、このメソッドは 201 Created 応答コードと、応答本文の siteRestoreArtifactsBulkAdditionRequest オブジェクトを返します。
考えられるエラー応答の一覧については、「 Backup Storage API エラー応答」を参照してください。
例
要求
次の例は、一括操作で指定した SharePoint 復元セッションにサイトの一覧を追加する要求を示しています。
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/sharePointRestoreSessions/959ba739-70b5-43c4-8c90-b2c22014f18b/siteRestoreArtifactsBulkAdditionRequests
Content-Type: application/json
{
"displayName": "SPO-BulkRestoreArtifacts",
"siteWebUrls": [
"https: //contoso1.sharepoint.com",
"https: //contoso2.sharepoint.com",
"https: //contoso3.sharepoint.com"
],
"protectionTimePeriod": {
"startDateTime": "2024-01-01T00:00:00Z",
"endDateTime": "2024-01-08T00:00:00Z"
},
"destinationType": "new",
"tags": "fastRestore",
"restorePointPreference": "latest"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new SiteRestoreArtifactsBulkAdditionRequest
{
DisplayName = "SPO-BulkRestoreArtifacts",
SiteWebUrls = new List<string>
{
"https: //contoso1.sharepoint.com",
"https: //contoso2.sharepoint.com",
"https: //contoso3.sharepoint.com",
},
ProtectionTimePeriod = new TimePeriod
{
StartDateTime = DateTimeOffset.Parse("2024-01-01T00:00:00Z"),
EndDateTime = DateTimeOffset.Parse("2024-01-08T00:00:00Z"),
},
DestinationType = DestinationType.New,
Tags = RestorePointTags.FastRestore,
RestorePointPreference = RestorePointPreference.Latest,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.BackupRestore.SharePointRestoreSessions["{sharePointRestoreSession-id}"].SiteRestoreArtifactsBulkAdditionRequests.PostAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewSiteRestoreArtifactsBulkAdditionRequest()
displayName := "SPO-BulkRestoreArtifacts"
requestBody.SetDisplayName(&displayName)
siteWebUrls := []string {
"https: //contoso1.sharepoint.com",
"https: //contoso2.sharepoint.com",
"https: //contoso3.sharepoint.com",
}
requestBody.SetSiteWebUrls(siteWebUrls)
protectionTimePeriod := graphmodels.NewTimePeriod()
startDateTime , err := time.Parse(time.RFC3339, "2024-01-01T00:00:00Z")
protectionTimePeriod.SetStartDateTime(&startDateTime)
endDateTime , err := time.Parse(time.RFC3339, "2024-01-08T00:00:00Z")
protectionTimePeriod.SetEndDateTime(&endDateTime)
requestBody.SetProtectionTimePeriod(protectionTimePeriod)
destinationType := graphmodels.NEW_DESTINATIONTYPE
requestBody.SetDestinationType(&destinationType)
tags := graphmodels.FASTRESTORE_RESTOREPOINTTAGS
requestBody.SetTags(&tags)
restorePointPreference := graphmodels.LATEST_RESTOREPOINTPREFERENCE
requestBody.SetRestorePointPreference(&restorePointPreference)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
siteRestoreArtifactsBulkAdditionRequests, err := graphClient.Solutions().BackupRestore().SharePointRestoreSessions().BySharePointRestoreSessionId("sharePointRestoreSession-id").SiteRestoreArtifactsBulkAdditionRequests().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
SiteRestoreArtifactsBulkAdditionRequest siteRestoreArtifactsBulkAdditionRequest = new SiteRestoreArtifactsBulkAdditionRequest();
siteRestoreArtifactsBulkAdditionRequest.setDisplayName("SPO-BulkRestoreArtifacts");
LinkedList<String> siteWebUrls = new LinkedList<String>();
siteWebUrls.add("https: //contoso1.sharepoint.com");
siteWebUrls.add("https: //contoso2.sharepoint.com");
siteWebUrls.add("https: //contoso3.sharepoint.com");
siteRestoreArtifactsBulkAdditionRequest.setSiteWebUrls(siteWebUrls);
TimePeriod protectionTimePeriod = new TimePeriod();
OffsetDateTime startDateTime = OffsetDateTime.parse("2024-01-01T00:00:00Z");
protectionTimePeriod.setStartDateTime(startDateTime);
OffsetDateTime endDateTime = OffsetDateTime.parse("2024-01-08T00:00:00Z");
protectionTimePeriod.setEndDateTime(endDateTime);
siteRestoreArtifactsBulkAdditionRequest.setProtectionTimePeriod(protectionTimePeriod);
siteRestoreArtifactsBulkAdditionRequest.setDestinationType(DestinationType.New);
siteRestoreArtifactsBulkAdditionRequest.setTags(EnumSet.of(RestorePointTags.FastRestore));
siteRestoreArtifactsBulkAdditionRequest.setRestorePointPreference(RestorePointPreference.Latest);
SiteRestoreArtifactsBulkAdditionRequest result = graphClient.solutions().backupRestore().sharePointRestoreSessions().bySharePointRestoreSessionId("{sharePointRestoreSession-id}").siteRestoreArtifactsBulkAdditionRequests().post(siteRestoreArtifactsBulkAdditionRequest);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const siteRestoreArtifactsBulkAdditionRequest = {
displayName: 'SPO-BulkRestoreArtifacts',
siteWebUrls: [
'https: //contoso1.sharepoint.com',
'https: //contoso2.sharepoint.com',
'https: //contoso3.sharepoint.com'
],
protectionTimePeriod: {
startDateTime: '2024-01-01T00:00:00Z',
endDateTime: '2024-01-08T00:00:00Z'
},
destinationType: 'new',
tags: 'fastRestore',
restorePointPreference: 'latest'
};
await client.api('/solutions/backupRestore/sharePointRestoreSessions/959ba739-70b5-43c4-8c90-b2c22014f18b/siteRestoreArtifactsBulkAdditionRequests')
.post(siteRestoreArtifactsBulkAdditionRequest);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\SiteRestoreArtifactsBulkAdditionRequest;
use Microsoft\Graph\Generated\Models\TimePeriod;
use Microsoft\Graph\Generated\Models\DestinationType;
use Microsoft\Graph\Generated\Models\RestorePointTags;
use Microsoft\Graph\Generated\Models\RestorePointPreference;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SiteRestoreArtifactsBulkAdditionRequest();
$requestBody->setDisplayName('SPO-BulkRestoreArtifacts');
$requestBody->setSiteWebUrls(['https: //contoso1.sharepoint.com', 'https: //contoso2.sharepoint.com', 'https: //contoso3.sharepoint.com', ]);
$protectionTimePeriod = new TimePeriod();
$protectionTimePeriod->setStartDateTime(new \DateTime('2024-01-01T00:00:00Z'));
$protectionTimePeriod->setEndDateTime(new \DateTime('2024-01-08T00:00:00Z'));
$requestBody->setProtectionTimePeriod($protectionTimePeriod);
$requestBody->setDestinationType(new DestinationType('new'));
$requestBody->setTags(new RestorePointTags('fastRestore'));
$requestBody->setRestorePointPreference(new RestorePointPreference('latest'));
$result = $graphServiceClient->solutions()->backupRestore()->sharePointRestoreSessions()->bySharePointRestoreSessionId('sharePointRestoreSession-id')->siteRestoreArtifactsBulkAdditionRequests()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.BackupRestore
$params = @{
displayName = "SPO-BulkRestoreArtifacts"
siteWebUrls = @(
"https: //contoso1.sharepoint.com"
"https: //contoso2.sharepoint.com"
"https: //contoso3.sharepoint.com"
)
protectionTimePeriod = @{
startDateTime = [System.DateTime]::Parse("2024-01-01T00:00:00Z")
endDateTime = [System.DateTime]::Parse("2024-01-08T00:00:00Z")
}
destinationType = "new"
tags = "fastRestore"
restorePointPreference = "latest"
}
New-MgSolutionBackupRestoreSharePointRestoreSessionSiteRestoreArtifactBulkAdditionRequest -SharePointRestoreSessionId $sharePointRestoreSessionId -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.site_restore_artifacts_bulk_addition_request import SiteRestoreArtifactsBulkAdditionRequest
from msgraph.generated.models.time_period import TimePeriod
from msgraph.generated.models.destination_type import DestinationType
from msgraph.generated.models.restore_point_tags import RestorePointTags
from msgraph.generated.models.restore_point_preference import RestorePointPreference
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SiteRestoreArtifactsBulkAdditionRequest(
display_name = "SPO-BulkRestoreArtifacts",
site_web_urls = [
"https: //contoso1.sharepoint.com",
"https: //contoso2.sharepoint.com",
"https: //contoso3.sharepoint.com",
],
protection_time_period = TimePeriod(
start_date_time = "2024-01-01T00:00:00Z",
end_date_time = "2024-01-08T00:00:00Z",
),
destination_type = DestinationType.New,
tags = RestorePointTags.FastRestore,
restore_point_preference = RestorePointPreference.Latest,
)
result = await graph_client.solutions.backup_restore.share_point_restore_sessions.by_share_point_restore_session_id('sharePointRestoreSession-id').site_restore_artifacts_bulk_addition_requests.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
次の例は応答を示しています。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "/solutions/backupRestore/$metadata#siteRestoreArtifactsBulkAdditionRequest/$entity",
"id": "4437afcf-e520-463c-90a7-ca96401d8039",
"destinationType": "new",
"tags": "fastRestore",
"restorePointPreference": "latest",
"displayName": "SPO-BulkRestoreArtifacts",
"status": "active",
"createdDateTime": "2024-12-03T07:47:57.6011358Z",
"lastModifiedDateTime": "2024-12-03T07:47:57.6011358Z",
"siteWebUrls": [],
"protectionTimePeriod": {
"startDateTime": "2024-01-01T00:00:00Z",
"endDateTime": "2024-01-08T00:00:00Z"
},
"createdBy": {
"user": {
"identity": "fb70be35-8c8e-4c8a-b55d-f8cd95c5e23a"
}
},
"lastModifiedBy": {
"user": {
"identity": "fb70be35-8c8e-4c8a-b55d-f8cd95c5e23a"
}
}
}