The sdk is broken into 3 parts:
- sample-app - This is a small CLI utility written in Go which runs a SQL query, meant to serve as an example to using the rest of the sdk
- oauth/ - The oauth package is intended to facility initial oauth token retrieval
- restapi/ - The restapi package includes a general purpose RestClient for calling Cloud Platform API's
SDK Functionality Includes:
- Utilizing OAuth2 to create client applications
- Sample for issuing queries to the report system
- General API consumption via Go
Usage:
- Requires Go 1.8 or newer
- Clone this repository
- Then build and run the sample app:
cd sample-app
go build
./sample-app -host abc123.my.idaptive.app -clientid joe@tenant.com --sql="select ID, DisplayName, Username, Email from User"
Note that the sample requires an OAuth2 Client application, default Application ID is "golang_sample", and scope named "all" with REST Regex of at least "redrock/query". The Application ID and scope names can be overriden on the command line. A sample template for import has been included in the sample-app/AppTemplate.zip file. See --help for more:
$ ./sample-app --help
Usage of ./sample-app:
-appid string
OAuth2 Application ID (default "golang_sample")
-clientid string
OAuth2 Confidential Client ID
-clientsecret string
OAuth2 Confidential Client Secret (if empty, you will be prompted)
-host string
Service URL, i.e. https://<tenantid>.my.idaptive.app
-scope string
OAuth2 Scope (default "all")
-sql string
Report query to run (default "select ID, DisplayName, Username, Email from User")
Please also note that this requires Idaptive Cloud Service version 17.10 or higher for related OAuth2 functionality.