Skip to content

Commit

Permalink
gateway crud update (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
munkhuushmgl authored and gguuss committed Feb 7, 2019
1 parent be23196 commit bafcfe9
Show file tree
Hide file tree
Showing 5 changed files with 866 additions and 306 deletions.
49 changes: 48 additions & 1 deletion iot/api-client/manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ the sample every time you run it.
Run the following command to install the libraries and build the sample with
Maven:

mvn clean compile assembly:single
mvn clean compile assembly:single

## Running the sample

Expand Down Expand Up @@ -166,6 +166,53 @@ Patch a device with RSA:
-device_id=java-device-0 \
-command=patch-device-rsa"

Create a gateway:

mvn exec:java \
-Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
-Dexec.args="-project_id=blue-jet-123 \
-registry_name=your-registry \
-public_key_file ../rsa_cert.pem \
-gateway_id=java-gateway-0 \
-command=create-gateway"

Bind a device to a gateway:

mvn exec:java \
-Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
-Dexec.args="-project_id=blue-jet-123 \
-registry_name=your-registry \
-gateway_id=java-gateway-0 \
-device_id=java-device-0 \
-command=bind-device-to-gateway"

Unbind a device to a gateway:

mvn exec:java \
-Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
-Dexec.args="-project_id=blue-jet-123 \
-registry_name=your-registry \
-gateway_id=java-gateway-0 \
-device_id=java-device-0 \
-command=unbind-device-from-gateway"

List gateways in a registry.

mvn exec:java \
-Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
-Dexec.args="-project_id=blue-jet-123 \
-registry_name=your-registry \
-command=list-gateways"

List devices bound to a gateway.

mvn exec:java \
-Dexec.mainClass="com.example.cloud.iot.examples.DeviceRegistryExample" \
-Dexec.args="-project_id=blue-jet-123 \
-registry_name=your-registry \
-gateway_id=your-gateway-id \
-command=list-devices-for-gateway"


# Cloud IoT Core Java HTTP example

Expand Down
4 changes: 2 additions & 2 deletions iot/api-client/manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-cloudiot</artifactId>
<version>v1-rev49-1.25.0</version>
<version>v1-rev20181120-1.27.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
Expand All @@ -71,7 +71,7 @@
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.22.0</version>
<version>1.23.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
Loading

0 comments on commit bafcfe9

Please sign in to comment.