Skip to content

Latest commit

 

History

History
160 lines (108 loc) · 6.22 KB

File metadata and controls

160 lines (108 loc) · 6.22 KB

Client.Governance.Data.Reports

Overview

Available Operations

  • create - Creates new one-time report
  • download - Downloads violations CSV for report
  • status - Fetches report run status

create

Creates a new one-time report and executes its batch job.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.UpdateDlpConfigRequest;
import com.glean.api_client.glean_api_client.models.operations.CreatereportResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        UpdateDlpConfigRequest req = UpdateDlpConfigRequest.builder()
                .build();

        CreatereportResponse res = sdk.client().governance().data().reports().create()
                .request(req)
                .call();

        if (res.updateDlpConfigResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request UpdateDlpConfigRequest ✔️ The request object to use for the request.

Response

CreatereportResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

download

Downloads CSV violations report for a specific report id.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.DownloadreportcsvResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        DownloadreportcsvResponse res = sdk.client().governance().data().reports().download()
                .id("<id>")
                .call();

        if (res.res().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
id String ✔️ The id of the report to download violations for.

Response

DownloadreportcsvResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

status

Fetches the status of the run corresponding to the report-id.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.GetreportstatusResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        GetreportstatusResponse res = sdk.client().governance().data().reports().status()
                .id("<id>")
                .call();

        if (res.reportStatusResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
id String ✔️ The id of the report to get run status for.

Response

GetreportstatusResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*