Git Product home page Git Product logo

Comments (6)

Matt-Stypulkoski avatar Matt-Stypulkoski commented on July 30, 2024

I believe the backends that are used in the get_analytics_for_users.py script are pulled from a separate csv file named analytics_data.csv. If by automating it you mean pulling all backends and then inputting each backend for each given user, then that would technically be possible, but would require reworking the script a bit. The endpoint to retrieve all available backends would also depend on the level in the Hub/Group/Project hierarchy that you want to retrieve the backends for.

I guess my main question is, are you trying to automatically retrieve all backends for a specific level in that hierarchy to then retrieve analytics for each of those backends? Or is it something else?

from hub-automation.

pshires avatar pshires commented on July 30, 2024

To respond to your main question- I am trying to do exactly that. Automatically retrieve all backends for a specific level in the hierarchy and then retrieve analytics for each of those backends. Ideally we could make a get request to an endpoint and receive a JSON response with a list of backends, and then that would allow us to pass the backend name to the system-usage endpoint directly (via correctly defined options- line 216) without the need for a csv file at all.

It might be easier if I just describe exactly what our goal is initially. We are looking to retrieve all of the analytics data available to us via get requests (probably once daily), store that data in a database, and then display that data to users in a meaningful and easily accessible way. This would be a long-running service that requires no manual intervention at all.

I understand that some users of this client may need the csv file workflow, but for our needs we only need the endpoints and then we handle the responses. The usage of the endpoints themselves is straightforward and documented via the source code itself. This being said- if you did decide to provide us with this endpoint and would like for it to be included in the client either as a standalone new script or integrated into get_analytics_for_users.py, I would be happy to do that work myself and open a PR (and make any changes desired, etc).

I realize my response is rather long-winded, but I hope that this provides more clarification as far as what I am actually trying to do.

from hub-automation.

Matt-Stypulkoski avatar Matt-Stypulkoski commented on July 30, 2024

There are endpoints from which you can retrieve a list of backends.

Hub Level (Must be Hub admin):
GET Network/{hubName}/devices

Group Level (this one does not have a direct devices endpoint, so you must pull from all Hub data. Must be a Hub admin):
GET Network/{hubName} (then parse down to the groups list, pick your specific group, and parse down to the device list in that group)

Project Level (Must be at least Group Admin):
GET Network/{hubName}/Groups/{groupName}/Projects/{projectName}/devices

from hub-automation.

kwehden avatar kwehden commented on July 30, 2024

@pshires, is this something you feel comfortable working with? If so, we can help by reviewing PRs or proposed implementation. Please let us know.

from hub-automation.

pshires avatar pshires commented on July 30, 2024

@kwehden , this is exactly what I was hoping to get. I've tested out the endpoints and seen the responses- the info I need is there. Thank you @Matt-Stypulkoski

Would you all like me to open a PR that adds a new script using these endpoints? I'd be happy to do that and make desired changes, etc.

from hub-automation.

kwehden avatar kwehden commented on July 30, 2024

Absolutely! Please do! We'd be happy to review and add! Please tag myself and @Matt-Stypulkoski for review

from hub-automation.

Related Issues (5)

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.