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

Migrate IoT samples to Cloud Client library #1478

Closed
gguuss opened this issue Sep 12, 2019 · 8 comments
Closed

Migrate IoT samples to Cloud Client library #1478

gguuss opened this issue Sep 12, 2019 · 8 comments
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@gguuss
Copy link
Contributor

gguuss commented Sep 12, 2019

Because it's easier to instantiate client libraries, we should migrate the IoT samples to the Cloud Client library. Example code showing send command to device:

  const iot = require('@google-cloud/iot');

  const newclient = new iot.v1.DeviceManagerClient({
    // optional auth parameters.
  });

  const parentName = `projects/${projectId}/locations/${cloudRegion}`;
  const registryName = `${parentName}/registries/${registryId}`;
  const binaryData = Buffer.from(data).toString('base64');
  const request = {
    name: `${registryName}/devices/${deviceId}`,
    binaryData: binaryData,
  };
  newclient.modifyCloudToDeviceConfig(request)
    .then(responses => {
      const response = responses[0];
      // doThingsWith(response)
    })
    .catch(err => {
      console.error(err);
    });
@fhinkel
Copy link
Contributor

fhinkel commented Oct 3, 2019

Can we assign this to somebody or should we close it for now as infeasible?

@JustinBeckwith JustinBeckwith added 🚨 This issue needs some love. triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Oct 3, 2019
@gguuss
Copy link
Contributor Author

gguuss commented Oct 3, 2019

I'm the right one to take it, I was waiting for another CL to land first.

@JustinBeckwith JustinBeckwith removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Oct 3, 2019
@fhinkel
Copy link
Contributor

fhinkel commented Oct 28, 2019

The samples should also be move to the client library instead of living here https://github.com/googleapis/nodejs-iot

This way we catch bugs when we release the library and not only later when we notice it in this repo.

@gguuss
Copy link
Contributor Author

gguuss commented Oct 30, 2019

SGTM, I may not be able to get to this until late Nov. early Dec. but it should not take long after I've wrapped up my talks and travel.

@gguuss
Copy link
Contributor Author

gguuss commented Nov 13, 2019

This is not fixed, will resolve once migration is complete.

@gguuss gguuss closed this as completed Nov 13, 2019
@gguuss gguuss reopened this Nov 13, 2019
@gguuss
Copy link
Contributor Author

gguuss commented Dec 26, 2019

We'll be 3/4 of the way there after this PR merges.

@gguuss
Copy link
Contributor Author

gguuss commented Jan 9, 2020

we're 3/4 of the way there!

@gguuss
Copy link
Contributor Author

gguuss commented Jan 17, 2020

4/4 will wrap up when #1594 merges

@gguuss gguuss closed this as completed Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants