1. Packages
  2. GitLab
  3. API Docs
  4. getUsers
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

gitlab.getUsers

Explore with Pulumi AI

gitlab logo
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

    The gitlab.getUsers data source allows details of multiple users to be retrieved given some optional filter criteria.

    Some attributes might not be returned depending on if you’re an admin or not.

    Some available options require administrator privileges.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const example = gitlab.getUsers({
        sort: "desc",
        orderBy: "name",
        createdBefore: "2019-01-01",
    });
    const example-two = gitlab.getUsers({
        search: "username",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.get_users(sort="desc",
        order_by="name",
        created_before="2019-01-01")
    example_two = gitlab.get_users(search="username")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gitlab.GetUsers(ctx, &gitlab.GetUsersArgs{
    			Sort:          pulumi.StringRef("desc"),
    			OrderBy:       pulumi.StringRef("name"),
    			CreatedBefore: pulumi.StringRef("2019-01-01"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.GetUsers(ctx, &gitlab.GetUsersArgs{
    			Search: pulumi.StringRef("username"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        var example = GitLab.GetUsers.Invoke(new()
        {
            Sort = "desc",
            OrderBy = "name",
            CreatedBefore = "2019-01-01",
        });
    
        var example_two = GitLab.GetUsers.Invoke(new()
        {
            Search = "username",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.GitlabFunctions;
    import com.pulumi.gitlab.inputs.GetUsersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = GitlabFunctions.getUsers(GetUsersArgs.builder()
                .sort("desc")
                .orderBy("name")
                .createdBefore("2019-01-01")
                .build());
    
            final var example-two = GitlabFunctions.getUsers(GetUsersArgs.builder()
                .search("username")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: gitlab:getUsers
          Arguments:
            sort: desc
            orderBy: name
            createdBefore: 2019-01-01
      example-two:
        fn::invoke:
          Function: gitlab:getUsers
          Arguments:
            search: username
    

    Using getUsers

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
    function getUsersOutput(args: GetUsersOutputArgs, opts?: InvokeOptions): Output<GetUsersResult>
    def get_users(active: Optional[bool] = None,
                  blocked: Optional[bool] = None,
                  created_after: Optional[str] = None,
                  created_before: Optional[str] = None,
                  extern_provider: Optional[str] = None,
                  extern_uid: Optional[str] = None,
                  order_by: Optional[str] = None,
                  search: Optional[str] = None,
                  sort: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetUsersResult
    def get_users_output(active: Optional[pulumi.Input[bool]] = None,
                  blocked: Optional[pulumi.Input[bool]] = None,
                  created_after: Optional[pulumi.Input[str]] = None,
                  created_before: Optional[pulumi.Input[str]] = None,
                  extern_provider: Optional[pulumi.Input[str]] = None,
                  extern_uid: Optional[pulumi.Input[str]] = None,
                  order_by: Optional[pulumi.Input[str]] = None,
                  search: Optional[pulumi.Input[str]] = None,
                  sort: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetUsersResult]
    func GetUsers(ctx *Context, args *GetUsersArgs, opts ...InvokeOption) (*GetUsersResult, error)
    func GetUsersOutput(ctx *Context, args *GetUsersOutputArgs, opts ...InvokeOption) GetUsersResultOutput

    > Note: This function is named GetUsers in the Go SDK.

    public static class GetUsers 
    {
        public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? opts = null)
        public static Output<GetUsersResult> Invoke(GetUsersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gitlab:index/getUsers:getUsers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Active bool
    Filter users that are active.
    Blocked bool
    Filter users that are blocked.
    CreatedAfter string
    Search for users created after a specific date. (Requires administrator privileges)
    CreatedBefore string
    Search for users created before a specific date. (Requires administrator privileges)
    ExternProvider string
    Lookup users by external provider. (Requires administrator privileges)
    ExternUid string
    Lookup users by external UID. (Requires administrator privileges)
    OrderBy string
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    Search string
    Search users by username, name or email.
    Sort string
    Sort users' list in asc or desc order. (Requires administrator privileges)
    Active bool
    Filter users that are active.
    Blocked bool
    Filter users that are blocked.
    CreatedAfter string
    Search for users created after a specific date. (Requires administrator privileges)
    CreatedBefore string
    Search for users created before a specific date. (Requires administrator privileges)
    ExternProvider string
    Lookup users by external provider. (Requires administrator privileges)
    ExternUid string
    Lookup users by external UID. (Requires administrator privileges)
    OrderBy string
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    Search string
    Search users by username, name or email.
    Sort string
    Sort users' list in asc or desc order. (Requires administrator privileges)
    active Boolean
    Filter users that are active.
    blocked Boolean
    Filter users that are blocked.
    createdAfter String
    Search for users created after a specific date. (Requires administrator privileges)
    createdBefore String
    Search for users created before a specific date. (Requires administrator privileges)
    externProvider String
    Lookup users by external provider. (Requires administrator privileges)
    externUid String
    Lookup users by external UID. (Requires administrator privileges)
    orderBy String
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search String
    Search users by username, name or email.
    sort String
    Sort users' list in asc or desc order. (Requires administrator privileges)
    active boolean
    Filter users that are active.
    blocked boolean
    Filter users that are blocked.
    createdAfter string
    Search for users created after a specific date. (Requires administrator privileges)
    createdBefore string
    Search for users created before a specific date. (Requires administrator privileges)
    externProvider string
    Lookup users by external provider. (Requires administrator privileges)
    externUid string
    Lookup users by external UID. (Requires administrator privileges)
    orderBy string
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search string
    Search users by username, name or email.
    sort string
    Sort users' list in asc or desc order. (Requires administrator privileges)
    active bool
    Filter users that are active.
    blocked bool
    Filter users that are blocked.
    created_after str
    Search for users created after a specific date. (Requires administrator privileges)
    created_before str
    Search for users created before a specific date. (Requires administrator privileges)
    extern_provider str
    Lookup users by external provider. (Requires administrator privileges)
    extern_uid str
    Lookup users by external UID. (Requires administrator privileges)
    order_by str
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search str
    Search users by username, name or email.
    sort str
    Sort users' list in asc or desc order. (Requires administrator privileges)
    active Boolean
    Filter users that are active.
    blocked Boolean
    Filter users that are blocked.
    createdAfter String
    Search for users created after a specific date. (Requires administrator privileges)
    createdBefore String
    Search for users created before a specific date. (Requires administrator privileges)
    externProvider String
    Lookup users by external provider. (Requires administrator privileges)
    externUid String
    Lookup users by external UID. (Requires administrator privileges)
    orderBy String
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search String
    Search users by username, name or email.
    sort String
    Sort users' list in asc or desc order. (Requires administrator privileges)

    getUsers Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Users List<Pulumi.GitLab.Outputs.GetUsersUser>
    The list of users.
    Active bool
    Filter users that are active.
    Blocked bool
    Filter users that are blocked.
    CreatedAfter string
    Search for users created after a specific date. (Requires administrator privileges)
    CreatedBefore string
    Search for users created before a specific date. (Requires administrator privileges)
    ExternProvider string
    Lookup users by external provider. (Requires administrator privileges)
    ExternUid string
    Lookup users by external UID. (Requires administrator privileges)
    OrderBy string
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    Search string
    Search users by username, name or email.
    Sort string
    Sort users' list in asc or desc order. (Requires administrator privileges)
    Id string
    The provider-assigned unique ID for this managed resource.
    Users []GetUsersUser
    The list of users.
    Active bool
    Filter users that are active.
    Blocked bool
    Filter users that are blocked.
    CreatedAfter string
    Search for users created after a specific date. (Requires administrator privileges)
    CreatedBefore string
    Search for users created before a specific date. (Requires administrator privileges)
    ExternProvider string
    Lookup users by external provider. (Requires administrator privileges)
    ExternUid string
    Lookup users by external UID. (Requires administrator privileges)
    OrderBy string
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    Search string
    Search users by username, name or email.
    Sort string
    Sort users' list in asc or desc order. (Requires administrator privileges)
    id String
    The provider-assigned unique ID for this managed resource.
    users List<GetUsersUser>
    The list of users.
    active Boolean
    Filter users that are active.
    blocked Boolean
    Filter users that are blocked.
    createdAfter String
    Search for users created after a specific date. (Requires administrator privileges)
    createdBefore String
    Search for users created before a specific date. (Requires administrator privileges)
    externProvider String
    Lookup users by external provider. (Requires administrator privileges)
    externUid String
    Lookup users by external UID. (Requires administrator privileges)
    orderBy String
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search String
    Search users by username, name or email.
    sort String
    Sort users' list in asc or desc order. (Requires administrator privileges)
    id string
    The provider-assigned unique ID for this managed resource.
    users GetUsersUser[]
    The list of users.
    active boolean
    Filter users that are active.
    blocked boolean
    Filter users that are blocked.
    createdAfter string
    Search for users created after a specific date. (Requires administrator privileges)
    createdBefore string
    Search for users created before a specific date. (Requires administrator privileges)
    externProvider string
    Lookup users by external provider. (Requires administrator privileges)
    externUid string
    Lookup users by external UID. (Requires administrator privileges)
    orderBy string
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search string
    Search users by username, name or email.
    sort string
    Sort users' list in asc or desc order. (Requires administrator privileges)
    id str
    The provider-assigned unique ID for this managed resource.
    users Sequence[GetUsersUser]
    The list of users.
    active bool
    Filter users that are active.
    blocked bool
    Filter users that are blocked.
    created_after str
    Search for users created after a specific date. (Requires administrator privileges)
    created_before str
    Search for users created before a specific date. (Requires administrator privileges)
    extern_provider str
    Lookup users by external provider. (Requires administrator privileges)
    extern_uid str
    Lookup users by external UID. (Requires administrator privileges)
    order_by str
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search str
    Search users by username, name or email.
    sort str
    Sort users' list in asc or desc order. (Requires administrator privileges)
    id String
    The provider-assigned unique ID for this managed resource.
    users List<Property Map>
    The list of users.
    active Boolean
    Filter users that are active.
    blocked Boolean
    Filter users that are blocked.
    createdAfter String
    Search for users created after a specific date. (Requires administrator privileges)
    createdBefore String
    Search for users created before a specific date. (Requires administrator privileges)
    externProvider String
    Lookup users by external provider. (Requires administrator privileges)
    externUid String
    Lookup users by external UID. (Requires administrator privileges)
    orderBy String
    Order the users' list by id, name, username, created_at or updated_at. (Requires administrator privileges)
    search String
    Search users by username, name or email.
    sort String
    Sort users' list in asc or desc order. (Requires administrator privileges)

    Supporting Types

    GetUsersUser

    AvatarUrl string
    The avatar URL of the user.
    Bio string
    The bio of the user.
    CanCreateGroup bool
    Whether the user can create groups.
    CanCreateProject bool
    Whether the user can create projects.
    ColorSchemeId int
    User's color scheme ID.
    CreatedAt string
    Date the user was created at.
    CurrentSignInAt string
    Current user's sign-in date.
    Email string
    The public email address of the user. Note: before GitLab 14.8 the lookup was based on the users primary email address.
    ExternUid string
    The external UID of the user.
    External bool
    Whether the user is external.
    Id int
    The unique id assigned to the user by the gitlab server.
    IsAdmin bool
    Whether the user is an admin.
    IsBot bool
    Whether the user is a bot.
    LastSignInAt string
    Last user's sign-in date.
    Linkedin string
    LinkedIn profile of the user.
    Location string
    The location of the user.
    Name string
    The name of the user.
    NamespaceId int
    The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.
    Organization string
    The organization of the user.
    ProjectsLimit int
    Number of projects the user can create.
    Provider string
    The UID provider of the user.
    Skype string
    Skype username of the user.
    State string
    Whether the user is active or blocked.
    ThemeId int
    User's theme ID.
    Twitter string
    Twitter username of the user.
    TwoFactorEnabled bool
    Whether user's two-factor auth is enabled.
    Username string
    The username of the user.
    WebsiteUrl string
    User's website URL.
    AvatarUrl string
    The avatar URL of the user.
    Bio string
    The bio of the user.
    CanCreateGroup bool
    Whether the user can create groups.
    CanCreateProject bool
    Whether the user can create projects.
    ColorSchemeId int
    User's color scheme ID.
    CreatedAt string
    Date the user was created at.
    CurrentSignInAt string
    Current user's sign-in date.
    Email string
    The public email address of the user. Note: before GitLab 14.8 the lookup was based on the users primary email address.
    ExternUid string
    The external UID of the user.
    External bool
    Whether the user is external.
    Id int
    The unique id assigned to the user by the gitlab server.
    IsAdmin bool
    Whether the user is an admin.
    IsBot bool
    Whether the user is a bot.
    LastSignInAt string
    Last user's sign-in date.
    Linkedin string
    LinkedIn profile of the user.
    Location string
    The location of the user.
    Name string
    The name of the user.
    NamespaceId int
    The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.
    Organization string
    The organization of the user.
    ProjectsLimit int
    Number of projects the user can create.
    Provider string
    The UID provider of the user.
    Skype string
    Skype username of the user.
    State string
    Whether the user is active or blocked.
    ThemeId int
    User's theme ID.
    Twitter string
    Twitter username of the user.
    TwoFactorEnabled bool
    Whether user's two-factor auth is enabled.
    Username string
    The username of the user.
    WebsiteUrl string
    User's website URL.
    avatarUrl String
    The avatar URL of the user.
    bio String
    The bio of the user.
    canCreateGroup Boolean
    Whether the user can create groups.
    canCreateProject Boolean
    Whether the user can create projects.
    colorSchemeId Integer
    User's color scheme ID.
    createdAt String
    Date the user was created at.
    currentSignInAt String
    Current user's sign-in date.
    email String
    The public email address of the user. Note: before GitLab 14.8 the lookup was based on the users primary email address.
    externUid String
    The external UID of the user.
    external Boolean
    Whether the user is external.
    id Integer
    The unique id assigned to the user by the gitlab server.
    isAdmin Boolean
    Whether the user is an admin.
    isBot Boolean
    Whether the user is a bot.
    lastSignInAt String
    Last user's sign-in date.
    linkedin String
    LinkedIn profile of the user.
    location String
    The location of the user.
    name String
    The name of the user.
    namespaceId Integer
    The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.
    organization String
    The organization of the user.
    projectsLimit Integer
    Number of projects the user can create.
    provider String
    The UID provider of the user.
    skype String
    Skype username of the user.
    state String
    Whether the user is active or blocked.
    themeId Integer
    User's theme ID.
    twitter String
    Twitter username of the user.
    twoFactorEnabled Boolean
    Whether user's two-factor auth is enabled.
    username String
    The username of the user.
    websiteUrl String
    User's website URL.
    avatarUrl string
    The avatar URL of the user.
    bio string
    The bio of the user.
    canCreateGroup boolean
    Whether the user can create groups.
    canCreateProject boolean
    Whether the user can create projects.
    colorSchemeId number
    User's color scheme ID.
    createdAt string
    Date the user was created at.
    currentSignInAt string
    Current user's sign-in date.
    email string
    The public email address of the user. Note: before GitLab 14.8 the lookup was based on the users primary email address.
    externUid string
    The external UID of the user.
    external boolean
    Whether the user is external.
    id number
    The unique id assigned to the user by the gitlab server.
    isAdmin boolean
    Whether the user is an admin.
    isBot boolean
    Whether the user is a bot.
    lastSignInAt string
    Last user's sign-in date.
    linkedin string
    LinkedIn profile of the user.
    location string
    The location of the user.
    name string
    The name of the user.
    namespaceId number
    The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.
    organization string
    The organization of the user.
    projectsLimit number
    Number of projects the user can create.
    provider string
    The UID provider of the user.
    skype string
    Skype username of the user.
    state string
    Whether the user is active or blocked.
    themeId number
    User's theme ID.
    twitter string
    Twitter username of the user.
    twoFactorEnabled boolean
    Whether user's two-factor auth is enabled.
    username string
    The username of the user.
    websiteUrl string
    User's website URL.
    avatar_url str
    The avatar URL of the user.
    bio str
    The bio of the user.
    can_create_group bool
    Whether the user can create groups.
    can_create_project bool
    Whether the user can create projects.
    color_scheme_id int
    User's color scheme ID.
    created_at str
    Date the user was created at.
    current_sign_in_at str
    Current user's sign-in date.
    email str
    The public email address of the user. Note: before GitLab 14.8 the lookup was based on the users primary email address.
    extern_uid str
    The external UID of the user.
    external bool
    Whether the user is external.
    id int
    The unique id assigned to the user by the gitlab server.
    is_admin bool
    Whether the user is an admin.
    is_bot bool
    Whether the user is a bot.
    last_sign_in_at str
    Last user's sign-in date.
    linkedin str
    LinkedIn profile of the user.
    location str
    The location of the user.
    name str
    The name of the user.
    namespace_id int
    The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.
    organization str
    The organization of the user.
    projects_limit int
    Number of projects the user can create.
    provider str
    The UID provider of the user.
    skype str
    Skype username of the user.
    state str
    Whether the user is active or blocked.
    theme_id int
    User's theme ID.
    twitter str
    Twitter username of the user.
    two_factor_enabled bool
    Whether user's two-factor auth is enabled.
    username str
    The username of the user.
    website_url str
    User's website URL.
    avatarUrl String
    The avatar URL of the user.
    bio String
    The bio of the user.
    canCreateGroup Boolean
    Whether the user can create groups.
    canCreateProject Boolean
    Whether the user can create projects.
    colorSchemeId Number
    User's color scheme ID.
    createdAt String
    Date the user was created at.
    currentSignInAt String
    Current user's sign-in date.
    email String
    The public email address of the user. Note: before GitLab 14.8 the lookup was based on the users primary email address.
    externUid String
    The external UID of the user.
    external Boolean
    Whether the user is external.
    id Number
    The unique id assigned to the user by the gitlab server.
    isAdmin Boolean
    Whether the user is an admin.
    isBot Boolean
    Whether the user is a bot.
    lastSignInAt String
    Last user's sign-in date.
    linkedin String
    LinkedIn profile of the user.
    location String
    The location of the user.
    name String
    The name of the user.
    namespaceId Number
    The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.
    organization String
    The organization of the user.
    projectsLimit Number
    Number of projects the user can create.
    provider String
    The UID provider of the user.
    skype String
    Skype username of the user.
    state String
    Whether the user is active or blocked.
    themeId Number
    User's theme ID.
    twitter String
    Twitter username of the user.
    twoFactorEnabled Boolean
    Whether user's two-factor auth is enabled.
    username String
    The username of the user.
    websiteUrl String
    User's website URL.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi