Struct gapi_grpc::google::cloud::iot::v1::Device[][src]

pub struct Device {
    pub id: String,
    pub name: String,
    pub num_id: u64,
    pub credentials: Vec<DeviceCredential>,
    pub last_heartbeat_time: Option<Timestamp>,
    pub last_event_time: Option<Timestamp>,
    pub last_state_time: Option<Timestamp>,
    pub last_config_ack_time: Option<Timestamp>,
    pub last_config_send_time: Option<Timestamp>,
    pub blocked: bool,
    pub last_error_time: Option<Timestamp>,
    pub last_error_status: Option<Status>,
    pub config: Option<DeviceConfig>,
    pub state: Option<DeviceState>,
    pub log_level: i32,
    pub metadata: HashMap<String, String>,
    pub gateway_config: Option<GatewayConfig>,
}

The device resource.

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/{num_id}. When name is populated as a response from the service, it always ends in the device numeric ID.

num_id: u64

[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.

credentials: Vec<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. 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.

last_heartbeat_time: Option<Timestamp>

[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.

last_event_time: Option<Timestamp>

[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.

last_state_time: Option<Timestamp>

[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.

last_config_ack_time: Option<Timestamp>

[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.

last_config_send_time: Option<Timestamp>

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

blocked: bool

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.

last_error_time: Option<Timestamp>

[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’.

last_error_status: Option<Status>

[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.

config: Option<DeviceConfig>

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 the DeviceManager.ModifyCloudToDeviceConfig method.

state: Option<DeviceState>

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

log_level: i32

Beta Feature

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

metadata: HashMap<String, String>

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][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.

gateway_config: Option<GatewayConfig>

Gateway-related configuration and state.

Implementations

impl Device[src]

pub fn log_level(&self) -> LogLevel[src]

Returns the enum value of log_level, or the default if the field is set to an invalid enum value.

pub fn set_log_level(&mut self, value: LogLevel)[src]

Sets log_level to the provided enum value.

Trait Implementations

impl Clone for Device[src]

impl Debug for Device[src]

impl Default for Device[src]

impl Message for Device[src]

impl PartialEq<Device> for Device[src]

impl StructuralPartialEq for Device[src]

Auto Trait Implementations

impl RefUnwindSafe for Device

impl Send for Device

impl Sync for Device

impl Unpin for Device

impl UnwindSafe for Device

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]