-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect PowerShell command for the Graph API - List driveProtectionUnits #3046
Comments
Hi @Anand-Malli thank you for logging this issue. It seems there are two issues here.
|
Hey @timayabi2020, we are the service owner in this case. I have 2 follow up questions:
|
@timayabi2020 - requesting to reopen this issue. |
Hi @vidula-verma this is the file in the metadata repo https://github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/v1.0/powershell_v2.yaml from where we generate the cmdlets. However, annotations need to be added in the AGS metadata first. I've reached out to you on a separate chat on how to do that. |
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: