GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — api-client-python/docs/sdks/policies/README.md at main · gleanwork/api-client-python

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
221 lines (143 loc) · 14.7 KB
/

README.md

Copy path

File metadata and controls

221 lines (143 loc) · 14.7 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Client.Governance.Data.Policies

Overview

Available Operations

  • retrieve - Gets specified policy
  • update - Updates an existing policy
  • list - Lists policies
  • create - Creates new policy
  • download - Downloads violations CSV for policy

retrieve

Fetches the specified policy version, or the latest if no version is provided.

Example Usage

from glean.api_client import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN"),
) as glean:

    res = glean.client.governance.data.policies.retrieve(id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The id of the policy to fetch.
version Optional[int] ➖ 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.
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.GetDlpReportResponse

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*

update

Updates an existing policy.

Example Usage

from glean.api_client import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN"),
) as glean:

    res = glean.client.governance.data.policies.update(id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The id of the policy to fetch.
config Optional[models.DlpConfig] ➖ Detailed configuration of what documents and sensitive content will be scanned.
frequency Optional[models.DlpFrequency] ➖ Interval between scans. DAILY is deprecated.
status Optional[models.DlpReportStatus] ➖ The status of the policy/report. Only ACTIVE status will be picked for scans.
auto_hide_docs Optional[bool] ➖ The new autoHideDoc boolean the policy will be updated to if provided.
report_name Optional[str] ➖ The new name of the policy if provided.
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.UpdateDlpReportResponse

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*

list

Lists policies with filtering.

Example Usage

from glean.api_client import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN"),
) as glean:

    res = glean.client.governance.data.policies.list()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
auto_hide Optional[bool] ➖ Filter to return reports with a given value of auto-hide.
frequency Optional[str] ➖ Filter to return reports with a given frequency.
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.ListDlpReportsResponse

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*

create

Creates a new policy with specified specifications and returns its id.

Example Usage

from glean.api_client import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN"),
) as glean:

    res = glean.client.governance.data.policies.create()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
name Optional[str] ➖ Name of the policy being created.
config Optional[models.DlpConfig] ➖ Detailed configuration of what documents and sensitive content will be scanned.
frequency Optional[models.DlpFrequency] ➖ Interval between scans. DAILY is deprecated.
auto_hide_docs Optional[bool] ➖ Controls whether the policy should hide documents with violations.
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.CreateDlpReportResponse

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*

download

Downloads CSV violations report for a specific policy id. This does not support continuous policies.

Example Usage

from glean.api_client import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN"),
) as glean:

    res = glean.client.governance.data.policies.download(id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The id of the policy to download violations for.
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

str

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.