blob: cde21295efb784cb0c0b69929ca49b25baf85856 [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 Kimd059ad82020-07-22 17:02:09 -070097 <code><a href="#list">list(parent, pageToken=None, fieldMask=None, pageSize=None, deviceIds=None, deviceNumIds=None, gatewayListOptions_associationsDeviceId=None, gatewayListOptions_gatewayType=None, gatewayListOptions_associationsGatewayId=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 Kim4ed7d3f2020-05-27 12:20:54 -0700124 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
125 # rotation without interruption, multiple device credentials can be bound to
126 # this device. No more than 3 credentials can be bound to a single device at
127 # a time. When new credentials are added to a device, they are verified
128 # against the registry credentials. For details, see the description of the
129 # `DeviceRegistry.credentials` field.
130 { # A server-stored device credential used for authentication.
131 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
132 # credential will be ignored for new client authentication requests after
133 # this timestamp; however, it will not be automatically deleted.
134 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
135 # When adding a new device credential, either via device creation or via
136 # modifications, this public key credential may be required to be signed by
137 # one of the registry level certificates. More specifically, if the
138 # registry contains at least one certificate, any new device credential
139 # must be signed by one of the registry certificates. As a result,
140 # when the registry contains certificates, only X.509 certificates are
141 # accepted as device credentials. However, if the registry does
142 # not contain a certificate, self-signed certificates and public keys will
143 # be accepted. New device credentials must be different from every
144 # registry-level certificate.
145 &quot;key&quot;: &quot;A String&quot;, # The key data.
146 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
147 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700149 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700150 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
151 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
152 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
153 # When `name` is populated as a response from the service, it always ends
154 # in the device numeric ID.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700155 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
156 # publish to Cloud Pub/Sub. This field is the timestamp of
157 # &#x27;last_error_status&#x27;.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700158 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
159 #
160 # The logging verbosity for device activity. If unspecified,
161 # DeviceRegistry.log_level will be used.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700162 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
163 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
164 # information for the device.
165 #
166 # Keys must conform to the regular expression a-zA-Z+ and
167 # be less than 128 bytes in length.
168 #
169 # Values are free-form strings. Each value must be less than or equal to 32
170 # KB in size.
171 #
172 # The total size of all keys and values must be less than 256 KB, and the
173 # maximum number of key-value pairs is 500.
174 &quot;a_key&quot;: &quot;A String&quot;,
175 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700176 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
177 # within a device registry.
178 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
179 # was received from the device. This field is only for configurations
180 # sent through MQTT.
181 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700182 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700183 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
184 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
185 # gateway.
186 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
187 # specified in `last_accessed_gateway`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700188 },
189 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
190 # more compact way to identify devices, and it is globally unique.
191 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
192 # Can be used to temporarily prevent the device from connecting if, for
193 # example, the sensor is generating bad data and needs maintenance.
194 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
195 # applies only to devices connecting through MQTT. MQTT clients usually only
196 # send `PINGREQ` messages if the connection is idle, and no other messages
197 # have been sent. Timestamps are periodically collected and written to
198 # storage; they may be stale by a few minutes.
199 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
200 # periodically collected and written to storage; they may be stale by a few
201 # minutes.
202 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
203 # the device.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700204 &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
205 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
206 # field. If no errors have occurred, this field has an empty message
207 # and the status code 0 == OK. Otherwise, this field is expected to have a
208 # status code other than OK.
209 # different programming environments, including REST APIs and RPC APIs. It is
210 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
211 # three pieces of data: error code, error message, and error details.
212 #
213 # You can find out more about this error model and how to work with it in the
214 # [API Design Guide](https://cloud.google.com/apis/design/errors).
215 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
216 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
217 # user-facing error message should be localized and sent in the
218 # google.rpc.Status.details field, or localized by the client.
219 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
220 # message types for APIs to use.
221 {
222 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
223 },
224 ],
225 },
226 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
227 # periodically collected and written to storage; they may be stale by a few
228 # minutes.
229 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
230 # has been reported, this field is not present.
231 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
232 # IoT Core.
233 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
234 },
235 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
236 # Cloud IoT Core to the device. If not present on creation, the
237 # configuration will be initialized with an empty payload and version value
238 # of `1`. To update this field after creation, use the
239 # `DeviceManager.ModifyCloudToDeviceConfig` method.
240 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
241 # the server, and is always greater than 0 after device creation. The
242 # version must be 0 on the `CreateDevice` request if a `config` is
243 # specified; the response of `CreateDevice` will always have a value of 1.
244 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
245 # Cloud IoT Core. This timestamp is set by the server.
246 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
247 # acknowledgment from the device, indicating that the device has received
248 # this configuration version. If this field is not present, the device has
249 # not yet acknowledged that it received this version. Note that when
250 # the config was sent to the device, many config versions may have been
251 # available in Cloud IoT Core while the device was disconnected, and on
252 # connection, only the latest version is sent to the device. Some
253 # versions may never be sent to the device, and therefore are never
254 # acknowledged. This timestamp is set by Cloud IoT Core.
255 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
256 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700257}
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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700268 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700269 # rotation without interruption, multiple device credentials can be bound to
270 # this device. No more than 3 credentials can be bound to a single device at
271 # a time. When new credentials are added to a device, they are verified
272 # against the registry credentials. For details, see the description of the
273 # `DeviceRegistry.credentials` field.
274 { # A server-stored device credential used for authentication.
Bu Sun Kim65020912020-05-20 12:08:20 -0700275 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
276 # credential will be ignored for new client authentication requests after
277 # this timestamp; however, it will not be automatically deleted.
278 &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 -0700279 # When adding a new device credential, either via device creation or via
280 # modifications, this public key credential may be required to be signed by
281 # one of the registry level certificates. More specifically, if the
282 # registry contains at least one certificate, any new device credential
283 # must be signed by one of the registry certificates. As a result,
284 # when the registry contains certificates, only X.509 certificates are
285 # accepted as device credentials. However, if the registry does
286 # not contain a certificate, self-signed certificates and public keys will
287 # be accepted. New device credentials must be different from every
288 # registry-level certificate.
Bu Sun Kim65020912020-05-20 12:08:20 -0700289 &quot;key&quot;: &quot;A String&quot;, # The key data.
290 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700291 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700292 },
293 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700294 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
295 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
296 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
297 # When `name` is populated as a response from the service, it always ends
298 # in the device numeric ID.
Bu Sun Kim65020912020-05-20 12:08:20 -0700299 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
300 # publish to Cloud Pub/Sub. This field is the timestamp of
301 # &#x27;last_error_status&#x27;.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700302 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
303 #
304 # The logging verbosity for device activity. If unspecified,
305 # DeviceRegistry.log_level will be used.
Bu Sun Kim65020912020-05-20 12:08:20 -0700306 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
Dan O'Mearadd494642020-05-01 07:42:23 -0700307 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
308 # information for the device.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700309 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700310 # Keys must conform to the regular expression a-zA-Z+ and
311 # be less than 128 bytes in length.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700312 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700313 # Values are free-form strings. Each value must be less than or equal to 32
314 # KB in size.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700315 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700316 # The total size of all keys and values must be less than 256 KB, and the
317 # maximum number of key-value pairs is 500.
Bu Sun Kim65020912020-05-20 12:08:20 -0700318 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700319 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700320 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
321 # within a device registry.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700322 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
323 # was received from the device. This field is only for configurations
324 # sent through MQTT.
325 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700326 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700327 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
328 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
329 # gateway.
330 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
331 # specified in `last_accessed_gateway`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700332 },
333 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
334 # more compact way to identify devices, and it is globally unique.
335 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
336 # Can be used to temporarily prevent the device from connecting if, for
337 # example, the sensor is generating bad data and needs maintenance.
338 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
339 # applies only to devices connecting through MQTT. MQTT clients usually only
340 # send `PINGREQ` messages if the connection is idle, and no other messages
341 # have been sent. Timestamps are periodically collected and written to
342 # storage; they may be stale by a few minutes.
343 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
344 # periodically collected and written to storage; they may be stale by a few
345 # minutes.
346 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
347 # the device.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700348 &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
349 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
350 # field. If no errors have occurred, this field has an empty message
351 # and the status code 0 == OK. Otherwise, this field is expected to have a
352 # status code other than OK.
353 # different programming environments, including REST APIs and RPC APIs. It is
354 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
355 # three pieces of data: error code, error message, and error details.
356 #
357 # You can find out more about this error model and how to work with it in the
358 # [API Design Guide](https://cloud.google.com/apis/design/errors).
359 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
360 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
361 # user-facing error message should be localized and sent in the
362 # google.rpc.Status.details field, or localized by the client.
363 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
364 # message types for APIs to use.
365 {
366 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
367 },
368 ],
369 },
370 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
371 # periodically collected and written to storage; they may be stale by a few
372 # minutes.
373 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
374 # has been reported, this field is not present.
375 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
376 # IoT Core.
377 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
378 },
379 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
380 # Cloud IoT Core to the device. If not present on creation, the
381 # configuration will be initialized with an empty payload and version value
382 # of `1`. To update this field after creation, use the
383 # `DeviceManager.ModifyCloudToDeviceConfig` method.
384 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
385 # the server, and is always greater than 0 after device creation. The
386 # version must be 0 on the `CreateDevice` request if a `config` is
387 # specified; the response of `CreateDevice` will always have a value of 1.
388 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
389 # Cloud IoT Core. This timestamp is set by the server.
390 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
391 # acknowledgment from the device, indicating that the device has received
392 # this configuration version. If this field is not present, the device has
393 # not yet acknowledged that it received this version. Note that when
394 # the config was sent to the device, many config versions may have been
395 # available in Cloud IoT Core while the device was disconnected, and on
396 # connection, only the latest version is sent to the device. Some
397 # versions may never be sent to the device, and therefore are never
398 # acknowledged. This timestamp is set by Cloud IoT Core.
399 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
400 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700401 }</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 Kim4ed7d3f2020-05-27 12:20:54 -0700451 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
452 # rotation without interruption, multiple device credentials can be bound to
453 # this device. No more than 3 credentials can be bound to a single device at
454 # a time. When new credentials are added to a device, they are verified
455 # against the registry credentials. For details, see the description of the
456 # `DeviceRegistry.credentials` field.
457 { # A server-stored device credential used for authentication.
458 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
459 # credential will be ignored for new client authentication requests after
460 # this timestamp; however, it will not be automatically deleted.
461 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
462 # When adding a new device credential, either via device creation or via
463 # modifications, this public key credential may be required to be signed by
464 # one of the registry level certificates. More specifically, if the
465 # registry contains at least one certificate, any new device credential
466 # must be signed by one of the registry certificates. As a result,
467 # when the registry contains certificates, only X.509 certificates are
468 # accepted as device credentials. However, if the registry does
469 # not contain a certificate, self-signed certificates and public keys will
470 # be accepted. New device credentials must be different from every
471 # registry-level certificate.
472 &quot;key&quot;: &quot;A String&quot;, # The key data.
473 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
474 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700475 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700476 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700477 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
478 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
479 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
480 # When `name` is populated as a response from the service, it always ends
481 # in the device numeric ID.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700482 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
483 # publish to Cloud Pub/Sub. This field is the timestamp of
484 # &#x27;last_error_status&#x27;.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700485 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
486 #
487 # The logging verbosity for device activity. If unspecified,
488 # DeviceRegistry.log_level will be used.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700489 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
490 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
491 # information for the device.
492 #
493 # Keys must conform to the regular expression a-zA-Z+ and
494 # be less than 128 bytes in length.
495 #
496 # Values are free-form strings. Each value must be less than or equal to 32
497 # KB in size.
498 #
499 # The total size of all keys and values must be less than 256 KB, and the
500 # maximum number of key-value pairs is 500.
501 &quot;a_key&quot;: &quot;A String&quot;,
502 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700503 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
504 # within a device registry.
505 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
506 # was received from the device. This field is only for configurations
507 # sent through MQTT.
508 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700509 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700510 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
511 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
512 # gateway.
513 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
514 # specified in `last_accessed_gateway`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700515 },
516 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
517 # more compact way to identify devices, and it is globally unique.
518 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
519 # Can be used to temporarily prevent the device from connecting if, for
520 # example, the sensor is generating bad data and needs maintenance.
521 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
522 # applies only to devices connecting through MQTT. MQTT clients usually only
523 # send `PINGREQ` messages if the connection is idle, and no other messages
524 # have been sent. Timestamps are periodically collected and written to
525 # storage; they may be stale by a few minutes.
526 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
527 # periodically collected and written to storage; they may be stale by a few
528 # minutes.
529 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
530 # the device.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700531 &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
532 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
533 # field. If no errors have occurred, this field has an empty message
534 # and the status code 0 == OK. Otherwise, this field is expected to have a
535 # status code other than OK.
536 # different programming environments, including REST APIs and RPC APIs. It is
537 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
538 # three pieces of data: error code, error message, and error details.
539 #
540 # You can find out more about this error model and how to work with it in the
541 # [API Design Guide](https://cloud.google.com/apis/design/errors).
542 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
543 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
544 # user-facing error message should be localized and sent in the
545 # google.rpc.Status.details field, or localized by the client.
546 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
547 # message types for APIs to use.
548 {
549 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
550 },
551 ],
552 },
553 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
554 # periodically collected and written to storage; they may be stale by a few
555 # minutes.
556 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
557 # has been reported, this field is not present.
558 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
559 # IoT Core.
560 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
561 },
562 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
563 # Cloud IoT Core to the device. If not present on creation, the
564 # configuration will be initialized with an empty payload and version value
565 # of `1`. To update this field after creation, use the
566 # `DeviceManager.ModifyCloudToDeviceConfig` method.
567 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
568 # the server, and is always greater than 0 after device creation. The
569 # version must be 0 on the `CreateDevice` request if a `config` is
570 # specified; the response of `CreateDevice` will always have a value of 1.
571 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
572 # Cloud IoT Core. This timestamp is set by the server.
573 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
574 # acknowledgment from the device, indicating that the device has received
575 # this configuration version. If this field is not present, the device has
576 # not yet acknowledged that it received this version. Note that when
577 # the config was sent to the device, many config versions may have been
578 # available in Cloud IoT Core while the device was disconnected, and on
579 # connection, only the latest version is sent to the device. Some
580 # versions may never be sent to the device, and therefore are never
581 # acknowledged. This timestamp is set by Cloud IoT Core.
582 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
583 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700584 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700585</div>
586
587<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700588 <code class="details" id="list">list(parent, pageToken=None, fieldMask=None, pageSize=None, deviceIds=None, deviceNumIds=None, gatewayListOptions_associationsDeviceId=None, gatewayListOptions_gatewayType=None, gatewayListOptions_associationsGatewayId=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 Kimd059ad82020-07-22 17:02:09 -0700594 pageToken: string, The value returned by the last `ListDevicesResponse`; indicates
595that this is a continuation of a prior `ListDevices` call and
596the system should return the next page of data.
597 fieldMask: string, The fields of the `Device` resource to be returned in the response. The
598fields `id` and `num_id` are always returned, along with any
599other fields specified.
600 pageSize: integer, The maximum number of devices to return in the response. If this value
601is zero, the service will select a default size. A call may return fewer
602objects than requested. A non-empty `next_page_token` in the response
603indicates that more data is available.
Bu Sun Kim65020912020-05-20 12:08:20 -0700604 deviceIds: string, A list of device string IDs. For example, `[&#x27;device0&#x27;, &#x27;device12&#x27;]`.
605If empty, this field is ignored. Maximum IDs: 10,000 (repeated)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700606 deviceNumIds: string, A list of device numeric IDs. If empty, this field is ignored. Maximum
607IDs: 10,000. (repeated)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700608 gatewayListOptions_associationsDeviceId: string, If set, returns only the gateways with which the specified device is
609associated. The device ID can be numeric (`num_id`) or the user-defined
610string (`id`). For example, if `456` is specified, returns only the
611gateways to which the device with `num_id` 456 is bound.
612 gatewayListOptions_gatewayType: string, If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY`
613is specified, only non-gateway devices are returned. If
614`GATEWAY_TYPE_UNSPECIFIED` is specified, all devices are returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700615 gatewayListOptions_associationsGatewayId: string, If set, only devices associated with the specified gateway are returned.
616The gateway ID can be numeric (`num_id`) or the user-defined string
617(`id`). For example, if `123` is specified, only devices bound to the
618gateway with `num_id` 123 are returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700619 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 Kim4ed7d3f2020-05-27 12:20:54 -0700628 &quot;devices&quot;: [ # The devices that match the request.
629 { # The device resource.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700630 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
631 # rotation without interruption, multiple device credentials can be bound to
632 # this device. No more than 3 credentials can be bound to a single device at
633 # a time. When new credentials are added to a device, they are verified
634 # against the registry credentials. For details, see the description of the
635 # `DeviceRegistry.credentials` field.
636 { # A server-stored device credential used for authentication.
637 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
638 # credential will be ignored for new client authentication requests after
639 # this timestamp; however, it will not be automatically deleted.
640 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
641 # When adding a new device credential, either via device creation or via
642 # modifications, this public key credential may be required to be signed by
643 # one of the registry level certificates. More specifically, if the
644 # registry contains at least one certificate, any new device credential
645 # must be signed by one of the registry certificates. As a result,
646 # when the registry contains certificates, only X.509 certificates are
647 # accepted as device credentials. However, if the registry does
648 # not contain a certificate, self-signed certificates and public keys will
649 # be accepted. New device credentials must be different from every
650 # registry-level certificate.
651 &quot;key&quot;: &quot;A String&quot;, # The key data.
652 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
653 },
654 },
655 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700656 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
657 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
658 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
659 # When `name` is populated as a response from the service, it always ends
660 # in the device numeric ID.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700661 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
662 # publish to Cloud Pub/Sub. This field is the timestamp of
663 # &#x27;last_error_status&#x27;.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700664 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
665 #
666 # The logging verbosity for device activity. If unspecified,
667 # DeviceRegistry.log_level will be used.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700668 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
669 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
670 # information for the device.
671 #
672 # Keys must conform to the regular expression a-zA-Z+ and
673 # be less than 128 bytes in length.
674 #
675 # Values are free-form strings. Each value must be less than or equal to 32
676 # KB in size.
677 #
678 # The total size of all keys and values must be less than 256 KB, and the
679 # maximum number of key-value pairs is 500.
680 &quot;a_key&quot;: &quot;A String&quot;,
681 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700682 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
683 # within a device registry.
684 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
685 # was received from the device. This field is only for configurations
686 # sent through MQTT.
687 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700688 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700689 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
690 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
691 # gateway.
692 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
693 # specified in `last_accessed_gateway`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700694 },
695 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
696 # more compact way to identify devices, and it is globally unique.
697 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
698 # Can be used to temporarily prevent the device from connecting if, for
699 # example, the sensor is generating bad data and needs maintenance.
700 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
701 # applies only to devices connecting through MQTT. MQTT clients usually only
702 # send `PINGREQ` messages if the connection is idle, and no other messages
703 # have been sent. Timestamps are periodically collected and written to
704 # storage; they may be stale by a few minutes.
705 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
706 # periodically collected and written to storage; they may be stale by a few
707 # minutes.
708 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
709 # the device.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700710 &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
711 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
712 # field. If no errors have occurred, this field has an empty message
713 # and the status code 0 == OK. Otherwise, this field is expected to have a
714 # status code other than OK.
715 # different programming environments, including REST APIs and RPC APIs. It is
716 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
717 # three pieces of data: error code, error message, and error details.
718 #
719 # You can find out more about this error model and how to work with it in the
720 # [API Design Guide](https://cloud.google.com/apis/design/errors).
721 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
722 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
723 # user-facing error message should be localized and sent in the
724 # google.rpc.Status.details field, or localized by the client.
725 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
726 # message types for APIs to use.
727 {
728 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
729 },
730 ],
731 },
732 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
733 # periodically collected and written to storage; they may be stale by a few
734 # minutes.
735 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
736 # has been reported, this field is not present.
737 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
738 # IoT Core.
739 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
740 },
741 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
742 # Cloud IoT Core to the device. If not present on creation, the
743 # configuration will be initialized with an empty payload and version value
744 # of `1`. To update this field after creation, use the
745 # `DeviceManager.ModifyCloudToDeviceConfig` method.
746 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
747 # the server, and is always greater than 0 after device creation. The
748 # version must be 0 on the `CreateDevice` request if a `config` is
749 # specified; the response of `CreateDevice` will always have a value of 1.
750 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
751 # Cloud IoT Core. This timestamp is set by the server.
752 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
753 # acknowledgment from the device, indicating that the device has received
754 # this configuration version. If this field is not present, the device has
755 # not yet acknowledged that it received this version. Note that when
756 # the config was sent to the device, many config versions may have been
757 # available in Cloud IoT Core while the device was disconnected, and on
758 # connection, only the latest version is sent to the device. Some
759 # versions may never be sent to the device, and therefore are never
760 # acknowledged. This timestamp is set by Cloud IoT Core.
761 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
762 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700763 },
764 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -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 Kim4ed7d3f2020-05-27 12:20:54 -0700798 &quot;binaryData&quot;: &quot;A String&quot;, # Required. The configuration data for the device.
Bu Sun Kim65020912020-05-20 12:08:20 -0700799 &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 -0700800 # version number of the server and will always update the current version;
801 # otherwise, this update will fail if the version number found on the server
802 # does not match this version number. This is used to support multiple
803 # simultaneous updates without losing data.
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 Kim4ed7d3f2020-05-27 12:20:54 -0700848 &quot;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
849 # rotation without interruption, multiple device credentials can be bound to
850 # this device. No more than 3 credentials can be bound to a single device at
851 # a time. When new credentials are added to a device, they are verified
852 # against the registry credentials. For details, see the description of the
853 # `DeviceRegistry.credentials` field.
854 { # A server-stored device credential used for authentication.
855 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
856 # credential will be ignored for new client authentication requests after
857 # this timestamp; however, it will not be automatically deleted.
858 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
859 # When adding a new device credential, either via device creation or via
860 # modifications, this public key credential may be required to be signed by
861 # one of the registry level certificates. More specifically, if the
862 # registry contains at least one certificate, any new device credential
863 # must be signed by one of the registry certificates. As a result,
864 # when the registry contains certificates, only X.509 certificates are
865 # accepted as device credentials. However, if the registry does
866 # not contain a certificate, self-signed certificates and public keys will
867 # be accepted. New device credentials must be different from every
868 # registry-level certificate.
869 &quot;key&quot;: &quot;A String&quot;, # The key data.
870 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
871 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700872 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700873 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700874 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
875 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
876 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
877 # When `name` is populated as a response from the service, it always ends
878 # in the device numeric ID.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700879 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
880 # publish to Cloud Pub/Sub. This field is the timestamp of
881 # &#x27;last_error_status&#x27;.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700882 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
883 #
884 # The logging verbosity for device activity. If unspecified,
885 # DeviceRegistry.log_level will be used.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700886 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
887 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
888 # information for the device.
889 #
890 # Keys must conform to the regular expression a-zA-Z+ and
891 # be less than 128 bytes in length.
892 #
893 # Values are free-form strings. Each value must be less than or equal to 32
894 # KB in size.
895 #
896 # The total size of all keys and values must be less than 256 KB, and the
897 # maximum number of key-value pairs is 500.
898 &quot;a_key&quot;: &quot;A String&quot;,
899 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700900 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
901 # within a device registry.
902 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
903 # was received from the device. This field is only for configurations
904 # sent through MQTT.
905 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700906 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700907 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
908 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
909 # gateway.
910 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
911 # specified in `last_accessed_gateway`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700912 },
913 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
914 # more compact way to identify devices, and it is globally unique.
915 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
916 # Can be used to temporarily prevent the device from connecting if, for
917 # example, the sensor is generating bad data and needs maintenance.
918 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
919 # applies only to devices connecting through MQTT. MQTT clients usually only
920 # send `PINGREQ` messages if the connection is idle, and no other messages
921 # have been sent. Timestamps are periodically collected and written to
922 # storage; they may be stale by a few minutes.
923 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
924 # periodically collected and written to storage; they may be stale by a few
925 # minutes.
926 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
927 # the device.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700928 &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
929 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
930 # field. If no errors have occurred, this field has an empty message
931 # and the status code 0 == OK. Otherwise, this field is expected to have a
932 # status code other than OK.
933 # different programming environments, including REST APIs and RPC APIs. It is
934 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
935 # three pieces of data: error code, error message, and error details.
936 #
937 # You can find out more about this error model and how to work with it in the
938 # [API Design Guide](https://cloud.google.com/apis/design/errors).
939 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
940 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
941 # user-facing error message should be localized and sent in the
942 # google.rpc.Status.details field, or localized by the client.
943 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
944 # message types for APIs to use.
945 {
946 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
947 },
948 ],
949 },
950 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
951 # periodically collected and written to storage; they may be stale by a few
952 # minutes.
953 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
954 # has been reported, this field is not present.
955 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
956 # IoT Core.
957 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
958 },
959 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
960 # Cloud IoT Core to the device. If not present on creation, the
961 # configuration will be initialized with an empty payload and version value
962 # of `1`. To update this field after creation, use the
963 # `DeviceManager.ModifyCloudToDeviceConfig` method.
964 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
965 # the server, and is always greater than 0 after device creation. The
966 # version must be 0 on the `CreateDevice` request if a `config` is
967 # specified; the response of `CreateDevice` will always have a value of 1.
968 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
969 # Cloud IoT Core. This timestamp is set by the server.
970 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
971 # acknowledgment from the device, indicating that the device has received
972 # this configuration version. If this field is not present, the device has
973 # not yet acknowledged that it received this version. Note that when
974 # the config was sent to the device, many config versions may have been
975 # available in Cloud IoT Core while the device was disconnected, and on
976 # connection, only the latest version is sent to the device. Some
977 # versions may never be sent to the device, and therefore are never
978 # acknowledged. This timestamp is set by Cloud IoT Core.
979 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
980 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700981}
982
983 updateMask: string, Required. Only updates the `device` fields indicated by this mask.
984The 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;credentials&quot;: [ # The credentials used to authenticate this device. To allow credential
997 # rotation without interruption, multiple device credentials can be bound to
998 # this device. No more than 3 credentials can be bound to a single device at
999 # a time. When new credentials are added to a device, they are verified
1000 # against the registry credentials. For details, see the description of the
1001 # `DeviceRegistry.credentials` field.
1002 { # A server-stored device credential used for authentication.
1003 &quot;expirationTime&quot;: &quot;A String&quot;, # [Optional] The time at which this credential becomes invalid. This
1004 # credential will be ignored for new client authentication requests after
1005 # this timestamp; however, it will not be automatically deleted.
1006 &quot;publicKey&quot;: { # A public key format and data. # A public key used to verify the signature of JSON Web Tokens (JWTs).
1007 # When adding a new device credential, either via device creation or via
1008 # modifications, this public key credential may be required to be signed by
1009 # one of the registry level certificates. More specifically, if the
1010 # registry contains at least one certificate, any new device credential
1011 # must be signed by one of the registry certificates. As a result,
1012 # when the registry contains certificates, only X.509 certificates are
1013 # accepted as device credentials. However, if the registry does
1014 # not contain a certificate, self-signed certificates and public keys will
1015 # be accepted. New device credentials must be different from every
1016 # registry-level certificate.
1017 &quot;key&quot;: &quot;A String&quot;, # The key data.
1018 &quot;format&quot;: &quot;A String&quot;, # The format of the key.
1019 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001020 },
1021 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001022 &quot;name&quot;: &quot;A String&quot;, # The resource path name. For example,
1023 # `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or
1024 # `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.
1025 # When `name` is populated as a response from the service, it always ends
1026 # in the device numeric ID.
Bu Sun Kim65020912020-05-20 12:08:20 -07001027 &quot;lastErrorTime&quot;: &quot;A String&quot;, # [Output only] The time the most recent error occurred, such as a failure to
1028 # publish to Cloud Pub/Sub. This field is the timestamp of
1029 # &#x27;last_error_status&#x27;.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001030 &quot;logLevel&quot;: &quot;A String&quot;, # **Beta Feature**
1031 #
1032 # The logging verbosity for device activity. If unspecified,
1033 # DeviceRegistry.log_level will be used.
Bu Sun Kim65020912020-05-20 12:08:20 -07001034 &quot;metadata&quot;: { # The metadata key-value pairs assigned to the device. This metadata is not
1035 # interpreted or indexed by Cloud IoT Core. It can be used to add contextual
1036 # information for the device.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001037 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001038 # Keys must conform to the regular expression a-zA-Z+ and
1039 # be less than 128 bytes in length.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001040 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001041 # Values are free-form strings. Each value must be less than or equal to 32
1042 # KB in size.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001043 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001044 # The total size of all keys and values must be less than 256 KB, and the
1045 # maximum number of key-value pairs is 500.
1046 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001047 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001048 &quot;id&quot;: &quot;A String&quot;, # The user-defined device identifier. The device ID must be unique
1049 # within a device registry.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001050 &quot;lastConfigAckTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version acknowledgment
1051 # was received from the device. This field is only for configurations
1052 # sent through MQTT.
1053 &quot;gatewayConfig&quot;: { # Gateway-related configuration and state. # Gateway-related configuration and state.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001054 &quot;gatewayType&quot;: &quot;A String&quot;, # Indicates whether the device is a gateway.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001055 &quot;lastAccessedGatewayId&quot;: &quot;A String&quot;, # [Output only] The ID of the gateway the device accessed most recently.
1056 &quot;gatewayAuthMethod&quot;: &quot;A String&quot;, # Indicates how to authorize and/or authenticate devices to access the
1057 # gateway.
1058 &quot;lastAccessedGatewayTime&quot;: &quot;A String&quot;, # [Output only] The most recent time at which the device accessed the gateway
1059 # specified in `last_accessed_gateway`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001060 },
1061 &quot;numId&quot;: &quot;A String&quot;, # [Output only] A server-defined unique numeric ID for the device. This is a
1062 # more compact way to identify devices, and it is globally unique.
1063 &quot;blocked&quot;: True or False, # If a device is blocked, connections or requests from this device will fail.
1064 # Can be used to temporarily prevent the device from connecting if, for
1065 # example, the sensor is generating bad data and needs maintenance.
1066 &quot;lastHeartbeatTime&quot;: &quot;A String&quot;, # [Output only] The last time an MQTT `PINGREQ` was received. This field
1067 # applies only to devices connecting through MQTT. MQTT clients usually only
1068 # send `PINGREQ` messages if the connection is idle, and no other messages
1069 # have been sent. Timestamps are periodically collected and written to
1070 # storage; they may be stale by a few minutes.
1071 &quot;lastEventTime&quot;: &quot;A String&quot;, # [Output only] The last time a telemetry event was received. Timestamps are
1072 # periodically collected and written to storage; they may be stale by a few
1073 # minutes.
1074 &quot;lastConfigSendTime&quot;: &quot;A String&quot;, # [Output only] The last time a cloud-to-device config version was sent to
1075 # the device.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001076 &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
1077 # to publish to Cloud Pub/Sub. &#x27;last_error_time&#x27; is the timestamp of this
1078 # field. If no errors have occurred, this field has an empty message
1079 # and the status code 0 == OK. Otherwise, this field is expected to have a
1080 # status code other than OK.
1081 # different programming environments, including REST APIs and RPC APIs. It is
1082 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1083 # three pieces of data: error code, error message, and error details.
1084 #
1085 # You can find out more about this error model and how to work with it in the
1086 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1087 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1088 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1089 # user-facing error message should be localized and sent in the
1090 # google.rpc.Status.details field, or localized by the client.
1091 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1092 # message types for APIs to use.
1093 {
1094 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1095 },
1096 ],
1097 },
1098 &quot;lastStateTime&quot;: &quot;A String&quot;, # [Output only] The last time a state event was received. Timestamps are
1099 # periodically collected and written to storage; they may be stale by a few
1100 # minutes.
1101 &quot;state&quot;: { # The device state, as reported by the device. # [Output only] The state most recently received from the device. If no state
1102 # has been reported, this field is not present.
1103 &quot;updateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this state version was updated in Cloud
1104 # IoT Core.
1105 &quot;binaryData&quot;: &quot;A String&quot;, # The device state data.
1106 },
1107 &quot;config&quot;: { # The device configuration. Eventually delivered to devices. # The most recent device configuration, which is eventually sent from
1108 # Cloud IoT Core to the device. If not present on creation, the
1109 # configuration will be initialized with an empty payload and version value
1110 # of `1`. To update this field after creation, use the
1111 # `DeviceManager.ModifyCloudToDeviceConfig` method.
1112 &quot;version&quot;: &quot;A String&quot;, # [Output only] The version of this update. The version number is assigned by
1113 # the server, and is always greater than 0 after device creation. The
1114 # version must be 0 on the `CreateDevice` request if a `config` is
1115 # specified; the response of `CreateDevice` will always have a value of 1.
1116 &quot;cloudUpdateTime&quot;: &quot;A String&quot;, # [Output only] The time at which this configuration version was updated in
1117 # Cloud IoT Core. This timestamp is set by the server.
1118 &quot;deviceAckTime&quot;: &quot;A String&quot;, # [Output only] The time at which Cloud IoT Core received the
1119 # acknowledgment from the device, indicating that the device has received
1120 # this configuration version. If this field is not present, the device has
1121 # not yet acknowledged that it received this version. Note that when
1122 # the config was sent to the device, many config versions may have been
1123 # available in Cloud IoT Core while the device was disconnected, and on
1124 # connection, only the latest version is sent to the device. Some
1125 # versions may never be sent to the device, and therefore are never
1126 # acknowledged. This timestamp is set by Cloud IoT Core.
1127 &quot;binaryData&quot;: &quot;A String&quot;, # The device configuration data.
1128 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001129 }</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>