Skip to content

Commit bafcfe9

Browse files
munkhuushmglgguuss
authored andcommitted
gateway crud update (GoogleCloudPlatform#1327)
1 parent be23196 commit bafcfe9

File tree

5 files changed

+866
-306
lines changed

5 files changed

+866
-306
lines changed

iot/api-client/manager/README.md

+48-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ the sample every time you run it.
1616
Run the following command to install the libraries and build the sample with
1717
Maven:
1818

19-
mvn clean compile assembly:single
19+
mvn clean compile assembly:single
2020

2121
## Running the sample
2222

@@ -166,6 +166,53 @@ Patch a device with RSA:
166166
-device_id=java-device-0 \
167167
-command=patch-device-rsa"
168168

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+
169216

170217
# Cloud IoT Core Java HTTP example
171218

iot/api-client/manager/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>com.google.apis</groupId>
6363
<artifactId>google-api-services-cloudiot</artifactId>
64-
<version>v1-rev49-1.25.0</version>
64+
<version>v1-rev20181120-1.27.0</version>
6565
</dependency>
6666
<dependency>
6767
<groupId>com.google.cloud</groupId>
@@ -71,7 +71,7 @@
7171
<dependency>
7272
<groupId>com.google.oauth-client</groupId>
7373
<artifactId>google-oauth-client</artifactId>
74-
<version>1.22.0</version>
74+
<version>1.23.0</version>
7575
</dependency>
7676
<dependency>
7777
<groupId>com.google.guava</groupId>

0 commit comments

Comments
 (0)