名前空間: microsoft.graph
新しい sharePointRestoreSession オブジェクトを 作成します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
BackupRestore-Restore.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
BackupRestore-Restore.ReadWrite.All |
注意事項なし。 |
HTTP 要求
POST /solutions/backupRestore/sharePointRestoreSessions
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、 sharePointRestoreSession の JSON 表現を指定します。
sharePointRestoreSession オブジェクトを作成するときに、次のプロパティを指定できます。
応答
成功した場合、このメソッドは応答コード 201 Created と、応答本文に sharePointRestoreSession オブジェクトを返します。
考えられるエラー応答の一覧については、「 Backup Storage API エラー応答」を参照してください。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/sharePointRestoreSessions
Content-Type: application/json
{
"siteRestoreArtifacts": [
{
"restorePoint": { "id": "1f1fccc3-a642-4f61-bf49-f37b9a888279" },
"destinationType": "inPlace"
},
{
"restorePoint": { "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 SharePointRestoreSession
{
SiteRestoreArtifacts = new List<SiteRestoreArtifact>
{
new SiteRestoreArtifact
{
RestorePoint = new RestorePoint
{
Id = "1f1fccc3-a642-4f61-bf49-f37b9a888279",
},
DestinationType = DestinationType.InPlace,
},
new SiteRestoreArtifact
{
RestorePoint = new RestorePoint
{
Id = "1f1fccc3-a642-4f61-bf49-f37b9a888280",
},
DestinationType = DestinationType.InPlace,
},
},
};
// 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.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.NewSharePointRestoreSession()
siteRestoreArtifact := graphmodels.NewSiteRestoreArtifact()
restorePoint := graphmodels.NewRestorePoint()
id := "1f1fccc3-a642-4f61-bf49-f37b9a888279"
restorePoint.SetId(&id)
siteRestoreArtifact.SetRestorePoint(restorePoint)
destinationType := graphmodels.INPLACE_DESTINATIONTYPE
siteRestoreArtifact.SetDestinationType(&destinationType)
siteRestoreArtifact1 := graphmodels.NewSiteRestoreArtifact()
restorePoint := graphmodels.NewRestorePoint()
id := "1f1fccc3-a642-4f61-bf49-f37b9a888280"
restorePoint.SetId(&id)
siteRestoreArtifact1.SetRestorePoint(restorePoint)
destinationType := graphmodels.INPLACE_DESTINATIONTYPE
siteRestoreArtifact1.SetDestinationType(&destinationType)
siteRestoreArtifacts := []graphmodels.SiteRestoreArtifactable {
siteRestoreArtifact,
siteRestoreArtifact1,
}
requestBody.SetSiteRestoreArtifacts(siteRestoreArtifacts)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
sharePointRestoreSessions, err := graphClient.Solutions().BackupRestore().SharePointRestoreSessions().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);
SharePointRestoreSession sharePointRestoreSession = new SharePointRestoreSession();
LinkedList<SiteRestoreArtifact> siteRestoreArtifacts = new LinkedList<SiteRestoreArtifact>();
SiteRestoreArtifact siteRestoreArtifact = new SiteRestoreArtifact();
RestorePoint restorePoint = new RestorePoint();
restorePoint.setId("1f1fccc3-a642-4f61-bf49-f37b9a888279");
siteRestoreArtifact.setRestorePoint(restorePoint);
siteRestoreArtifact.setDestinationType(DestinationType.InPlace);
siteRestoreArtifacts.add(siteRestoreArtifact);
SiteRestoreArtifact siteRestoreArtifact1 = new SiteRestoreArtifact();
RestorePoint restorePoint1 = new RestorePoint();
restorePoint1.setId("1f1fccc3-a642-4f61-bf49-f37b9a888280");
siteRestoreArtifact1.setRestorePoint(restorePoint1);
siteRestoreArtifact1.setDestinationType(DestinationType.InPlace);
siteRestoreArtifacts.add(siteRestoreArtifact1);
sharePointRestoreSession.setSiteRestoreArtifacts(siteRestoreArtifacts);
SharePointRestoreSession result = graphClient.solutions().backupRestore().sharePointRestoreSessions().post(sharePointRestoreSession);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const sharePointRestoreSession = {
siteRestoreArtifacts: [
{
restorePoint: { id: '1f1fccc3-a642-4f61-bf49-f37b9a888279' },
destinationType: 'inPlace'
},
{
restorePoint: { id: '1f1fccc3-a642-4f61-bf49-f37b9a888280' },
destinationType: 'inPlace'
}
]
};
await client.api('/solutions/backupRestore/sharePointRestoreSessions')
.post(sharePointRestoreSession);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\SharePointRestoreSession;
use Microsoft\Graph\Generated\Models\SiteRestoreArtifact;
use Microsoft\Graph\Generated\Models\RestorePoint;
use Microsoft\Graph\Generated\Models\DestinationType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SharePointRestoreSession();
$siteRestoreArtifactsSiteRestoreArtifact1 = new SiteRestoreArtifact();
$siteRestoreArtifactsSiteRestoreArtifact1RestorePoint = new RestorePoint();
$siteRestoreArtifactsSiteRestoreArtifact1RestorePoint->setId('1f1fccc3-a642-4f61-bf49-f37b9a888279');
$siteRestoreArtifactsSiteRestoreArtifact1->setRestorePoint($siteRestoreArtifactsSiteRestoreArtifact1RestorePoint);
$siteRestoreArtifactsSiteRestoreArtifact1->setDestinationType(new DestinationType('inPlace'));
$siteRestoreArtifactsArray []= $siteRestoreArtifactsSiteRestoreArtifact1;
$siteRestoreArtifactsSiteRestoreArtifact2 = new SiteRestoreArtifact();
$siteRestoreArtifactsSiteRestoreArtifact2RestorePoint = new RestorePoint();
$siteRestoreArtifactsSiteRestoreArtifact2RestorePoint->setId('1f1fccc3-a642-4f61-bf49-f37b9a888280');
$siteRestoreArtifactsSiteRestoreArtifact2->setRestorePoint($siteRestoreArtifactsSiteRestoreArtifact2RestorePoint);
$siteRestoreArtifactsSiteRestoreArtifact2->setDestinationType(new DestinationType('inPlace'));
$siteRestoreArtifactsArray []= $siteRestoreArtifactsSiteRestoreArtifact2;
$requestBody->setSiteRestoreArtifacts($siteRestoreArtifactsArray);
$result = $graphServiceClient->solutions()->backupRestore()->sharePointRestoreSessions()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.BackupRestore
$params = @{
siteRestoreArtifacts = @(
@{
restorePoint = @{
id = "1f1fccc3-a642-4f61-bf49-f37b9a888279"
}
destinationType = "inPlace"
}
@{
restorePoint = @{
id = "1f1fccc3-a642-4f61-bf49-f37b9a888280"
}
destinationType = "inPlace"
}
)
}
New-MgSolutionBackupRestoreSharePointRestoreSession -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.share_point_restore_session import SharePointRestoreSession
from msgraph.generated.models.site_restore_artifact import SiteRestoreArtifact
from msgraph.generated.models.restore_point import RestorePoint
from msgraph.generated.models.destination_type import DestinationType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SharePointRestoreSession(
site_restore_artifacts = [
SiteRestoreArtifact(
restore_point = RestorePoint(
id = "1f1fccc3-a642-4f61-bf49-f37b9a888279",
),
destination_type = DestinationType.InPlace,
),
SiteRestoreArtifact(
restore_point = RestorePoint(
id = "1f1fccc3-a642-4f61-bf49-f37b9a888280",
),
destination_type = DestinationType.InPlace,
),
],
)
result = await graph_client.solutions.backup_restore.share_point_restore_sessions.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": " /solutions/backupRestore/$metadata#restoreSessions/$entity",
"@odata.id": "/solutions/backupRestore/sharepointRestoreSessions(61633878-8321-4950-bfaf-ed285bdd1461)",
"@odata.type": "#microsoft.graph.sharepointRestoreSession",
"id": "61633878-8321-4950-bfaf-ed285bdd1461",
"status": "activating",
"restoreJobType": "standard",
"restoreSessionArtifactCount": {
"total": 2,
"completed": 0,
"inProgress": 2,
"failed": 0
},
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"createdDateTime": "2015-06-19T12:01:03.45Z",
"lastModifiedBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User2"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z"
}