1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. getRepositoryFileLine
Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi

oci.DevOps.getRepositoryFileLine

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi

    This data source provides details about a specific Repository File Line resource in Oracle Cloud Infrastructure Devops service.

    Retrieve lines of a specified file. Supports starting line number and limit. This API will be deprecated on Wed, 29 Mar 2023 01:00:00 GMT as it does not get recognized when filePath has ‘/’. This will be replaced by “/repositories/{repositoryId}/file/lines”

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testRepositoryFileLine = oci.DevOps.getRepositoryFileLine({
        repositoryId: oci_devops_repository.test_repository.id,
        revision: _var.repository_file_line_revision,
        filePath: _var.repository_file_line_file_path,
        startLineNumber: _var.repository_file_line_start_line_number,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_repository_file_line = oci.DevOps.get_repository_file_line(repository_id=oci_devops_repository["test_repository"]["id"],
        revision=var["repository_file_line_revision"],
        file_path=var["repository_file_line_file_path"],
        start_line_number=var["repository_file_line_start_line_number"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/DevOps"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := DevOps.GetRepositoryFileLine(ctx, &devops.GetRepositoryFileLineArgs{
    			RepositoryId:    oci_devops_repository.Test_repository.Id,
    			Revision:        _var.Repository_file_line_revision,
    			FilePath:        _var.Repository_file_line_file_path,
    			StartLineNumber: pulumi.IntRef(_var.Repository_file_line_start_line_number),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testRepositoryFileLine = Oci.DevOps.GetRepositoryFileLine.Invoke(new()
        {
            RepositoryId = oci_devops_repository.Test_repository.Id,
            Revision = @var.Repository_file_line_revision,
            FilePath = @var.Repository_file_line_file_path,
            StartLineNumber = @var.Repository_file_line_start_line_number,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.DevOps.DevOpsFunctions;
    import com.pulumi.oci.DevOps.inputs.GetRepositoryFileLineArgs;
    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 testRepositoryFileLine = DevOpsFunctions.getRepositoryFileLine(GetRepositoryFileLineArgs.builder()
                .repositoryId(oci_devops_repository.test_repository().id())
                .revision(var_.repository_file_line_revision())
                .filePath(var_.repository_file_line_file_path())
                .startLineNumber(var_.repository_file_line_start_line_number())
                .build());
    
        }
    }
    
    variables:
      testRepositoryFileLine:
        fn::invoke:
          Function: oci:DevOps:getRepositoryFileLine
          Arguments:
            repositoryId: ${oci_devops_repository.test_repository.id}
            revision: ${var.repository_file_line_revision}
            filePath: ${var.repository_file_line_file_path}
            startLineNumber: ${var.repository_file_line_start_line_number}
    

    Using getRepositoryFileLine

    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 getRepositoryFileLine(args: GetRepositoryFileLineArgs, opts?: InvokeOptions): Promise<GetRepositoryFileLineResult>
    function getRepositoryFileLineOutput(args: GetRepositoryFileLineOutputArgs, opts?: InvokeOptions): Output<GetRepositoryFileLineResult>
    def get_repository_file_line(file_path: Optional[str] = None,
                                 repository_id: Optional[str] = None,
                                 revision: Optional[str] = None,
                                 start_line_number: Optional[int] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetRepositoryFileLineResult
    def get_repository_file_line_output(file_path: Optional[pulumi.Input[str]] = None,
                                 repository_id: Optional[pulumi.Input[str]] = None,
                                 revision: Optional[pulumi.Input[str]] = None,
                                 start_line_number: Optional[pulumi.Input[int]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryFileLineResult]
    func GetRepositoryFileLine(ctx *Context, args *GetRepositoryFileLineArgs, opts ...InvokeOption) (*GetRepositoryFileLineResult, error)
    func GetRepositoryFileLineOutput(ctx *Context, args *GetRepositoryFileLineOutputArgs, opts ...InvokeOption) GetRepositoryFileLineResultOutput

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

    public static class GetRepositoryFileLine 
    {
        public static Task<GetRepositoryFileLineResult> InvokeAsync(GetRepositoryFileLineArgs args, InvokeOptions? opts = null)
        public static Output<GetRepositoryFileLineResult> Invoke(GetRepositoryFileLineInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRepositoryFileLineResult> getRepositoryFileLine(GetRepositoryFileLineArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:DevOps/getRepositoryFileLine:getRepositoryFileLine
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FilePath string
    A filter to return file contents of the specified paths.
    RepositoryId string
    Unique repository identifier.
    Revision string
    Retrieve file lines from specific revision.
    StartLineNumber int
    Line number from where to start returning file lines.
    FilePath string
    A filter to return file contents of the specified paths.
    RepositoryId string
    Unique repository identifier.
    Revision string
    Retrieve file lines from specific revision.
    StartLineNumber int
    Line number from where to start returning file lines.
    filePath String
    A filter to return file contents of the specified paths.
    repositoryId String
    Unique repository identifier.
    revision String
    Retrieve file lines from specific revision.
    startLineNumber Integer
    Line number from where to start returning file lines.
    filePath string
    A filter to return file contents of the specified paths.
    repositoryId string
    Unique repository identifier.
    revision string
    Retrieve file lines from specific revision.
    startLineNumber number
    Line number from where to start returning file lines.
    file_path str
    A filter to return file contents of the specified paths.
    repository_id str
    Unique repository identifier.
    revision str
    Retrieve file lines from specific revision.
    start_line_number int
    Line number from where to start returning file lines.
    filePath String
    A filter to return file contents of the specified paths.
    repositoryId String
    Unique repository identifier.
    revision String
    Retrieve file lines from specific revision.
    startLineNumber Number
    Line number from where to start returning file lines.

    getRepositoryFileLine Result

    The following output properties are available:

    FilePath string
    Id string
    The provider-assigned unique ID for this managed resource.
    Lines List<GetRepositoryFileLineLine>
    The list of lines in the file.
    RepositoryId string
    Revision string
    StartLineNumber int
    FilePath string
    Id string
    The provider-assigned unique ID for this managed resource.
    Lines []GetRepositoryFileLineLine
    The list of lines in the file.
    RepositoryId string
    Revision string
    StartLineNumber int
    filePath String
    id String
    The provider-assigned unique ID for this managed resource.
    lines List<GetRepositoryFileLineLine>
    The list of lines in the file.
    repositoryId String
    revision String
    startLineNumber Integer
    filePath string
    id string
    The provider-assigned unique ID for this managed resource.
    lines GetRepositoryFileLineLine[]
    The list of lines in the file.
    repositoryId string
    revision string
    startLineNumber number
    file_path str
    id str
    The provider-assigned unique ID for this managed resource.
    lines GetRepositoryFileLineLine]
    The list of lines in the file.
    repository_id str
    revision str
    start_line_number int
    filePath String
    id String
    The provider-assigned unique ID for this managed resource.
    lines List<Property Map>
    The list of lines in the file.
    repositoryId String
    revision String
    startLineNumber Number

    Supporting Types

    GetRepositoryFileLineLine

    LineContent string
    The content of the line.
    LineNumber int
    The line number.
    LineContent string
    The content of the line.
    LineNumber int
    The line number.
    lineContent String
    The content of the line.
    lineNumber Integer
    The line number.
    lineContent string
    The content of the line.
    lineNumber number
    The line number.
    line_content str
    The content of the line.
    line_number int
    The line number.
    lineContent String
    The content of the line.
    lineNumber Number
    The line number.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi