Skip to content

Commit

Permalink
docs: regenerated README
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Apr 28, 2020
1 parent 38d8148 commit 777c4fb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 27 deletions.
63 changes: 37 additions & 26 deletions packages/google-cloud-iot/samples/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Google Cloud Internet of Things (IoT) Core: Node.js Samples](https://github.com/googleapis/nodejs-iot)

This folder contains NodeJS samples that demonstrate an overview of the Google
Cloud IoT Core platform.
[![Open in Cloud Shell][shell_img]][shell_link]

## Quickstart
> Node.js idiomatic client for [Cloud IoT Core][product-docs].
1. Install the Google Cloud SDK as described in [the Cloud IoT Core documentation](https://cloud.google.com/iot/docs/how-tos/getting-started#set_up_the_google_cloud_sdk_and_gcloud).
1. Create a Cloud Pub/Sub topic:
[Google Cloud Internet of Things (IoT) Core](https://cloud.google.com/iot/docs) is a fully managed service for securely connecting and managing IoT devices, from a few to millions. Ingest data from connected devices and build rich applications that integrate with the other big data services of Google Cloud Platform.

gcloud beta pubsub topics create projects/my-iot-project/topics/device-events
## Table of Contents

1. Add the service account `[email protected]` with the role `Publisher` to that
Cloud Pub/Sub topic from the [Cloud Developer Console](https://console.cloud.google.com)
or by setting the `GOOGLE_CLOUD_PROJECT` environment variable and using the
helper script in the `scripts/` folder.
* [Before you begin](#before-you-begin)
* [Samples](#samples)
* [Quickstart](#quickstart)

1. Create a registry:
## Before you begin

gcloud iot registries create "your-registry-id" \
--project=<your-project-id> \
--region=us-central1 \
--event-notification-config=topic=projects/<your-project-id>/topics/<pubsub-topic-name>
Before running the samples, make sure you've followed the steps outlined in
[Using the client library](https://github.com/googleapis/nodejs-iot#using-the-client-library).

1. Use the `generate_keys.sh` script to generate your signing keys:
`cd samples`

./scripts/generate_keys.sh
`npm install`

1. Create a device.
`cd ..`

gcloud iot devices create my-node-device \
--project=my-iot-project \
--region=us-central1 \
--registry=my-registry \
--public-key path=rsa_cert.pem,type=rs256
## Samples

1. Connect a sample device using the sample app in the `mqtt_example` folder.
1. Learn how to manage devices programatically with the sample app in the
`manager` folder.


### Quickstart

View the [source code](https://github.com/googleapis/nodejs-iot/blob/master/samples/quickstart.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-iot&page=editor&open_in_editor=samples/quickstart.js,samples/README.md)

__Usage:__


`node samples/quickstart.js`






[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-iot&page=editor&open_in_editor=samples/README.md
[product-docs]: https://cloud.google.com/iot
2 changes: 1 addition & 1 deletion packages/google-cloud-iot/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-iot.git",
"sha": "73137b64bcd84cc7be2a0effee867e34e88f700e"
"sha": "cc635d6a851a093342f4603574df256ba14643a1"
}
},
{
Expand Down

0 comments on commit 777c4fb

Please sign in to comment.