POST
/
api
/
index
/
v1
/
adddatasource
from glean.api_client import Glean, models
import os


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

    glean.indexing.datasources.add(name="<value>", datasource_category=models.DatasourceCategory.UNCATEGORIZED, url_regex="https://example-company.datasource.com/.*", quicklinks=[
        {
            "icon_config": {
                "color": "#343CED",
                "key": "person_icon",
                "icon_type": models.IconType.GLYPH,
                "name": "user",
            },
        },
    ], trust_url_regex_for_view_activity=True, strip_fragment_in_canonical_url=True, is_entity_datasource=False, is_test_datasource=False)

    # 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

Structure describing config properties of a custom datasource Structure describing shared config properties of a datasource with no multi-instance support.

Response

200

OK