getProjects

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

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());
}
}

Return

A collection of values returned by getProjects.

Parameters

argument

A collection of arguments for invoking getProjects.


suspend fun getProjects(archived: Boolean? = null, groupId: Int? = null, includeSubgroups: Boolean? = null, maxQueryablePages: Int? = null, membership: Boolean? = null, minAccessLevel: Int? = null, orderBy: String? = null, owned: Boolean? = null, page: Int? = null, perPage: Int? = null, search: String? = null, simple: Boolean? = null, sort: String? = null, starred: Boolean? = null, statistics: Boolean? = null, visibility: String? = null, withCustomAttributes: Boolean? = null, withIssuesEnabled: Boolean? = null, withMergeRequestsEnabled: Boolean? = null, withProgrammingLanguage: String? = null, withShared: Boolean? = null): GetProjectsResult

Return

A collection of values returned by getProjects.

Parameters

archived

Limit by archived status.

groupId

The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.

includeSubgroups

Include projects in subgroups of this group. Default is false. Needs group_id.

maxQueryablePages

The maximum number of project results pages that may be queried. Prevents overloading your Gitlab instance in case of a misconfiguration.

membership

Limit by projects that the current user is a member of.

minAccessLevel

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.

orderBy

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.

owned

Limit by projects owned by the current user.

page

The first page to begin the query on.

perPage

The number of results to return per page.

search

Return list of authorized projects matching the search criteria.

simple

Return only the ID, URL, name, and path of each project.

sort

Return projects sorted in asc or desc order. Default is desc.

starred

Limit by projects starred by the current user.

statistics

Include project statistics. Cannot be used with group_id.

visibility

Limit by visibility public, internal, or private.

withCustomAttributes

Include custom attributes in response (admins only).

withIssuesEnabled

Limit by projects with issues feature enabled. Default is false.

withMergeRequestsEnabled

Limit by projects with merge requests feature enabled. Default is false.

withProgrammingLanguage

Limit by projects which use the given programming language. Cannot be used with group_id.

withShared

Include projects shared to this group. Default is true. Needs group_id.

See also


suspend fun getProjects(argument: suspend GetProjectsPlainArgsBuilder.() -> Unit): GetProjectsResult

Return

A collection of values returned by getProjects.

Parameters

argument

Builder for com.pulumi.gitlab.kotlin.inputs.GetProjectsPlainArgs.

See also