TheJumpCloud / jcapi

JumpCloud's Go (golang) REST API V1 SDK
https://jumpcloud.com
Mozilla Public License 2.0
13 stars 11 forks source link

Update example scripts to work with Groups orgs + fix ExportUsersPerSystemToCSV #41

Closed run-o closed 7 years ago

run-o commented 7 years ago

Updated some of the scripts that require v2 calls to work with Groups orgs (the others don't need to be modified to work with a Groups org):

Each updated script comes with a helper checkOrgType.go which allows us to tell whether an org uses Tags or Groups. Since these scripts are standalone example scripts, I thought it was ok to just have copies of that same file for each script that uses the helper.

I started working on a groups version of the BackupRestoreTags script but realized that backing up a Group's info requires backing up a lot more than just Users or Systems associations. It requires backing up /restoring all the groups associations such as : Applications, Directories, GSuite, LDAP, O365, Systems, Radius Servers, Policies etc... After talking to Rob and Cody, it doesn't even seem like this script is used much, if at all. So we may want to wait for specific customers' requests before coming up with a new Groups version for it.

Note that I'm generating a PR against the jcapi repo, for ease of reviewing the diff, but I will most likely move the scripts to the support repo once they are reviewed.

run-o commented 7 years ago

@beckjake Thanks for the review! Made a bunch of changes according to your feedback.