Slice life cycle

A slice (or specialized network) life cycle consists of creation, activation, deactivation and removal. In Network as Code, a slice will be in one of the following states:

Slice StatusDescription
PENDINGthe slice provisioning software is planning or installing the network slice
AVAILABLESlice has been provisioned, but it is not active for users yet
OPERATINGSlice has been activated and is accepting or serving users
DELETEDSlice has been deactivated, and it's in the process of removal or has been removed
FAILEDSlice could not be provisioned correctly by the network

For example, if a slice is PENDING, it means your request is being processed. Once your slice is provisioned successfully, it will become AVAILABLE, but it does not mean that it is active or serving users yet at this point. So, just use our SDKs to activate it. When you activate a life, it changes to the OPERATING state and can serve users. However, OPERATING slices cannot be directly deleted. Whenever needed, call a method to deactivate an OPERATING slice first, and then you can delete it subsequently. Once deactivated or deleted, the slice will become inactive and move on to the DELETED state.

If something goes wrong with a slice, its status will be FAILED. It is also not possible to activate OPERATING slices, since they are already active.

You can react to different slice states based on the notifications received from a web server, such as this one. If you prefer to wait for an ongoing order to complete, for instance, until a slice reaches a desired state, you can use the wait_for or waitFor functionality below.

Managing slice statuses

How do I know if a slice is not pending anymore?

If a slice has a PENDING status, it means it is not ready to serve users yet. You will need to wait for the slice to be AVAILABLE to activate it. Similarly, you can wait for a desired state, such as OPERATING to know that, in this case, the slice is in use and will need to be deactivated before deletion.

Use wait_for() or waitFor method as you wish to wait for a slice to reach a specified state. Or you can also use slice notifications for this purpose.

# When a slice is PENDING,
# use this to wait for it to become available.
new_state = await my_slice.wait_for(desired_state="AVAILABLE")
# When a slice is AVAILABLE,
# use this to wait for it to become OPERATING
# OPERATING slices must be deactivated before deletion
new_state = await my_slice.wait_for(desired_state="OPERATING")

Last updated on June 28, 2024