The REST API documented on the linked page is missing a required parameter. The sample in its current form results in the error keyType value must equal primarySharedKey or secondarySharedKey. Some experimentation shows that this key-value-pair should be passed as a query parameter.
The error in the API documentation also affects libraries generated from it, e.g. azure-mgmt-loganalytics version 12.0.0. The library has no way to pass this parameter, so we are forced to use direct HTTP calls with an undocumented parameter instead of using the appropriate function in the management library.
Thanks a bunch,
Kjeld
Expected behavior
I should be able to pass a parameter to define which key to regenerate into LogAnalyticsManagementClient.shared_keys.regenerate.
This should then result in that one key being regenerated.
Actual behavior
I cannot pass a key specifier into LogAnalyticsManagementClient.shared_keys.regenerate.
The call results in a failed request with the error keyType value must equal primarySharedKey or secondarySharedKey.
i.e., create a Log Analytics Workspace, get a LogAnalyticsManagementClient and attempt to call client.shared_keys.regenerate with the appropriate Workspace details as parameters.
Link to sample
https://learn.microsoft.com/en-us/rest/api/loganalytics/shared-keys/regenerate?view=rest-loganalytics-2023-09-01&tabs=Python#regeneratesharedkeys
Library name and version
azure-mgmt-loganalytics 12.0.0
Language of the Sample
Sample Issue Type
Issue details
Hey there,
The REST API documented on the linked page is missing a required parameter. The sample in its current form results in the error
keyType value must equal primarySharedKey or secondarySharedKey
. Some experimentation shows that this key-value-pair should be passed as a query parameter.The error in the API documentation also affects libraries generated from it, e.g.
azure-mgmt-loganalytics
version 12.0.0. The library has no way to pass this parameter, so we are forced to use direct HTTP calls with an undocumented parameter instead of using the appropriate function in the management library.Thanks a bunch, Kjeld
Expected behavior
I should be able to pass a parameter to define which key to regenerate into
LogAnalyticsManagementClient.shared_keys.regenerate
.This should then result in that one key being regenerated.
Actual behavior
I cannot pass a key specifier into
LogAnalyticsManagementClient.shared_keys.regenerate
.The call results in a failed request with the error
keyType value must equal primarySharedKey or secondarySharedKey
.Reproduction Steps
Follow this sample request
i.e., create a Log Analytics Workspace, get a
LogAnalyticsManagementClient
and attempt to callclient.shared_keys.regenerate
with the appropriate Workspace details as parameters.Environment
Library: azure-mgmt-loganalytics Library version: 12.0.0 OS: Windows 10 Python Version: 3.11.8