1. Packages
  2. GitLab
  3. API Docs
  4. getProjectProtectedBranch
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

gitlab.getProjectProtectedBranch

Explore with Pulumi AI

gitlab logo
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

    The gitlab.getProjectProtectedBranch 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

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const example = gitlab.getProjectProtectedBranch({
        name: "main",
        projectId: "foo/bar/baz",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.get_project_protected_branch(name="main",
        project_id="foo/bar/baz")
    
    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 {
    		_, err := gitlab.GetProjectProtectedBranch(ctx, &gitlab.GetProjectProtectedBranchArgs{
    			Name:      "main",
    			ProjectId: "foo/bar/baz",
    		}, 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.GetProjectProtectedBranch.Invoke(new()
        {
            Name = "main",
            ProjectId = "foo/bar/baz",
        });
    
    });
    
    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.GetProjectProtectedBranchArgs;
    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.getProjectProtectedBranch(GetProjectProtectedBranchArgs.builder()
                .name("main")
                .projectId("foo/bar/baz")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: gitlab:getProjectProtectedBranch
          Arguments:
            name: main
            projectId: foo/bar/baz
    

    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(merge_access_levels: Optional[Sequence[GetProjectProtectedBranchMergeAccessLevel]] = None,
                                     name: Optional[str] = None,
                                     project_id: Optional[str] = None,
                                     push_access_levels: Optional[Sequence[GetProjectProtectedBranchPushAccessLevel]] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetProjectProtectedBranchResult
    def get_project_protected_branch_output(merge_access_levels: Optional[pulumi.Input[Sequence[pulumi.Input[GetProjectProtectedBranchMergeAccessLevelArgs]]]] = None,
                                     name: Optional[pulumi.Input[str]] = None,
                                     project_id: Optional[pulumi.Input[str]] = None,
                                     push_access_levels: Optional[pulumi.Input[Sequence[pulumi.Input[GetProjectProtectedBranchPushAccessLevelArgs]]]] = 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 string
    The name of the protected branch.
    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    MergeAccessLevels List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchMergeAccessLevel>
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    PushAccessLevels List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchPushAccessLevel>
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    Name string
    The name of the protected branch.
    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    MergeAccessLevels []GetProjectProtectedBranchMergeAccessLevel
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    PushAccessLevels []GetProjectProtectedBranchPushAccessLevel
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    name String
    The name of the protected branch.
    projectId String
    The integer or path with namespace that uniquely identifies the project.
    mergeAccessLevels List<GetProjectProtectedBranchMergeAccessLevel>
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    pushAccessLevels List<GetProjectProtectedBranchPushAccessLevel>
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    name string
    The name of the protected branch.
    projectId string
    The integer or path with namespace that uniquely identifies the project.
    mergeAccessLevels GetProjectProtectedBranchMergeAccessLevel[]
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    pushAccessLevels GetProjectProtectedBranchPushAccessLevel[]
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    name str
    The name of the protected branch.
    project_id str
    The integer or path with namespace that uniquely identifies the project.
    merge_access_levels Sequence[GetProjectProtectedBranchMergeAccessLevel]
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    push_access_levels Sequence[GetProjectProtectedBranchPushAccessLevel]
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    name String
    The name of the protected branch.
    projectId String
    The integer or path with namespace that uniquely identifies the project.
    mergeAccessLevels List<Property Map>
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    pushAccessLevels List<Property Map>
    Array of access levels and user(s)/group(s) allowed to push to protected branch.

    getProjectProtectedBranch Result

    The following output properties are available:

    AllowForcePush bool
    Whether force push is allowed.
    CodeOwnerApprovalRequired bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    Id int
    The ID of this resource.
    Name string
    The name of the protected branch.
    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    MergeAccessLevels List<Pulumi.GitLab.Outputs.GetProjectProtectedBranchMergeAccessLevel>
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    PushAccessLevels List<Pulumi.GitLab.Outputs.GetProjectProtectedBranchPushAccessLevel>
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    AllowForcePush bool
    Whether force push is allowed.
    CodeOwnerApprovalRequired bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    Id int
    The ID of this resource.
    Name string
    The name of the protected branch.
    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    MergeAccessLevels []GetProjectProtectedBranchMergeAccessLevel
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    PushAccessLevels []GetProjectProtectedBranchPushAccessLevel
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    allowForcePush Boolean
    Whether force push is allowed.
    codeOwnerApprovalRequired Boolean
    Reject code pushes that change files listed in the CODEOWNERS file.
    id Integer
    The ID of this resource.
    name String
    The name of the protected branch.
    projectId String
    The integer or path with namespace that uniquely identifies the project.
    mergeAccessLevels List<GetProjectProtectedBranchMergeAccessLevel>
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    pushAccessLevels List<GetProjectProtectedBranchPushAccessLevel>
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    allowForcePush boolean
    Whether force push is allowed.
    codeOwnerApprovalRequired boolean
    Reject code pushes that change files listed in the CODEOWNERS file.
    id number
    The ID of this resource.
    name string
    The name of the protected branch.
    projectId string
    The integer or path with namespace that uniquely identifies the project.
    mergeAccessLevels GetProjectProtectedBranchMergeAccessLevel[]
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    pushAccessLevels GetProjectProtectedBranchPushAccessLevel[]
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    allow_force_push bool
    Whether force push is allowed.
    code_owner_approval_required bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    id int
    The ID of this resource.
    name str
    The name of the protected branch.
    project_id str
    The integer or path with namespace that uniquely identifies the project.
    merge_access_levels Sequence[GetProjectProtectedBranchMergeAccessLevel]
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    push_access_levels Sequence[GetProjectProtectedBranchPushAccessLevel]
    Array of access levels and user(s)/group(s) allowed to push to protected branch.
    allowForcePush Boolean
    Whether force push is allowed.
    codeOwnerApprovalRequired Boolean
    Reject code pushes that change files listed in the CODEOWNERS file.
    id Number
    The ID of this resource.
    name String
    The name of the protected branch.
    projectId String
    The integer or path with namespace that uniquely identifies the project.
    mergeAccessLevels List<Property Map>
    Array of access levels and user(s)/group(s) allowed to merge to protected branch.
    pushAccessLevels List<Property Map>
    Array of access levels and user(s)/group(s) allowed to push to protected branch.

    Supporting Types

    GetProjectProtectedBranchMergeAccessLevel

    AccessLevel string
    Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    AccessLevel string
    Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel String
    Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
    accessLevelDescription String
    Readable description of access level.
    groupId Integer
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId Integer
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel string
    Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
    accessLevelDescription string
    Readable description of access level.
    groupId number
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId number
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    access_level str
    Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
    access_level_description str
    Readable description of access level.
    group_id int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    user_id int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel String
    Access levels allowed to merge to protected branch. Valid values are: no one, developer, maintainer.
    accessLevelDescription String
    Readable description of access level.
    groupId Number
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId Number
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.

    GetProjectProtectedBranchPushAccessLevel

    AccessLevel string
    Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    AccessLevel string
    Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel String
    Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
    accessLevelDescription String
    Readable description of access level.
    groupId Integer
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId Integer
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel string
    Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
    accessLevelDescription string
    Readable description of access level.
    groupId number
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId number
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    access_level str
    Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
    access_level_description str
    Readable description of access level.
    group_id int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    user_id int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel String
    Access levels allowed to push to protected branch. Valid values are: no one, developer, maintainer.
    accessLevelDescription String
    Readable description of access level.
    groupId Number
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId Number
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi