-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Post-GA nits #1040
Merged
Post-GA nits #1040
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ This sample app demonstrates device management for Google Cloud IoT Core. | |
Note that before you can run the sample, you must configure a Google Cloud | ||
PubSub topic for Cloud IoT as described in [the parent README](../README.md). | ||
|
||
Before running the samples, you can set the `GCLOUD_PROJECT` and | ||
`GOOGLE_APPLICATION_CREDENTIALS` environment variables to avoid passing them to | ||
the sample every time you run it. | ||
|
||
## Setup | ||
Run the following command to install the libraries and build the sample with | ||
Maven: | ||
|
@@ -24,7 +28,7 @@ The following description summarizes the sample usage: | |
|
||
Cloud IoT Core Commandline Example (Device / Registry management): | ||
|
||
--cloud_region <arg> GCP cloud region. | ||
--cloud_region <arg> GCP cloud region (default us-central1). | ||
--command <arg> Command to run: | ||
create-iot-topic | ||
create-rsa | ||
|
@@ -68,6 +72,7 @@ Create an ES device: | |
java -cp target/cloudiot-manager-demo-1.0-jar-with-dependencies.jar \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow that's long There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, updated the manager samples to use |
||
com.example.cloud.iot.examples.DeviceRegistryExample \ | ||
-project_id=blue-jet-123 -pubsub_topic=hello-java \ | ||
-cloud_region=us-central1 | ||
-registry_name=hello-java -ec_public_key_file ../ec_public.pem \ | ||
-device_id="java-device-0" -command=create-es | ||
|
||
|
@@ -169,16 +174,17 @@ The following command summarizes the sample usage: | |
-algorithm=<RS256|ES256>" | ||
``` | ||
|
||
For example, if your project ID is `blue-jet-123`, your service account | ||
credentials are stored in your home folder in creds.json and you have generated | ||
your credentials using the [`generate_keys.sh`](../generate_keys.sh) script | ||
For example, if your project ID is `blue-jet-123`, the Cloud region associated | ||
with your device registry is europe-west1, and you have generated your | ||
credentials using the [`generate_keys.sh`](../generate_keys.sh) script | ||
provided in the parent folder, you can run the sample as: | ||
|
||
``` | ||
mvn exec:java \ | ||
-Dexec.mainClass="com.example.cloud.iot.examples.HttpExample" \ | ||
-Dexec.args="-project_id=blue-jet-123 \ | ||
-registry_id=my-registry \ | ||
-cloud_region=europe-west1 \ | ||
-device_id=my-java-device \ | ||
-private_key_file=../rsa_private_pkcs8 \ | ||
-algorithm=RS256" | ||
|
@@ -191,6 +197,7 @@ To publish state messages, run the sample as follows: | |
-Dexec.mainClass="com.example.cloud.iot.examples.HttpExample" \ | ||
-Dexec.args="-project_id=blue-jet-123 \ | ||
-registry_id=my-registry \ | ||
-cloud_region=us-central1 \ | ||
-device_id=my-java-device \ | ||
-private_key_file=../rsa_private_pkcs8 \ | ||
-message_type=state \ | ||
|
@@ -238,19 +245,21 @@ The following command summarizes the sample usage: | |
-Dexec.mainClass="com.example.cloud.iot.examples.MqttExample" \ | ||
-Dexec.args="-project_id=my-iot-project \ | ||
-registry_id=my-registry \ | ||
-cloud_region=us-central1 \ | ||
-device_id=my-device \ | ||
-private_key_file=rsa_private_pkcs8 \ | ||
-algorithm=RS256" | ||
|
||
For example, if your project ID is `blue-jet-123`, your service account | ||
credentials are stored in your home folder in creds.json and you have generated | ||
your credentials using the [`generate_keys.sh`](../generate_keys.sh) script | ||
For example, if your project ID is `blue-jet-123`, your device registry is | ||
located in the `asia-east1` region, and you have generated your | ||
credentials using the [`generate_keys.sh`](../generate_keys.sh) script | ||
provided in the parent folder, you can run the sample as: | ||
|
||
mvn exec:java \ | ||
-Dexec.mainClass="com.example.cloud.iot.examples.MqttExample" \ | ||
-Dexec.args="-project_id=blue-jet-123 \ | ||
-registry_id=my-registry \ | ||
-cloud_region=asia-east1 \ | ||
-device_id=my-device \ | ||
-private_key_file=../rsa_private_pkcs8 \ | ||
-algorithm=RS256" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be GOOGLE_CLOUD_PROJECT ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thanks!