Updates the permissions for a given document without modifying document content.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.update_permissions(datasource="<value>", permissions={})
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
N/A |
permissions |
models.DocumentPermissionsDefinition |
✔️ |
describes the access control details of the document |
object_type |
Optional[str] |
➖ |
The type of the document (Case, KnowledgeArticle for Salesforce for example). It cannot have spaces or _ |
id |
Optional[str] |
➖ |
The datasource specific id for the document. This field is case insensitive and should not be more than 200 characters in length. |
view_url |
Optional[str] |
➖ |
The permalink for viewing the document. Note: viewURL is a required field if id was not set when uploading the document.'
|
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Adds a datasource user or updates an existing user.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.index_user(datasource="<value>", user={
"email": "Art.Schaden@hotmail.com",
"name": "<value>",
})
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
The datasource for which the user is added |
user |
models.DatasourceUserDefinition |
✔️ |
describes a user in the datasource |
version |
Optional[int] |
➖ |
Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Replaces the users in a datasource using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.
Note: Any users deleted from the existing set will have their associated memberships deleted as well.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.bulk_index_users(upload_id="<id>", datasource="<value>", users=[
{
"email": "Ivory_Cummerata@hotmail.com",
"name": "<value>",
},
])
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
upload_id |
str |
✔️ |
Unique id that must be used for this instance of datasource users upload |
datasource |
str |
✔️ |
datasource of the users |
users |
List[models.DatasourceUserDefinition] |
✔️ |
batch of users for the datasource |
is_first_page |
Optional[bool] |
➖ |
true if this is the first page of the upload. Defaults to false |
is_last_page |
Optional[bool] |
➖ |
true if this is the last page of the upload. Defaults to false |
force_restart_upload |
Optional[bool] |
➖ |
Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true |
disable_stale_data_deletion_check |
Optional[bool] |
➖ |
True if older user data needs to be force deleted after the upload completes. Defaults to older data being deleted only if the percentage of data being deleted is less than a reasonable threshold. This must only be set when isLastPage = true |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Add or update a group in the datasource.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.index_group(datasource="<value>", group={
"name": "<value>",
})
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
The datasource for which the group is added |
group |
models.DatasourceGroupDefinition |
✔️ |
describes a group in the datasource |
version |
Optional[int] |
➖ |
Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Replaces the groups in a datasource using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.
Note: Any groups deleted from the existing set will have their associated memberships deleted as well.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.bulk_index_groups(upload_id="<id>", datasource="<value>", groups=[
{
"name": "<value>",
},
])
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
upload_id |
str |
✔️ |
Unique id that must be used for this instance of datasource groups upload |
datasource |
str |
✔️ |
datasource of the groups |
groups |
List[models.DatasourceGroupDefinition] |
✔️ |
batch of groups for the datasource |
is_first_page |
Optional[bool] |
➖ |
true if this is the first page of the upload. Defaults to false |
is_last_page |
Optional[bool] |
➖ |
true if this is the last page of the upload. Defaults to false |
force_restart_upload |
Optional[bool] |
➖ |
Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true |
disable_stale_data_deletion_check |
Optional[bool] |
➖ |
True if older group data needs to be force deleted after the upload completes. Defaults to older data being deleted only if the percentage of data being deleted is less than a reasonable threshold. This must only be set when isLastPage = true |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Add the memberships of a group in the datasource.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.index_membership(datasource="<value>", membership={
"group_name": "<value>",
})
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
The datasource for which the membership is added |
membership |
models.DatasourceMembershipDefinition |
✔️ |
describes the membership row of a group. Only one of memberUserId and memberGroupName can be specified. |
version |
Optional[int] |
➖ |
Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Replaces the memberships for a group in a datasource using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.bulk_index_memberships(upload_id="<id>", datasource="<value>", memberships=[
{},
])
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
upload_id |
str |
✔️ |
Unique id that must be used for this instance of datasource group memberships upload |
datasource |
str |
✔️ |
datasource of the memberships |
memberships |
List[models.DatasourceBulkMembershipDefinition] |
✔️ |
batch of memberships for the group |
is_first_page |
Optional[bool] |
➖ |
true if this is the first page of the upload. Defaults to false |
is_last_page |
Optional[bool] |
➖ |
true if this is the last page of the upload. Defaults to false |
force_restart_upload |
Optional[bool] |
➖ |
Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true |
group |
Optional[str] |
➖ |
group who's memberships are specified |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Schedules the immediate processing of all group memberships uploaded through the indexing API. By default the uploaded group memberships will be processed asynchronously but this API can be used to schedule processing of all memberships on demand.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.process_memberships()
# Use the SDK ...
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Delete the user from the datasource. Silently succeeds if user is not present.
Note: All memberships associated with the deleted user will also be deleted.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.delete_user(datasource="<value>", email="Ed.Johnston@gmail.com")
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
The datasource for which the user is removed |
email |
str |
✔️ |
The email of the user to be deleted |
version |
Optional[int] |
➖ |
Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Delete group from the datasource. Silently succeeds if group is not present.
Note: All memberships associated with the deleted group will also be deleted.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.delete_group(datasource="<value>", group_name="<value>")
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
The datasource for which the group is removed |
group_name |
str |
✔️ |
the name of the group to be deleted |
version |
Optional[int] |
➖ |
Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Delete membership to a group in the specified datasource. Silently succeeds if membership is not present.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.delete_membership(datasource="<value>", membership={
"group_name": "<value>",
})
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
The datasource for which the membership is removed |
membership |
models.DatasourceMembershipDefinition |
✔️ |
describes the membership row of a group. Only one of memberUserId and memberGroupName can be specified. |
version |
Optional[int] |
➖ |
Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Allow the datasource be visible to the specified beta users. The default behaviour is datasource being visible to all users if it is enabled and not visible to any user if it is not enabled.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.permissions.authorize_beta_users(datasource="<value>", emails=[
"Neil92@gmail.com",
"Alejandrin_Boyer4@hotmail.com",
"Shyanne_McLaughlin95@hotmail.com",
])
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
datasource |
str |
✔️ |
Datasource which needs to be made visible to users specified in the emails field. |
emails |
List[str] |
✔️ |
The emails of the beta users |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |