Manage datasources.
- getDatasourceInstanceConfiguration - Get datasource instance configuration
- updateDatasourceInstanceConfiguration - Update datasource instance configuration
- getDatasourceCredentialStatus - Get datasource instance credential status
- rotateDatasourceCredentials - Rotate datasource instance credentials
Gets the greenlisted configuration values for a datasource instance. Returns only configuration keys that are exposed via the public API greenlist.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.ErrorResponse;
import com.glean.api_client.glean_api_client.models.operations.GetDatasourceInstanceConfigurationResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
GetDatasourceInstanceConfigurationResponse res = sdk.datasources().getDatasourceInstanceConfiguration()
.datasourceId("o365sharepoint")
.instanceId("o365sharepoint_abc123")
.call();
if (res.datasourceConfigurationResponse().isPresent()) {
System.out.println(res.datasourceConfigurationResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
datasourceId |
String | ✔️ | The datasource type identifier (e.g. o365sharepoint) | o365sharepoint |
instanceId |
String | ✔️ | The datasource instance identifier | o365sharepoint_abc123 |
GetDatasourceInstanceConfigurationResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 400, 403, 404 | application/json |
| models/errors/APIException | 4XX, 5XX | */* |
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.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.DatasourceInstanceConfiguration;
import com.glean.api_client.glean_api_client.models.components.UpdateDatasourceConfigurationRequest;
import com.glean.api_client.glean_api_client.models.errors.ErrorResponse;
import com.glean.api_client.glean_api_client.models.operations.UpdateDatasourceInstanceConfigurationResponse;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
UpdateDatasourceInstanceConfigurationResponse res = sdk.datasources().updateDatasourceInstanceConfiguration()
.datasourceId("o365sharepoint")
.instanceId("o365sharepoint_abc123")
.updateDatasourceConfigurationRequest(UpdateDatasourceConfigurationRequest.builder()
.configuration(DatasourceInstanceConfiguration.builder()
.values(Map.ofEntries(
))
.build())
.build())
.call();
if (res.datasourceConfigurationResponse().isPresent()) {
System.out.println(res.datasourceConfigurationResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
datasourceId |
String | ✔️ | The datasource type identifier (e.g. o365sharepoint) | o365sharepoint |
instanceId |
String | ✔️ | The datasource instance identifier | o365sharepoint_abc123 |
updateDatasourceConfigurationRequest |
UpdateDatasourceConfigurationRequest | ✔️ | N/A |
UpdateDatasourceInstanceConfigurationResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 400, 403, 404 | application/json |
| models/errors/APIException | 4XX, 5XX | */* |
Returns the current credential status for a datasource instance. Access is limited to callers with the ADMIN scope; the handler enforces this check.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.ErrorResponse;
import com.glean.api_client.glean_api_client.models.operations.GetDatasourceCredentialStatusResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
GetDatasourceCredentialStatusResponse res = sdk.datasources().getDatasourceCredentialStatus()
.datasourceInstanceId("o365sharepoint_abc123")
.call();
if (res.datasourceCredentialStatusResponse().isPresent()) {
System.out.println(res.datasourceCredentialStatusResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
datasourceInstanceId |
String | ✔️ | The full datasource instance identifier (e.g. o365sharepoint_abc123) | o365sharepoint_abc123 |
GetDatasourceCredentialStatusResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 400, 403, 404 | application/json |
| models/errors/APIException | 4XX, 5XX | */* |
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}.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.errors.ErrorResponse;
import com.glean.api_client.glean_api_client.models.operations.RotateDatasourceCredentialsResponse;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
RotateDatasourceCredentialsResponse res = sdk.datasources().rotateDatasourceCredentials()
.datasourceInstanceId("o365sharepoint_abc123")
.rotateDatasourceCredentialsRequest(RotateDatasourceCredentialsRequest.builder()
.credentials(DatasourceInstanceConfiguration.builder()
.values(Map.ofEntries(
Map.entry("key", ConfigurationValue.builder()
.build())))
.build())
.build())
.call();
if (res.datasourceCredentialStatusResponse().isPresent()) {
System.out.println(res.datasourceCredentialStatusResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
datasourceInstanceId |
String | ✔️ | The full datasource instance identifier (e.g. o365sharepoint_abc123) | o365sharepoint_abc123 |
rotateDatasourceCredentialsRequest |
RotateDatasourceCredentialsRequest | ✔️ | N/A |
RotateDatasourceCredentialsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 400, 403, 404 | application/json |
| models/errors/APIException | 4XX, 5XX | */* |