Deleting slices
You can delete a deactivated slice using the delete()
method.
NOTE: It's not possible to delete a slice that is operating or serving users. So, to delete a slice, first remember to deactivate it. Learn more about different slice states and how you can react to them.
Deleting a slice
After deactivating a slice, use the following snippet to delete it.
import network_as_code as nac
from network_as_code.models.device import DeviceIpv4Addr
from network_as_code.models.slice import(
NetworkIdentifier,
Slice,
SliceInfo,
AreaOfService,
Point,
Throughput
)
...
# First, create or get a slice
my_slice = client.slices.create(...)
# Get a slice by its ID
slice = client.slices.get(my_slice.name)
# If it's active, deactivate it:
slice.deactivate()
# Now, you can delete it
slice.delete()
Last updated on July 25, 2024