@@ -16,7 +16,7 @@ the sample every time you run it.
16
16
Run the following command to install the libraries and build the sample with
17
17
Maven:
18
18
19
- mvn clean compile assembly: single
19
+ mvn clean compile assembly:single
20
20
21
21
## Running the sample
22
22
@@ -166,6 +166,53 @@ Patch a device with RSA:
166
166
-device_id=java-device-0 \
167
167
-command=patch-device-rsa"
168
168
169
+ Create a gateway:
170
+
171
+ mvn exec:java \
172
+ -Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
173
+ -Dexec.args="-project_id=blue-jet-123 \
174
+ -registry_name=your-registry \
175
+ -public_key_file ../rsa_cert.pem \
176
+ -gateway_id=java-gateway-0 \
177
+ -command=create-gateway"
178
+
179
+ Bind a device to a gateway:
180
+
181
+ mvn exec:java \
182
+ -Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
183
+ -Dexec.args="-project_id=blue-jet-123 \
184
+ -registry_name=your-registry \
185
+ -gateway_id=java-gateway-0 \
186
+ -device_id=java-device-0 \
187
+ -command=bind-device-to-gateway"
188
+
189
+ Unbind a device to a gateway:
190
+
191
+ mvn exec:java \
192
+ -Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
193
+ -Dexec.args="-project_id=blue-jet-123 \
194
+ -registry_name=your-registry \
195
+ -gateway_id=java-gateway-0 \
196
+ -device_id=java-device-0 \
197
+ -command=unbind-device-from-gateway"
198
+
199
+ List gateways in a registry.
200
+
201
+ mvn exec:java \
202
+ -Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
203
+ -Dexec.args="-project_id=blue-jet-123 \
204
+ -registry_name=your-registry \
205
+ -command=list-gateways"
206
+
207
+ List devices bound to a gateway.
208
+
209
+ mvn exec:java \
210
+ -Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
211
+ -Dexec.args="-project_id=blue-jet-123 \
212
+ -registry_name=your-registry \
213
+ -gateway_id=your-gateway-id \
214
+ -command=list-devices-for-gateway"
215
+
169
216
170
217
# Cloud IoT Core Java HTTP example
171
218
0 commit comments