PSGSuite icon indicating copy to clipboard operation
PSGSuite copied to clipboard

Added Get-GSChromeDeviceTelemetry

Open Foggy2 opened this issue 2 years ago • 3 comments

Added Get-GSChromeDeviceTelemetry Added ChromeMamnagement API to NuGetDependencies.json Updated Newtonsoft.Json version in NuGetDependencies.json to support the ChromeManagement API

This will allow use of the customers.telemetry.devices method of the Chrome Management API.

Haven't done anything on this level before so let me know of any feedback.

Foggy2 avatar Mar 01 '22 07:03 Foggy2

Hey @Foggy2 this looks really good. I assume you've been able to test this yourself in your Org? I don't have access to Chrome devices in mine so I can't test it myself.

FISHMANPET avatar Apr 01 '22 17:04 FISHMANPET

Hey @FISHMANPET. Yes, I have been using this for the last couple weeks without issue.

In the interests of consistency I would like your thoughts on the naming? I was unsure if I should call it Get-GSChromeDeviceTelemetry or Get-GSChromeTelemetry. Ultimately I ended up with specifying Device in the name as this one appears to relate only to Chrome hardware devices. However, the Chrome Management API where this request is serviced from does include methods that cover both Chrome browser and Chrome devices at the same time.

We also already have a function `Get-GSChromeOSDevice' as an example too which is another variation on the naming convention.

Foggy2 avatar Apr 03 '22 22:04 Foggy2

Naming can be tricky, especially with some of Google's APIs, but my opinion is that you've made the right choice here. While this is in the "Chrome" API, you're right this particular endpoint only applies to devices, so I think it makes sense to include it in the name.

The other function uses the admin directory API and specifically returns an object of type ChromeOSDevice so that name makes sense there. In both cases, the name is basically going off the actual API that Google provides, so any inconsistency is there. Here it wouldn't be wrong to call it, say, Get-GSChromeOSDeviceTelemetry but now you've made this command inconsistent with the API it uses (OS doesn't appear anywhere in the API names) to keep it consistent with some other basically unrelated API.

As an example of the inconsistencies that appear in something as large as Google's APIs, here's something I came across a few years ago: The enums for two separate endpoints are different in .Net even though they're the same in the REST documentation: https://github.com/googleapis/google-api-dotnet-client/issues/1593

So, I'd say what you've done is fine. If anything, there could be an argument that there should be an alias of Get-GSChromeOSDeviceTelemetry pointing to this function, and Get-GSChromeDevice pointing to Get-GSChromeOSDevice but I don't feel like I'd know enough about Chrome Devices and their management to make that call.

FISHMANPET avatar Apr 04 '22 15:04 FISHMANPET