Incorrect PowerShell command for the Graph API - List driveProtectionUnits #3046
Labels
Bug: Documentation
Dependency: metadata-issue
no-recent-activity
Service issue
status:waiting-for-author-feedback
Issue that we've responded but needs author feedback to close
type:bug
A broken experience
Describe the bug
On this documentation page - https://learn.microsoft.com/en-us/graph/api/backuprestoreroot-list-driveprotectionunits?view=graph-rest-1.0&tabs=http
For this API - List driveProtectionUnits, following endpoint is supported and works as expected. Purpose of this endpoint is to return all the protection units of type driveProtectionUnit. Here driveProtectionUnit inherits the protectionUnits type.
GET /solutions/backupRestore/protectionUnits/microsoft.graph.driveProtectionUnit
For this endpoint, equivalent PowerShell command is mentioned below which does not represent the equivalent HTTP endpoint.
Import-Module Microsoft.Graph.BackupRestore
Get-MgSolutionBackupRestoreProtectionUnit -ProtectionUnitBaseId $protectionUnitBaseId
Here it takes the "ProtectionUnitBaseId" which represents the identifier of the single unit which is not matching with the http endpoint.
This issue is present for 3 similar endpoints.
https://learn.microsoft.com/en-us/graph/api/backuprestoreroot-list-driveprotectionunits?view=graph-rest-1.0&tabs=http
https://learn.microsoft.com/en-us/graph/api/backuprestoreroot-list-siteprotectionunits?view=graph-rest-1.0&tabs=http
https://learn.microsoft.com/en-us/graph/api/backuprestoreroot-list-siteprotectionunits?view=graph-rest-1.0&tabs=http
Expected behavior
Expected PowerShell command is which takes the type similar to "microsoft.graph.driveProtectionUnit" instead of "ProtectionUnitBaseId" which represents the id of the single unit.
Attached the debug output, it's translating to Uri "https://graph.microsoft.com/v1.0/solutions/backupRestore/protectionUnits" instead this should be translating to Uri "https://graph.microsoft.com/v1.0/solutions/backupRestore/protectionUnits/microsoft.graph.driveProtectionUnit"
How to reproduce
Execute 'Get-MgSolutionBackupRestoreProtectionUnit'
SDK Version
2.25.0
Latest version known to work for scenario above?
No response
Known Workarounds
No workaround
Debug output
Click to expand log
```DEBUG: [Authentication]: - Scopes: [BackupRestore-Configuration.ReadWrite.All, BackupRestore-Control.ReadWrite.All,
BackupRestore-Restore.ReadWrite.All, BackupRestore-Search.Read.All, openid, profile, email].
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://graph.microsoft.com/v1.0/solutions/backupRestore/protectionUnits
Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100;
en-US),PowerShell/5.1.26100.2161
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
InternalServerError
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : d397dc57-dab0-4453-b0e1-c1d7dd05f20b
client-request-id : 568ad042-bfdb-4a9d-8fd4-5d16925af3aa
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Central
India","Slice":"E","Ring":"3","ScaleUnit":"002","RoleInstance":"PN2PEPF00000278"}}
Date : Tue, 03 Dec 2024 17:34:15 GMT
Body:
{
"error": {
"code": "Unknown",
"message": "We are unable to process your request right now due to an internal error Please contact raise an
incident ticket if problem is not resolved",
"innerError": {
"date": "2024-12-03T17:34:15",
"request-id": "d397dc57-dab0-4453-b0e1-c1d7dd05f20b",
"client-request-id": "568ad042-bfdb-4a9d-8fd4-5d16925af3aa"
}
}
}
Confirm
We are unable to process your request right now due to an internal error Please contact raise an incident ticket if
problem is not resolved
Status: 500 (InternalServerError)
ErrorCode: Unknown
Date: 2024-12-03T17:34:15
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : d397dc57-dab0-4453-b0e1-c1d7dd05f20b
client-request-id : 568ad042-bfdb-4a9d-8fd4-5d16925af3aa
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Central
India","Slice":"E","Ring":"3","ScaleUnit":"002","RoleInstance":"PN2PEPF00000278"}}
Date : Tue, 03 Dec 2024 17:34:15 GMT
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
Get-MgSolutionBackupRestoreProtectionUnit : We are unable to process your request right now due to an internal
error Please contact raise an incident ticket if problem is not resolved
Status: 500 (InternalServerError)
ErrorCode: Unknown
Date: 2024-12-03T17:34:15
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : d397dc57-dab0-4453-b0e1-c1d7dd05f20b
client-request-id : 568ad042-bfdb-4a9d-8fd4-5d16925af3aa
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Central
India","Slice":"E","Ring":"3","ScaleUnit":"002","RoleInstance":"PN2PEPF00000278"}}
Date : Tue, 03 Dec 2024 17:34:15 GMT
At line:1 char:1
DEBUG: [CmdletEndProcessing]: - Get-MgSolutionBackupRestoreProtectionUnit end processing.
The text was updated successfully, but these errors were encountered: