Skip to content

Commit cb26c15

Browse files
cscereskeJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Fix the api version and payload for iot end to end example (GoogleCloudPlatform#1333)
1 parent c7424bf commit cb26c15

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

iot/api-client/end_to_end_example/cloudiot_pubsub_example_server.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050

5151
API_SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
52-
API_VERSION = 'v1beta1'
52+
API_VERSION = 'v1'
5353
DISCOVERY_API = 'https://cloudiot.googleapis.com/$discovery/rest'
5454
SERVICE_NAME = 'cloudiot'
5555

@@ -106,13 +106,11 @@ def _update_device_config(self, project_id, region, registry_id, device_id,
106106
# case, you use the special value of 0, which tells Cloud IoT to
107107
# always update the config.
108108
'version_to_update': 0,
109-
'data': {
110-
# The data is passed as raw bytes, so you encode it as base64.
111-
# Note that the device will receive the decoded string, so you
112-
# do not need to base64 decode the string on the device.
113-
'binary_data': base64.b64encode(
114-
config_data_json.encode('utf-8')).decode('ascii')
115-
}
109+
# The data is passed as raw bytes, so you encode it as base64.
110+
# Note that the device will receive the decoded string, so you
111+
# do not need to base64 decode the string on the device.
112+
'binary_data': base64.b64encode(
113+
config_data_json.encode('utf-8')).decode('ascii')
116114
}
117115

118116
device_name = ('projects/{}/locations/{}/registries/{}/'

0 commit comments

Comments
 (0)