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

list_all() for network_watchers only lists network watchers with provisioning state 'Succeeded'

Open dragcop opened this issue 8 years ago • 3 comments

The count should always be 27 since there are 27 network watchers if I disable one of them then count becomes 26 which shouldn't happen

network_client = NetworkManagementClient(credentials, str(subscription.subscription_id))
network_watcher_list = network_client.network_watchers.list_all()
count=0
for network_watcher in network_watcher_list:
   count=count+1
print count

Following is the link to Network_watchers class https://github.com/Azure/azure-sdk-for-python/blob/master/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_watchers_operations.py/#L21

dragcop avatar Mar 22 '18 06:03 dragcop

@tjprescott ?

lmazuel avatar Mar 22 '18 17:03 lmazuel

@prakhark Currently how disable network watcher works is actually delete that network watcher. So when we list all the network watchers, the deleted ones cannot be found anymore.

junyezhu avatar Nov 30 '18 20:11 junyezhu

There is no bug in the SDK. It's expected behavior. If customer disable network watcher in portal, that means that resource is deleted from NRP KVS. Thus, no network watcher resource will be returned to customer when he try to query it.

irrogozh avatar Oct 11 '19 23:10 irrogozh