GitLab

Pulumi Official
Package maintained by Pulumi
v4.7.1 published on Thursday, Jun 30, 2022 by Pulumi

getProjectProtectedBranches

The gitlab_protected_branches data source allows details of the protected branches of a given project.

Upstream API: GitLab REST API docs

Example Usage

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(GitLab.GetProjectProtectedBranches.InvokeAsync(new GitLab.GetProjectProtectedBranchesArgs
        {
            ProjectId = "foo/bar/baz",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v4/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.GetProjectProtectedBranches(ctx, &GetProjectProtectedBranchesArgs{
			ProjectId: "foo/bar/baz",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(GitlabFunctions.getProjectProtectedBranches(GetProjectProtectedBranchesArgs.builder()
            .projectId("foo/bar/baz")
            .build()));

    }
}
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_project_protected_branches(project_id="foo/bar/baz")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = pulumi.output(gitlab.getProjectProtectedBranches({
    projectId: "foo/bar/baz",
}));
variables:
  example:
    Fn::Invoke:
      Function: gitlab:getProjectProtectedBranches
      Arguments:
        projectId: foo/bar/baz

Using getProjectProtectedBranches

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 getProjectProtectedBranches(args: GetProjectProtectedBranchesArgs, opts?: InvokeOptions): Promise<GetProjectProtectedBranchesResult>
function getProjectProtectedBranchesOutput(args: GetProjectProtectedBranchesOutputArgs, opts?: InvokeOptions): Output<GetProjectProtectedBranchesResult>
def get_project_protected_branches(project_id: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetProjectProtectedBranchesResult
def get_project_protected_branches_output(project_id: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetProjectProtectedBranchesResult]
func GetProjectProtectedBranches(ctx *Context, args *GetProjectProtectedBranchesArgs, opts ...InvokeOption) (*GetProjectProtectedBranchesResult, error)
func GetProjectProtectedBranchesOutput(ctx *Context, args *GetProjectProtectedBranchesOutputArgs, opts ...InvokeOption) GetProjectProtectedBranchesResultOutput

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

public static class GetProjectProtectedBranches 
{
    public static Task<GetProjectProtectedBranchesResult> InvokeAsync(GetProjectProtectedBranchesArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectProtectedBranchesResult> Invoke(GetProjectProtectedBranchesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetProjectProtectedBranchesResult> getProjectProtectedBranches(GetProjectProtectedBranchesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: gitlab:index/getProjectProtectedBranches:getProjectProtectedBranches
  Arguments:
    # Arguments dictionary

The following arguments are supported:

ProjectId string
ProjectId string
projectId String
projectId string
projectId String

getProjectProtectedBranches Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

ProjectId string
ProtectedBranches List<Pulumi.GitLab.Outputs.GetProjectProtectedBranchesProtectedBranch>
Id string

The provider-assigned unique ID for this managed resource.

ProjectId string
ProtectedBranches []GetProjectProtectedBranchesProtectedBranch
id String

The provider-assigned unique ID for this managed resource.

projectId String
protectedBranches List<GetProjectProtectedBranchesProtectedBranch>
id string

The provider-assigned unique ID for this managed resource.

projectId string
protectedBranches GetProjectProtectedBranchesProtectedBranch[]
id str

The provider-assigned unique ID for this managed resource.

project_id str
protected_branches Sequence[GetProjectProtectedBranchesProtectedBranch]
id String

The provider-assigned unique ID for this managed resource.

projectId String
protectedBranches List<Property Map>

Supporting Types

GetProjectProtectedBranchesProtectedBranch

GetProjectProtectedBranchesProtectedBranchMergeAccessLevel

GetProjectProtectedBranchesProtectedBranchPushAccessLevel

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes

This Pulumi package is based on the gitlab Terraform Provider.