exchangeRestoreSession を作成する
[アーティクル]
08/22/2024
1 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
新しい exchangeRestoreSession オブジェクトを 作成します。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
❌
❌
❌
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ 、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類 」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス 」を参照してください。
アクセス許可の種類
最小特権アクセス許可
より高い特権のアクセス許可
委任 (職場または学校のアカウント)
BackupRestore-Restore.ReadWrite.All
注意事項なし。
委任 (個人用 Microsoft アカウント)
サポートされていません。
サポートされていません。
アプリケーション
BackupRestore-Restore.ReadWrite.All
注意事項なし。
HTTP 要求
POST /solutions/backupRestore/exchangeRestoreSessions
名前
説明
Authorization
ベアラー {token}。 必須です。
認証と認可 についての詳細をご覧ください。
Content-Type
application/json. 必須です。
要求本文
要求本文で、 exchangeRestoreSession の JSON 表現を指定します。
exchangeRestoreSession オブジェクトを作成するときに、次のプロパティを指定できます。
応答
成功した場合、このメソッドは応答コード 201 Created
と、応答本文に exchangeRestoreSession オブジェクトを返します。
例
例 1: mailboxRestoreArtifacts を使用して exchangeRestoreSession を作成する
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/exchangeRestoreSessions
Content-Type: application/json
{
"mailboxRestoreArtifacts": [
{
"restorePoint": { "@odata.id": "1f1fccc3-a642-4f61-bf49-f37b9a888279" },
"destinationType": "inPlace"
},
{
"restorePoint": { "@odata.id": "1f1fccc3-a642-4f61-bf49-f37b9a888280" },
"destinationType": "inPlace"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ExchangeRestoreSession
{
MailboxRestoreArtifacts = new List<MailboxRestoreArtifact>
{
new MailboxRestoreArtifact
{
RestorePoint = new RestorePoint
{
AdditionalData = new Dictionary<string, object>
{
{
"@odata.id" , "1f1fccc3-a642-4f61-bf49-f37b9a888279"
},
},
},
DestinationType = DestinationType.InPlace,
},
new MailboxRestoreArtifact
{
RestorePoint = new RestorePoint
{
AdditionalData = new Dictionary<string, object>
{
{
"@odata.id" , "1f1fccc3-a642-4f61-bf49-f37b9a888280"
},
},
},
DestinationType = DestinationType.InPlace,
},
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.BackupRestore.ExchangeRestoreSessions.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
mgc solutions backup-restore exchange-restore-sessions create --body '{\
"mailboxRestoreArtifacts": [\
{\
"restorePoint": { "@odata.id": "1f1fccc3-a642-4f61-bf49-f37b9a888279" },\
"destinationType": "inPlace"\
},\
{\
"restorePoint": { "@odata.id": "1f1fccc3-a642-4f61-bf49-f37b9a888280" },\
"destinationType": "inPlace"\
}\
]\
}\
'
プロジェクトに 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.NewExchangeRestoreSession()
mailboxRestoreArtifact := graphmodels.NewMailboxRestoreArtifact()
restorePoint := graphmodels.NewRestorePoint()
additionalData := map[string]interface{}{
"@odata.id" : "1f1fccc3-a642-4f61-bf49-f37b9a888279",
}
restorePoint.SetAdditionalData(additionalData)
mailboxRestoreArtifact.SetRestorePoint(restorePoint)
destinationType := graphmodels.INPLACE_DESTINATIONTYPE
mailboxRestoreArtifact.SetDestinationType(&destinationType)
mailboxRestoreArtifact1 := graphmodels.NewMailboxRestoreArtifact()
restorePoint := graphmodels.NewRestorePoint()
additionalData := map[string]interface{}{
"@odata.id" : "1f1fccc3-a642-4f61-bf49-f37b9a888280",
}
restorePoint.SetAdditionalData(additionalData)
mailboxRestoreArtifact1.SetRestorePoint(restorePoint)
destinationType := graphmodels.INPLACE_DESTINATIONTYPE
mailboxRestoreArtifact1.SetDestinationType(&destinationType)
mailboxRestoreArtifacts := []graphmodels.MailboxRestoreArtifactable {
mailboxRestoreArtifact,
mailboxRestoreArtifact1,
}
requestBody.SetMailboxRestoreArtifacts(mailboxRestoreArtifacts)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
exchangeRestoreSessions, err := graphClient.Solutions().BackupRestore().ExchangeRestoreSessions().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);
ExchangeRestoreSession exchangeRestoreSession = new ExchangeRestoreSession();
LinkedList<MailboxRestoreArtifact> mailboxRestoreArtifacts = new LinkedList<MailboxRestoreArtifact>();
MailboxRestoreArtifact mailboxRestoreArtifact = new MailboxRestoreArtifact();
RestorePoint restorePoint = new RestorePoint();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("@odata.id", "1f1fccc3-a642-4f61-bf49-f37b9a888279");
restorePoint.setAdditionalData(additionalData);
mailboxRestoreArtifact.setRestorePoint(restorePoint);
mailboxRestoreArtifact.setDestinationType(DestinationType.InPlace);
mailboxRestoreArtifacts.add(mailboxRestoreArtifact);
MailboxRestoreArtifact mailboxRestoreArtifact1 = new MailboxRestoreArtifact();
RestorePoint restorePoint1 = new RestorePoint();
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("@odata.id", "1f1fccc3-a642-4f61-bf49-f37b9a888280");
restorePoint1.setAdditionalData(additionalData1);
mailboxRestoreArtifact1.setRestorePoint(restorePoint1);
mailboxRestoreArtifact1.setDestinationType(DestinationType.InPlace);
mailboxRestoreArtifacts.add(mailboxRestoreArtifact1);
exchangeRestoreSession.setMailboxRestoreArtifacts(mailboxRestoreArtifacts);
ExchangeRestoreSession result = graphClient.solutions().backupRestore().exchangeRestoreSessions().post(exchangeRestoreSession);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const exchangeRestoreSession = {
mailboxRestoreArtifacts: [
{
restorePoint: { '@odata.id': '1f1fccc3-a642-4f61-bf49-f37b9a888279' },
destinationType: 'inPlace'
},
{
restorePoint: { '@odata.id': '1f1fccc3-a642-4f61-bf49-f37b9a888280' },
destinationType: 'inPlace'
}
]
};
await client.api('/solutions/backupRestore/exchangeRestoreSessions')
.post(exchangeRestoreSession);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExchangeRestoreSession;
use Microsoft\Graph\Generated\Models\MailboxRestoreArtifact;
use Microsoft\Graph\Generated\Models\RestorePoint;
use Microsoft\Graph\Generated\Models\DestinationType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExchangeRestoreSession();
$mailboxRestoreArtifactsMailboxRestoreArtifact1 = new MailboxRestoreArtifact();
$mailboxRestoreArtifactsMailboxRestoreArtifact1RestorePoint = new RestorePoint();
$additionalData = [
'@odata.id' => '1f1fccc3-a642-4f61-bf49-f37b9a888279',
];
$mailboxRestoreArtifactsMailboxRestoreArtifact1RestorePoint->setAdditionalData($additionalData);
$mailboxRestoreArtifactsMailboxRestoreArtifact1->setRestorePoint($mailboxRestoreArtifactsMailboxRestoreArtifact1RestorePoint);
$mailboxRestoreArtifactsMailboxRestoreArtifact1->setDestinationType(new DestinationType('inPlace'));
$mailboxRestoreArtifactsArray []= $mailboxRestoreArtifactsMailboxRestoreArtifact1;
$mailboxRestoreArtifactsMailboxRestoreArtifact2 = new MailboxRestoreArtifact();
$mailboxRestoreArtifactsMailboxRestoreArtifact2RestorePoint = new RestorePoint();
$additionalData = [
'@odata.id' => '1f1fccc3-a642-4f61-bf49-f37b9a888280',
];
$mailboxRestoreArtifactsMailboxRestoreArtifact2RestorePoint->setAdditionalData($additionalData);
$mailboxRestoreArtifactsMailboxRestoreArtifact2->setRestorePoint($mailboxRestoreArtifactsMailboxRestoreArtifact2RestorePoint);
$mailboxRestoreArtifactsMailboxRestoreArtifact2->setDestinationType(new DestinationType('inPlace'));
$mailboxRestoreArtifactsArray []= $mailboxRestoreArtifactsMailboxRestoreArtifact2;
$requestBody->setMailboxRestoreArtifacts($mailboxRestoreArtifactsArray);
$result = $graphServiceClient->solutions()->backupRestore()->exchangeRestoreSessions()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.exchange_restore_session import ExchangeRestoreSession
from msgraph.generated.models.mailbox_restore_artifact import MailboxRestoreArtifact
from msgraph.generated.models.restore_point import RestorePoint
from msgraph.generated.models.destination_type import DestinationType
graph_client = GraphServiceClient(credentials, scopes)
request_body = ExchangeRestoreSession(
mailbox_restore_artifacts = [
MailboxRestoreArtifact(
restore_point = RestorePoint(
additional_data = {
"@odata_id" : "1f1fccc3-a642-4f61-bf49-f37b9a888279",
}
),
destination_type = DestinationType.InPlace,
),
MailboxRestoreArtifact(
restore_point = RestorePoint(
additional_data = {
"@odata_id" : "1f1fccc3-a642-4f61-bf49-f37b9a888280",
}
),
destination_type = DestinationType.InPlace,
),
],
)
result = await graph_client.solutions.backup_restore.exchange_restore_sessions.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "/solutions/backupRestore/$metadata#exchangeRestoreSessions/$entity",
"id": "959ba739-70b5-43c4-8c90-b2c22014f18b",
"status": "draft",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "ABC"
}
},
"createdDateTime": "2023-03-30T12:01:03.45Z",
"lastModifiedBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "DEF"
}
},
"lastModifiedDateTime": "2023-03-30T12:01:03.45Z",
"error": null
}
例 2: 詳細なMailboxRestoreArtifact を使用して exchangeRestoreSession を作成する
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/exchangeRestoreSessions
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.exchangeRestoreSession",
"granularMailboxRestoreArtifacts": [
{
"restorePoint": { "@odata.id": "1f1fccc3-a642-4f61-bf49-f37b9a888279" },
"destinationType": "inPlace",
"searchResponseId" : "M2UyZDAwMDAwMDMxMzkzYTMyNj"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ExchangeRestoreSession
{
OdataType = "#microsoft.graph.exchangeRestoreSession",
GranularMailboxRestoreArtifacts = new List<GranularMailboxRestoreArtifact>
{
new GranularMailboxRestoreArtifact
{
RestorePoint = new RestorePoint
{
AdditionalData = new Dictionary<string, object>
{
{
"@odata.id" , "1f1fccc3-a642-4f61-bf49-f37b9a888279"
},
},
},
DestinationType = DestinationType.InPlace,
SearchResponseId = "M2UyZDAwMDAwMDMxMzkzYTMyNj",
},
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.BackupRestore.ExchangeRestoreSessions.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
mgc solutions backup-restore exchange-restore-sessions create --body '{\
"@odata.type": "#microsoft.graph.exchangeRestoreSession",\
"granularMailboxRestoreArtifacts": [\
{\
"restorePoint": { "@odata.id": "1f1fccc3-a642-4f61-bf49-f37b9a888279" },\
"destinationType": "inPlace",\
"searchResponseId" : "M2UyZDAwMDAwMDMxMzkzYTMyNj"\
}\
]\
}\
'
プロジェクトに 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.NewExchangeRestoreSession()
granularMailboxRestoreArtifact := graphmodels.NewGranularMailboxRestoreArtifact()
restorePoint := graphmodels.NewRestorePoint()
additionalData := map[string]interface{}{
"@odata.id" : "1f1fccc3-a642-4f61-bf49-f37b9a888279",
}
restorePoint.SetAdditionalData(additionalData)
granularMailboxRestoreArtifact.SetRestorePoint(restorePoint)
destinationType := graphmodels.INPLACE_DESTINATIONTYPE
granularMailboxRestoreArtifact.SetDestinationType(&destinationType)
searchResponseId := "M2UyZDAwMDAwMDMxMzkzYTMyNj"
granularMailboxRestoreArtifact.SetSearchResponseId(&searchResponseId)
granularMailboxRestoreArtifacts := []graphmodels.GranularMailboxRestoreArtifactable {
granularMailboxRestoreArtifact,
}
requestBody.SetGranularMailboxRestoreArtifacts(granularMailboxRestoreArtifacts)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
exchangeRestoreSessions, err := graphClient.Solutions().BackupRestore().ExchangeRestoreSessions().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);
ExchangeRestoreSession exchangeRestoreSession = new ExchangeRestoreSession();
exchangeRestoreSession.setOdataType("#microsoft.graph.exchangeRestoreSession");
LinkedList<GranularMailboxRestoreArtifact> granularMailboxRestoreArtifacts = new LinkedList<GranularMailboxRestoreArtifact>();
GranularMailboxRestoreArtifact granularMailboxRestoreArtifact = new GranularMailboxRestoreArtifact();
RestorePoint restorePoint = new RestorePoint();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("@odata.id", "1f1fccc3-a642-4f61-bf49-f37b9a888279");
restorePoint.setAdditionalData(additionalData);
granularMailboxRestoreArtifact.setRestorePoint(restorePoint);
granularMailboxRestoreArtifact.setDestinationType(DestinationType.InPlace);
granularMailboxRestoreArtifact.setSearchResponseId("M2UyZDAwMDAwMDMxMzkzYTMyNj");
granularMailboxRestoreArtifacts.add(granularMailboxRestoreArtifact);
exchangeRestoreSession.setGranularMailboxRestoreArtifacts(granularMailboxRestoreArtifacts);
ExchangeRestoreSession result = graphClient.solutions().backupRestore().exchangeRestoreSessions().post(exchangeRestoreSession);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const exchangeRestoreSession = {
'@odata.type': '#microsoft.graph.exchangeRestoreSession',
granularMailboxRestoreArtifacts: [
{
restorePoint: { '@odata.id': '1f1fccc3-a642-4f61-bf49-f37b9a888279' },
destinationType: 'inPlace',
searchResponseId: 'M2UyZDAwMDAwMDMxMzkzYTMyNj'
}
]
};
await client.api('/solutions/backupRestore/exchangeRestoreSessions')
.post(exchangeRestoreSession);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExchangeRestoreSession;
use Microsoft\Graph\Generated\Models\GranularMailboxRestoreArtifact;
use Microsoft\Graph\Generated\Models\RestorePoint;
use Microsoft\Graph\Generated\Models\DestinationType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExchangeRestoreSession();
$requestBody->setOdataType('#microsoft.graph.exchangeRestoreSession');
$granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1 = new GranularMailboxRestoreArtifact();
$granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1RestorePoint = new RestorePoint();
$additionalData = [
'@odata.id' => '1f1fccc3-a642-4f61-bf49-f37b9a888279',
];
$granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1RestorePoint->setAdditionalData($additionalData);
$granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1->setRestorePoint($granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1RestorePoint);
$granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1->setDestinationType(new DestinationType('inPlace'));
$granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1->setSearchResponseId('M2UyZDAwMDAwMDMxMzkzYTMyNj');
$granularMailboxRestoreArtifactsArray []= $granularMailboxRestoreArtifactsGranularMailboxRestoreArtifact1;
$requestBody->setGranularMailboxRestoreArtifacts($granularMailboxRestoreArtifactsArray);
$result = $graphServiceClient->solutions()->backupRestore()->exchangeRestoreSessions()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.exchange_restore_session import ExchangeRestoreSession
from msgraph.generated.models.granular_mailbox_restore_artifact import GranularMailboxRestoreArtifact
from msgraph.generated.models.restore_point import RestorePoint
from msgraph.generated.models.destination_type import DestinationType
graph_client = GraphServiceClient(credentials, scopes)
request_body = ExchangeRestoreSession(
odata_type = "#microsoft.graph.exchangeRestoreSession",
granular_mailbox_restore_artifacts = [
GranularMailboxRestoreArtifact(
restore_point = RestorePoint(
additional_data = {
"@odata_id" : "1f1fccc3-a642-4f61-bf49-f37b9a888279",
}
),
destination_type = DestinationType.InPlace,
search_response_id = "M2UyZDAwMDAwMDMxMzkzYTMyNj",
),
],
)
result = await graph_client.solutions.backup_restore.exchange_restore_sessions.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "/solutions/backupRestore/$metadata#exchangeRestoreSessions/$entity",
"id": "959ba739-70b5-43c4-8c90-b2c22014f18b",
"status": "draft",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "ABC"
}
},
"createdDateTime": "2023-03-30T12:01:03.45Z",
"lastModifiedBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "DEF"
}
},
"lastModifiedDateTime": "2023-03-30T12:01:03.45Z",
"error": null,
"granularMailboxRestoreArtifact": [
{
"id": "959ba739-70b5-43c4-8c90-b2c22014f18a",
"restorePoint": { "@odata.id": "1f1fccc3-a642-4f61-bf49-f37b9a888279" },
"restoredFolderId": null,
"status": "added",
"startDateTime": null,
"destinationType": "inPlace",
"searchResponseId": "M2UyZDAwMDAwMDMxMzkzYTMyNj",
"error": null
}
]
}