You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pyZscaler displays data pulled from Zscaler via the native format in the API - JSON. While JSON is optimal for programmatic purposes, our users may want to export data into a format where it's easier to manipulate or display the data. pyZscaler should be able to support the ability to export to different data formats.
Challenges
Many of Zscaler's API calls return nested data structures that can't be easily flattened without creating a potentially unpredictable number of columns. When Zscaler has a nested data structure, most times it's going to be another object that may separately exist with it's own id. e.g. a user resource record often has a nested object for department and a nested object for the groups they belong to. Now we know that users can only belong to one department, but they can belong to multiple groups. Compounding this further is that Zscaler doesn't return all possible fields for every resource record (i.e. if a user isn't assigned to a department, a null department field isn't returned).
Ultimately this means there can be quite a few edge cases and a lot of work to create a reliable CSV export that works flawlessly for every API call. Gut feel is to go for a balanced approach unless there is consensus otherwise.
There is a design decision that needs to be made:
Create an export method that can generally flatten any JSON to a CSV, regardless of the number of columns.
Create an export method that detects whether the id key is present and then only return that, ignoring nested objects that don't match this format (then creating edge cases as our users require)
Create an export method that returns an immaculately usable data structure at the expense of a lot of coding effort and not being able to cover the entire library
After writing out this issue
Leaning towards an export method that looks for an id and only returns the id for each nested object. Reasons for this:
As stated above, most (if not all) nested objects have an id
This id means that the object should exist in its own right
If the object exists somewhere in Zscaler, we should be able to make an API call to retrieve further details if required
Users are likely to use another tool to join data after importing via CSV
Feedback
Open to any feedback on this from anyone using pyZscaler, thanks!
The text was updated successfully, but these errors were encountered:
Context
pyZscaler displays data pulled from Zscaler via the native format in the API - JSON. While JSON is optimal for programmatic purposes, our users may want to export data into a format where it's easier to manipulate or display the data. pyZscaler should be able to support the ability to export to different data formats.
Challenges
Many of Zscaler's API calls return nested data structures that can't be easily flattened without creating a potentially unpredictable number of columns. When Zscaler has a nested data structure, most times it's going to be another object that may separately exist with it's own id. e.g. a user resource record often has a nested object for department and a nested object for the groups they belong to. Now we know that users can only belong to one department, but they can belong to multiple groups. Compounding this further is that Zscaler doesn't return all possible fields for every resource record (i.e. if a user isn't assigned to a department, a null department field isn't returned).
Ultimately this means there can be quite a few edge cases and a lot of work to create a reliable CSV export that works flawlessly for every API call. Gut feel is to go for a balanced approach unless there is consensus otherwise.
There is a design decision that needs to be made:
After writing out this issue
Leaning towards an export method that looks for an id and only returns the id for each nested object. Reasons for this:
Feedback
Open to any feedback on this from anyone using pyZscaler, thanks!
The text was updated successfully, but these errors were encountered: