GitLab
getBranch
The gitlab.Branch
data source allows details of a repository branch to be retrieved by its name and project.
Upstream API: GitLab REST API docs
Example Usage
using Pulumi;
using GitLab = Pulumi.GitLab;
class MyStack : Stack
{
public MyStack()
{
var foo = Output.Create(GitLab.GetBranch.InvokeAsync(new GitLab.GetBranchArgs
{
Name = "example",
Project = "foo/bar",
}));
}
}
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.LookupBranch(ctx, &GetBranchArgs{
Name: "example",
Project: "foo/bar",
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_gitlab as gitlab
foo = gitlab.get_branch(name="example",
project="foo/bar")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
// By project full path
const foo = pulumi.output(gitlab.getBranch({
name: "example",
project: "foo/bar",
}));
Coming soon!
Using getBranch
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 getBranch(args: GetBranchArgs, opts?: InvokeOptions): Promise<GetBranchResult>
function getBranchOutput(args: GetBranchOutputArgs, opts?: InvokeOptions): Output<GetBranchResult>
def get_branch(name: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBranchResult
def get_branch_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBranchResult]
func LookupBranch(ctx *Context, args *LookupBranchArgs, opts ...InvokeOption) (*LookupBranchResult, error)
func LookupBranchOutput(ctx *Context, args *LookupBranchOutputArgs, opts ...InvokeOption) LookupBranchResultOutput
> Note: This function is named LookupBranch
in the Go SDK.
public static class GetBranch
{
public static Task<GetBranchResult> InvokeAsync(GetBranchArgs args, InvokeOptions? opts = null)
public static Output<GetBranchResult> Invoke(GetBranchInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBranchResult> getBranch(GetBranchArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: gitlab:index/getBranch:getBranch
Arguments:
# Arguments dictionary
The following arguments are supported:
getBranch Result
The following output properties are available:
- Can
Push bool - Commits
List<Pulumi.
Git Lab. Outputs. Get Branch Commit> - Default bool
- Developer
Can boolMerge - Developer
Can boolPush - Id string
The provider-assigned unique ID for this managed resource.
- Merged bool
- Name string
- Project string
- Protected bool
- Web
Url string
- Can
Push bool - Commits
[]Get
Branch Commit - Default bool
- Developer
Can boolMerge - Developer
Can boolPush - Id string
The provider-assigned unique ID for this managed resource.
- Merged bool
- Name string
- Project string
- Protected bool
- Web
Url string
- can
Push Boolean - commits
List<Get
Branch Commit> - default_ Boolean
- developer
Can BooleanMerge - developer
Can BooleanPush - id String
The provider-assigned unique ID for this managed resource.
- merged Boolean
- name String
- project String
- protected_ Boolean
- web
Url String
- can
Push boolean - commits
Get
Branch Commit[] - default boolean
- developer
Can booleanMerge - developer
Can booleanPush - id string
The provider-assigned unique ID for this managed resource.
- merged boolean
- name string
- project string
- protected boolean
- web
Url string
- can_
push bool - commits
Sequence[Get
Branch Commit] - default bool
- developer_
can_ boolmerge - developer_
can_ boolpush - id str
The provider-assigned unique ID for this managed resource.
- merged bool
- name str
- project str
- protected bool
- web_
url str
- can
Push Boolean - commits List<Property Map>
- default Boolean
- developer
Can BooleanMerge - developer
Can BooleanPush - id String
The provider-assigned unique ID for this managed resource.
- merged Boolean
- name String
- project String
- protected Boolean
- web
Url String
Supporting Types
GetBranchCommit
- string
- string
- string
- Committed
Date string - Committer
Email string - Committer
Name string - Id string
- Message string
- Parent
Ids List<string> - Short
Id string - Title string
- string
- string
- string
- Committed
Date string - Committer
Email string - Committer
Name string - Id string
- Message string
- Parent
Ids []string - Short
Id string - Title string
- String
- String
- String
- committed
Date String - committer
Email String - committer
Name String - id String
- message String
- parent
Ids List<String> - short
Id String - title String
- string
- string
- string
- committed
Date string - committer
Email string - committer
Name string - id string
- message string
- parent
Ids string[] - short
Id string - title string
- str
- str
- str
- committed_
date str - committer_
email str - committer_
name str - id str
- message str
- parent_
ids Sequence[str] - short_
id str - title str
- String
- String
- String
- committed
Date String - committer
Email String - committer
Name String - id String
- message String
- parent
Ids List<String> - short
Id String - title String
Package Details
- Repository
- https://github.com/pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
gitlab
Terraform Provider.