Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Commit 8540289

Browse files
gguussandrewsg
authored andcommitted
MQTT Exponential backoff and manager updates [(#1345)](GoogleCloudPlatform/python-docs-samples#1345)
1 parent ae27ec3 commit 8540289

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

samples/api-client/manager/README.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ To run this sample:
7777
[--project_id PROJECT_ID] [--registry_id REGISTRY_ID]
7878
[--rsa_certificate_file RSA_CERTIFICATE_FILE]
7979
[--service_account_json SERVICE_ACCOUNT_JSON]
80-
[--version VERSION]
81-
{create-es256,create-registry,create-rsa256,create-topic,create-unauth,delete-device,delete-registry,get,get-registry,get-state,list,list-registries,patch-es256,patch-rs256,set-config}
80+
[--version VERSION] [--member MEMBER] [--role ROLE]
81+
{create-es256,create-registry,create-rsa256,create-topic,create-unauth,delete-device,delete-registry,get,get-config-versions,get-iam-permissions,get-registry,get-state,list,list-registries,patch-es256,patch-rs256,set-config,set-iam-permissions}
8282
...
8383
8484
Example of using the Google Cloud IoT Core device manager to administer
@@ -95,7 +95,7 @@ To run this sample:
9595
list
9696
9797
positional arguments:
98-
{create-es256,create-registry,create-rsa256,create-topic,create-unauth,delete-device,delete-registry,get,get-registry,get-state,list,list-registries,patch-es256,patch-rs256,set-config}
98+
{create-es256,create-registry,create-rsa256,create-topic,create-unauth,delete-device,delete-registry,get,get-config-versions,get-iam-permissions,get-registry,get-state,list,list-registries,patch-es256,patch-rs256,set-config,set-iam-permissions}
9999
create-es256 Create a new device with the given id, using ES256 for
100100
authentication.
101101
create-registry Gets or creates a device registry.
@@ -107,6 +107,11 @@ To run this sample:
107107
delete-device Delete the device with the given id.
108108
delete-registry Deletes the specified registry.
109109
get Retrieve the device with the given id.
110+
get-config-versions
111+
Lists versions of a device config in descending order
112+
(newest first).
113+
get-iam-permissions
114+
Retrieves IAM permissions for the given registry.
110115
get-registry Retrieves a device registry.
111116
get-state Retrieve a device's state blobs.
112117
list List all devices in the registry.
@@ -117,6 +122,9 @@ To run this sample:
117122
device.
118123
set-config Patch the device to add an RSA256 public key to the
119124
device.
125+
set-iam-permissions
126+
Sets IAM permissions for the given registry to a
127+
single role/member.
120128
121129
optional arguments:
122130
-h, --help show this help message and exit
@@ -139,6 +147,8 @@ To run this sample:
139147
--service_account_json SERVICE_ACCOUNT_JSON
140148
Path to service account json file.
141149
--version VERSION Version number for setting device configuration.
150+
--member MEMBER Member used for IAM commands.
151+
--role ROLE Role used for IAM commands.
142152
143153
144154

samples/api-client/manager/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def get_iam_permissions(
438438
def set_iam_permissions(
439439
service_account_json, project_id, cloud_region, registry_id, role,
440440
member):
441-
"""Retrieves IAM permissions for the given registry."""
441+
"""Sets IAM permissions for the given registry to a single role/member."""
442442
client = get_client(service_account_json)
443443

444444
registry_path = 'projects/{}/locations/{}/registries/{}'.format(

0 commit comments

Comments
 (0)