名前空間: microsoft.graph
exchangeRestoreSession に関連付けられている新しいメールボックスRestoreArtifactsBulkAdditionRequest オブジェクトを作成します。
次の手順では、一括成果物を追加して exchangeRestoreSession を作成および管理する方法について説明します。
- 空のペイロードを使用して新しい exchangeRestoreSession を作成します。
-
exchangeRestoreSession に関連付けられている新しいメールボックスRestoreArtifactsBulkAdditionRequest オブジェクトを作成します。
- Exchange 復元セッションの mailboxRestoreArtifactsBulkAdditionRequest の状態を取得します。 作成時の初期状態は
active され、 exchangeRestoreSession がアクティブになるまでこの状態のままです。
- 最初の手順で作成した exchangeRestoreSession をアクティブにします。
-
mailboxRestoreArtifactsBulkAdditionRequest の状態を監視します。 すべてのメールが対応する exchangeRestoreSession に追加されると、 mailboxRestoreArtifactsBulkAdditionRequest の状態が
completedに変わります。 リソースの解決中にエラーが発生した場合、状態は completedWithErrorsに変わります。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
BackupRestore-Restore.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
BackupRestore-Restore.ReadWrite.All |
注意事項なし。 |
HTTP 要求
POST /solutions/backupRestore/exchangeRestoreSessions/{exchangeRestoreSessionId}/mailboxRestoreArtifactsBulkAdditionRequests
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、 mailboxRestoreArtifactsBulkAdditionRequest オブジェクトの JSON 表現を指定します。
mailboxRestoreArtifactsBulkAdditionRequest オブジェクトを作成するときに、次のプロパティを指定できます。
| プロパティ |
型 |
説明 |
| directoryObjectIds |
String collection |
ディレクトリ オブジェクト ID の一覧。 省略可能。 |
| メールボックス |
String collection |
電子メール アドレスの一覧。 省略可能。 |
応答
成功した場合、このメソッドは 201 Created 応答コードと、応答本文の mailboxRestoreArtifactsBulkAdditionRequest オブジェクトを返します。
考えられるエラー応答の一覧については、「 Backup Storage API エラー応答」を参照してください。
例
要求
次の例は、一括操作で指定した Exchange 復元セッションにメールボックスの一覧を追加する要求を示しています。
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/exchangeRestoreSessions/dc3a3fc8-eb4b-45eb-9ca6-4955696344b8/mailboxRestoreArtifactsBulkAdditionRequests
Content-Type: application/json
{
"displayName": "Usermailbox-BulkRestoreArtifacts",
"mailboxes": [
"contoso1@micorosft.com",
"consotos2@microsoft.com",
"contoso3@microsoft.com"
],
"protectionTimePeriod": {
"startDateTime": "2021-01-01T00:00:00Z",
"endDateTime": "2021-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 MailboxRestoreArtifactsBulkAdditionRequest
{
DisplayName = "Usermailbox-BulkRestoreArtifacts",
Mailboxes = new List<string>
{
"contoso1@micorosft.com",
"consotos2@microsoft.com",
"contoso3@microsoft.com",
},
ProtectionTimePeriod = new TimePeriod
{
StartDateTime = DateTimeOffset.Parse("2021-01-01T00:00:00Z"),
EndDateTime = DateTimeOffset.Parse("2021-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.ExchangeRestoreSessions["{exchangeRestoreSession-id}"].MailboxRestoreArtifactsBulkAdditionRequests.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.NewMailboxRestoreArtifactsBulkAdditionRequest()
displayName := "Usermailbox-BulkRestoreArtifacts"
requestBody.SetDisplayName(&displayName)
mailboxes := []string {
"contoso1@micorosft.com",
"consotos2@microsoft.com",
"contoso3@microsoft.com",
}
requestBody.SetMailboxes(mailboxes)
protectionTimePeriod := graphmodels.NewTimePeriod()
startDateTime , err := time.Parse(time.RFC3339, "2021-01-01T00:00:00Z")
protectionTimePeriod.SetStartDateTime(&startDateTime)
endDateTime , err := time.Parse(time.RFC3339, "2021-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
mailboxRestoreArtifactsBulkAdditionRequests, err := graphClient.Solutions().BackupRestore().ExchangeRestoreSessions().ByExchangeRestoreSessionId("exchangeRestoreSession-id").MailboxRestoreArtifactsBulkAdditionRequests().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);
MailboxRestoreArtifactsBulkAdditionRequest mailboxRestoreArtifactsBulkAdditionRequest = new MailboxRestoreArtifactsBulkAdditionRequest();
mailboxRestoreArtifactsBulkAdditionRequest.setDisplayName("Usermailbox-BulkRestoreArtifacts");
LinkedList<String> mailboxes = new LinkedList<String>();
mailboxes.add("contoso1@micorosft.com");
mailboxes.add("consotos2@microsoft.com");
mailboxes.add("contoso3@microsoft.com");
mailboxRestoreArtifactsBulkAdditionRequest.setMailboxes(mailboxes);
TimePeriod protectionTimePeriod = new TimePeriod();
OffsetDateTime startDateTime = OffsetDateTime.parse("2021-01-01T00:00:00Z");
protectionTimePeriod.setStartDateTime(startDateTime);
OffsetDateTime endDateTime = OffsetDateTime.parse("2021-01-08T00:00:00Z");
protectionTimePeriod.setEndDateTime(endDateTime);
mailboxRestoreArtifactsBulkAdditionRequest.setProtectionTimePeriod(protectionTimePeriod);
mailboxRestoreArtifactsBulkAdditionRequest.setDestinationType(DestinationType.New);
mailboxRestoreArtifactsBulkAdditionRequest.setTags(EnumSet.of(RestorePointTags.FastRestore));
mailboxRestoreArtifactsBulkAdditionRequest.setRestorePointPreference(RestorePointPreference.Latest);
MailboxRestoreArtifactsBulkAdditionRequest result = graphClient.solutions().backupRestore().exchangeRestoreSessions().byExchangeRestoreSessionId("{exchangeRestoreSession-id}").mailboxRestoreArtifactsBulkAdditionRequests().post(mailboxRestoreArtifactsBulkAdditionRequest);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const mailboxRestoreArtifactsBulkAdditionRequest = {
displayName: 'Usermailbox-BulkRestoreArtifacts',
mailboxes: [
'contoso1@micorosft.com',
'consotos2@microsoft.com',
'contoso3@microsoft.com'
],
protectionTimePeriod: {
startDateTime: '2021-01-01T00:00:00Z',
endDateTime: '2021-01-08T00:00:00Z'
},
destinationType: 'new',
tags: 'fastRestore',
restorePointPreference: 'latest'
};
await client.api('/solutions/backupRestore/exchangeRestoreSessions/dc3a3fc8-eb4b-45eb-9ca6-4955696344b8/mailboxRestoreArtifactsBulkAdditionRequests')
.post(mailboxRestoreArtifactsBulkAdditionRequest);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MailboxRestoreArtifactsBulkAdditionRequest;
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 MailboxRestoreArtifactsBulkAdditionRequest();
$requestBody->setDisplayName('Usermailbox-BulkRestoreArtifacts');
$requestBody->setMailboxes(['contoso1@micorosft.com', 'consotos2@microsoft.com', 'contoso3@microsoft.com', ]);
$protectionTimePeriod = new TimePeriod();
$protectionTimePeriod->setStartDateTime(new \DateTime('2021-01-01T00:00:00Z'));
$protectionTimePeriod->setEndDateTime(new \DateTime('2021-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()->exchangeRestoreSessions()->byExchangeRestoreSessionId('exchangeRestoreSession-id')->mailboxRestoreArtifactsBulkAdditionRequests()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.BackupRestore
$params = @{
displayName = "Usermailbox-BulkRestoreArtifacts"
mailboxes = @(
"contoso1@micorosft.com"
"consotos2@microsoft.com"
"contoso3@microsoft.com"
)
protectionTimePeriod = @{
startDateTime = [System.DateTime]::Parse("2021-01-01T00:00:00Z")
endDateTime = [System.DateTime]::Parse("2021-01-08T00:00:00Z")
}
destinationType = "new"
tags = "fastRestore"
restorePointPreference = "latest"
}
New-MgSolutionBackupRestoreExchangeRestoreSessionMailboxRestoreArtifactBulkAdditionRequest -ExchangeRestoreSessionId $exchangeRestoreSessionId -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.mailbox_restore_artifacts_bulk_addition_request import MailboxRestoreArtifactsBulkAdditionRequest
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 = MailboxRestoreArtifactsBulkAdditionRequest(
display_name = "Usermailbox-BulkRestoreArtifacts",
mailboxes = [
"contoso1@micorosft.com",
"consotos2@microsoft.com",
"contoso3@microsoft.com",
],
protection_time_period = TimePeriod(
start_date_time = "2021-01-01T00:00:00Z",
end_date_time = "2021-01-08T00:00:00Z",
),
destination_type = DestinationType.New,
tags = RestorePointTags.FastRestore,
restore_point_preference = RestorePointPreference.Latest,
)
result = await graph_client.solutions.backup_restore.exchange_restore_sessions.by_exchange_restore_session_id('exchangeRestoreSession-id').mailbox_restore_artifacts_bulk_addition_requests.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
次の例は応答を示しています。
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "b4318e3a-3eae-4ce5-87f3-bad51e1527c4",
"destinationType": "new",
"tags": "fastRestore",
"restorePointPreference": "latest",
"displayName": "EXO-BulkRestoreArtifacts",
"status": "active",
"createdDateTime": "2024-12-03T13:17:19.8862272Z",
"lastModifiedDateTime": "2024-12-03T13:17:19.8862272Z",
"mailboxes": [],
"protectionTimePeriod": {
"startDateTime": "2024-11-26T00:00:00Z",
"endDateTime": "2024-12-03T00:00:00Z"
},
"createdBy": {
"user": {
"identity": "fb70be35-8c8e-4c8a-b55d-f8cd95c5e23a"
}
},
"lastModifiedBy": {
"user": {
"identity": "fb70be35-8c8e-4c8a-b55d-f8cd95c5e23a"
}
}
}