blob: 48c50afd148cabf1abf85498513ad97e5392aafd [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="cloudiot_v1.html">Cloud IoT API</a> . <a href="cloudiot_v1.projects.html">projects</a> . <a href="cloudiot_v1.projects.locations.html">locations</a> . <a href="cloudiot_v1.projects.locations.registries.html">registries</a> . <a href="cloudiot_v1.projects.locations.registries.devices.html">devices</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="cloudiot_v1.projects.locations.registries.devices.configVersions.html">configVersions()</a></code>
79</p>
80<p class="firstline">Returns the configVersions Resource.</p>
81
82<p class="toc_element">
83 <code><a href="cloudiot_v1.projects.locations.registries.devices.states.html">states()</a></code>
84</p>
85<p class="firstline">Returns the states Resource.</p>
86
87<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070088 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089<p class="firstline">Creates a device in a device registry.</p>
90<p class="toc_element">
91 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
92<p class="firstline">Deletes a device.</p>
93<p class="toc_element">
94 <code><a href="#get">get(name, fieldMask=None, x__xgafv=None)</a></code></p>
95<p class="firstline">Gets details about a device.</p>
96<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070097 <code><a href="#list">list(parent, deviceIds=None, deviceNumIds=None, gatewayListOptions_associationsDeviceId=None, gatewayListOptions_gatewayType=None, gatewayListOptions_associationsGatewayId=None, pageToken=None, fieldMask=None, pageSize=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098<p class="firstline">List devices in a device registry.</p>
99<p class="toc_element">
100 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
101<p class="firstline">Retrieves the next page of results.</p>
102<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700103 <code><a href="#modifyCloudToDeviceConfig">modifyCloudToDeviceConfig(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700104<p class="firstline">Modifies the configuration for the device, which is eventually sent from</p>
105<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700106 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107<p class="firstline">Updates a device.</p>
108<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 <code><a href="#sendCommandToDevice">sendCommandToDevice(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110<p class="firstline">Sends a command to the specified device. In order for a device to be able</p>
111<h3>Method Details</h3>
112<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700113 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700114 <pre>Creates a device in a device registry.
115
116Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 parent: string, Required. The name of the device registry where this device should be created.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118For example,
119`projects/example-project/locations/us-central1/registries/my-registry`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700121 The object takes the form of:
122
123{ # The device resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700124 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
125 # was received from the device. This field is only for configurations
126 # sent through MQTT.
127 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
128 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129 # gateway.
Bu Sun Kim65020912020-05-20 12:08:20 -0700130 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
131 # specified in `last_accessed_gateway`.
132 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
133 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700134 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700135 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 # more compact way to identify devices, and it is globally unique.
Bu Sun Kim65020912020-05-20 12:08:20 -0700137 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
138 # Can be used to temporarily prevent the device from connecting if, for
139 # example, the sensor is generating bad data and needs maintenance.
140 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700141 # applies only to devices connecting through MQTT. MQTT clients usually only
142 # send `PINGREQ` messages if the connection is idle, and no other messages
143 # have been sent. Timestamps are periodically collected and written to
144 # storage; they may be stale by a few minutes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700145 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
146 # periodically collected and written to storage; they may be stale by a few
147 # minutes.
148 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
Dan O'Mearadd494642020-05-01 07:42:23 -0700149 # the device.
Bu Sun Kim65020912020-05-20 12:08:20 -0700150 &quot;lastErrorStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output only] The error message of the most recent error, such as a failure
151 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700152 # field. If no errors have occurred, this field has an empty message
153 # and the status code 0 == OK. Otherwise, this field is expected to have a
154 # status code other than OK.
155 # different programming environments, including REST APIs and RPC APIs. It is
156 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
157 # three pieces of data: error code, error message, and error details.
158 #
159 # You can find out more about this error model and how to work with it in the
160 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim65020912020-05-20 12:08:20 -0700161 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
162 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700163 # user-facing error message should be localized and sent in the
164 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -0700165 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700166 # message types for APIs to use.
167 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700168 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700169 },
170 ],
171 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700172 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
173 # periodically collected and written to storage; they may be stale by a few
174 # minutes.
175 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
176 # has been reported, this field is not present.
177 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
178 # IoT Core.
179 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
180 },
181 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
182 # Cloud IoT Core to the device. If not present on creation, the
183 # configuration will be initialized with an empty payload and version value
184 # of `1`. To update this field after creation, use the
185 # `DeviceManager.ModifyCloudToDeviceConfig` method.
186 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
187 # the server, and is always greater than 0 after device creation. The
188 # version must be 0 on the `CreateDevice` request if a `config` is
189 # specified; the response of `CreateDevice` will always have a value of 1.
190 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
191 # Cloud IoT Core. This timestamp is set by the server.
192 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
193 # acknowledgment from the device, indicating that the device has received
194 # this configuration version. If this field is not present, the device has
195 # not yet acknowledged that it received this version. Note that when
196 # the config was sent to the device, many config versions may have been
197 # available in Cloud IoT Core while the device was disconnected, and on
198 # connection, only the latest version is sent to the device. Some
199 # versions may never be sent to the device, and therefore are never
200 # acknowledged. This timestamp is set by Cloud IoT Core.
201 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
202 },
203 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700204 # rotation without interruption, multiple device credentials can be bound to
205 # this device. No more than 3 credentials can be bound to a single device at
206 # a time. When new credentials are added to a device, they are verified
207 # against the registry credentials. For details, see the description of the
208 # `DeviceRegistry.credentials` field.
209 { # A server-stored device credential used for authentication.
Bu Sun Kim65020912020-05-20 12:08:20 -0700210 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
211 # credential will be ignored for new client authentication requests after
212 # this timestamp; however, it will not be automatically deleted.
213 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700214 # When adding a new device credential, either via device creation or via
215 # modifications, this public key credential may be required to be signed by
216 # one of the registry level certificates. More specifically, if the
217 # registry contains at least one certificate, any new device credential
218 # must be signed by one of the registry certificates. As a result,
219 # when the registry contains certificates, only X.509 certificates are
220 # accepted as device credentials. However, if the registry does
221 # not contain a certificate, self-signed certificates and public keys will
222 # be accepted. New device credentials must be different from every
223 # registry-level certificate.
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 &quot;key&quot;: &quot;A String&quot;, # The key data.
225 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700226 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700227 },
228 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700229 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
230 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
231 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
232 # When `name` is populated as a response from the service, it always ends
233 # in the device numeric ID.
234 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
235 # publish to Cloud Pub/Sub. This field is the timestamp of
236 # &#x27;last_error_status&#x27;.
237 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
238 #
239 # The logging verbosity for device activity. If unspecified,
240 # DeviceRegistry.log_level will be used.
241 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
Dan O'Mearadd494642020-05-01 07:42:23 -0700242 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
243 # information for the device.
Bu Sun Kim65020912020-05-20 12:08:20 -0700244 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700245 # Keys must conform to the regular expression a-zA-Z+ and
246 # be less than 128 bytes in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700247 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700248 # Values are free-form strings. Each value must be less than or equal to 32
249 # KB in size.
Bu Sun Kim65020912020-05-20 12:08:20 -0700250 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700251 # The total size of all keys and values must be less than 256 KB, and the
252 # maximum number of key-value pairs is 500.
Bu Sun Kim65020912020-05-20 12:08:20 -0700253 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700254 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700255 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
256 # within a device registry.
257 }
258
259 x__xgafv: string, V1 error format.
260 Allowed values
261 1 - v1 error format
262 2 - v2 error format
263
264Returns:
265 An object of the form:
266
267 { # The device resource.
268 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
269 # was received from the device. This field is only for configurations
270 # sent through MQTT.
271 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
272 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
273 # gateway.
274 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
275 # specified in `last_accessed_gateway`.
276 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
277 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
278 },
279 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
280 # more compact way to identify devices, and it is globally unique.
281 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
282 # Can be used to temporarily prevent the device from connecting if, for
283 # example, the sensor is generating bad data and needs maintenance.
284 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
285 # applies only to devices connecting through MQTT. MQTT clients usually only
286 # send `PINGREQ` messages if the connection is idle, and no other messages
287 # have been sent. Timestamps are periodically collected and written to
288 # storage; they may be stale by a few minutes.
289 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
290 # periodically collected and written to storage; they may be stale by a few
291 # minutes.
292 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
293 # the device.
294 &quot;lastErrorStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output only] The error message of the most recent error, such as a failure
295 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
296 # field. If no errors have occurred, this field has an empty message
297 # and the status code 0 == OK. Otherwise, this field is expected to have a
298 # status code other than OK.
299 # different programming environments, including REST APIs and RPC APIs. It is
300 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
301 # three pieces of data: error code, error message, and error details.
302 #
303 # You can find out more about this error model and how to work with it in the
304 # [API Design Guide](https://cloud.google.com/apis/design/errors).
305 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
306 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
307 # user-facing error message should be localized and sent in the
308 # google.rpc.Status.details field, or localized by the client.
309 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
310 # message types for APIs to use.
311 {
312 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
313 },
314 ],
315 },
316 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
317 # periodically collected and written to storage; they may be stale by a few
318 # minutes.
319 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
320 # has been reported, this field is not present.
321 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
322 # IoT Core.
323 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
324 },
325 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
326 # Cloud IoT Core to the device. If not present on creation, the
327 # configuration will be initialized with an empty payload and version value
328 # of `1`. To update this field after creation, use the
329 # `DeviceManager.ModifyCloudToDeviceConfig` method.
330 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
331 # the server, and is always greater than 0 after device creation. The
332 # version must be 0 on the `CreateDevice` request if a `config` is
333 # specified; the response of `CreateDevice` will always have a value of 1.
334 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
335 # Cloud IoT Core. This timestamp is set by the server.
336 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
337 # acknowledgment from the device, indicating that the device has received
338 # this configuration version. If this field is not present, the device has
339 # not yet acknowledged that it received this version. Note that when
340 # the config was sent to the device, many config versions may have been
341 # available in Cloud IoT Core while the device was disconnected, and on
342 # connection, only the latest version is sent to the device. Some
343 # versions may never be sent to the device, and therefore are never
344 # acknowledged. This timestamp is set by Cloud IoT Core.
345 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
346 },
347 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
348 # rotation without interruption, multiple device credentials can be bound to
349 # this device. No more than 3 credentials can be bound to a single device at
350 # a time. When new credentials are added to a device, they are verified
351 # against the registry credentials. For details, see the description of the
352 # `DeviceRegistry.credentials` field.
353 { # A server-stored device credential used for authentication.
354 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
355 # credential will be ignored for new client authentication requests after
356 # this timestamp; however, it will not be automatically deleted.
357 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
358 # When adding a new device credential, either via device creation or via
359 # modifications, this public key credential may be required to be signed by
360 # one of the registry level certificates. More specifically, if the
361 # registry contains at least one certificate, any new device credential
362 # must be signed by one of the registry certificates. As a result,
363 # when the registry contains certificates, only X.509 certificates are
364 # accepted as device credentials. However, if the registry does
365 # not contain a certificate, self-signed certificates and public keys will
366 # be accepted. New device credentials must be different from every
367 # registry-level certificate.
368 &quot;key&quot;: &quot;A String&quot;, # The key data.
369 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
370 },
371 },
372 ],
373 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
374 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
375 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
376 # When `name` is populated as a response from the service, it always ends
377 # in the device numeric ID.
378 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
379 # publish to Cloud Pub/Sub. This field is the timestamp of
380 # &#x27;last_error_status&#x27;.
381 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
382 #
383 # The logging verbosity for device activity. If unspecified,
384 # DeviceRegistry.log_level will be used.
385 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
386 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
387 # information for the device.
388 #
389 # Keys must conform to the regular expression a-zA-Z+ and
390 # be less than 128 bytes in length.
391 #
392 # Values are free-form strings. Each value must be less than or equal to 32
393 # KB in size.
394 #
395 # The total size of all keys and values must be less than 256 KB, and the
396 # maximum number of key-value pairs is 500.
397 &quot;a_key&quot;: &quot;A String&quot;,
398 },
399 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
400 # within a device registry.
401 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402</div>
403
404<div class="method">
405 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
406 <pre>Deletes a device.
407
408Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700409 name: string, Required. The name of the device. For example,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700410`projects/p0/locations/us-central1/registries/registry0/devices/device0` or
411`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. (required)
412 x__xgafv: string, V1 error format.
413 Allowed values
414 1 - v1 error format
415 2 - v2 error format
416
417Returns:
418 An object of the form:
419
420 { # A generic empty message that you can re-use to avoid defining duplicated
421 # empty messages in your APIs. A typical example is to use it as the request
422 # or the response type of an API method. For instance:
423 #
424 # service Foo {
425 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
426 # }
427 #
428 # The JSON representation for `Empty` is empty JSON object `{}`.
429 }</pre>
430</div>
431
432<div class="method">
433 <code class="details" id="get">get(name, fieldMask=None, x__xgafv=None)</code>
434 <pre>Gets details about a device.
435
436Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700437 name: string, Required. The name of the device. For example,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700438`projects/p0/locations/us-central1/registries/registry0/devices/device0` or
439`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. (required)
440 fieldMask: string, The fields of the `Device` resource to be returned in the response. If the
441field mask is unset or empty, all fields are returned.
442 x__xgafv: string, V1 error format.
443 Allowed values
444 1 - v1 error format
445 2 - v2 error format
446
447Returns:
448 An object of the form:
449
450 { # The device resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700451 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
452 # was received from the device. This field is only for configurations
453 # sent through MQTT.
454 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
455 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
456 # gateway.
457 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
458 # specified in `last_accessed_gateway`.
459 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
460 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
461 },
462 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
463 # more compact way to identify devices, and it is globally unique.
464 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
465 # Can be used to temporarily prevent the device from connecting if, for
466 # example, the sensor is generating bad data and needs maintenance.
467 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
468 # applies only to devices connecting through MQTT. MQTT clients usually only
469 # send `PINGREQ` messages if the connection is idle, and no other messages
470 # have been sent. Timestamps are periodically collected and written to
471 # storage; they may be stale by a few minutes.
472 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
473 # periodically collected and written to storage; they may be stale by a few
474 # minutes.
475 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
476 # the device.
477 &quot;lastErrorStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output only] The error message of the most recent error, such as a failure
478 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
479 # field. If no errors have occurred, this field has an empty message
480 # and the status code 0 == OK. Otherwise, this field is expected to have a
481 # status code other than OK.
482 # different programming environments, including REST APIs and RPC APIs. It is
483 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
484 # three pieces of data: error code, error message, and error details.
485 #
486 # You can find out more about this error model and how to work with it in the
487 # [API Design Guide](https://cloud.google.com/apis/design/errors).
488 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
489 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
490 # user-facing error message should be localized and sent in the
491 # google.rpc.Status.details field, or localized by the client.
492 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
493 # message types for APIs to use.
494 {
495 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
496 },
497 ],
498 },
499 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
500 # periodically collected and written to storage; they may be stale by a few
501 # minutes.
502 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
503 # has been reported, this field is not present.
504 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
505 # IoT Core.
506 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
507 },
508 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
509 # Cloud IoT Core to the device. If not present on creation, the
510 # configuration will be initialized with an empty payload and version value
511 # of `1`. To update this field after creation, use the
512 # `DeviceManager.ModifyCloudToDeviceConfig` method.
513 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
514 # the server, and is always greater than 0 after device creation. The
515 # version must be 0 on the `CreateDevice` request if a `config` is
516 # specified; the response of `CreateDevice` will always have a value of 1.
517 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
518 # Cloud IoT Core. This timestamp is set by the server.
519 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
520 # acknowledgment from the device, indicating that the device has received
521 # this configuration version. If this field is not present, the device has
522 # not yet acknowledged that it received this version. Note that when
523 # the config was sent to the device, many config versions may have been
524 # available in Cloud IoT Core while the device was disconnected, and on
525 # connection, only the latest version is sent to the device. Some
526 # versions may never be sent to the device, and therefore are never
527 # acknowledged. This timestamp is set by Cloud IoT Core.
528 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
529 },
530 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
531 # rotation without interruption, multiple device credentials can be bound to
532 # this device. No more than 3 credentials can be bound to a single device at
533 # a time. When new credentials are added to a device, they are verified
534 # against the registry credentials. For details, see the description of the
535 # `DeviceRegistry.credentials` field.
536 { # A server-stored device credential used for authentication.
537 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
538 # credential will be ignored for new client authentication requests after
539 # this timestamp; however, it will not be automatically deleted.
540 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
541 # When adding a new device credential, either via device creation or via
542 # modifications, this public key credential may be required to be signed by
543 # one of the registry level certificates. More specifically, if the
544 # registry contains at least one certificate, any new device credential
545 # must be signed by one of the registry certificates. As a result,
546 # when the registry contains certificates, only X.509 certificates are
547 # accepted as device credentials. However, if the registry does
548 # not contain a certificate, self-signed certificates and public keys will
549 # be accepted. New device credentials must be different from every
550 # registry-level certificate.
551 &quot;key&quot;: &quot;A String&quot;, # The key data.
552 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
553 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700554 },
555 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700556 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
557 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
558 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
559 # When `name` is populated as a response from the service, it always ends
560 # in the device numeric ID.
561 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
562 # publish to Cloud Pub/Sub. This field is the timestamp of
563 # &#x27;last_error_status&#x27;.
564 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
565 #
566 # The logging verbosity for device activity. If unspecified,
567 # DeviceRegistry.log_level will be used.
568 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
569 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
570 # information for the device.
571 #
572 # Keys must conform to the regular expression a-zA-Z+ and
573 # be less than 128 bytes in length.
574 #
575 # Values are free-form strings. Each value must be less than or equal to 32
576 # KB in size.
577 #
578 # The total size of all keys and values must be less than 256 KB, and the
579 # maximum number of key-value pairs is 500.
580 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700581 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700582 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
583 # within a device registry.
584 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700585</div>
586
587<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700588 <code class="details" id="list">list(parent, deviceIds=None, deviceNumIds=None, gatewayListOptions_associationsDeviceId=None, gatewayListOptions_gatewayType=None, gatewayListOptions_associationsGatewayId=None, pageToken=None, fieldMask=None, pageSize=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700589 <pre>List devices in a device registry.
590
591Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700592 parent: string, Required. The device registry path. Required. For example,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700593`projects/my-project/locations/us-central1/registries/my-registry`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700594 deviceIds: string, A list of device string IDs. For example, `[&#x27;device0&#x27;, &#x27;device12&#x27;]`.
595If empty, this field is ignored. Maximum IDs: 10,000 (repeated)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700596 deviceNumIds: string, A list of device numeric IDs. If empty, this field is ignored. Maximum
597IDs: 10,000. (repeated)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700598 gatewayListOptions_associationsDeviceId: string, If set, returns only the gateways with which the specified device is
599associated. The device ID can be numeric (`num_id`) or the user-defined
600string (`id`). For example, if `456` is specified, returns only the
601gateways to which the device with `num_id` 456 is bound.
602 gatewayListOptions_gatewayType: string, If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY`
603is specified, only non-gateway devices are returned. If
604`GATEWAY_TYPE_UNSPECIFIED` is specified, all devices are returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700605 gatewayListOptions_associationsGatewayId: string, If set, only devices associated with the specified gateway are returned.
606The gateway ID can be numeric (`num_id`) or the user-defined string
607(`id`). For example, if `123` is specified, only devices bound to the
608gateway with `num_id` 123 are returned.
609 pageToken: string, The value returned by the last `ListDevicesResponse`; indicates
610that this is a continuation of a prior `ListDevices` call and
611the system should return the next page of data.
612 fieldMask: string, The fields of the `Device` resource to be returned in the response. The
613fields `id` and `num_id` are always returned, along with any
614other fields specified.
615 pageSize: integer, The maximum number of devices to return in the response. If this value
616is zero, the service will select a default size. A call may return fewer
617objects than requested. A non-empty `next_page_token` in the response
618indicates that more data is available.
619 x__xgafv: string, V1 error format.
620 Allowed values
621 1 - v1 error format
622 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700623
624Returns:
625 An object of the form:
626
627 { # Response for `ListDevices`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700628 &quot;devices&quot;: [ # The devices that match the request.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700629 { # The device resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700630 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
631 # was received from the device. This field is only for configurations
632 # sent through MQTT.
633 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
634 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
635 # gateway.
636 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
637 # specified in `last_accessed_gateway`.
638 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
639 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
640 },
641 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
642 # more compact way to identify devices, and it is globally unique.
643 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
644 # Can be used to temporarily prevent the device from connecting if, for
645 # example, the sensor is generating bad data and needs maintenance.
646 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
647 # applies only to devices connecting through MQTT. MQTT clients usually only
648 # send `PINGREQ` messages if the connection is idle, and no other messages
649 # have been sent. Timestamps are periodically collected and written to
650 # storage; they may be stale by a few minutes.
651 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
652 # periodically collected and written to storage; they may be stale by a few
653 # minutes.
654 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
655 # the device.
656 &quot;lastErrorStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output only] The error message of the most recent error, such as a failure
657 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
658 # field. If no errors have occurred, this field has an empty message
659 # and the status code 0 == OK. Otherwise, this field is expected to have a
660 # status code other than OK.
661 # different programming environments, including REST APIs and RPC APIs. It is
662 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
663 # three pieces of data: error code, error message, and error details.
664 #
665 # You can find out more about this error model and how to work with it in the
666 # [API Design Guide](https://cloud.google.com/apis/design/errors).
667 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
668 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
669 # user-facing error message should be localized and sent in the
670 # google.rpc.Status.details field, or localized by the client.
671 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
672 # message types for APIs to use.
673 {
674 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
675 },
676 ],
677 },
678 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
679 # periodically collected and written to storage; they may be stale by a few
680 # minutes.
681 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
682 # has been reported, this field is not present.
683 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
684 # IoT Core.
685 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
686 },
687 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
688 # Cloud IoT Core to the device. If not present on creation, the
689 # configuration will be initialized with an empty payload and version value
690 # of `1`. To update this field after creation, use the
691 # `DeviceManager.ModifyCloudToDeviceConfig` method.
692 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
693 # the server, and is always greater than 0 after device creation. The
694 # version must be 0 on the `CreateDevice` request if a `config` is
695 # specified; the response of `CreateDevice` will always have a value of 1.
696 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
697 # Cloud IoT Core. This timestamp is set by the server.
698 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
699 # acknowledgment from the device, indicating that the device has received
700 # this configuration version. If this field is not present, the device has
701 # not yet acknowledged that it received this version. Note that when
702 # the config was sent to the device, many config versions may have been
703 # available in Cloud IoT Core while the device was disconnected, and on
704 # connection, only the latest version is sent to the device. Some
705 # versions may never be sent to the device, and therefore are never
706 # acknowledged. This timestamp is set by Cloud IoT Core.
707 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
708 },
709 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
710 # rotation without interruption, multiple device credentials can be bound to
711 # this device. No more than 3 credentials can be bound to a single device at
712 # a time. When new credentials are added to a device, they are verified
713 # against the registry credentials. For details, see the description of the
714 # `DeviceRegistry.credentials` field.
715 { # A server-stored device credential used for authentication.
716 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
717 # credential will be ignored for new client authentication requests after
718 # this timestamp; however, it will not be automatically deleted.
719 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
720 # When adding a new device credential, either via device creation or via
721 # modifications, this public key credential may be required to be signed by
722 # one of the registry level certificates. More specifically, if the
723 # registry contains at least one certificate, any new device credential
724 # must be signed by one of the registry certificates. As a result,
725 # when the registry contains certificates, only X.509 certificates are
726 # accepted as device credentials. However, if the registry does
727 # not contain a certificate, self-signed certificates and public keys will
728 # be accepted. New device credentials must be different from every
729 # registry-level certificate.
730 &quot;key&quot;: &quot;A String&quot;, # The key data.
731 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
732 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700733 },
734 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700735 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
736 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
737 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
738 # When `name` is populated as a response from the service, it always ends
739 # in the device numeric ID.
740 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
741 # publish to Cloud Pub/Sub. This field is the timestamp of
742 # &#x27;last_error_status&#x27;.
743 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
744 #
745 # The logging verbosity for device activity. If unspecified,
746 # DeviceRegistry.log_level will be used.
747 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
748 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
749 # information for the device.
750 #
751 # Keys must conform to the regular expression a-zA-Z+ and
752 # be less than 128 bytes in length.
753 #
754 # Values are free-form strings. Each value must be less than or equal to 32
755 # KB in size.
756 #
757 # The total size of all keys and values must be less than 256 KB, and the
758 # maximum number of key-value pairs is 500.
759 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700760 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700761 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
762 # within a device registry.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700763 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700764 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700765 &quot;nextPageToken&quot;: &quot;A String&quot;, # If not empty, indicates that there may be more devices that match the
766 # request; this value should be passed in a new `ListDevicesRequest`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700767 }</pre>
768</div>
769
770<div class="method">
771 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
772 <pre>Retrieves the next page of results.
773
774Args:
775 previous_request: The request for the previous page. (required)
776 previous_response: The response from the request for the previous page. (required)
777
778Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700779 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700780 page. Returns None if there are no more items in the collection.
781 </pre>
782</div>
783
784<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700785 <code class="details" id="modifyCloudToDeviceConfig">modifyCloudToDeviceConfig(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700786 <pre>Modifies the configuration for the device, which is eventually sent from
787the Cloud IoT Core servers. Returns the modified configuration version and
788its metadata.
789
790Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700791 name: string, Required. The name of the device. For example,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700792`projects/p0/locations/us-central1/registries/registry0/devices/device0` or
793`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700794 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700795 The object takes the form of:
796
797{ # Request for `ModifyCloudToDeviceConfig`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700798 &quot;versionToUpdate&quot;: &quot;A String&quot;, # The version number to update. If this value is zero, it will not check the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700799 # version number of the server and will always update the current version;
800 # otherwise, this update will fail if the version number found on the server
801 # does not match this version number. This is used to support multiple
802 # simultaneous updates without losing data.
Bu Sun Kim65020912020-05-20 12:08:20 -0700803 &quot;binaryData&quot;: &quot;A String&quot;, # Required. The configuration data for the device.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700804 }
805
806 x__xgafv: string, V1 error format.
807 Allowed values
808 1 - v1 error format
809 2 - v2 error format
810
811Returns:
812 An object of the form:
813
814 { # The device configuration. Eventually delivered to devices.
Bu Sun Kim65020912020-05-20 12:08:20 -0700815 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700816 # the server, and is always greater than 0 after device creation. The
817 # version must be 0 on the `CreateDevice` request if a `config` is
818 # specified; the response of `CreateDevice` will always have a value of 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700819 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700820 # Cloud IoT Core. This timestamp is set by the server.
Bu Sun Kim65020912020-05-20 12:08:20 -0700821 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700822 # acknowledgment from the device, indicating that the device has received
823 # this configuration version. If this field is not present, the device has
824 # not yet acknowledged that it received this version. Note that when
825 # the config was sent to the device, many config versions may have been
826 # available in Cloud IoT Core while the device was disconnected, and on
827 # connection, only the latest version is sent to the device. Some
828 # versions may never be sent to the device, and therefore are never
829 # acknowledged. This timestamp is set by Cloud IoT Core.
Bu Sun Kim65020912020-05-20 12:08:20 -0700830 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700831 }</pre>
832</div>
833
834<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700835 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700836 <pre>Updates a device.
837
838Args:
839 name: string, The resource path name. For example,
840`projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
841`projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
842When `name` is populated as a response from the service, it always ends
843in the device numeric ID. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700844 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700845 The object takes the form of:
846
847{ # The device resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700848 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
849 # was received from the device. This field is only for configurations
850 # sent through MQTT.
851 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
852 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
853 # gateway.
854 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
855 # specified in `last_accessed_gateway`.
856 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
857 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
858 },
859 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
860 # more compact way to identify devices, and it is globally unique.
861 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
862 # Can be used to temporarily prevent the device from connecting if, for
863 # example, the sensor is generating bad data and needs maintenance.
864 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
865 # applies only to devices connecting through MQTT. MQTT clients usually only
866 # send `PINGREQ` messages if the connection is idle, and no other messages
867 # have been sent. Timestamps are periodically collected and written to
868 # storage; they may be stale by a few minutes.
869 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
870 # periodically collected and written to storage; they may be stale by a few
871 # minutes.
872 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
873 # the device.
874 &quot;lastErrorStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output only] The error message of the most recent error, such as a failure
875 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
876 # field. If no errors have occurred, this field has an empty message
877 # and the status code 0 == OK. Otherwise, this field is expected to have a
878 # status code other than OK.
879 # different programming environments, including REST APIs and RPC APIs. It is
880 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
881 # three pieces of data: error code, error message, and error details.
882 #
883 # You can find out more about this error model and how to work with it in the
884 # [API Design Guide](https://cloud.google.com/apis/design/errors).
885 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
886 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
887 # user-facing error message should be localized and sent in the
888 # google.rpc.Status.details field, or localized by the client.
889 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
890 # message types for APIs to use.
891 {
892 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
893 },
894 ],
895 },
896 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
897 # periodically collected and written to storage; they may be stale by a few
898 # minutes.
899 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
900 # has been reported, this field is not present.
901 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
902 # IoT Core.
903 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
904 },
905 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
906 # Cloud IoT Core to the device. If not present on creation, the
907 # configuration will be initialized with an empty payload and version value
908 # of `1`. To update this field after creation, use the
909 # `DeviceManager.ModifyCloudToDeviceConfig` method.
910 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
911 # the server, and is always greater than 0 after device creation. The
912 # version must be 0 on the `CreateDevice` request if a `config` is
913 # specified; the response of `CreateDevice` will always have a value of 1.
914 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
915 # Cloud IoT Core. This timestamp is set by the server.
916 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
917 # acknowledgment from the device, indicating that the device has received
918 # this configuration version. If this field is not present, the device has
919 # not yet acknowledged that it received this version. Note that when
920 # the config was sent to the device, many config versions may have been
921 # available in Cloud IoT Core while the device was disconnected, and on
922 # connection, only the latest version is sent to the device. Some
923 # versions may never be sent to the device, and therefore are never
924 # acknowledged. This timestamp is set by Cloud IoT Core.
925 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
926 },
927 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
928 # rotation without interruption, multiple device credentials can be bound to
929 # this device. No more than 3 credentials can be bound to a single device at
930 # a time. When new credentials are added to a device, they are verified
931 # against the registry credentials. For details, see the description of the
932 # `DeviceRegistry.credentials` field.
933 { # A server-stored device credential used for authentication.
934 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
935 # credential will be ignored for new client authentication requests after
936 # this timestamp; however, it will not be automatically deleted.
937 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
938 # When adding a new device credential, either via device creation or via
939 # modifications, this public key credential may be required to be signed by
940 # one of the registry level certificates. More specifically, if the
941 # registry contains at least one certificate, any new device credential
942 # must be signed by one of the registry certificates. As a result,
943 # when the registry contains certificates, only X.509 certificates are
944 # accepted as device credentials. However, if the registry does
945 # not contain a certificate, self-signed certificates and public keys will
946 # be accepted. New device credentials must be different from every
947 # registry-level certificate.
948 &quot;key&quot;: &quot;A String&quot;, # The key data.
949 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
950 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700951 },
952 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700953 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
954 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
955 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
956 # When `name` is populated as a response from the service, it always ends
957 # in the device numeric ID.
958 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
959 # publish to Cloud Pub/Sub. This field is the timestamp of
960 # &#x27;last_error_status&#x27;.
961 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
962 #
963 # The logging verbosity for device activity. If unspecified,
964 # DeviceRegistry.log_level will be used.
965 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
966 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
967 # information for the device.
968 #
969 # Keys must conform to the regular expression a-zA-Z+ and
970 # be less than 128 bytes in length.
971 #
972 # Values are free-form strings. Each value must be less than or equal to 32
973 # KB in size.
974 #
975 # The total size of all keys and values must be less than 256 KB, and the
976 # maximum number of key-value pairs is 500.
977 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700978 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700979 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
980 # within a device registry.
981 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700982
Dan O'Mearadd494642020-05-01 07:42:23 -0700983 updateMask: string, Required. Only updates the `device` fields indicated by this mask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700984The field mask must not be empty, and it must not contain fields that
985are immutable or only set by the server.
986Mutable top-level fields: `credentials`, `blocked`, and `metadata`
987 x__xgafv: string, V1 error format.
988 Allowed values
989 1 - v1 error format
990 2 - v2 error format
991
992Returns:
993 An object of the form:
994
995 { # The device resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700996 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
997 # was received from the device. This field is only for configurations
998 # sent through MQTT.
999 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
1000 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
1001 # gateway.
1002 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
1003 # specified in `last_accessed_gateway`.
1004 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
1005 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
1006 },
1007 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
1008 # more compact way to identify devices, and it is globally unique.
1009 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
1010 # Can be used to temporarily prevent the device from connecting if, for
1011 # example, the sensor is generating bad data and needs maintenance.
1012 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
1013 # applies only to devices connecting through MQTT. MQTT clients usually only
1014 # send `PINGREQ` messages if the connection is idle, and no other messages
1015 # have been sent. Timestamps are periodically collected and written to
1016 # storage; they may be stale by a few minutes.
1017 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
1018 # periodically collected and written to storage; they may be stale by a few
1019 # minutes.
1020 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
1021 # the device.
1022 &quot;lastErrorStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output only] The error message of the most recent error, such as a failure
1023 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
1024 # field. If no errors have occurred, this field has an empty message
1025 # and the status code 0 == OK. Otherwise, this field is expected to have a
1026 # status code other than OK.
1027 # different programming environments, including REST APIs and RPC APIs. It is
1028 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1029 # three pieces of data: error code, error message, and error details.
1030 #
1031 # You can find out more about this error model and how to work with it in the
1032 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1033 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1034 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1035 # user-facing error message should be localized and sent in the
1036 # google.rpc.Status.details field, or localized by the client.
1037 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1038 # message types for APIs to use.
1039 {
1040 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1041 },
1042 ],
1043 },
1044 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
1045 # periodically collected and written to storage; they may be stale by a few
1046 # minutes.
1047 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
1048 # has been reported, this field is not present.
1049 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
1050 # IoT Core.
1051 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
1052 },
1053 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
1054 # Cloud IoT Core to the device. If not present on creation, the
1055 # configuration will be initialized with an empty payload and version value
1056 # of `1`. To update this field after creation, use the
1057 # `DeviceManager.ModifyCloudToDeviceConfig` method.
1058 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
1059 # the server, and is always greater than 0 after device creation. The
1060 # version must be 0 on the `CreateDevice` request if a `config` is
1061 # specified; the response of `CreateDevice` will always have a value of 1.
1062 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
1063 # Cloud IoT Core. This timestamp is set by the server.
1064 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
1065 # acknowledgment from the device, indicating that the device has received
1066 # this configuration version. If this field is not present, the device has
1067 # not yet acknowledged that it received this version. Note that when
1068 # the config was sent to the device, many config versions may have been
1069 # available in Cloud IoT Core while the device was disconnected, and on
1070 # connection, only the latest version is sent to the device. Some
1071 # versions may never be sent to the device, and therefore are never
1072 # acknowledged. This timestamp is set by Cloud IoT Core.
1073 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
1074 },
1075 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
1076 # rotation without interruption, multiple device credentials can be bound to
1077 # this device. No more than 3 credentials can be bound to a single device at
1078 # a time. When new credentials are added to a device, they are verified
1079 # against the registry credentials. For details, see the description of the
1080 # `DeviceRegistry.credentials` field.
1081 { # A server-stored device credential used for authentication.
1082 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
1083 # credential will be ignored for new client authentication requests after
1084 # this timestamp; however, it will not be automatically deleted.
1085 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
1086 # When adding a new device credential, either via device creation or via
1087 # modifications, this public key credential may be required to be signed by
1088 # one of the registry level certificates. More specifically, if the
1089 # registry contains at least one certificate, any new device credential
1090 # must be signed by one of the registry certificates. As a result,
1091 # when the registry contains certificates, only X.509 certificates are
1092 # accepted as device credentials. However, if the registry does
1093 # not contain a certificate, self-signed certificates and public keys will
1094 # be accepted. New device credentials must be different from every
1095 # registry-level certificate.
1096 &quot;key&quot;: &quot;A String&quot;, # The key data.
1097 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
1098 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001099 },
1100 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001101 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
1102 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
1103 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
1104 # When `name` is populated as a response from the service, it always ends
1105 # in the device numeric ID.
1106 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
1107 # publish to Cloud Pub/Sub. This field is the timestamp of
1108 # &#x27;last_error_status&#x27;.
1109 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
1110 #
1111 # The logging verbosity for device activity. If unspecified,
1112 # DeviceRegistry.log_level will be used.
1113 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
1114 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
1115 # information for the device.
1116 #
1117 # Keys must conform to the regular expression a-zA-Z+ and
1118 # be less than 128 bytes in length.
1119 #
1120 # Values are free-form strings. Each value must be less than or equal to 32
1121 # KB in size.
1122 #
1123 # The total size of all keys and values must be less than 256 KB, and the
1124 # maximum number of key-value pairs is 500.
1125 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001126 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001127 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
1128 # within a device registry.
1129 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001130</div>
1131
1132<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001133 <code class="details" id="sendCommandToDevice">sendCommandToDevice(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001134 <pre>Sends a command to the specified device. In order for a device to be able
1135to receive commands, it must:
11361) be connected to Cloud IoT Core using the MQTT protocol, and
11372) be subscribed to the group of MQTT topics specified by
1138 /devices/{device-id}/commands/#. This subscription will receive commands
1139 at the top-level topic /devices/{device-id}/commands as well as commands
1140 for subfolders, like /devices/{device-id}/commands/subfolder.
1141 Note that subscribing to specific subfolders is not supported.
1142If the command could not be delivered to the device, this method will
1143return an error; in particular, if the device is not subscribed, this
1144method will return FAILED_PRECONDITION. Otherwise, this method will
1145return OK. If the subscription is QoS 1, at least once delivery will be
1146guaranteed; for QoS 0, no acknowledgment will be expected from the device.
1147
1148Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001149 name: string, Required. The name of the device. For example,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001150`projects/p0/locations/us-central1/registries/registry0/devices/device0` or
1151`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001152 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001153 The object takes the form of:
1154
1155{ # Request for `SendCommandToDevice`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001156 &quot;subfolder&quot;: &quot;A String&quot;, # Optional subfolder for the command. If empty, the command will be delivered
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001157 # to the /devices/{device-id}/commands topic, otherwise it will be delivered
1158 # to the /devices/{device-id}/commands/{subfolder} topic. Multi-level
1159 # subfolders are allowed. This field must not have more than 256 characters,
Bu Sun Kim65020912020-05-20 12:08:20 -07001160 # and must not contain any MQTT wildcards (&quot;+&quot; or &quot;#&quot;) or null characters.
1161 &quot;binaryData&quot;: &quot;A String&quot;, # Required. The command data to send to the device.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001162 }
1163
1164 x__xgafv: string, V1 error format.
1165 Allowed values
1166 1 - v1 error format
1167 2 - v2 error format
1168
1169Returns:
1170 An object of the form:
1171
1172 { # Response for `SendCommandToDevice`.
1173 }</pre>
1174</div>
1175
1176</body></html>