GitLab

Pulumi Official
Package maintained by Pulumi
v4.7.0 published on Thursday, Mar 31, 2022 by Pulumi

getRepositoryFile

The gitlab.RepositoryFile data source allows details of a file in a repository to be retrieved.

Upstream API: GitLab REST API docs

Example Usage

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(GitLab.GetRepositoryFile.InvokeAsync(new GitLab.GetRepositoryFileArgs
        {
            FilePath = "README.md",
            Project = "example",
            Ref = "main",
        }));
    }

}
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.LookupRepositoryFile(ctx, &GetRepositoryFileArgs{
			FilePath: "README.md",
			Project:  "example",
			Ref:      "main",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_repository_file(file_path="README.md",
    project="example",
    ref="main")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = pulumi.output(gitlab.getRepositoryFile({
    filePath: "README.md",
    project: "example",
    ref: "main",
}));

Coming soon!

Using getRepositoryFile

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 getRepositoryFile(args: GetRepositoryFileArgs, opts?: InvokeOptions): Promise<GetRepositoryFileResult>
function getRepositoryFileOutput(args: GetRepositoryFileOutputArgs, opts?: InvokeOptions): Output<GetRepositoryFileResult>
def get_repository_file(file_path: Optional[str] = None,
                        project: Optional[str] = None,
                        ref: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetRepositoryFileResult
def get_repository_file_output(file_path: Optional[pulumi.Input[str]] = None,
                        project: Optional[pulumi.Input[str]] = None,
                        ref: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryFileResult]
func LookupRepositoryFile(ctx *Context, args *LookupRepositoryFileArgs, opts ...InvokeOption) (*LookupRepositoryFileResult, error)
func LookupRepositoryFileOutput(ctx *Context, args *LookupRepositoryFileOutputArgs, opts ...InvokeOption) LookupRepositoryFileResultOutput

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

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

The following arguments are supported:

FilePath string
Project string
Ref string
FilePath string
Project string
Ref string
filePath String
project String
ref String
filePath string
project string
ref string
filePath String
project String
ref String

getRepositoryFile Result

The following output properties are available:

BlobId string
CommitId string
Content string
ContentSha256 string
Encoding string
FileName string
FilePath string
Id string

The provider-assigned unique ID for this managed resource.

LastCommitId string
Project string
Ref string
Size int
BlobId string
CommitId string
Content string
ContentSha256 string
Encoding string
FileName string
FilePath string
Id string

The provider-assigned unique ID for this managed resource.

LastCommitId string
Project string
Ref string
Size int
blobId String
commitId String
content String
contentSha256 String
encoding String
fileName String
filePath String
id String

The provider-assigned unique ID for this managed resource.

lastCommitId String
project String
ref String
size Integer
blobId string
commitId string
content string
contentSha256 string
encoding string
fileName string
filePath string
id string

The provider-assigned unique ID for this managed resource.

lastCommitId string
project string
ref string
size number
blob_id str
commit_id str
content str
content_sha256 str
encoding str
file_name str
file_path str
id str

The provider-assigned unique ID for this managed resource.

last_commit_id str
project str
ref str
size int
blobId String
commitId String
content String
contentSha256 String
encoding String
fileName String
filePath String
id String

The provider-assigned unique ID for this managed resource.

lastCommitId String
project String
ref String
size 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.