Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Fields

id

string

The user-defined device identifier. The device ID must be unique within a device registry.

name

string

The resource path name. For example, projects/p1/locations/us-central1/registries/registry0/devices/dev0 or projects/p1/locations/us-central1/registries/registry0/devices/{numId}. When name is populated as a response from the service, it always ends in the device’s numeric ID.

numId

string

[Output only] A The device’s server-defined unique numeric ID for the device. This is a more compact way to identify devices and is globally unique.

credentials[]

object(DeviceCredential)

The credentials used to authenticate this device. Multiple device credentials can be bound to this device to allow credential rotation without interruption. At most, three credentials can be bound to a single device at a time. When new credentials are added to a device, they are verified against the registry credentials. For details, see the description of the DeviceRegistry.credentials field.

lastHeartbeatTime

string (Timestamp format)

[Output only] The last time an MQTT PINGREQ was received. This field applies only to devices connecting through MQTT. MQTT clients usually only send PINGREQ messages if the connection is idle and no other messages have been sent. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

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

lastEventTime

string (Timestamp format)

[Output only] The last time a telemetry event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

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

lastStateTime

string (Timestamp format)

[Output only] The last time a state event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

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

lastConfigAckTime

string (Timestamp format)

[Output only] The last time a cloud-to-device config version acknowledgment was received from the device. This field is only for configurations sent through MQTT.

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

lastConfigSendTime

string (Timestamp format)

[Output only] The last time a cloud-to-device config version was sent to the device.

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

blocked

boolean

If a device is blocked, connections or requests from this device will fail. Can be used to temporarily prevent the device from connecting if, for example, the sensor is generating bad data and needs maintenance.

lastErrorTime

string (Timestamp format)

[Output only] The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub. This field is the timestamp of 'lastErrorStatus.'

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

lastErrorStatus

object(Status)

[Output only] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. 'lastErrorTime' is the timestamp of this field. If no errors have occurred, this field has an empty message, and the status code 0 == OK. Otherwise, this field is expected to have a status code other than OK.

config

object(DeviceConfig)

The most recent device configuration, which is eventually sent from ClearBlade IoT Core to the device. If not present on creation, the configuration will be initialized with an empty payload and 1 version value of 1. To update this field after creation, use the DeviceManager.ModifyCloudToDeviceConfig method.

state

object(DeviceState)

[Output only] The state most recently received from the device. If no state has been reported, this field is not present.

logLevel

enum(LogLevel)

The logging verbosity for device activity. If unspecified, DeviceRegistry.log_level will be used.

metadata

map (key: string, value: string)

The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by ClearBlade IoT Core. It can be used to add contextual information for the device.

Keys must conform to the regular expression [a-zA-Z][a-zA-Z0-9-_.+~%]+ and be less than 128 bytes in length.

Values are free-form strings. Each value must be less than or equal to 32 KB in size.

The total size of all keys and values must be less than 256 KB, and the maximum number of key-value pairs is 500.

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

gatewayConfig

object(GatewayConfig)

Gateway-related configuration and state.

...

The Status type defines a logical error model suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. The error model is designed to be:

  • Simple to use and understand for understood by most users

  • Flexible enough to meet unexpected needs

...

The Status message is the logical representation of the error model, but it is not necessarily the actual wire format. The Status message can be mapped differently when exposed in different client libraries and wire protocols. For example, it will likely be mapped to some Java exceptions in Java but more likely mapped to some C error codes in C.

Other uses

The error model and the Status message can be used in various environments, either with or without APIs, to provide a consistent developer experience across different environments.

...

  • Partial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.

  • Workflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.

  • Batch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.

  • Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.

  • Logging. If some API errors are stored in logs, the Status message Status could be used directly after any stripping needed for security/privacy reasons.

...

Fields

gatewayType

enum(GatewayType)

Indicates whether the device is a gateway.

gatewayAuthMethod

enum(GatewayAuthMethod)

Indicates how to authorize and authenticate devices to access the gateway.

lastAccessedGatewayId

string

[Output only] The gateway ID of the gateway the device accessed most recently.

lastAccessedGatewayTime

string (Timestamp format)

[Output only] The most recent time the device accessed the gateway specified in last_accessed_gateway.

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

...

Enums

GATEWAY_AUTH_METHOD_UNSPECIFIED

No authentication/authorization method specified. No devices are allowed to access the gateway.

ASSOCIATION_ONLY

The device is authenticated through the gateway association only, and device credentials are ignored even if provided.

DEVICE_AUTH_TOKEN_ONLY

The device is authenticated through its credentials, and the Gateway gateway association is not checked.

ASSOCIATION_AND_DEVICE_AUTH_TOKEN

The device is authenticated through both device credentials and gateway association. The device must be bound to the gateway and must provide its credentials.

Methods

create

Creates a device in a device registry.

delete

Deletes a device.

get

Gets details about a device.

list

List devices in a device registry.

modifyCloudToDeviceConfig

Modifies the configuration for the device, which is eventually sent from the ClearBlade IoT Core servers.

patch

Updates a device.

sendCommandToDevice

Sends a command to the specified device.