Client.Governance.Data.Policies
retrieve - Gets specified policy
update - Updates an existing policy
list - Lists policies
create - Creates new policy
download - Downloads violations CSV for policy
Fetches the specified policy version, or the latest if no version is provided.
package hello .world ;
import com .glean .api_client .glean_api_client .Glean ;
import com .glean .api_client .glean_api_client .models .operations .GetpolicyResponse ;
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 ();
GetpolicyResponse res = sdk .client ().governance ().data ().policies ().retrieve ()
.id ("<id>" )
.call ();
if (res .getDlpReportResponse ().isPresent ()) {
System .out .println (res .getDlpReportResponse ().get ());
}
}
}
Parameter
Type
Required
Description
id
String
✔️
The id of the policy to fetch.
version
Optional<Long>
➖
The version of the policy to fetch. Each time a policy is updated, the older version is still stored. If this is left empty, the latest policy is fetched.
GetpolicyResponse
Error Type
Status Code
Content Type
models/errors/APIException
4XX, 5XX
*/*
Updates an existing policy.
package hello .world ;
import com .glean .api_client .glean_api_client .Glean ;
import com .glean .api_client .glean_api_client .models .components .UpdateDlpReportRequest ;
import com .glean .api_client .glean_api_client .models .operations .UpdatepolicyResponse ;
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 ();
UpdatepolicyResponse res = sdk .client ().governance ().data ().policies ().update ()
.id ("<id>" )
.updateDlpReportRequest (UpdateDlpReportRequest .builder ()
.build ())
.call ();
if (res .updateDlpReportResponse ().isPresent ()) {
System .out .println (res .updateDlpReportResponse ().get ());
}
}
}
Parameter
Type
Required
Description
id
String
✔️
The id of the policy to fetch.
updateDlpReportRequest
UpdateDlpReportRequest
✔️
N/A
UpdatepolicyResponse
Error Type
Status Code
Content Type
models/errors/APIException
4XX, 5XX
*/*
Lists policies with filtering.
package hello .world ;
import com .glean .api_client .glean_api_client .Glean ;
import com .glean .api_client .glean_api_client .models .operations .ListpoliciesResponse ;
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 ();
ListpoliciesResponse res = sdk .client ().governance ().data ().policies ().list ()
.call ();
if (res .listDlpReportsResponse ().isPresent ()) {
System .out .println (res .listDlpReportsResponse ().get ());
}
}
}
Parameter
Type
Required
Description
autoHide
Optional<Boolean>
➖
Filter to return reports with a given value of auto-hide.
frequency
Optional<String>
➖
Filter to return reports with a given frequency.
ListpoliciesResponse
Error Type
Status Code
Content Type
models/errors/APIException
4XX, 5XX
*/*
Creates a new policy with specified specifications and returns its id.
package hello .world ;
import com .glean .api_client .glean_api_client .Glean ;
import com .glean .api_client .glean_api_client .models .components .CreateDlpReportRequest ;
import com .glean .api_client .glean_api_client .models .operations .CreatepolicyResponse ;
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 ();
CreateDlpReportRequest req = CreateDlpReportRequest .builder ()
.build ();
CreatepolicyResponse res = sdk .client ().governance ().data ().policies ().create ()
.request (req )
.call ();
if (res .createDlpReportResponse ().isPresent ()) {
System .out .println (res .createDlpReportResponse ().get ());
}
}
}
Parameter
Type
Required
Description
request
CreateDlpReportRequest
✔️
The request object to use for the request.
CreatepolicyResponse
Error Type
Status Code
Content Type
models/errors/APIException
4XX, 5XX
*/*
Downloads CSV violations report for a specific policy id. This does not support continuous policies.
package hello .world ;
import com .glean .api_client .glean_api_client .Glean ;
import com .glean .api_client .glean_api_client .models .operations .DownloadpolicycsvResponse ;
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 ();
DownloadpolicycsvResponse res = sdk .client ().governance ().data ().policies ().download ()
.id ("<id>" )
.call ();
if (res .res ().isPresent ()) {
System .out .println (res .res ().get ());
}
}
}
Parameter
Type
Required
Description
id
String
✔️
The id of the policy to download violations for.
DownloadpolicycsvResponse
Error Type
Status Code
Content Type
models/errors/APIException
4XX, 5XX
*/*