get Projects
The gitlab.getProjects
data source allows details of multiple projects to be retrieved. Optionally filtered by the set attributes.
This data source supports all available filters exposed by the xanzy/go-gitlab package, which might not expose all available filters exposed by the Gitlab APIs. The owner sub-attributes are only populated if the Gitlab token used has an administrator scope. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const mygroup = gitlab.getGroup({
fullPath: "mygroup",
});
const groupProjects = mygroup.then(mygroup => gitlab.getProjects({
groupId: mygroup.id,
orderBy: "name",
includeSubgroups: true,
withShared: false,
}));
const projects = gitlab.getProjects({
search: "postgresql",
visibility: "private",
});
import pulumi
import pulumi_gitlab as gitlab
mygroup = gitlab.get_group(full_path="mygroup")
group_projects = gitlab.get_projects(group_id=mygroup.id,
order_by="name",
include_subgroups=True,
with_shared=False)
projects = gitlab.get_projects(search="postgresql",
visibility="private")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var mygroup = GitLab.GetGroup.Invoke(new()
{
FullPath = "mygroup",
});
var groupProjects = GitLab.GetProjects.Invoke(new()
{
GroupId = mygroup.Apply(getGroupResult => getGroupResult.Id),
OrderBy = "name",
IncludeSubgroups = true,
WithShared = false,
});
var projects = GitLab.GetProjects.Invoke(new()
{
Search = "postgresql",
Visibility = "private",
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
mygroup, err := gitlab.LookupGroup(ctx, &gitlab.LookupGroupArgs{
FullPath: pulumi.StringRef("mygroup"),
}, nil)
if err != nil {
return err
}
_, err = gitlab.GetProjects(ctx, &gitlab.GetProjectsArgs{
GroupId: pulumi.IntRef(mygroup.Id),
OrderBy: pulumi.StringRef("name"),
IncludeSubgroups: pulumi.BoolRef(true),
WithShared: pulumi.BoolRef(false),
}, nil)
if err != nil {
return err
}
_, err = gitlab.GetProjects(ctx, &gitlab.GetProjectsArgs{
Search: pulumi.StringRef("postgresql"),
Visibility: pulumi.StringRef("private"),
}, nil)
if err != nil {
return err
}
return nil
})
}
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.GetGroupArgs;
import com.pulumi.gitlab.inputs.GetProjectsArgs;
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 mygroup = GitlabFunctions.getGroup(GetGroupArgs.builder()
.fullPath("mygroup")
.build());
final var groupProjects = GitlabFunctions.getProjects(GetProjectsArgs.builder()
.groupId(mygroup.applyValue(getGroupResult -> getGroupResult.id()))
.orderBy("name")
.includeSubgroups(true)
.withShared(false)
.build());
final var projects = GitlabFunctions.getProjects(GetProjectsArgs.builder()
.search("postgresql")
.visibility("private")
.build());
}
}
variables:
mygroup:
fn::invoke:
Function: gitlab:getGroup
Arguments:
fullPath: mygroup
groupProjects:
fn::invoke:
Function: gitlab:getProjects
Arguments:
groupId: ${mygroup.id}
orderBy: name
includeSubgroups: true
withShared: false
projects:
fn::invoke:
Function: gitlab:getProjects
Arguments:
search: postgresql
visibility: private
Return
A collection of values returned by getProjects.
Parameters
A collection of arguments for invoking getProjects.
Return
A collection of values returned by getProjects.
Parameters
Include projects in subgroups of this group. Default is false
. Needs group_id
.
The maximum number of project results pages that may be queried. Prevents overloading your Gitlab instance in case of a misconfiguration.
Limit by projects that the current user is a member of.
Limit to projects where current user has at least this access level, refer to the official documentation for values. Cannot be used with group_id
.
Return projects ordered ordered by: id
, name
, path
, created_at
, updated_at
, last_activity_at
, similarity
, repository_size
, storage_size
, packages_size
, wiki_size
. Some values or only available in certain circumstances. See upstream docs for details.
Limit by projects owned by the current user.
The first page to begin the query on.
The number of results to return per page.
Return list of authorized projects matching the search criteria.
Return only the ID, URL, name, and path of each project.
Return projects sorted in asc
or desc
order. Default is desc
.
Limit by projects starred by the current user.
Limit by projects that have all of the given topics.
Include custom attributes in response (admins only).
Limit by projects with issues feature enabled. Default is false
.
Limit by projects with merge requests feature enabled. Default is false
.
Limit by projects which use the given programming language. Cannot be used with group_id
.
Include projects shared to this group. Default is true
. Needs group_id
.
See also
Return
A collection of values returned by getProjects.
Parameters
Builder for com.pulumi.gitlab.kotlin.inputs.GetProjectsPlainArgs.