Skip to content

Latest commit

 

History

History
590 lines (430 loc) · 26.2 KB

File metadata and controls

590 lines (430 loc) · 26.2 KB

Indexing.People

Overview

Available Operations

debug

Gives various information that would help in debugging related to a particular user. Currently in beta, might undergo breaking changes without prior notice.

Tip: Refer to the Troubleshooting tutorial for more information.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.DebugUserRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceUserResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        PostApiIndexV1DebugDatasourceUserResponse res = sdk.indexing().people().debug()
                .datasource("<value>")
                .debugUserRequest(DebugUserRequest.builder()
                    .email("u1@foo.com")
                    .build())
                .call();

        if (res.debugUserResponse().isPresent()) {
            System.out.println(res.debugUserResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
datasource String ✔️ The datasource to which the user belongs
debugUserRequest DebugUserRequest ✔️ N/A

Response

PostApiIndexV1DebugDatasourceUserResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

count

Fetches user count for the specified custom datasource.

Tip: Use /debug/{datasource}/status for richer information.

⚠️ DEPRECATED: Deprecated on 2026-02-03, removal scheduled for 2026-10-15: Endpoint is deprecated.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.GetUserCountRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetusercountResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        GetUserCountRequest req = GetUserCountRequest.builder()
                .datasource("<value>")
                .build();

        PostApiIndexV1GetusercountResponse res = sdk.indexing().people().count()
                .request(req)
                .call();

        if (res.getUserCountResponse().isPresent()) {
            System.out.println(res.getUserCountResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
request GetUserCountRequest ✔️ The request object to use for the request.

Response

PostApiIndexV1GetusercountResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

index

Adds an employee or replaces the existing information about an employee.

Example Usage

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.operations.PostApiIndexV1IndexemployeeResponse;
import java.lang.Exception;
import java.util.List;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        IndexEmployeeRequest req = IndexEmployeeRequest.builder()
                .employee(EmployeeInfoDefinition.builder()
                    .email("Jerrold_Hermann@hotmail.com")
                    .department("<value>")
                    .datasourceProfiles(List.of(
                        DatasourceProfile.builder()
                            .datasource("github")
                            .handle("<value>")
                            .build()))
                    .build())
                .build();

        PostApiIndexV1IndexemployeeResponse res = sdk.indexing().people().index()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request IndexEmployeeRequest ✔️ The request object to use for the request.

Response

PostApiIndexV1IndexemployeeResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

bulkIndex

Replaces all the currently indexed employees using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.

⚠️ DEPRECATED: Deprecated on 2026-02-03, removal scheduled for 2026-10-15: Endpoint is deprecated.

Example Usage

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.operations.PostApiIndexV1BulkindexemployeesResponse;
import java.lang.Exception;
import java.util.List;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        BulkIndexEmployeesRequest req = BulkIndexEmployeesRequest.builder()
                .uploadId("<id>")
                .employees(List.of(
                    EmployeeInfoDefinition.builder()
                        .email("Robin.Stoltenberg@yahoo.com")
                        .department("<value>")
                        .datasourceProfiles(List.of(
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build()))
                        .build(),
                    EmployeeInfoDefinition.builder()
                        .email("Robin.Stoltenberg@yahoo.com")
                        .department("<value>")
                        .datasourceProfiles(List.of(
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build()))
                        .build(),
                    EmployeeInfoDefinition.builder()
                        .email("Robin.Stoltenberg@yahoo.com")
                        .department("<value>")
                        .datasourceProfiles(List.of(
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build()))
                        .build()))
                .build();

        PostApiIndexV1BulkindexemployeesResponse res = sdk.indexing().people().bulkIndex()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request BulkIndexEmployeesRequest ✔️ The request object to use for the request.

Response

PostApiIndexV1BulkindexemployeesResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

processAllEmployeesAndTeams

Schedules the immediate processing of employees and teams uploaded through the indexing API. By default all uploaded people data will be processed asynchronously but this API can be used to schedule its processing on demand.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessallemployeesandteamsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        PostApiIndexV1ProcessallemployeesandteamsResponse res = sdk.indexing().people().processAllEmployeesAndTeams()
                .call();

        // handle response
    }
}

Response

PostApiIndexV1ProcessallemployeesandteamsResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

delete

Delete an employee. Silently succeeds if employee is not present.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.DeleteEmployeeRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeleteemployeeResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        DeleteEmployeeRequest req = DeleteEmployeeRequest.builder()
                .employeeEmail("<value>")
                .build();

        PostApiIndexV1DeleteemployeeResponse res = sdk.indexing().people().delete()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request DeleteEmployeeRequest ✔️ The request object to use for the request.

Response

PostApiIndexV1DeleteemployeeResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

indexTeam

Adds a team or updates information about a team

Example Usage

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.operations.PostApiIndexV1IndexteamResponse;
import java.lang.Exception;
import java.util.List;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        IndexTeamRequest req = IndexTeamRequest.builder()
                .team(TeamInfoDefinition.builder()
                    .id("<id>")
                    .name("<value>")
                    .members(List.of(
                        TeamMember.builder()
                            .email("Nasir.Hilll73@hotmail.com")
                            .build()))
                    .datasourceProfiles(List.of(
                        DatasourceProfile.builder()
                            .datasource("github")
                            .handle("<value>")
                            .build(),
                        DatasourceProfile.builder()
                            .datasource("github")
                            .handle("<value>")
                            .build(),
                        DatasourceProfile.builder()
                            .datasource("github")
                            .handle("<value>")
                            .build()))
                    .build())
                .build();

        PostApiIndexV1IndexteamResponse res = sdk.indexing().people().indexTeam()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request IndexTeamRequest ✔️ The request object to use for the request.

Response

PostApiIndexV1IndexteamResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

deleteTeam

Delete a team based on provided id.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.DeleteTeamRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeleteteamResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        DeleteTeamRequest req = DeleteTeamRequest.builder()
                .id("<id>")
                .build();

        PostApiIndexV1DeleteteamResponse res = sdk.indexing().people().deleteTeam()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request DeleteTeamRequest ✔️ The request object to use for the request.

Response

PostApiIndexV1DeleteteamResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

bulkIndexTeams

Replaces all the currently indexed teams using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.

Example Usage

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.operations.PostApiIndexV1BulkindexteamsResponse;
import java.lang.Exception;
import java.util.List;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        BulkIndexTeamsRequest req = BulkIndexTeamsRequest.builder()
                .uploadId("<id>")
                .teams(List.of(
                    TeamInfoDefinition.builder()
                        .id("<id>")
                        .name("<value>")
                        .members(List.of())
                        .datasourceProfiles(List.of(
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build(),
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build()))
                        .build(),
                    TeamInfoDefinition.builder()
                        .id("<id>")
                        .name("<value>")
                        .members(List.of())
                        .datasourceProfiles(List.of(
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build(),
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build()))
                        .build(),
                    TeamInfoDefinition.builder()
                        .id("<id>")
                        .name("<value>")
                        .members(List.of())
                        .datasourceProfiles(List.of(
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build(),
                            DatasourceProfile.builder()
                                .datasource("github")
                                .handle("<value>")
                                .build()))
                        .build()))
                .build();

        PostApiIndexV1BulkindexteamsResponse res = sdk.indexing().people().bulkIndexTeams()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request BulkIndexTeamsRequest ✔️ The request object to use for the request.

Response

PostApiIndexV1BulkindexteamsResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*