Skip to main content

devices

Creates, updates, deletes, gets or lists a devices resource.

Overview

Namedevices
TypeResource
Idgoogle.cloudidentity.devices

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Resource name of the Device in format: devices/{device}, where device is the unique id assigned to the Device. Important: Device API scopes require that you use domain-wide delegation to access the API. For more information, see Set up the Devices API.
androidSpecificAttributesobjectOutput only. Attributes specific to Android devices. (id: GoogleAppsCloudidentityDevicesV1AndroidAttributes)
assetTagstringAsset tag of the device.
basebandVersionstringOutput only. Baseband version of the device.
bootloaderVersionstringOutput only. Device bootloader version. Example: 0.6.7.
brandstringOutput only. Device brand. Example: Samsung.
buildNumberstringOutput only. Build number of the device.
compromisedStatestringOutput only. Represents whether the Device is compromised.
createTimestring (google-datetime)Output only. When the Company-Owned device was imported. This field is empty for BYOD devices.
deviceIdstringUnique identifier for the device.
deviceTypestringOutput only. Type of device.
enabledDeveloperOptionsbooleanOutput only. Whether developer options is enabled on device.
enabledUsbDebuggingbooleanOutput only. Whether USB debugging is enabled on device.
encryptionStatestringOutput only. Device encryption state.
endpointVerificationSpecificAttributesobjectOutput only. Attributes specific to Endpoint Verification devices. (id: GoogleAppsCloudidentityDevicesV1EndpointVerificationSpecificAttributes)
hostnamestringHost name of the device.
imeistringOutput only. IMEI number of device if GSM device; empty otherwise.
kernelVersionstringOutput only. Kernel version of the device.
lastSyncTimestring (google-datetime)Most recent time when device synced with this service.
managementStatestringOutput only. Management state of the device
manufacturerstringOutput only. Device manufacturer. Example: Motorola.
meidstringOutput only. MEID number of device if CDMA device; empty otherwise.
modelstringOutput only. Model name of device. Example: Pixel 3.
networkOperatorstringOutput only. Mobile or network operator of device, if available.
osVersionstringOutput only. OS version of the device. Example: Android 8.1.0.
otherAccountsarrayOutput only. Domain name for Google accounts on device. Type for other accounts on device. On Android, will only be populated if |ownership_privilege| is |PROFILE_OWNER| or |DEVICE_OWNER|. Does not include the account signed in to the device policy app if that account's domain has only one account. Examples: "com.example", "xyz.com".
ownerTypestringOutput only. Whether the device is owned by the company or an individual
releaseVersionstringOutput only. OS release version. Example: 6.0.
securityPatchTimestring (google-datetime)Output only. OS security patch update time on device.
serialNumberstringSerial Number of device. Example: HT82V1A01076.
unifiedDeviceIdstringOutput only. Unified device id of the device.
wifiMacAddressesarrayWiFi MAC addresses of device.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdevicesIdcustomerRetrieves the specified device.
listselectcustomer, filter, pageSize, pageToken, orderBy, viewLists/Searches devices.
createinsertcustomerCreates a device. Only company-owned device may be created. Note: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium
deletedeletedevicesIdcustomerDeletes the specified device.
wipeexecdevicesIdWipes all data on the specified device.
cancel_wipeexecdevicesIdCancels an unfinished device wipe. This operation can be used to cancel device wipe in the gap between the wipe operation returning success and the device being wiped. This operation is possible when the device is in a "pending wipe" state. The device enters the "pending wipe" state when a wipe device command is issued, but has not yet been sent to the device. The cancel wipe will fail if the wipe command has already been issued to the device.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
devicesIdstring
customerstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
viewstring

SELECT examples

Retrieves the specified device.

SELECT
name,
androidSpecificAttributes,
assetTag,
basebandVersion,
bootloaderVersion,
brand,
buildNumber,
compromisedState,
createTime,
deviceId,
deviceType,
enabledDeveloperOptions,
enabledUsbDebugging,
encryptionState,
endpointVerificationSpecificAttributes,
hostname,
imei,
kernelVersion,
lastSyncTime,
managementState,
manufacturer,
meid,
model,
networkOperator,
osVersion,
otherAccounts,
ownerType,
releaseVersion,
securityPatchTime,
serialNumber,
unifiedDeviceId,
wifiMacAddresses
FROM google.cloudidentity.devices
WHERE devicesId = '{{ devicesId }}' -- required
AND customer = '{{ customer }}';

INSERT examples

Creates a device. Only company-owned device may be created. Note: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium

INSERT INTO google.cloudidentity.devices (
data__lastSyncTime,
data__serialNumber,
data__assetTag,
data__wifiMacAddresses,
data__deviceId,
data__hostname,
customer
)
SELECT
'{{ lastSyncTime }}',
'{{ serialNumber }}',
'{{ assetTag }}',
'{{ wifiMacAddresses }}',
'{{ deviceId }}',
'{{ hostname }}',
'{{ customer }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes the specified device.

DELETE FROM google.cloudidentity.devices
WHERE devicesId = '{{ devicesId }}' --required
AND customer = '{{ customer }}';

Lifecycle Methods

Wipes all data on the specified device.

EXEC google.cloudidentity.devices.wipe 
@devicesId='{{ devicesId }}' --required
@@json=
'{
"customer": "{{ customer }}",
"removeResetLock": {{ removeResetLock }}
}';