Skip to content
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

Closed
Anand-Malli opened this issue Dec 3, 2024 · 2 comments
Closed

Comments

@Anand-Malli
Copy link

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

  • Get-MgSolutionBackupRestoreProtectionUnit -Debug
  •   + CategoryInfo          : InvalidOperation: ({ Top = , Skip ... , Headers =  }:<>f__AnonymousType3`9) [Get-MgSo
     lutionB...ectionUnit_List], Exception
      + FullyQualifiedErrorId : Unknown,Microsoft.Graph.PowerShell.Cmdlets.GetMgSolutionBackupRestoreProtectionUnit_L
     ist
    

DEBUG: [CmdletEndProcessing]: - Get-MgSolutionBackupRestoreProtectionUnit end processing.

</details>


### Configuration

_No response_

### Other information

_No response_
@Anand-Malli Anand-Malli added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Dec 3, 2024
@timayabi2020
Copy link
Contributor

Hi @Anand-Malli thank you for logging this issue. It seems there are two issues here.

  1. Metadata issue.
    The paths /solutions/backupRestore/protectionUnits/microsoft.graph.driveProtectionUnit and /solutions/backupRestore/protectionUnits/microsoft.graph.siteProtectionUnit do not exist among the list of paths provided in the metadata here. Please note that cmdlet generation depends on metadata/open Api information provided by the workload/service owners and in this case, it seems like invalid endpoints were provided. For such an issue it needs to be escalated here https://developer.microsoft.com/en-us/graph/support so that the API owner can respond to it.

  2. Documentation issue.
    Wrong snippets have been provided for the equivalent http paths. The PowerShell example tabs should be blank. Related issue for that is here Wrong PowerShell Snippet microsoft-graph-devx-api#2265.

@timayabi2020 timayabi2020 added Service issue Bug: Documentation Dependency: metadata-issue status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Dec 13, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants