-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Final additions in private beta #489
Conversation
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.
Not sure how easy it would be to add tests for the codes in http_example/
. If it is easy and makes sense to have them, please consider adding some tests.
iot/http_example/README.md
Outdated
|
||
# Google Cloud IoT Core NodeJS HTTP example | ||
|
||
This sample app publishes messages to Cloud Pub/Sub or states using the HTTP |
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.
I don't understand what "Cloud Pub/Sub or states" means.
iot/http_example/cloudiot.rest.json
Outdated
@@ -0,0 +1,279 @@ | |||
{ |
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.
What is this file for?
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.
Removed, the device API was to be exposed as Apiary via device REST discovery.
description: 'Encryption algorithm to generate the JWT.', | ||
requiresArg: true, | ||
demandOption: true, | ||
choices: ['RS256', 'ES256'], |
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.
If the target user of this sample is expected to be familiar with JWT, or node already prints allowed choices, then please ignore my comment:
It might help to print the allowed choices in the help/description message.
// messageCount. Telemetry events are published at a rate of 1 per second and | ||
// states at a rate of 1 every 2 seconds. | ||
function publishAsync (messageCount, numMessages) { | ||
const payload = `${argv.registry_id}/${argv.device_id}-payload-${messageCount}`; |
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.
The publishAsync
function in http_client_example.js
seems more flexible allowing the user to specify a message
argument. Why is the publishAsync
function in this file not allowing the same?
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.
Checked in duplicate versions of the same sample, will clean up after dinner.
console.log('Publishing to:', path); | ||
console.log('Publishing message:', message); | ||
|
||
// TODO: Publish message hurr |
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.
Still need to do this?
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.
Removed extra implementation,
|
||
// Publish numMessages messages asynchronously, starting from message | ||
// messageCount. | ||
function publishAsync (bearer, client, messageCount, message, projectId, cloudRegion, registryId, deviceId) { |
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.
The order of arguments is a bit inconsistent:
for this function: (bearer, client, messageCount, message, projectId, cloudRegion, registryId, deviceId)
for getDeviceState
in manager.js
it is (client, deviceId, registryId, projectId, cloudRegion)
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.
This will be difficult to setup tests for because it depends on a lot of components being in place both in order to run the sample as well as being able to measure the sample is working.
🤖 I have created a release \*beep\* \*boop\* --- ## [2.6.0](https://www.github.com/googleapis/nodejs-kms/compare/v2.5.0...v2.6.0) (2021-08-17) ### Features * **kms:** add samples for new rng and hmac kms apis ([#487](https://www.github.com/googleapis/nodejs-kms/issues/487)) ([5278a8e](https://www.github.com/googleapis/nodejs-kms/commit/5278a8e62c14fcc5cc02e4bd7b36e68a4ed48b72)) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#489](https://www.github.com/googleapis/nodejs-kms/issues/489)) ([f5e8569](https://www.github.com/googleapis/nodejs-kms/commit/f5e85696de33d8870951d684b491338fc3c029f3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ## [2.6.0](https://www.github.com/googleapis/nodejs-kms/compare/v2.5.0...v2.6.0) (2021-08-17) ### Features * **kms:** add samples for new rng and hmac kms apis ([#487](https://www.github.com/googleapis/nodejs-kms/issues/487)) ([5278a8e](https://www.github.com/googleapis/nodejs-kms/commit/5278a8e62c14fcc5cc02e4bd7b36e68a4ed48b72)) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#489](https://www.github.com/googleapis/nodejs-kms/issues/489)) ([f5e8569](https://www.github.com/googleapis/nodejs-kms/commit/f5e85696de33d8870951d684b491338fc3c029f3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
No description provided.