Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb26c15

Browse filesBrowse files
cscereskeJon Wayne Parrott
authored andcommitted
Fix the api version and payload for iot end to end example (GoogleCloudPlatform#1333)
1 parent c7424bf commit cb26c15
Copy full SHA for cb26c15

File tree

Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed

‎iot/api-client/end_to_end_example/cloudiot_pubsub_example_server.py

Copy file name to clipboardExpand all lines: iot/api-client/end_to_end_example/cloudiot_pubsub_example_server.py
+6-8Lines changed: 6 additions & 8 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.