google_api_cloud_iot v0.7.0 GoogleApi.CloudIot.V1.Model.Device View Source
The device resource.
Attributes
- 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. Defaults to
nil
. - config (GoogleApi.CloudIot.V1.Model.DeviceConfig.t): The most recent device configuration, which is eventually sent from
Cloud IoT Core to the device. If not present on creation, the
configuration will be initialized with an empty payload and version value
of
1
. To update this field after creation, use theDeviceManager.ModifyCloudToDeviceConfig
method. Defaults tonil
. - credentials (list(GoogleApi.CloudIot.V1.Model.DeviceCredential.t)): The credentials used to authenticate this device. To allow credential
rotation without interruption, multiple device credentials can be bound to
this device. No more than 3 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. Defaults tonil
. - gatewayConfig (GoogleApi.CloudIot.V1.Model.GatewayConfig.t): Gateway-related configuration and state. Defaults to
nil
. - id (String.t): The user-defined device identifier. The device ID must be unique
within a device registry. Defaults to
nil
. - lastConfigAckTime (DateTime.t): [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. Defaults to
nil
. - lastConfigSendTime (DateTime.t): [Output only] The last time a cloud-to-device config version was sent to
the device. Defaults to
nil
. - lastErrorStatus (GoogleApi.CloudIot.V1.Model.Status.t): [Output only] The error message of the most recent error, such as a failure
to publish to Cloud Pub/Sub. 'last_error_time' 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. Defaults to
nil
. - lastErrorTime (DateTime.t): [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
'last_error_status'. Defaults to
nil
. - lastEventTime (DateTime.t): [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. Defaults to
nil
. - lastHeartbeatTime (DateTime.t): [Output only] The last time an MQTT
PINGREQ
was received. This field applies only to devices connecting through MQTT. MQTT clients usually only sendPINGREQ
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. Defaults tonil
. - lastStateTime (DateTime.t): [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. Defaults to
nil
. - logLevel (String.t): Beta Feature
The logging verbosity for device activity. If unspecified,
DeviceRegistry.log_level will be used. Defaults to nil
.
- metadata (map()): The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device.
Keys must conform to the regular expression a-zA-Z+ 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. Defaults to nil
.
- name (String.t): The resource path name. For example,
projects/p1/locations/us-central1/registries/registry0/devices/dev0
orprojects/p1/locations/us-central1/registries/registry0/devices/{num_id}
. Whenname
is populated as a response from the service, it always ends in the device numeric ID. Defaults tonil
. - numId (String.t): [Output only] A server-defined unique numeric ID for the device. This is a
more compact way to identify devices, and it is globally unique. Defaults to
nil
. - state (GoogleApi.CloudIot.V1.Model.DeviceState.t): [Output only] The state most recently received from the device. If no state
has been reported, this field is not present. Defaults to
nil
.
Link to this section Summary
Functions
Unwrap a decoded JSON object into its complex fields.
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %GoogleApi.CloudIot.V1.Model.Device{
blocked: boolean(),
config: GoogleApi.CloudIot.V1.Model.DeviceConfig.t(),
credentials: [GoogleApi.CloudIot.V1.Model.DeviceCredential.t()],
gatewayConfig: GoogleApi.CloudIot.V1.Model.GatewayConfig.t(),
id: String.t(),
lastConfigAckTime: DateTime.t(),
lastConfigSendTime: DateTime.t(),
lastErrorStatus: GoogleApi.CloudIot.V1.Model.Status.t(),
lastErrorTime: DateTime.t(),
lastEventTime: DateTime.t(),
lastHeartbeatTime: DateTime.t(),
lastStateTime: DateTime.t(),
logLevel: String.t(),
metadata: map(),
name: String.t(),
numId: String.t(),
state: GoogleApi.CloudIot.V1.Model.DeviceState.t()
}
t() :: %GoogleApi.CloudIot.V1.Model.Device{ blocked: boolean(), config: GoogleApi.CloudIot.V1.Model.DeviceConfig.t(), credentials: [GoogleApi.CloudIot.V1.Model.DeviceCredential.t()], gatewayConfig: GoogleApi.CloudIot.V1.Model.GatewayConfig.t(), id: String.t(), lastConfigAckTime: DateTime.t(), lastConfigSendTime: DateTime.t(), lastErrorStatus: GoogleApi.CloudIot.V1.Model.Status.t(), lastErrorTime: DateTime.t(), lastEventTime: DateTime.t(), lastHeartbeatTime: DateTime.t(), lastStateTime: DateTime.t(), logLevel: String.t(), metadata: map(), name: String.t(), numId: String.t(), state: GoogleApi.CloudIot.V1.Model.DeviceState.t() }
Link to this section Functions
Link to this function
decode(value, options) View Source
Unwrap a decoded JSON object into its complex fields.