Azure / Azure/azure-sdk-for-js
[core] Provide an option to skip the final GET request on an LRO
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 1.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 138
Description
For majority of LROs that conform to the guidelines, the method correctly dictates how to get the final resource. But some non-conforming LROs require additional knobs to customize the core poller's implementation. This issue tracks adding the ability to skip the final GET request on LROs that either do not require it _or_ do not support it.
An option should be available to skip the final GET request. One implementation idea can check if its set and return undefined [here](https://github.com/Azure/azure-sdk-for-js/blob/13ee6b85c6d35c7a39a971dd6ca79c99ab3d6512/sdk/core/core-lro/src/http/operation.ts#L51-L53)
A concrete example / additional details:
KeyVault Managed HSM support multiple methods of restore from a backup like [Full Restore](https://learn.microsoft.com/en-us/rest/api/keyvault/managedhsm-backup/restore/full-restore-operation?view=rest-keyvault-managedhsm-backup-restore-7.4) and [Selective Key Restore](https://learn.microsoft.com/en-us/rest/api/keyvault/managedhsm-backup/restore/selective-key-restore-operation?view=rest-keyvault-managedhsm-backup-restore-7.4)
As PUT operations, it is expected that the final GET request can be sent to the same URL to get the final result; however, these two methods will fail on the final GET request as there is no resource to GET. For Selective Key Restore for example the URL `GET //restore` conflicts with `GET //` which allows fetching a specific version of a given key. For these operations we need to skip the final GET request.
- [x] Add support in core https://github.com/Azure/azure-sdk-for-js/pull/33286
- [ ] Add support in codegen
Contributor guide
Assessment
This issue has not been assessed yet.