Пространство имен: microsoft.graph
Найдите объекты restorePoint , связанные с protectionUnit.
Этот API доступен в следующих национальных облачных развертываниях.
Глобальная служба |
Правительство США L4 |
Правительство США L5 (DOD) |
Китай управляется 21Vianet |
✅ |
❌ |
❌ |
❌ |
Разрешения
Выберите разрешение или разрешения, помеченные как наименее привилегированные для этого API. Используйте более привилегированное разрешение или разрешения только в том случае, если это требуется приложению. Дополнительные сведения о делегированных разрешениях и разрешениях приложений см. в разделе Типы разрешений. Дополнительные сведения об этих разрешениях см. в справочнике по разрешениям.
Тип разрешения |
Разрешения с наименьшими привилегиями |
Более высокие привилегированные разрешения |
Делегированные (рабочая или учебная учетная запись) |
BackupRestore-Search.Read.All |
Недоступно. |
Делегированные (личная учетная запись Майкрософт) |
Не поддерживается. |
Не поддерживается. |
Приложение |
BackupRestore-Search.Read.All |
Недоступно. |
HTTP-запрос
POST /solutions/backupRestore/restorePoints/search
Текст запроса
В тексте запроса укажите представление следующих параметров в формате JSON.
Параметр |
Тип |
Описание |
artifactQuery |
artifactQuery |
Содержит выражение, указывающее критерии для поиска. Необязательный параметр. |
protectionUnitIds |
Коллекция строк |
Идентификатор единиц защиты. Обязательно. |
protectionTimePeriod |
timePeriod |
Время начала и окончания периода защиты. Обязательно. |
restorePointPreference |
restorePointPreference |
Указывает, какую точку восстановления следует вернуть. Возможные значения: oldest , latest . Необязательный параметр. |
tags |
restorePointTags |
Тип точки восстановления. Возможные значения: None , FastRestore , UnknownFutureValue . Необязательный параметр. |
значения restorePointPreference
Member |
Описание |
самый поздний |
Возвращает последнюю точку восстановления за заданный период времени защиты. |
старейший |
Возвращает старую точку восстановления за заданный период времени защиты. |
Отклик
В случае успешного выполнения это действие возвращает код отклика 200 OK
и объект restorePointSearchResponse в теле отклика.
Примечание.
- Вызовы возвращают не более пяти точек восстановления.
- В одном запросе можно включить не более 20 единиц защиты, и ответ не будет разбит на страницы.
- При указании выражения для свойства artifactQuery необходимо указать только один идентификатор единицы защиты в свойстве protectionUnitIds .
Список возможных ответов на ошибки см. в разделе Ответы на ошибки API хранилища резервных копий.
Примеры
Пример 1. Запрос на поиск
Запрос
Ниже показан пример запроса.
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/restorePoints/search
Content-Type: application/json
{
"protectionUnitIds": ["23014d8c-71fe-4d00-a01a-31850bc5b42a", "43014d8c-71fe-4d00-a01a-31850bc5b42b", "63014d8c-71fe-4d00-a01a-31850bc5b42c", "83014d8c-71fe-4d00-a01a-31850bc5b42d"],
"protectionTimePeriod": {
"startDateTime": "2021-01-01T00:00:00Z",
"endDateTime": "2021-01-08T00:00:00Z"
},
"restorePointPreference": "latest",
"tags": "fastRestore"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Solutions.BackupRestore.RestorePoints.Search;
using Microsoft.Graph.Models;
var requestBody = new SearchPostRequestBody
{
ProtectionUnitIds = new List<string>
{
"23014d8c-71fe-4d00-a01a-31850bc5b42a",
"43014d8c-71fe-4d00-a01a-31850bc5b42b",
"63014d8c-71fe-4d00-a01a-31850bc5b42c",
"83014d8c-71fe-4d00-a01a-31850bc5b42d",
},
ProtectionTimePeriod = new TimePeriod
{
StartDateTime = DateTimeOffset.Parse("2021-01-01T00:00:00Z"),
EndDateTime = DateTimeOffset.Parse("2021-01-08T00:00:00Z"),
},
RestorePointPreference = RestorePointPreference.Latest,
Tags = RestorePointTags.FastRestore,
};
// 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.RestorePoints.Search.PostAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
mgc solutions backup-restore restore-points search post --body '{\
"protectionUnitIds": ["23014d8c-71fe-4d00-a01a-31850bc5b42a", "43014d8c-71fe-4d00-a01a-31850bc5b42b", "63014d8c-71fe-4d00-a01a-31850bc5b42c", "83014d8c-71fe-4d00-a01a-31850bc5b42d"],\
"protectionTimePeriod": {\
"startDateTime": "2021-01-01T00:00:00Z",\
"endDateTime": "2021-01-08T00:00:00Z"\
},\
"restorePointPreference": "latest",\
"tags": "fastRestore"\
}\
'
Подробнее о том, как добавить 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"
graphsolutions "github.com/microsoftgraph/msgraph-sdk-go/solutions"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphsolutions.NewSearchPostRequestBody()
protectionUnitIds := []string {
"23014d8c-71fe-4d00-a01a-31850bc5b42a",
"43014d8c-71fe-4d00-a01a-31850bc5b42b",
"63014d8c-71fe-4d00-a01a-31850bc5b42c",
"83014d8c-71fe-4d00-a01a-31850bc5b42d",
}
requestBody.SetProtectionUnitIds(protectionUnitIds)
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)
restorePointPreference := graphmodels.LATEST_RESTOREPOINTPREFERENCE
requestBody.SetRestorePointPreference(&restorePointPreference)
tags := graphmodels.FASTRESTORE_RESTOREPOINTTAGS
requestBody.SetTags(&tags)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
search, err := graphClient.Solutions().BackupRestore().RestorePoints().Search().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);
com.microsoft.graph.solutions.backuprestore.restorepoints.search.SearchPostRequestBody searchPostRequestBody = new com.microsoft.graph.solutions.backuprestore.restorepoints.search.SearchPostRequestBody();
LinkedList<String> protectionUnitIds = new LinkedList<String>();
protectionUnitIds.add("23014d8c-71fe-4d00-a01a-31850bc5b42a");
protectionUnitIds.add("43014d8c-71fe-4d00-a01a-31850bc5b42b");
protectionUnitIds.add("63014d8c-71fe-4d00-a01a-31850bc5b42c");
protectionUnitIds.add("83014d8c-71fe-4d00-a01a-31850bc5b42d");
searchPostRequestBody.setProtectionUnitIds(protectionUnitIds);
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);
searchPostRequestBody.setProtectionTimePeriod(protectionTimePeriod);
searchPostRequestBody.setRestorePointPreference(RestorePointPreference.Latest);
searchPostRequestBody.setTags(EnumSet.of(RestorePointTags.FastRestore));
var result = graphClient.solutions().backupRestore().restorePoints().search().post(searchPostRequestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const restorePointSearchResponse = {
protectionUnitIds: ['23014d8c-71fe-4d00-a01a-31850bc5b42a', '43014d8c-71fe-4d00-a01a-31850bc5b42b', '63014d8c-71fe-4d00-a01a-31850bc5b42c', '83014d8c-71fe-4d00-a01a-31850bc5b42d'],
protectionTimePeriod: {
startDateTime: '2021-01-01T00:00:00Z',
endDateTime: '2021-01-08T00:00:00Z'
},
restorePointPreference: 'latest',
tags: 'fastRestore'
};
await client.api('/solutions/backupRestore/restorePoints/search')
.post(restorePointSearchResponse);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Solutions\BackupRestore\RestorePoints\Search\SearchPostRequestBody;
use Microsoft\Graph\Generated\Models\TimePeriod;
use Microsoft\Graph\Generated\Models\RestorePointPreference;
use Microsoft\Graph\Generated\Models\RestorePointTags;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SearchPostRequestBody();
$requestBody->setProtectionUnitIds(['23014d8c-71fe-4d00-a01a-31850bc5b42a', '43014d8c-71fe-4d00-a01a-31850bc5b42b', '63014d8c-71fe-4d00-a01a-31850bc5b42c', '83014d8c-71fe-4d00-a01a-31850bc5b42d', ]);
$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->setRestorePointPreference(new RestorePointPreference('latest'));
$requestBody->setTags(new RestorePointTags('fastRestore'));
$result = $graphServiceClient->solutions()->backupRestore()->restorePoints()->search()->post($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Import-Module Microsoft.Graph.BackupRestore
$params = @{
protectionUnitIds = @(
"23014d8c-71fe-4d00-a01a-31850bc5b42a"
"43014d8c-71fe-4d00-a01a-31850bc5b42b"
"63014d8c-71fe-4d00-a01a-31850bc5b42c"
"83014d8c-71fe-4d00-a01a-31850bc5b42d"
)
protectionTimePeriod = @{
startDateTime = [System.DateTime]::Parse("2021-01-01T00:00:00Z")
endDateTime = [System.DateTime]::Parse("2021-01-08T00:00:00Z")
}
restorePointPreference = "latest"
tags = "fastRestore"
}
Search-MgSolutionBackupRestorePoint -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.solutions.backuprestore.restorepoints.search.search_post_request_body import SearchPostRequestBody
from msgraph.generated.models.time_period import TimePeriod
from msgraph.generated.models.restore_point_preference import RestorePointPreference
from msgraph.generated.models.restore_point_tags import RestorePointTags
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SearchPostRequestBody(
protection_unit_ids = [
"23014d8c-71fe-4d00-a01a-31850bc5b42a",
"43014d8c-71fe-4d00-a01a-31850bc5b42b",
"63014d8c-71fe-4d00-a01a-31850bc5b42c",
"83014d8c-71fe-4d00-a01a-31850bc5b42d",
],
protection_time_period = TimePeriod(
start_date_time = "2021-01-01T00:00:00Z",
end_date_time = "2021-01-08T00:00:00Z",
),
restore_point_preference = RestorePointPreference.Latest,
tags = RestorePointTags.FastRestore,
)
result = await graph_client.solutions.backup_restore.restore_points.search.post(request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Отклик
- Вызовы возвращают не более пяти точек восстановления.
- В одном запросе можно включить не более 20 единиц защиты, и ответ не будет разбит на страницы.
Ниже показан пример отклика.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context":"/solutions/backupRestore/$metadata#restorePoints",
"searchResponseId": "M2UyZDAwMDAwMDMxMzkzYTMyNj",
"searchResults": [
{
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id":"1f1fccc3-a642-4f61-bf49-f37b9a888279",
"protectionDateTime":"2023-01-04T00:00:00Z",
"expirationDateTime":"2024-01-04T00:00:00Z",
"protectionUnit":{
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id":"23014d8c-71fe-4d00-a01a-31850bc5b42a",
"siteId":"344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId":"9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
},
{
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id":"cdf4a823-sfde-ki2s-kmsj-clu2nsdk43ga",
"protectionDateTime":"2023-01-03T00:00:00Z",
"expirationDateTime":"2024-01-03T00:00:00Z",
"protectionUnit":{
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id":"43014d8c-71fe-4d00-a01a-31850bc5b42b",
"siteId":"344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId":"9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
},
{
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id":"1f1fccc3-a642-4f61-bf49-f37b9a888280",
"protectionDateTime":"2023-01-02T00:00:00Z",
"expirationDateTime":"2024-01-02T00:00:00Z",
"protectionUnit":{
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id":"83014d8c-71fe-4d00-a01a-31850bc5b42c",
"siteId":"344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId":"9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
}
],
"noResultProtectionUnitIds": ["63014d8c-71fe-4d00-a01a-31850bc5b42c"]
}
Пример 2. Поиск с помощью выражения artifactQuery
Запрос
Ниже показан пример запроса.
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/restorePoints/search
Content-Type: application/json
{
"artifactQuery": {
"queryExpression": "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')",
"artifactType": "message"
},
"protectionUnitIds": ["23014d8c-71fe-4d00-a01a-31850bc5b42a"],
"protectionTimePeriod": {
"startDateTime": "2021-01-01T00:00:00Z"
},
"restorePointPreference": "oldest"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Solutions.BackupRestore.RestorePoints.Search;
using Microsoft.Graph.Models;
var requestBody = new SearchPostRequestBody
{
ArtifactQuery = new ArtifactQuery
{
QueryExpression = "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')",
ArtifactType = RestorableArtifact.Message,
},
ProtectionUnitIds = new List<string>
{
"23014d8c-71fe-4d00-a01a-31850bc5b42a",
},
ProtectionTimePeriod = new TimePeriod
{
StartDateTime = DateTimeOffset.Parse("2021-01-01T00:00:00Z"),
},
RestorePointPreference = RestorePointPreference.Oldest,
};
// 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.RestorePoints.Search.PostAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
mgc solutions backup-restore restore-points search post --body '{\
"artifactQuery": {\
"queryExpression": "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')",\
"artifactType": "message"\
},\
"protectionUnitIds": ["23014d8c-71fe-4d00-a01a-31850bc5b42a"],\
"protectionTimePeriod": {\
"startDateTime": "2021-01-01T00:00:00Z"\
},\
"restorePointPreference": "oldest"\
}\
'
Подробнее о том, как добавить 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"
graphsolutions "github.com/microsoftgraph/msgraph-sdk-go/solutions"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphsolutions.NewSearchPostRequestBody()
artifactQuery := graphmodels.NewArtifactQuery()
queryExpression := "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')"
artifactQuery.SetQueryExpression(&queryExpression)
artifactType := graphmodels.MESSAGE_RESTORABLEARTIFACT
artifactQuery.SetArtifactType(&artifactType)
requestBody.SetArtifactQuery(artifactQuery)
protectionUnitIds := []string {
"23014d8c-71fe-4d00-a01a-31850bc5b42a",
}
requestBody.SetProtectionUnitIds(protectionUnitIds)
protectionTimePeriod := graphmodels.NewTimePeriod()
startDateTime , err := time.Parse(time.RFC3339, "2021-01-01T00:00:00Z")
protectionTimePeriod.SetStartDateTime(&startDateTime)
requestBody.SetProtectionTimePeriod(protectionTimePeriod)
restorePointPreference := graphmodels.OLDEST_RESTOREPOINTPREFERENCE
requestBody.SetRestorePointPreference(&restorePointPreference)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
search, err := graphClient.Solutions().BackupRestore().RestorePoints().Search().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);
com.microsoft.graph.solutions.backuprestore.restorepoints.search.SearchPostRequestBody searchPostRequestBody = new com.microsoft.graph.solutions.backuprestore.restorepoints.search.SearchPostRequestBody();
ArtifactQuery artifactQuery = new ArtifactQuery();
artifactQuery.setQueryExpression("(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')");
artifactQuery.setArtifactType(RestorableArtifact.Message);
searchPostRequestBody.setArtifactQuery(artifactQuery);
LinkedList<String> protectionUnitIds = new LinkedList<String>();
protectionUnitIds.add("23014d8c-71fe-4d00-a01a-31850bc5b42a");
searchPostRequestBody.setProtectionUnitIds(protectionUnitIds);
TimePeriod protectionTimePeriod = new TimePeriod();
OffsetDateTime startDateTime = OffsetDateTime.parse("2021-01-01T00:00:00Z");
protectionTimePeriod.setStartDateTime(startDateTime);
searchPostRequestBody.setProtectionTimePeriod(protectionTimePeriod);
searchPostRequestBody.setRestorePointPreference(RestorePointPreference.Oldest);
var result = graphClient.solutions().backupRestore().restorePoints().search().post(searchPostRequestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const restorePointSearchResponse = {
artifactQuery: {
queryExpression: '(Sender -eq \'abc@contoso.com\') -and (Subject -like \'*Check email*\' -or Subject -like \' Important\') -and (HasAttachment -eq \'true\') -and (PitrDumpsterActionTriggeredTime -gt \'{2024-09-21T08:20:00.0000000Z}\')',
artifactType: 'message'
},
protectionUnitIds: ['23014d8c-71fe-4d00-a01a-31850bc5b42a'],
protectionTimePeriod: {
startDateTime: '2021-01-01T00:00:00Z'
},
restorePointPreference: 'oldest'
};
await client.api('/solutions/backupRestore/restorePoints/search')
.post(restorePointSearchResponse);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Solutions\BackupRestore\RestorePoints\Search\SearchPostRequestBody;
use Microsoft\Graph\Generated\Models\ArtifactQuery;
use Microsoft\Graph\Generated\Models\RestorableArtifact;
use Microsoft\Graph\Generated\Models\TimePeriod;
use Microsoft\Graph\Generated\Models\RestorePointPreference;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SearchPostRequestBody();
$artifactQuery = new ArtifactQuery();
$artifactQuery->setQueryExpression('(Sender -eq \'abc@contoso.com\') -and (Subject -like \'*Check email*\' -or Subject -like \' Important\') -and (HasAttachment -eq \'true\') -and (PitrDumpsterActionTriggeredTime -gt \'{2024-09-21T08:20:00.0000000Z}\')');
$artifactQuery->setArtifactType(new RestorableArtifact('message'));
$requestBody->setArtifactQuery($artifactQuery);
$requestBody->setProtectionUnitIds(['23014d8c-71fe-4d00-a01a-31850bc5b42a', ]);
$protectionTimePeriod = new TimePeriod();
$protectionTimePeriod->setStartDateTime(new \DateTime('2021-01-01T00:00:00Z'));
$requestBody->setProtectionTimePeriod($protectionTimePeriod);
$requestBody->setRestorePointPreference(new RestorePointPreference('oldest'));
$result = $graphServiceClient->solutions()->backupRestore()->restorePoints()->search()->post($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Import-Module Microsoft.Graph.BackupRestore
$params = @{
artifactQuery = @{
queryExpression = "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')"
artifactType = "message"
}
protectionUnitIds = @(
"23014d8c-71fe-4d00-a01a-31850bc5b42a"
)
protectionTimePeriod = @{
startDateTime = [System.DateTime]::Parse("2021-01-01T00:00:00Z")
}
restorePointPreference = "oldest"
}
Search-MgSolutionBackupRestorePoint -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.solutions.backuprestore.restorepoints.search.search_post_request_body import SearchPostRequestBody
from msgraph.generated.models.artifact_query import ArtifactQuery
from msgraph.generated.models.restorable_artifact import RestorableArtifact
from msgraph.generated.models.time_period import TimePeriod
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 = SearchPostRequestBody(
artifact_query = ArtifactQuery(
query_expression = "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')",
artifact_type = RestorableArtifact.Message,
),
protection_unit_ids = [
"23014d8c-71fe-4d00-a01a-31850bc5b42a",
],
protection_time_period = TimePeriod(
start_date_time = "2021-01-01T00:00:00Z",
),
restore_point_preference = RestorePointPreference.Oldest,
)
result = await graph_client.solutions.backup_restore.restore_points.search.post(request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Отклик
Ниже показан пример отклика.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "/solutions/backupRestore/$metadata#restorePoints",
"searchResponseId": "M2UyZDAwMDAwMDMxMzkzYTMyNj",
"searchResults": [
{
"artifactHitCount": 26,
"restorePoint": {
"@odata.type": "#microsoft.graph.restorePoint",
"id": "1f1fccc3-a642-4f61-bf49-f37b9a888279",
"protectionDateTime": "2023-01-04T00:00:00Z",
"expirationDateTime": "2024-01-04T00:00:00Z",
"protectionUnit": {
"@odata.type": "#microsoft.graph.siteProtectionUnit",
"id": "23014d8c-71fe-4d00-a01a-31850bc5b42a",
"siteId": "344d9337-d8f0-456e-92cd-00a3abdd2093",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"tags": "fastRestore"
}
}
]
}