REST Resource: enterprises.devices

Resource: Device

A device owned by an enterprise. Unless otherwise noted, all fields are read-only and can't be modified by enterprises.devices.patch.

JSON representation
{
  "name": string,
  "userName": string,
  "managementMode": enum (ManagementMode),
  "state": enum (DeviceState),
  "appliedState": enum (DeviceState),
  "policyCompliant": boolean,
  "nonComplianceDetails": [
    {
      object (NonComplianceDetail)
    }
  ],
  "enrollmentTime": string,
  "lastStatusReportTime": string,
  "lastPolicyComplianceReportTime": string,
  "lastPolicySyncTime": string,
  "policyName": string,
  "appliedPolicyName": string,
  "appliedPolicyVersion": string,
  "apiLevel": number,
  "enrollmentTokenData": string,
  "enrollmentTokenName": string,
  "disabledReason": {
    object (UserFacingMessage)
  },
  "softwareInfo": {
    object (SoftwareInfo)
  },
  "hardwareInfo": {
    object (HardwareInfo)
  },
  "displays": [
    {
      object (Display)
    }
  ],
  "applicationReports": [
    {
      object (ApplicationReport)
    }
  ],
  "previousDeviceNames": [
    string
  ],
  "networkInfo": {
    object (NetworkInfo)
  },
  "memoryInfo": {
    object (MemoryInfo)
  },
  "memoryEvents": [
    {
      object (MemoryEvent)
    }
  ],
  "powerManagementEvents": [
    {
      object (PowerManagementEvent)
    }
  ],
  "hardwareStatusSamples": [
    {
      object (HardwareStatus)
    }
  ],
  "deviceSettings": {
    object (DeviceSettings)
  },
  "user": {
    object (User)
  },
  "systemProperties": {
    string: string,
    ...
  }
}
Fields
name

string

The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.

userName

string

The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}.

managementMode

enum (ManagementMode)

The type of management mode Android Device Policy takes on the device. This influences which policy settings are supported.

state

enum (DeviceState)

The state to be applied to the device. This field can be modified by a patch request. Note that when calling enterprises.devices.patch, ACTIVE and DISABLED are the only allowable values. To enter the device into a DELETED state, call enterprises.devices.delete.

appliedState

enum (DeviceState)

The state currently applied to the device.

policyCompliant

boolean

Whether the device is compliant with its policy.

nonComplianceDetails[]

object (NonComplianceDetail)

Details about policy settings that the device is not compliant with.

enrollmentTime

string (Timestamp format)

The time of device enrollment.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

lastStatusReportTime

string (Timestamp format)

The last time the device sent a status report.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

lastPolicyComplianceReportTime
(deprecated)

string (Timestamp format)

Deprecated.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

lastPolicySyncTime

string (Timestamp format)

The last time the device fetched its policy.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

policyName

string

The name of the policy applied to the device, in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policyName for the device's user is applied. This field can be modified by a patch request. You can specify only the policyId when calling enterprises.devices.patch, as long as the policyId doesn’t contain any slashes. The rest of the policy name is inferred.

appliedPolicyName

string

The name of the policy currently applied to the device.

appliedPolicyVersion

string (int64 format)

The version of the policy currently applied to the device.

apiLevel

number

The API level of the Android platform version running on the device.

enrollmentTokenData

string

If the device was enrolled with an enrollment token with additional data provided, this field contains that data.

enrollmentTokenName

string

If the device was enrolled with an enrollment token, this field contains the name of the token.

disabledReason

object (UserFacingMessage)

If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field can be modified by a patch request.

softwareInfo

object (SoftwareInfo)

Detailed information about the device software. This information is only available if softwareInfoEnabled is true in the device's policy.

hardwareInfo

object (HardwareInfo)

Detailed information about the device hardware.

displays[]

object (Display)

Detailed information about displays on the device. This information is only available if displayInfoEnabled is true in the device's policy.

applicationReports[]

object (ApplicationReport)

Reports for apps installed on the device. This information is only available when applicationReportsEnabled is true in the device's policy.

previousDeviceNames[]

string

If the same physical device has been enrolled multiple times, this field contains its previous device names. The serial number is used as the unique identifier to determine if the same physical device has enrolled previously. The names are in chronological order.

networkInfo

object (NetworkInfo)

Device network information. This information is only available if networkInfoEnabled is true in the device's policy.

memoryInfo

object (MemoryInfo)

Memory information. This information is only available if memoryInfoEnabled is true in the device's policy.

memoryEvents[]

object (MemoryEvent)

Events related to memory and storage measurements in chronological order. This information is only available if memoryInfoEnabled is true in the device's policy.

powerManagementEvents[]

object (PowerManagementEvent)

Power management events on the device in chronological order. This information is only available if powerManagementEventsEnabled is true in the device's policy.

hardwareStatusSamples[]

object (HardwareStatus)

Hardware status samples in chronological order. This information is only available if hardwareStatusEnabled is true in the device's policy.

deviceSettings

object (DeviceSettings)

Device settings information. This information is only available if deviceSettingsEnabled is true in the device's policy.

user

object (User)

The user who owns the device.

systemProperties

map (key: string, value: string)

Map of selected system properties name and value related to the device.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

ManagementMode

The type of management mode Android Device Policy takes on the device.

Enums
MANAGEMENT_MODE_UNSPECIFIED This value is disallowed.
DEVICE_OWNER Device owner. Android Device Policy has full control over the device.
PROFILE_OWNER Profile owner. Android Device Policy has control over a managed profile on the device.

DeviceState

States that may be applied to a device.

Enums
DEVICE_STATE_UNSPECIFIED This value is disallowed.
ACTIVE The device is active.
DISABLED The device is disabled.
DELETED The device was deleted. This state will never be returned by an API call, but is used in the final status report published to Cloud Pub/Sub when the device acknowledges the deletion.
PROVISIONING The device is being provisioned. Newly enrolled devices are in this state until they have a policy applied.

NonComplianceDetail

Provides detail about non-compliance with a policy setting.

JSON representation
{
  "settingName": string,
  "nonComplianceReason": enum (NonComplianceReason),
  "packageName": string,
  "fieldPath": string,
  "currentValue": value,
  "installationFailureReason": enum (InstallationFailureReason)
}
Fields
settingName

string

The name of the policy setting. This is the JSON field name of a top-level Policy field.

nonComplianceReason

enum (NonComplianceReason)

The reason the device is not in compliance with the setting.

packageName

string

The package name indicating which app is out of compliance, if applicable.

fieldPath

string

For settings with nested fields, if a particular nested field is out of compliance, this specifies the full path to the offending field. The path is formatted in the same way the policy JSON field would be referenced in JavaScript, that is: 1) For object-typed fields, the field name is followed by a dot then by a subfield name. 2) For array-typed fields, the field name is followed by the array index enclosed in brackets. For example, to indicate a problem with the url field in the externalData field in the 3rd application, the path would be applications[2].externalData.url

currentValue

value (Value format)

If the policy setting could not be applied, the current value of the setting on the device.

installationFailureReason

enum (InstallationFailureReason)

If packageName is set and the non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the detailed reason the app can't be installed or updated.

InstallationFailureReason

Reasons an app installation might fail.

Enums
INSTALLATION_FAILURE_REASON_UNSPECIFIED This value is disallowed.
INSTALLATION_FAILURE_REASON_UNKNOWN An unknown condition is preventing the app from being installed. Some potential reasons are that the device doesn't have enough storage, the device network connection is unreliable, or the installation is taking longer than expected. The installation will be retried automatically.
IN_PROGRESS The installation is still in progress.
NOT_FOUND The app was not found in Play.
NOT_COMPATIBLE_WITH_DEVICE The app is incompatible with the device.
NOT_APPROVED The app has not been approved by the admin.
PERMISSIONS_NOT_ACCEPTED The app has new permissions that have not been accepted by the admin.
NOT_AVAILABLE_IN_COUNTRY The app is not available in the user's country.
NO_LICENSES_REMAINING There are no licenses available to assign to the user.
NOT_ENROLLED The enterprise is no longer enrolled with managed Play or the admin has not accepted the latest managed Play terms of service.
USER_INVALID The user is no longer valid. The user may have been deleted or disabled.

SoftwareInfo

Information about device software.

JSON representation
{
  "androidVersion": string,
  "androidDevicePolicyVersionCode": number,
  "androidDevicePolicyVersionName": string,
  "androidBuildNumber": string,
  "deviceKernelVersion": string,
  "bootloaderVersion": string,
  "androidBuildTime": string,
  "securityPatchLevel": string,
  "primaryLanguageCode": string,
  "deviceBuildSignature": string
}
Fields
androidVersion

string

The user-visible Android version string. For example, 6.0.1.

androidDevicePolicyVersionCode

number

The Android Device Policy app version code.

androidDevicePolicyVersionName

string

The Android Device Policy app version as displayed to the user.

androidBuildNumber

string

Android build ID string meant for displaying to the user. For example, shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys.

deviceKernelVersion

string

Kernel version, for example, 2.6.32.9-g103d848.

bootloaderVersion

string

The system bootloader version number, e.g. 0.6.7.

androidBuildTime

string (Timestamp format)

Build time.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

securityPatchLevel

string

Security patch level, e.g. 2016-05-01.

primaryLanguageCode

string

An IETF BCP 47 language code for the primary locale on the device.

deviceBuildSignature

string

SHA-256 hash of android.content.pm.Signature associated with the system package, which can be used to verify that the system build hasn't been modified.

HardwareInfo

Information about device hardware. The fields related to temperature thresholds are only available if hardwareStatusEnabled is true in the device's policy.

JSON representation
{
  "brand": string,
  "hardware": string,
  "deviceBasebandVersion": string,
  "manufacturer": string,
  "serialNumber": string,
  "model": string,
  "batteryShutdownTemperatures": [
    number
  ],
  "batteryThrottlingTemperatures": [
    number
  ],
  "cpuShutdownTemperatures": [
    number
  ],
  "cpuThrottlingTemperatures": [
    number
  ],
  "gpuShutdownTemperatures": [
    number
  ],
  "gpuThrottlingTemperatures": [
    number
  ],
  "skinShutdownTemperatures": [
    number
  ],
  "skinThrottlingTemperatures": [
    number
  ]
}
Fields
brand

string

Brand of the device. For example, Google.

hardware

string

Name of the hardware. For example, Angler.

deviceBasebandVersion

string

Baseband version. For example, MDM9625_104662.22.05.34p.

manufacturer

string

Manufacturer. For example, Motorola.

serialNumber

string

The device serial number.

model

string

The model of the device. For example, Asus Nexus 7.

batteryShutdownTemperatures[]

number

Battery shutdown temperature thresholds in Celsius for each battery on the device.

batteryThrottlingTemperatures[]

number

Battery throttling temperature thresholds in Celsius for each battery on the device.

cpuShutdownTemperatures[]

number

CPU shutdown temperature thresholds in Celsius for each CPU on the device.

cpuThrottlingTemperatures[]

number

CPU throttling temperature thresholds in Celsius for each CPU on the device.

gpuShutdownTemperatures[]

number

GPU shutdown temperature thresholds in Celsius for each GPU on the device.

gpuThrottlingTemperatures[]

number

GPU throttling temperature thresholds in Celsius for each GPU on the device.

skinShutdownTemperatures[]

number

Device skin shutdown temperature thresholds in Celsius.

skinThrottlingTemperatures[]

number

Device skin throttling temperature thresholds in Celsius.

Display

Device display information.

JSON representation
{
  "name": string,
  "displayId": number,
  "refreshRate": number,
  "state": enum (DisplayState),
  "width": number,
  "height": number,
  "density": number
}
Fields
name

string

Name of the display.

displayId

number

Unique display id.

refreshRate

number

Refresh rate of the display in frames per second.

state

enum (DisplayState)

State of the display.

width

number

Display width in pixels.

height

number

Display height in pixels.

density

number

Display density expressed as dots-per-inch.

DisplayState

The state of a display.

Enums
DISPLAY_STATE_UNSPECIFIED This value is disallowed.
OFF Display is off.
ON Display is on.
DOZE Display is dozing in a low power state
SUSPENDED Display is dozing in a suspended low power state.

ApplicationReport

Information reported about an installed app.

JSON representation
{
  "packageName": string,
  "versionName": string,
  "versionCode": number,
  "events": [
    {
      object (ApplicationEvent)
    }
  ],
  "displayName": string,
  "packageSha256Hash": string,
  "signingKeyCertFingerprints": [
    string
  ],
  "installerPackageName": string,
  "applicationSource": enum (ApplicationSource),
  "state": enum (ApplicationState),
  "keyedAppStates": [
    {
      object (KeyedAppState)
    }
  ]
}
Fields
packageName

string

Package name of the app.

versionName

string

The app version as displayed to the user.

versionCode

number

The app version code, which can be used to determine whether one version is more recent than another.

events[]

object (ApplicationEvent)

List of app events. The most recent 20 events are stored in the list.

displayName

string

The display name of the app.

packageSha256Hash

string

The SHA-256 hash of the app's APK file, which can be used to verify the app hasn't been modified. Each byte of the hash value is represented as a two-digit hexadecimal number.

signingKeyCertFingerprints[]

string

The SHA-1 hash of each android.content.pm.Signature associated with the app package. Each byte of each hash value is represented as a two-digit hexadecimal number.

installerPackageName

string

The package name of the app that installed this app.

applicationSource

enum (ApplicationSource)

The source of the package.

state

enum (ApplicationState)

Application state.

keyedAppStates[]

object (KeyedAppState)

List of keyed app states reported by the app.

ApplicationEvent

An app-related event.

JSON representation
{
  "eventType": enum (ApplicationEventType),
  "createTime": string
}
Fields
eventType

enum (ApplicationEventType)

App event type.

createTime

string (Timestamp format)

The creation time of the event.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

ApplicationEventType

A type of app-related event.

Enums
APPLICATION_EVENT_TYPE_UNSPECIFIED This value is disallowed.
INSTALLED The app was installed.
CHANGED The app was changed, for example, a component was enabled or disabled.
DATA_CLEARED The app data was cleared.
REMOVED The app was removed.
REPLACED A new version of the app has been installed, replacing the old version.
RESTARTED The app was restarted.
PINNED The app was pinned to the foreground.
UNPINNED The app was unpinned.

ApplicationSource

The source that provided an app.

Enums
APPLICATION_SOURCE_UNSPECIFIED The app was sideloaded from an unspecified source.
SYSTEM_APP_FACTORY_VERSION This is a system app from the device's factory image.
SYSTEM_APP_UPDATED_VERSION This is an updated system app.
INSTALLED_FROM_PLAY_STORE The app was installed from the Google Play Store.

ApplicationState

The current installation status.

Enums
INSTALLED App is installed on the device
REMOVED App was removed from the device

KeyedAppState

Keyed app state reported by the app.

JSON representation
{
  "key": string,
  "severity": enum (Severity),
  "message": string,
  "data": string,
  "createTime": string,
  "lastUpdateTime": string
}
Fields
key

string

The key for the app state. Acts as a point of reference for what the app is providing state for. For example, when providing managed configuration feedback, this key could be the managed configuration key.

severity

enum (Severity)

The severity of the app state.

message

string

Optionally, a free-form message string to explain the app state. If the state was triggered by a particular value (e.g. a managed configuration value), it should be included in the message.

data

string

Optionally, a machine-readable value to be read by the EMM. For example, setting values that the admin can choose to query against in the EMM console (e.g. “notify me if the battery_warning data < 10”).

createTime

string (Timestamp format)

The creation time of the app state on the device.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

lastUpdateTime

string (Timestamp format)

The time the app state was most recently updated.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

Severity

The severity of the app state.

Enums
SEVERITY_UNSPECIFIED Unspecified severity level.
INFO Information severity level.
ERROR Error severity level. This should only be set for genuine error conditions that a management organization needs to take action to fix.

NetworkInfo

Device network info.

JSON representation
{
  "imei": string,
  "meid": string,
  "wifiMacAddress": string,
  "networkOperatorName": string
}
Fields
imei

string

IMEI number of the GSM device. For example, A1000031212.

meid

string

MEID number of the CDMA device. For example, A00000292788E1.

wifiMacAddress

string

Wi-Fi MAC address of the device. For example, 7c:11:11:11:11:11.

networkOperatorName

string

Alphabetic name of current registered operator. For example, Vodafone.

MemoryInfo

Information about device memory and storage.

JSON representation
{
  "totalRam": string,
  "totalInternalStorage": string
}
Fields
totalRam

string (int64 format)

Total RAM on device in bytes.

totalInternalStorage

string (int64 format)

Total internal storage on device in bytes.

MemoryEvent

An event related to memory and storage measurements.

JSON representation
{
  "eventType": enum (MemoryEventType),
  "createTime": string,
  "byteCount": string
}
Fields
eventType

enum (MemoryEventType)

Event type.

createTime

string (Timestamp format)

The creation time of the event.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

byteCount

string (int64 format)

The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium.

MemoryEventType

The type of event.

Enums
MEMORY_EVENT_TYPE_UNSPECIFIED Unspecified. No events have this type.
RAM_MEASURED Free space in RAM was measured.
INTERNAL_STORAGE_MEASURED Free space in internal storage was measured.
EXTERNAL_STORAGE_DETECTED A new external storage medium was detected. The reported byte count is the total capacity of the storage medium.
EXTERNAL_STORAGE_REMOVED An external storage medium was removed. The reported byte count is zero.
EXTERNAL_STORAGE_MEASURED Free space in an external storage medium was measured.

PowerManagementEvent

A power management event.

JSON representation
{
  "eventType": enum (PowerManagementEventType),
  "createTime": string,
  "batteryLevel": number
}
Fields
eventType

enum (PowerManagementEventType)

Event type.

createTime

string (Timestamp format)

The creation time of the event.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

batteryLevel

number

For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage.

PowerManagementEventType

The type of event.

Enums
POWER_MANAGEMENT_EVENT_TYPE_UNSPECIFIED Unspecified. No events have this type.
BATTERY_LEVEL_COLLECTED Battery level was measured.
POWER_CONNECTED The device started charging.
POWER_DISCONNECTED The device stopped charging.
BATTERY_LOW The device entered low-power mode.
BATTERY_OKAY The device exited low-power mode.
BOOT_COMPLETED The device booted.
SHUTDOWN The device shut down.

HardwareStatus

Hardware status. Temperatures may be compared to the temperature thresholds available in hardwareInfo to determine hardware health.

JSON representation
{
  "createTime": string,
  "batteryTemperatures": [
    number
  ],
  "cpuTemperatures": [
    number
  ],
  "gpuTemperatures": [
    number
  ],
  "skinTemperatures": [
    number
  ],
  "fanSpeeds": [
    number
  ],
  "cpuUsages": [
    number
  ]
}
Fields
createTime

string (Timestamp format)

The time the measurements were taken.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

batteryTemperatures[]

number

Current battery temperatures in Celsius for each battery on the device.

cpuTemperatures[]

number

Current CPU temperatures in Celsius for each CPU on the device.

gpuTemperatures[]

number

Current GPU temperatures in Celsius for each GPU on the device.

skinTemperatures[]

number

Current device skin temperatures in Celsius.

fanSpeeds[]

number

Fan speeds in RPM for each fan on the device. Empty array means that there are no fans or fan speed is not supported on the system.

cpuUsages[]

number

CPU usages in percentage for each core available on the device. Usage is 0 for each unplugged core. Empty array implies that CPU usage is not supported in the system.

DeviceSettings

Information about security related device settings on device.

JSON representation
{
  "isDeviceSecure": boolean,
  "unknownSourcesEnabled": boolean,
  "developmentSettingsEnabled": boolean,
  "adbEnabled": boolean,
  "isEncrypted": boolean,
  "encryptionStatus": enum (EncryptionStatus),
  "verifyAppsEnabled": boolean
}
Fields
isDeviceSecure

boolean

Whether the device is secured with PIN/password.

unknownSourcesEnabled

boolean

Whether installing apps from unknown sources is enabled.

developmentSettingsEnabled

boolean

Whether developer mode is enabled on the device.

adbEnabled

boolean

Whether ADB is enabled on the device.

isEncrypted

boolean

Whether the storage encryption is enabled.

encryptionStatus

enum (EncryptionStatus)

Encryption status from DevicePolicyManager.

verifyAppsEnabled

boolean

Whether Verify Apps (Google Play Protect) is enabled on the device.

EncryptionStatus

Encryption status of a device.

Enums
ENCRYPTION_STATUS_UNSPECIFIED Unspecified. No device should have this type.
UNSUPPORTED Encryption is not supported by the device.
INACTIVE Encryption is supported by the device, but is not currently active.
ACTIVATING Encryption is not currently active, but is currently being activated.
ACTIVE Encryption is active.
ACTIVE_DEFAULT_KEY Encryption is active, but an encryption key is not set by the user.
ACTIVE_PER_USER Encryption is active, and the encryption key is tied to the user profile.

Methods

delete

Deletes a device.

get

Gets a device.

issueCommand

Issues a command to a device.

list

Lists devices for a given enterprise.

patch

Updates a device.

发送以下问题的反馈:

此网页
Android Management API
Android Management API