GitLab
Pulumi Official

Package maintained by Pulumiv4.7.0 published on Thursday, Mar 31, 2022 by Pulumi
getProjectProtectedBranch
The gitlab_protected_branch
data source allows details of a protected branch to be retrieved by its name and the project it belongs to.
Upstream API: GitLab REST API docs
Example Usage
using Pulumi;
using GitLab = Pulumi.GitLab;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(GitLab.GetProjectProtectedBranch.InvokeAsync(new GitLab.GetProjectProtectedBranchArgs
{
Name = "main",
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.GetProjectProtectedBranch(ctx, &GetProjectProtectedBranchArgs{
Name: "main",
ProjectId: "foo/bar/baz",
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.get_project_protected_branch(name="main",
project_id="foo/bar/baz")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = pulumi.output(gitlab.getProjectProtectedBranch({
name: "main",
projectId: "foo/bar/baz",
}));
Coming soon!
Using getProjectProtectedBranch
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 getProjectProtectedBranch(args: GetProjectProtectedBranchArgs, opts?: InvokeOptions): Promise<GetProjectProtectedBranchResult>
function getProjectProtectedBranchOutput(args: GetProjectProtectedBranchOutputArgs, opts?: InvokeOptions): Output<GetProjectProtectedBranchResult>
def get_project_protected_branch(name: Optional[str] = None,
project_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectProtectedBranchResult
def get_project_protected_branch_output(name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectProtectedBranchResult]
func GetProjectProtectedBranch(ctx *Context, args *GetProjectProtectedBranchArgs, opts ...InvokeOption) (*GetProjectProtectedBranchResult, error)
func GetProjectProtectedBranchOutput(ctx *Context, args *GetProjectProtectedBranchOutputArgs, opts ...InvokeOption) GetProjectProtectedBranchResultOutput
> Note: This function is named GetProjectProtectedBranch
in the Go SDK.
public static class GetProjectProtectedBranch
{
public static Task<GetProjectProtectedBranchResult> InvokeAsync(GetProjectProtectedBranchArgs args, InvokeOptions? opts = null)
public static Output<GetProjectProtectedBranchResult> Invoke(GetProjectProtectedBranchInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetProjectProtectedBranchResult> getProjectProtectedBranch(GetProjectProtectedBranchArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: gitlab:index/getProjectProtectedBranch:getProjectProtectedBranch
Arguments:
# Arguments dictionary
The following arguments are supported:
- name str
- project_
id str
getProjectProtectedBranch Result
The following output properties are available:
- allow
Force BooleanPush - code
Owner BooleanApproval Required - id Number
- merge
Access List<Property Map>Levels - name String
- project
Id String - push
Access List<Property Map>Levels
Supporting Types
GetProjectProtectedBranchMergeAccessLevel
- Access
Level string - Access
Level stringDescription - Group
Id int - User
Id int
- Access
Level string - Access
Level stringDescription - Group
Id int - User
Id int
- access
Level String - access
Level StringDescription - group
Id Integer - user
Id Integer
- access
Level string - access
Level stringDescription - group
Id number - user
Id number
- access_
level str - access_
level_ strdescription - group_
id int - user_
id int
- access
Level String - access
Level StringDescription - group
Id Number - user
Id Number
GetProjectProtectedBranchPushAccessLevel
- Access
Level string - Access
Level stringDescription - Group
Id int - User
Id int
- Access
Level string - Access
Level stringDescription - Group
Id int - User
Id int
- access
Level String - access
Level StringDescription - group
Id Integer - user
Id Integer
- access
Level string - access
Level stringDescription - group
Id number - user
Id number
- access_
level str - access_
level_ strdescription - group_
id int - user_
id int
- access
Level String - access
Level StringDescription - group
Id Number - user
Id Number
Package Details
- Repository
- https://github.com/pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
gitlab
Terraform Provider.