# Device Decommissioning
In this tutorial, you will learn how to decommission a device from a multi-tenant system. Decommissioning a device removes that device's ability to communicate with the Ability Platform. Deleting the device removes it from the solution in which it was deployed, and allows the device to be reused elsewhere.
We will be taking a look at how to identify and disconnect a device, and how to decommission it from a particular solution.
There are two paths that may be taken in order to decommission a device, a programmatic approach utilizing APIs and a UI based approach utilizing the Admin Portal application. Both of these processes are outlined within this document.
# Pre-requisites
This tutorial contains two paths, and assumes the following:
- You know the Device ID of the device you are decommissioning.
- You know the Solution that the device is currently registered to.
- Appropriate access levels and permissions are already in place
- For the Admin Portal decommissioning path, the decommissioning party must
have at least
Solution Administrator
permissions. - For the API decommissioning path, the decommissioning party has an
access_token
for accessingPrincipal Manager
API endpoints.
- For the Admin Portal decommissioning path, the decommissioning party must
have at least
# Admin Portal Decommissioning Path
The following sections contain information on how to decommission a device using the Admin Portal.
# Decommissioning a Device from a Solution
In order to decommission a device, you are required to have Solution Administrator
level privileges for your BL solution. Failure to have these
permissions in place will result in you being unable to access some or all of
the proceeding steps.
- Log in to the Admin Portal targeting the tenant name which manages the solution of the device to be decommissioned.
- Once logged in, navigate to your solution:
- Navigate to the
Devices
tab of the solution.
Find the device ID in the
Identity
column corresponding to the device ID you would like to decommission.Select the
Disconnect
option in theAction
column. Upon successful disconnection, you will receive a pop up confirming success.Once the device has been disconnected, it will still appear as being registered in the solution. To remove the device entirely, select the
Delete
option in theAction
column.
At this point, the device is no longer registered to the solution and has been removed from the Connectivity Provider. The device will not be able to communicate with the Platform, and you may take the proper steps to repurpose or remove your device from your solution.
# API Decommissioning Path
The following sections contain information on how to decommission a device using API endpoints.
# Disconnecting a Device from a Solution
A number of endpoints are provided as part of the Region APIs to facilitate development of a management portal by a Business Line, or to allow device decommissioning to occur programmatically. The following steps should be taken in order to disconnect a device.
Access Tokens
The following steps assume that you are using a valid access token for authorization. Generating this token will vary based on the Identity Provider that is being used for your solution.
Issue a DELETE
call to the /devices/{deviceId}/connectivityProvider/{cpId}
endpoint. The deviceId
should be the ID of the device you are attempting to
connect, and cpId
should be the ID of the connectivity provider you are
disconnecting the device from.
curl -X DELETE \
'https://api-xxxxx.abilityplatform.abb/devices/{deviceId}/connectivityProvider/{cpId}' \
-H 'Authorization: Bearer {access_token}'
On successful deletion, a 204
HTTP response code will be returned to the
issuer. For any other codes that are returned, please see the documentation on
error codes.
# Deleting a Device from a Solution
After completing the above steps and receiving a 204
HTTP response code from
the API endpoint, your device has been properly disconnected from the associated
Identity Provider. At this point, the device still exists within the solution
and must be deleted to be removed entirely.
To delete a device after disconnecting it, issue a DELETE
call to the
/devices/{deviceId}
endpoint.
curl -X DELETE \
'https://api-xxxxx.abilityplatform.abb/devices/{deviceId}' \
-H 'Authorization: Bearer {access_token}'
Upon successful deletion, a 204
HTTP response code will be returned to the
issuer. For any other codes that are returned, please see the documentation on
error codes