Bulk devices state

Bulk Devices state

GET https://api.connect.jfrog.io/v1/get_devices_state

Using this call you will get the current state - Online or Offline on a bulk of devices.

Request Body

NameTypeDescription

user_token

string

This is your account token. You can find it under the Settings category on the dashboard.

group_name

string

This is the group name of the group you would like to get all its devices state.

project_name

string

This is the project name of the project you would like to get all its devices state.

limit

integer

The number of results per page. The maximum limit is 50. Default is 20.

offset

integer

Offset to start pagination search results. This should be the last device_uuid from the previous request.

{"message": {"device_status": "online",
             "device_uuid": "d-1234-abcd",
             "device_name": "My-Device-1"}}

If no parameters are set, the first 20 devices of that user will be returned.

Example

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/get_devices_state", 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_status = device["device_status"]
        device_uuid = device["device_uuid"]
        device_name = device["device_name"]

Last updated