Listar unidadeProtectionUnits
Namespace: microsoft.graph
Obtenha uma lista dos objetos driveProtectionUnit associados a um oneDriveForBusinessProtectionPolicy.
Esta API está disponível nas seguintes implementações de cloud nacionais.
Serviço global | US Government L4 | US Government L5 (DOD) | China operada pela 21Vianet |
---|---|---|---|
✅ | ❌ | ❌ | ❌ |
Permissões
Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
Tipo de permissão | Permissões com menos privilégios | Permissões com privilégios superiores |
---|---|---|
Delegado (conta corporativa ou de estudante) | BackupRestore-Configuration.Read.All | Indisponível. |
Delegado (conta pessoal da Microsoft) | Sem suporte. | Sem suporte. |
Application | BackupRestore-Configuration.Read.All | Indisponível. |
Solicitação HTTP
GET /solutions/backupRestore/protectionUnits/microsoft.graph.driveProtectionUnit
GET /solutions/backupRestore/oneDriveForBusinessProtectionPolicies/{oneDriveForBusinessProtectionPolicyId}/driveProtectionUnits
Cabeçalhos de solicitação
Nome | Descrição |
---|---|
Autorização | {token} de portador. Obrigatório. Saiba mais sobre autenticação e autorização. |
Corpo da solicitação
Não forneça um corpo de solicitação para esse método.
Resposta
Se for bem-sucedido, este método devolve um 200 OK
código de resposta e uma coleção de driveProtectionUnit no corpo da resposta.
Para obter uma lista de possíveis respostas a erros, veja Respostas de erros da API de Armazenamento de Cópias de Segurança.
Exemplos
Exemplo 1: listar todas as unidadesProtectionUnits num inquilino
O exemplo seguinte mostra como obter uma lista de todos os objetos driveProtectionUnits num inquilino.
Solicitação
O exemplo a seguir mostra uma solicitação.
GET /solutions/backupRestore/protectionUnits/microsoft.graph.driveProtectionUnit
Resposta
O exemplo a seguir mostra a resposta.
HTTP/1.1 200 OK
{
"@odata.nextLink": "https://graph.microsoft.com/v1.0/solutions/backupRestore/protectionUnits/microsoft.graph.driveProtectionUnit?$skiptoken=M2UyZDAwMDAwMDMxMzkzYTMyNjQ2MTM0NjMzMjM5NjYzNjY0MzczMDM0MzE2NTYzNjEzNzMwNjIzNjMzMzg2MjM0MzM2NDM0MzUzNDMzMzc0MDc0Njg3MjY1NjE2NDJlNzYzMjAxZThmYjY4M2Y3ODAxMDAwMDg4NjA5ODdhNzgwMTAwMDB8MTYxNjk2NDUwOTgzMg%3d%3d",
"value": [
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "2b014d8c-71fe-4d00-a01a-31850bc5b32c",
"directoryObjectId": "384974e2-72cd-48de-a6e8-6985d7c5db90",
"displayName": "Emily Braun", // Newly Added
"email": "emilyb@contoso.com", // Newly Added
"status": "unprotected",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "8f014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "781d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Alex Wilber", // Newly Added
"email": "alexw@contoso.com", // Newly Added
"status": "protectRequested",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "9b014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "2d1d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Shaun Wong", // Newly Added
"email": "shaunw@contoso.com", // Newly Added
"status": "unprotected",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "9b014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "2e1d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Janet Green", // Newly Added
"email": "janetg@contoso.com", // Newly Added
"status": "protected",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "9b014d8c-71fe-4d00-a01a-31850bc5b32c",
"directoryObjectId": "2w1d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Eddie Brock ", // Newly Added
"email": "eddyb@contoso.com", // Newly Added
"status": "unprotected",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
}
]
}
Exemplo 2: listar a unidadeProtectionUnits associadas a uma política de proteção do OneDrive para trabalho ou escola
O exemplo seguinte mostra como listar todas as unidadesProtectionUnits associadas a um oneDriveForBusinessProtectionPolicy.
Solicitação
O exemplo a seguir mostra uma solicitação.
GET /solutions/backupRestore/oneDriveForBusinessProtectionPolicies/845457dc-4bb2-4815-bef3-8628ebd1952e/driveProtectionUnits
Resposta
O exemplo a seguir mostra a resposta.
HTTP/1.1 200 OK
{
"@odata.nextLink": "https://graph.microsoft.com/v1.0/solutions/backupRestore/oneDriveForBusinessProtectionPolicies/845457dc-4bb2-4815-bef3-8628ebd1952e/driveProtectionUnits?$skiptoken=M2UyZDAwMDAwMDMxMzkzYTMyNjQ2MTM0NjMzMjM5NjYzNjY0MzczMDM0MzE2NTYzNjEzNzMwNjIzNjMzMzg2MjM0MzM2NDM0MzUzNDMzMzc0MDc0Njg3MjY1NjE2NDJlNzYzMjAxZThmYjY4M2Y3ODAxMDAwMDg4NjA5ODdhNzgwMTAwMDB8MTYxNjk2NDUwOTgzMg%3d%3d",
"value": [
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "2b014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "384974e2-72cd-48de-a6e8-6985d7c5db90",
"displayName": "Emily Braun", // Newly Added
"email": "emilyb@contoso.com", // Newly Added
"status": "protectRequested",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "57014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "184d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Alex Wilber", // Newly Added
"email": "alexw@contoso.com", // Newly Added
"status": "protectRequested",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "17014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "344d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Shaun Wong", // Newly Added
"email": "shaunw@contoso.com", // Newly Added
"status": "protectRequested",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "8f014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "781d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Janet Green", // Newly Added
"email": "janetg@contoso.com", // Newly Added
"status": "protectRequested",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
},
{
"@odata.type": "#microsoft.graph.driveProtectionUnit",
"id": "9b014d8c-71fe-4d00-a01a-31850bc5b32c",
"policyId": "9fec8e78-bce4-4aaf-ab1b-5451cc387264",
"directoryObjectId": "2d1d9337-d8f0-456e-92cd-00a3abdd2093",
"displayName": "Eddie Brock ", // Newly Added
"email": "eddyb@contoso.com", // Newly Added
"status": "protectRequested",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264",
"displayName": "Microsoft Enhanced Restore"
},
"user": {
"email": "User1@contoso.com",
"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": {
"email": "User1@contoso.com",
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e",
"displayName": "User1"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"error": null
}
]
}