azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

[azure-mgmt-security] Defender pricings uses old API version, missing useful field

Open aeetos opened this issue 1 year ago • 3 comments

  • 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.

aeetos avatar Sep 22 '22 21:09 aeetos

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Security:0.5847058,Search:0.037224695,API Management:0.02932473'

azure-sdk avatar Sep 22 '22 21:09 azure-sdk

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Sep 23 '22 16:09 ghost

@aeetos We are looking into it and get back to you for any additional information.

SaurabhSharma-MSFT avatar Sep 24 '22 17:09 SaurabhSharma-MSFT

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

Wzb123456789 avatar Oct 21 '22 06:10 Wzb123456789

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.

ghost avatar Oct 24 '22 07:10 ghost

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.

ghost avatar Oct 31 '22 10:10 ghost