from glean import Glean, models
import os


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

    g_client.indexing.documents.add_or_update(document=models.DocumentDefinition(
        datasource="<value>",
    ))

    # Use the SDK ...

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Describes the request body of the /indexdocument API call

document
object
required

Document being added/updated

version
integer

Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done.

Response

200

OK