Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API version and body. #1326

Merged
merged 1 commit into from
Jan 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@


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

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

device_name = ('projects/{}/locations/{}/registries/{}/'
Expand Down