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

gateway crud update #1327

Merged
merged 11 commits into from
Feb 7, 2019
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