Deleting Device-Status subscriptions

You can delete any subscription to device-status notifications with the delete() method.

Unsubscribe from receiving status updates

Use the following snippet to delete a Device Status subscription if you wish to stop receiving the previously configured status notifications.

You will simply need to pass the subscription identifier or id callback parameter to the get method. Then, use delete() to delete your subscription to status updates.

import network_as_code as nac
 
from network_as_code.models.device import Device, DeviceIpv4Addr
 
client = nac.NetworkAsCodeClient(...)
 
# Create a subscription
connectivity_subscription = client.connectivity.subscribe(...)
 
# Get a subscription by its ID
subscription = client.connectivity.get_subscription(connectivity_subscription.id)
 
subscription.delete()

Note that the snippet above assumes you have already created Device Status subscription before, which you can learn how to do here. And that you have also created a Network-as-Code client and identified your mobile network device previously.

Last updated on July 09, 2024