- Create - Creates new one-time report
- Download - Downloads violations CSV for report
- Status - Fetches report run status
Creates a new one-time report and executes its batch job.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Client.Governance.Data.Reports.Create(ctx, components.UpdateDlpConfigRequest{})
if err != nil {
log.Fatal(err)
}
if res.UpdateDlpConfigResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.UpdateDlpConfigRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CreatereportResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Downloads CSV violations report for a specific report id.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Client.Governance.Data.Reports.Download(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.Res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string |
✔️ | The id of the report to download violations for. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.DownloadreportcsvResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Fetches the status of the run corresponding to the report-id.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Client.Governance.Data.Reports.Status(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.ReportStatusResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string |
✔️ | The id of the report to get run status for. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetreportstatusResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |