Class: Google::Apis::CloudiotV1beta1::Device
- Inherits:
-
Object
- Object
- Google::Apis::CloudiotV1beta1::Device
- Defined in:
- generated/google/apis/cloudiot_v1beta1/classes.rb,
generated/google/apis/cloudiot_v1beta1/representations.rb,
generated/google/apis/cloudiot_v1beta1/representations.rb
Overview
The device resource.
Instance Attribute Summary collapse
-
#config ⇒ Google::Apis::CloudiotV1beta1::DeviceConfig
The device configuration and its metadata.
-
#credentials ⇒ Array<Google::Apis::CloudiotV1beta1::DeviceCredential>
The credentials used to authenticate this device.
-
#enabled_state ⇒ String
If a device is disabled, communication from it will be blocked.
-
#id ⇒ String
The user-defined device identifier.
-
#last_config_ack_time ⇒ String
[Output only] The last time a cloud-to-device config version acknowledgment was received from the device.
-
#last_error_status ⇒ Google::Apis::CloudiotV1beta1::Status
The
Status
type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. -
#last_error_time ⇒ String
[Output only] The last time an error happened, e.g., failed to publish to Cloud Pub/Sub.
-
#last_event_time ⇒ String
[Output only] The last time an event was received.
-
#last_heartbeat_time ⇒ String
[Output only] The last time a heartbeat was received.
-
#name ⇒ String
The resource path name.
-
#num_id ⇒ Fixnum
[Output only] A server-defined unique numeric ID for the device.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Device
constructor
A new instance of Device.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Google::Apis::Core::JsonObjectSupport
Methods included from Google::Apis::Core::Hashable
Constructor Details
#initialize(**args) ⇒ Device
Returns a new instance of Device
311 312 313 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 311 def initialize(**args) update!(**args) end |
Instance Attribute Details
#config ⇒ Google::Apis::CloudiotV1beta1::DeviceConfig
The device configuration and its metadata. Eventually delivered to devices.
Corresponds to the JSON property config
204 205 206 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 204 def config @config end |
#credentials ⇒ Array<Google::Apis::CloudiotV1beta1::DeviceCredential>
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.
Corresponds to the JSON property credentials
212 213 214 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 212 def credentials @credentials end |
#enabled_state ⇒ String
If a device is disabled, communication from it will be blocked. Can be used
to temporarily prevent the device from connecting if, for example, the
sensor is generating bad data and needs maintenance.
Corresponds to the JSON property enabledState
219 220 221 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 219 def enabled_state @enabled_state end |
#id ⇒ String
The user-defined device identifier. The device ID must be unique
within a device registry.
Corresponds to the JSON property id
225 226 227 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 225 def id @id end |
#last_config_ack_time ⇒ String
[Output only] The last time a cloud-to-device config version acknowledgment
was received from the device.
Corresponds to the JSON property lastConfigAckTime
231 232 233 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 231 def last_config_ack_time @last_config_ack_time end |
#last_error_status ⇒ Google::Apis::CloudiotV1beta1::Status
The Status
type defines a logical error model that is 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 most users
- Flexible enough to meet unexpected needs
# Overview
The
Status
message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the packagegoogle.rpc
that can be used for common error conditions. # Language mapping TheStatus
message is the logical representation of the error model, but it is not necessarily the actual wire format. When theStatus
message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and theStatus
message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments. Example uses of this error model include: - 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 message
Status
could be used directly after any stripping needed for security/privacy reasons. Corresponds to the JSON propertylastErrorStatus
274 275 276 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 274 def last_error_status @last_error_status end |
#last_error_time ⇒ String
[Output only] The last time an error happened, e.g., failed to publish to
Cloud Pub/Sub. This field is the timestamp of 'last_error_status'.
Corresponds to the JSON property lastErrorTime
280 281 282 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 280 def last_error_time @last_error_time end |
#last_event_time ⇒ String
[Output only] The last time an event was received. Timestamps are
periodically collected and written to storage; they may be stale by a few
minutes.
Corresponds to the JSON property lastEventTime
287 288 289 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 287 def last_event_time @last_event_time end |
#last_heartbeat_time ⇒ String
[Output only] The last time a heartbeat was received. Timestamps are
periodically collected and written to storage; they may be stale by a few
minutes.
Corresponds to the JSON property lastHeartbeatTime
294 295 296 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 294 def last_heartbeat_time @last_heartbeat_time end |
#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/
num_id`.
When
nameis populated as a response from the service, it always ends
in the device numeric ID.
Corresponds to the JSON property
name`
303 304 305 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 303 def name @name end |
#num_id ⇒ Fixnum
[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.
Corresponds to the JSON property numId
309 310 311 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 309 def num_id @num_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'generated/google/apis/cloudiot_v1beta1/classes.rb', line 316 def update!(**args) @config = args[:config] if args.key?(:config) @credentials = args[:credentials] if args.key?(:credentials) @enabled_state = args[:enabled_state] if args.key?(:enabled_state) @id = args[:id] if args.key?(:id) @last_config_ack_time = args[:last_config_ack_time] if args.key?(:last_config_ack_time) @last_error_status = args[:last_error_status] if args.key?(:last_error_status) @last_error_time = args[:last_error_time] if args.key?(:last_error_time) @last_event_time = args[:last_event_time] if args.key?(:last_event_time) @last_heartbeat_time = args[:last_heartbeat_time] if args.key?(:last_heartbeat_time) @name = args[:name] if args.key?(:name) @num_id = args[:num_id] if args.key?(:num_id) end |