Code Monkey home page Code Monkey logo

Comments (10)

templesnr avatar templesnr commented on May 22, 2024

Hi, confirmed, I tried this some time ago and had the same result.

from loaner.

iamgeef avatar iamgeef commented on May 22, 2024

I've been having to manually update datastore, on behalf of our desktop team who don't have gcp access, to get the asset tags to work with auditing a shelf

from loaner.

JoshSanchezG avatar JoshSanchezG commented on May 22, 2024

from loaner.

iamgeef avatar iamgeef commented on May 22, 2024

If you go to Datastore -> Entities and filter by Device (The 'kind' option) you'll see all the registered devices (It seems to have all of the devices that are registered in GSuite, not just the loaner/grab and go ones):
Screen Shot 2019-04-30 at 10 40 03 am

Search for the serial number, click on the value in the Name/Id column to Edit it and you can then add the asset tag to the asset_tag property
Edit_entity_–_Datastore_–_ncau-tech-grab-n-go…_–_Google_Cloud_Platform

That enables being able to use the asset tags for shelf audits, but you need to do it for every device after you've initially enrolled it

from loaner.

JoshSanchezG avatar JoshSanchezG commented on May 22, 2024

Hi "iamgeef" thank you for your comment but...

I tried editing the asset_tag directly on the entity in the GCP, but in some part of the process the relation is lost and the device is not recognized, so at the end the "device" become a "ghost" and it cannot be unrolled, audit, extend the loaner period, etc. I tried with "Clear device (in settings)" but this did not work.

In recap, I don not recommend to do this manually in the GCP.

Does anybody has another suggestion?

Thank you in advance for your time.

Kind regards,
Josh S.

from loaner.

Sasho11 avatar Sasho11 commented on May 22, 2024

Just a bit of clarification here on using asset tag.

  1. Currently there is no way to manually add asset tags to devices unless you do it manually through datastore (not recommended). If you do it this way, you will need to reindex all of the devices in the configuration menu under Search Indexing.

  2. If you want to do this automatically, you will need to create your own custom action that will translate an asset tag to a serial number using an asset management system you have (assuming it has an API you can utilize). This action can then be tied to the event called 'device_enroll' which is raised during device enrollment.

from loaner.

JoshSanchezG avatar JoshSanchezG commented on May 22, 2024

Hi Sasho11,

Thank you for the clarifications (#1 seems that is the easy way to use the asset tag, but could be a little bit risky, #2 definitively it's an interesting proposal that it has to be tried on the test environment).

Kind regards!

from loaner.

iamgeef avatar iamgeef commented on May 22, 2024

Raises an interesting question of what the "Use asset tags" option does if the feature isn't available without creating it ourselves...

I've got a workaround, that works for my use case anyway. Maybe it'll help others.

We use the 'Asset ID' field of the chrome_devices GSuite config to store our asset tags, entered during Enterprise Enrollment process by our desktop team, BUT the Directory API doesn't provide the ability to get the asset tag field: https://developers.google.com/admin-sdk/directory/v1/reference/chromeosdevices

It does allow you to get the contents of the 'notes' field so I've been able to convince the desktop team to also enter the asset tag into the devices 'notes' field at enrollment time.

It's then just 4 lines that need to be changed - sorry for the formatting...:

loaner/web_app/constants.py - appending 'notes' as a new field mask:
CHROME_FIELDS_MASK = 'deviceId,serialNumber,model,orgUnitPath,notes'
CHROME_LIST_FIELDS_MASK = ( 'chromeosdevices(deviceId,serialNumber,model,orgUnitPath,notes)')

loaner/web_app/backend/clients/directory.py - adding ASSET_TAG = u'notes'

DEVICE_ID = u'deviceId'
+ASSET_TAG = u'notes'
MODEL = u'model'
ORG_UNIT_PATH = u'orgUnitPath'
SERIAL_NUMBER = u'serialNumber'
_NEXT_PAGE = 'nextPageToken'

loaner/web_app/backend/models/device_model.py - adding a new line to assign the notes to device.asset_tag field:
device.chrome_device_id = directory_device_object[directory.DEVICE_ID]
device.current_ou = directory_device_object[directory.ORG_UNIT_PATH]
device.device_model = directory_device_object[directory.MODEL]
+device.asset_tag = directory_device_object[directory.ASSET_TAG]

I still have to enroll with the serial number, but it now gets the asset Id.

from loaner.

iamgeef avatar iamgeef commented on May 22, 2024

If anyone else uses the same 'Asset ID' field, I've raised a feature request to get the 'Asset ID' field available in the Directory API to avoid using the 'notes' field to store the ID:
https://issuetracker.google.com/issues/132368945

from loaner.

SPS-BL avatar SPS-BL commented on May 22, 2024

using annotatedAssetId instead of notes in the code above worked for me.

from loaner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.