GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi
gitlab.getUsers
Explore with Pulumi AI
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.
- Created
After string - Search for users created after a specific date. (Requires administrator privileges)
- Created
Before string - Search for users created before a specific date. (Requires administrator privileges)
- Extern
Provider string - Lookup users by external provider. (Requires administrator privileges)
- Extern
Uid string - Lookup users by external UID. (Requires administrator privileges)
- Order
By string - Order the users' list by
id
,name
,username
,created_at
orupdated_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 string - Search for users created after a specific date. (Requires administrator privileges)
- Created
Before string - Search for users created before a specific date. (Requires administrator privileges)
- Extern
Provider string - Lookup users by external provider. (Requires administrator privileges)
- Extern
Uid string - Lookup users by external UID. (Requires administrator privileges)
- Order
By string - Order the users' list by
id
,name
,username
,created_at
orupdated_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.
- created
After String - Search for users created after a specific date. (Requires administrator privileges)
- created
Before String - Search for users created before a specific date. (Requires administrator privileges)
- extern
Provider String - Lookup users by external provider. (Requires administrator privileges)
- extern
Uid String - Lookup users by external UID. (Requires administrator privileges)
- order
By String - Order the users' list by
id
,name
,username
,created_at
orupdated_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.
- created
After string - Search for users created after a specific date. (Requires administrator privileges)
- created
Before string - Search for users created before a specific date. (Requires administrator privileges)
- extern
Provider string - Lookup users by external provider. (Requires administrator privileges)
- extern
Uid string - Lookup users by external UID. (Requires administrator privileges)
- order
By string - Order the users' list by
id
,name
,username
,created_at
orupdated_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
orupdated_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.
- created
After String - Search for users created after a specific date. (Requires administrator privileges)
- created
Before String - Search for users created before a specific date. (Requires administrator privileges)
- extern
Provider String - Lookup users by external provider. (Requires administrator privileges)
- extern
Uid String - Lookup users by external UID. (Requires administrator privileges)
- order
By String - Order the users' list by
id
,name
,username
,created_at
orupdated_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.
Git Lab. Outputs. Get Users User> - The list of users.
- Active bool
- Filter users that are active.
- Blocked bool
- Filter users that are blocked.
- Created
After string - Search for users created after a specific date. (Requires administrator privileges)
- Created
Before string - Search for users created before a specific date. (Requires administrator privileges)
- Extern
Provider string - Lookup users by external provider. (Requires administrator privileges)
- Extern
Uid string - Lookup users by external UID. (Requires administrator privileges)
- Order
By string - Order the users' list by
id
,name
,username
,created_at
orupdated_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
[]Get
Users User - The list of users.
- Active bool
- Filter users that are active.
- Blocked bool
- Filter users that are blocked.
- Created
After string - Search for users created after a specific date. (Requires administrator privileges)
- Created
Before string - Search for users created before a specific date. (Requires administrator privileges)
- Extern
Provider string - Lookup users by external provider. (Requires administrator privileges)
- Extern
Uid string - Lookup users by external UID. (Requires administrator privileges)
- Order
By string - Order the users' list by
id
,name
,username
,created_at
orupdated_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<Get
Users User> - The list of users.
- active Boolean
- Filter users that are active.
- blocked Boolean
- Filter users that are blocked.
- created
After String - Search for users created after a specific date. (Requires administrator privileges)
- created
Before String - Search for users created before a specific date. (Requires administrator privileges)
- extern
Provider String - Lookup users by external provider. (Requires administrator privileges)
- extern
Uid String - Lookup users by external UID. (Requires administrator privileges)
- order
By String - Order the users' list by
id
,name
,username
,created_at
orupdated_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
Get
Users User[] - The list of users.
- active boolean
- Filter users that are active.
- blocked boolean
- Filter users that are blocked.
- created
After string - Search for users created after a specific date. (Requires administrator privileges)
- created
Before string - Search for users created before a specific date. (Requires administrator privileges)
- extern
Provider string - Lookup users by external provider. (Requires administrator privileges)
- extern
Uid string - Lookup users by external UID. (Requires administrator privileges)
- order
By string - Order the users' list by
id
,name
,username
,created_at
orupdated_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[Get
Users User] - 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
orupdated_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.
- created
After String - Search for users created after a specific date. (Requires administrator privileges)
- created
Before String - Search for users created before a specific date. (Requires administrator privileges)
- extern
Provider String - Lookup users by external provider. (Requires administrator privileges)
- extern
Uid String - Lookup users by external UID. (Requires administrator privileges)
- order
By String - Order the users' list by
id
,name
,username
,created_at
orupdated_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
- Avatar
Url string - The avatar URL of the user.
- Bio string
- The bio of the user.
- Can
Create boolGroup - Whether the user can create groups.
- Can
Create boolProject - Whether the user can create projects.
- Color
Scheme intId - User's color scheme ID.
- Created
At string - Date the user was created at.
- Current
Sign stringIn At - 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.
- Extern
Uid 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.
- Is
Admin bool - Whether the user is an admin.
- Is
Bot bool - Whether the user is a bot.
- Last
Sign stringIn At - 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.
- Namespace
Id 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.
- Projects
Limit 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.
- Theme
Id int - User's theme ID.
- Twitter string
- Twitter username of the user.
- Two
Factor boolEnabled - Whether user's two-factor auth is enabled.
- Username string
- The username of the user.
- Website
Url string - User's website URL.
- Avatar
Url string - The avatar URL of the user.
- Bio string
- The bio of the user.
- Can
Create boolGroup - Whether the user can create groups.
- Can
Create boolProject - Whether the user can create projects.
- Color
Scheme intId - User's color scheme ID.
- Created
At string - Date the user was created at.
- Current
Sign stringIn At - 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.
- Extern
Uid 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.
- Is
Admin bool - Whether the user is an admin.
- Is
Bot bool - Whether the user is a bot.
- Last
Sign stringIn At - 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.
- Namespace
Id 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.
- Projects
Limit 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.
- Theme
Id int - User's theme ID.
- Twitter string
- Twitter username of the user.
- Two
Factor boolEnabled - Whether user's two-factor auth is enabled.
- Username string
- The username of the user.
- Website
Url string - User's website URL.
- avatar
Url String - The avatar URL of the user.
- bio String
- The bio of the user.
- can
Create BooleanGroup - Whether the user can create groups.
- can
Create BooleanProject - Whether the user can create projects.
- color
Scheme IntegerId - User's color scheme ID.
- created
At String - Date the user was created at.
- current
Sign StringIn At - 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.
- extern
Uid 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.
- is
Admin Boolean - Whether the user is an admin.
- is
Bot Boolean - Whether the user is a bot.
- last
Sign StringIn At - 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.
- namespace
Id 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.
- projects
Limit 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.
- theme
Id Integer - User's theme ID.
- twitter String
- Twitter username of the user.
- two
Factor BooleanEnabled - Whether user's two-factor auth is enabled.
- username String
- The username of the user.
- website
Url String - User's website URL.
- avatar
Url string - The avatar URL of the user.
- bio string
- The bio of the user.
- can
Create booleanGroup - Whether the user can create groups.
- can
Create booleanProject - Whether the user can create projects.
- color
Scheme numberId - User's color scheme ID.
- created
At string - Date the user was created at.
- current
Sign stringIn At - 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.
- extern
Uid 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.
- is
Admin boolean - Whether the user is an admin.
- is
Bot boolean - Whether the user is a bot.
- last
Sign stringIn At - 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.
- namespace
Id 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.
- projects
Limit 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.
- theme
Id number - User's theme ID.
- twitter string
- Twitter username of the user.
- two
Factor booleanEnabled - Whether user's two-factor auth is enabled.
- username string
- The username of the user.
- website
Url string - User's website URL.
- avatar_
url str - The avatar URL of the user.
- bio str
- The bio of the user.
- can_
create_ boolgroup - Whether the user can create groups.
- can_
create_ boolproject - Whether the user can create projects.
- color_
scheme_ intid - User's color scheme ID.
- created_
at str - Date the user was created at.
- current_
sign_ strin_ at - 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_ strin_ at - 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_ boolenabled - Whether user's two-factor auth is enabled.
- username str
- The username of the user.
- website_
url str - User's website URL.
- avatar
Url String - The avatar URL of the user.
- bio String
- The bio of the user.
- can
Create BooleanGroup - Whether the user can create groups.
- can
Create BooleanProject - Whether the user can create projects.
- color
Scheme NumberId - User's color scheme ID.
- created
At String - Date the user was created at.
- current
Sign StringIn At - 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.
- extern
Uid 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.
- is
Admin Boolean - Whether the user is an admin.
- is
Bot Boolean - Whether the user is a bot.
- last
Sign StringIn At - 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.
- namespace
Id 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.
- projects
Limit 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.
- theme
Id Number - User's theme ID.
- twitter String
- Twitter username of the user.
- two
Factor BooleanEnabled - Whether user's two-factor auth is enabled.
- username String
- The username of the user.
- website
Url 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.