azure-sdk-for-python
azure-sdk-for-python copied to clipboard
[azure-mgmt-security] Defender pricings uses old API version, missing useful field
- Package Name: azure.mgmt.security
- Package Version: 1.0.0
- Operating System: MacOS
- Python Version: 3.9
Describe the bug
The PricingOperations class in operations/_pricings_operations.py is hard-coded to API version 2018-06-01 and cannot be overridden. This API version is missing useful fields such properties.subPlan
which can be important to determine service level and overall cost of covered resources by products such as Defender for Cloud. The currently published API version 2022-03-01 has this field.
Reference: API docs
To Reproduce
from azure.mgmt.security import SecurityCenter
sec_client = SecurityCenter(credential, subscription_id, '')
pricings = sec_client.pricings.list()
pricings.as_dict()
Expected behavior Return results with the subPlan field.
Additional Context Unsure if this is in context for the architecture of this SDK, but I would expect to be able to override the API version and still have the SDK make the API call and give me raw results. If that is not how the SDK is designed, I think it's worth considering and I'll file a feature request just for that.
Label prediction was below confidence level 0.6
for Model:ServiceLabels
: 'Security:0.5847058,Search:0.037224695,API Management:0.02932473'
Thank you for your feedback. This has been routed to the support team for assistance.
@aeetos We are looking into it and get back to you for any additional information.
Hi @aeetos
According to my investigation, you can get information including subPlan
field using:
pricings = sec_client.pricings.list().value
for item in pricings:
print(item)
When the value of subPlan
is None, using pricings.as_dict()
will filter out the fields whose value is None.
Hope it can help you
Hi @aeetos. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve
” to remove the “issue-addressed” label and continue the conversation.
Hi @aeetos, since you haven’t asked that we “/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.