Decommissioning inactive computers (v2)
Available from 9.2.24.
You use the DELETE
operation on the
api/sam/v2/computers
element to decommission a computer on which the disconnected
scanner is installed from the License Metric Tool
server.
Permissions
You must have the Manage Endpoints and View Endpoints permissions to use this API.
Resource URL
https://hostname:port/api/sam/v2/computers
Resource information
Operation details | Description |
---|---|
HTTP method | DELETE |
Request headers |
|
Request format | application/json |
Response headers |
|
Response format | application/json |
Response codes |
|
Action parameters
Column | Description | Required | Type |
---|---|---|---|
disconnected_endpoint_id | Identifier of the disconnected computer as defined in the config/endpoint_id.txt file in the disconnected scanner folder. For computers that do not report to a disconnected data source, the value is null. | At least one of these parameters is required | String |
dns_name | DNS of the computer. | String | |
id | Identifier of the computer as defined in License Metric Tool. | Numeric | |
ip_address | IP address of the computer. | String | |
name | Name of the computer. | String |
Example conversation
- Request
-
DELETE https://hostname:port/api/sam/v2/computers?disconnected_endpoint_id=1
- Request header
-
Accept: application/json Accept-Language: en-US Token: <token>
- Response body
-
200
Example conversation - deleting all computers from which new data has not been sent for more than one month
To delete all computers from which new data has not been sent for more than one month, perform
the following steps.
- Use the
GET
operation on theapi/sam/v2/computers
REST API to retrieve information about all disconnected computers for which the value of the last_seen parameter is older than one month.- Request
-
GET https://hostname:port/api/sam/v2/computers ?datasource_type=1&criteria={"and":[["last_seen","ending","-P1M"]]} &is_deleted=0&columns[]=id
- Request header
-
Accept: application/json Accept-Language: en-US Token: <token>
- Response body
-
[ { "id":1, }, { "id":2, }, ]
- For every
id
that is returned by theGET
operation, run theDELETE
operation.- Request
-
DELETE https://hostname:port/api/sam/v2/computers?id=1
- Request header
-
Accept: application/json Accept-Language: en-US Token: <token>
- Response body
-
200