Gleanex.Admin.Datasources (Gleanex v0.1.0)

Copy Markdown View Source

Provides API endpoints related to datasources

Summary

Functions

get_datasource_credential_status(datasourceInstanceId, opts \\ [])

@spec get_datasource_credential_status(
  datasourceInstanceId :: String.t(),
  opts :: keyword()
) ::
  {:ok, Gleanex.Admin.DatasourceCredentialStatusResponse.t()}
  | {:error, Gleanex.Error.t()}

Get datasource instance credential status

Returns the current credential status for a datasource instance. Access is limited to callers with the ADMIN scope; the handler enforces this check.

get_datasource_instance_configuration(datasourceId, instanceId, opts \\ [])

@spec get_datasource_instance_configuration(
  datasourceId :: String.t(),
  instanceId :: String.t(),
  opts :: keyword()
) ::
  {:ok, Gleanex.Admin.DatasourceConfigurationResponse.t()}
  | {:error, Gleanex.Error.t()}

Get datasource instance configuration

Gets the greenlisted configuration values for a datasource instance. Returns only configuration keys that are exposed via the public API greenlist.

rotate_datasource_credentials(datasourceInstanceId, body, opts \\ [])

@spec rotate_datasource_credentials(
  datasourceInstanceId :: String.t(),
  body :: Gleanex.Admin.RotateDatasourceCredentialsRequest.t(),
  opts :: keyword()
) ::
  {:ok, Gleanex.Admin.DatasourceCredentialStatusResponse.t()}
  | {:error, Gleanex.Error.t()}

Rotate datasource instance credentials

Rotates the credentials that a datasource instance uses to connect to its upstream system. Replaces the active credential material with the supplied values and returns the credential status after rotation. Access is limited to callers with the ADMIN scope; the handler enforces this check. Only keys recognized as credential material for the datasource type may be set in credentials.values (e.g. clientSecret, apiToken, privateKey, depending on the configured auth method). Unrecognized keys, or keys that correspond to non-credential configuration, cause a 400; other instance configuration must be updated via PATCH /configure/datasources/{datasourceId}/instances/{instanceId}.

Request Body

Content Types: application/json

update_datasource_instance_configuration(datasourceId, instanceId, body, opts \\ [])

@spec update_datasource_instance_configuration(
  datasourceId :: String.t(),
  instanceId :: String.t(),
  body :: Gleanex.Admin.UpdateDatasourceConfigurationRequest.t(),
  opts :: keyword()
) ::
  {:ok, Gleanex.Admin.DatasourceConfigurationResponse.t()}
  | {:error, Gleanex.Error.t()}

Update datasource instance configuration

Updates the greenlisted configuration values for a datasource instance. Only configuration keys that are exposed via the public API greenlist may be set. Returns the full greenlisted configuration after the update is applied.

Request Body

Content Types: application/json