Get the live status of a latest device
client.ZeroTrust.Devices.FleetStatus.Get(ctx, deviceID, params) (*DeviceFleetStatusGetResponse, error)
GET/accounts/{account_id}/dex/devices/{device_id}/fleet-status/live
Get the live status of a latest device given device_id from the device_state table
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get the live status of a latest device
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/cloudflare-go"
"github.com/stainless-sdks/cloudflare-go/option"
"github.com/stainless-sdks/cloudflare-go/zero_trust"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
fleetStatus, err := client.ZeroTrust.Devices.FleetStatus.Get(
context.TODO(),
"cb49c27f-7f97-49c5-b6f3-f7c01ead0fd7",
zero_trust.DeviceFleetStatusGetParams{
AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"),
SinceMinutes: cloudflare.F(10.000000),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fleetStatus.NetworkSsid)
}
{
"colo": "SJC",
"deviceId": "deviceId",
"mode": "proxy",
"platform": "windows",
"status": "connected",
"timestamp": "2023-10-11 00:00:00+00",
"version": "1.0.0",
"alwaysOn": true,
"batteryCharging": true,
"batteryCycles": 0,
"batteryPct": 0,
"connectionType": "connectionType",
"cpuPct": 0,
"cpuPctByApp": [
{
"cpu_pct": 0,
"name": "name"
}
],
"deviceIpv4": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"deviceIpv6": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"deviceName": "deviceName",
"deviceRegistration": "deviceRegistration",
"diskReadBps": 0,
"diskUsagePct": 0,
"diskWriteBps": 0,
"dohSubdomain": "dohSubdomain",
"estimatedLossPct": 0,
"firewallEnabled": true,
"gatewayIpv4": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"gatewayIpv6": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"handshakeLatencyMs": 0,
"ispIpv4": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"ispIpv6": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"metal": "metal",
"networkRcvdBps": 0,
"networkSentBps": 0,
"networkSsid": "networkSsid",
"personEmail": "personEmail",
"ramAvailableKb": 0,
"ramUsedPct": 0,
"ramUsedPctByApp": [
{
"name": "name",
"ram_used_pct": 0
}
],
"registrationId": "registrationId",
"rtt": {
"minRttUs": {
"downstream": 0,
"upstream": 0
},
"rttUs": {
"downstream": 0,
"upstream": 0
},
"rttVarUs": {
"downstream": 0,
"upstream": 0
}
},
"switchLocked": true,
"tunnelStats": {
"bytesLost": {
"downstream": 0,
"upstream": 0
},
"bytesReceived": {
"downstream": 0,
"upstream": 0
},
"bytesRetransmitted": {
"downstream": 0,
"upstream": 0
},
"bytesSent": {
"downstream": 0,
"upstream": 0
},
"packetsLost": {
"downstream": 0,
"upstream": 0
},
"packetsReceived": {
"downstream": 0,
"upstream": 0
},
"packetsRetransmitted": {
"downstream": 0,
"upstream": 0
},
"packetsSent": {
"downstream": 0,
"upstream": 0
},
"statsWindowMs": 0
},
"tunnelType": "tunnelType",
"wifiStrengthDbm": 0
}Returns Examples
{
"colo": "SJC",
"deviceId": "deviceId",
"mode": "proxy",
"platform": "windows",
"status": "connected",
"timestamp": "2023-10-11 00:00:00+00",
"version": "1.0.0",
"alwaysOn": true,
"batteryCharging": true,
"batteryCycles": 0,
"batteryPct": 0,
"connectionType": "connectionType",
"cpuPct": 0,
"cpuPctByApp": [
{
"cpu_pct": 0,
"name": "name"
}
],
"deviceIpv4": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"deviceIpv6": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"deviceName": "deviceName",
"deviceRegistration": "deviceRegistration",
"diskReadBps": 0,
"diskUsagePct": 0,
"diskWriteBps": 0,
"dohSubdomain": "dohSubdomain",
"estimatedLossPct": 0,
"firewallEnabled": true,
"gatewayIpv4": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"gatewayIpv6": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"handshakeLatencyMs": 0,
"ispIpv4": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"ispIpv6": {
"address": "address",
"asn": 0,
"aso": "aso",
"location": {
"city": "city",
"country_iso": "country_iso",
"state_iso": "state_iso",
"zip": "zip"
},
"name": "name",
"netmask": "netmask",
"version": 1
},
"metal": "metal",
"networkRcvdBps": 0,
"networkSentBps": 0,
"networkSsid": "networkSsid",
"personEmail": "personEmail",
"ramAvailableKb": 0,
"ramUsedPct": 0,
"ramUsedPctByApp": [
{
"name": "name",
"ram_used_pct": 0
}
],
"registrationId": "registrationId",
"rtt": {
"minRttUs": {
"downstream": 0,
"upstream": 0
},
"rttUs": {
"downstream": 0,
"upstream": 0
},
"rttVarUs": {
"downstream": 0,
"upstream": 0
}
},
"switchLocked": true,
"tunnelStats": {
"bytesLost": {
"downstream": 0,
"upstream": 0
},
"bytesReceived": {
"downstream": 0,
"upstream": 0
},
"bytesRetransmitted": {
"downstream": 0,
"upstream": 0
},
"bytesSent": {
"downstream": 0,
"upstream": 0
},
"packetsLost": {
"downstream": 0,
"upstream": 0
},
"packetsReceived": {
"downstream": 0,
"upstream": 0
},
"packetsRetransmitted": {
"downstream": 0,
"upstream": 0
},
"packetsSent": {
"downstream": 0,
"upstream": 0
},
"statsWindowMs": 0
},
"tunnelType": "tunnelType",
"wifiStrengthDbm": 0
}