Get devices details
get
https://api.connect.jfrog.io/v1/
devices_details
Devices details
1. device_id - Integer - The ID of the device.
2. device_name - String - The name of the device.
3. upswift_version - String - Upswift Agent version.
4. device_uuid - string - The UUID of the device (as shown in the dashboard)
5. project - String - The name of the project this device is registered to.
6. group - String - The name of the group this device is registered to.
7. device_ip - String - The IP of the device.
8. last_keepalive - String(DATETIME) - The last time a keep-alive message received from that device.
9. cpu_usage - Integer - The current CPU usage of the device (Percentage - value can be 0-100).
10. ram_usage - Integer - The current RAM usage of the device (Percentage - value can be 0-100).
11. disk_usage - Float - The current Disk usage of the device (MegaBytes).
12. address - String - The current address set for this device.
13. lat - Float - The current Latitude parameter set for this device.
14. lng - Float - The current Longitude parameter set for this device.
15. is_update_trigger_set - Boolean - If the parameter update trigger is currently set. valid values true/false.
16. description - String - The description of that device.
17. registered_date - String(DATETIME) - The date when this device has been registered to the platform.
18. tags - List of Strings - A list of all of the tags for this device.
19. updates - List of JSONs - The last 5 updates of that device with information regarding those updates.
Each JSON includes the next parameters:
1. update_id - Integer - The ID of the update.
2. update_status - String - The status of the update.
Possible values are:
pending - The update is pending and will be deployed at the scheduled time.
in_progress - The update is in progress state, meaning it is currently being deployed.
success - The update successfully finished the deployment. failed - The deployment failed.
3. update_version - String - The version of the update.
4. comment - String - The comment set to the update when it was created.
5. deployment_schedule_time - String(DATETIME) - The time the deployment was scheduled to. By default this is the update creation time. Please note the value is UTC time with the next format: Year-Month-Day Hour:Minute:Second.
20. updates_v2 - List of JSONs - the last 5 updates (v2) of that device with information regarding those updates. Each JSON includes the next parameters:
1. flow_name - String - The name of the flow that was deployed.
2. deployment_status - String - The status of the update. Possible values are: pending - The update is pending and will be deployed at the scheduled time.
in_progress - The update is in progress state, meaning it is currently being deployed.
success - The update successfully finished deployment. failed - The deployment failed.
3. comment - String - The comment set to the deployment when it was created.
4. deployment_scheduled_time - String(DATETIME) - The time the deployment was scheduled to. By default this is the deployment creation time. Please note the value is UTC time with the next format: Year-Month-Day Hour:Minute:Second.
5. apps_updated - List of JSONs - The apps that were set during the deployment. The JSON object contains 2 keys: {"app_name": "<name>", "app_new_version": "<version>"}
6. deployment_type - String - The type of the deployment. Possible values are: manual, api-deployment.
21. apps - List of JSONs - A list of apps that this device has and their versions. the JSON object contains 2 keys: {"app_name": "<name>", "version": "<version>"}. The value of "more" is a boolean representing if there are more devices to query.
If no parameters are set, the first 20 devices of that user will be returned.
Python
import json
import requests
json_content = {'project_name': 'MYPROJECT',
'group_name': 'Production',
'user_token': 'YYYYYYYYYYYYYYY'}
call_request = requests.get("https://api.connect.jfrog.io/v1/devices_details", json=json_content)
call_response = json.loads(call_request.text)
if call_request.status_code != 200:
if call_request.status_code == 429:
error = "API limit reached"
else:
error = call_response["error_message"]
print(error)
else:
for device in call_response["message"]:
device_name = device["device_name"]
device_id = device["device_id"]
device_uuid = device["device_uuid"]
upswift_version = device["upswift_version"]
project = device["project"]
group = device["group"]
device_ip = device["device_ip"]
last_keepalive = device["last_keepalive"]
cpu_usage = device["cpu_usage"]
ram_usage = device["ram_usage"]
address = device["address"]
lat = device["lat"]
lng = device["lng"]
is_update_trigger_set = device["is_update_trigger_set"]
description = device["description"]
registered_date = device["registered_date"]
updates = device["updates"]
tags = device["tags"]
updates = device["updates_v2"]
apps = device["apps"]
mac_addresses = device["mac_addresses"]
Last modified 3mo ago