Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
La status initiale lors de la création de la session de restauration est active. Lorsque tous les sites sont ajoutés à la session de restauration SharePoint correspondante et que la session de restauration est activée, le status devient completed. Si des échecs sont rencontrés lors de la résolution des ressources, le status de la session de restauration devient completedWithErrors.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.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);
// 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);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.site_restore_artifacts_bulk_addition_request import SiteRestoreArtifactsBulkAdditionRequest
from msgraph_beta.generated.models.time_period import TimePeriod
from msgraph_beta.generated.models.destination_type import DestinationType
from msgraph_beta.generated.models.restore_point_tags import RestorePointTags
from msgraph_beta.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)