1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. getRepoFileLine
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

oci.DevOps.getRepoFileLine

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

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

    Retrieve lines of a specified file. Supports starting line number and limit.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testRepoFileLine = oci.DevOps.getRepoFileLine({
        repositoryId: testRepository.id,
        revision: repoFileLineRevision,
        filePath: repoFileLineFilePath,
        startLineNumber: repoFileLineStartLineNumber,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_repo_file_line = oci.DevOps.get_repo_file_line(repository_id=test_repository["id"],
        revision=repo_file_line_revision,
        file_path=repo_file_line_file_path,
        start_line_number=repo_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.GetRepoFileLine(ctx, &devops.GetRepoFileLineArgs{
    			RepositoryId:    testRepository.Id,
    			Revision:        repoFileLineRevision,
    			FilePath:        repoFileLineFilePath,
    			StartLineNumber: pulumi.IntRef(repoFileLineStartLineNumber),
    		}, 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 testRepoFileLine = Oci.DevOps.GetRepoFileLine.Invoke(new()
        {
            RepositoryId = testRepository.Id,
            Revision = repoFileLineRevision,
            FilePath = repoFileLineFilePath,
            StartLineNumber = repoFileLineStartLineNumber,
        });
    
    });
    
    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.GetRepoFileLineArgs;
    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 testRepoFileLine = DevOpsFunctions.getRepoFileLine(GetRepoFileLineArgs.builder()
                .repositoryId(testRepository.id())
                .revision(repoFileLineRevision)
                .filePath(repoFileLineFilePath)
                .startLineNumber(repoFileLineStartLineNumber)
                .build());
    
        }
    }
    
    variables:
      testRepoFileLine:
        fn::invoke:
          Function: oci:DevOps:getRepoFileLine
          Arguments:
            repositoryId: ${testRepository.id}
            revision: ${repoFileLineRevision}
            filePath: ${repoFileLineFilePath}
            startLineNumber: ${repoFileLineStartLineNumber}
    

    Using getRepoFileLine

    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 getRepoFileLine(args: GetRepoFileLineArgs, opts?: InvokeOptions): Promise<GetRepoFileLineResult>
    function getRepoFileLineOutput(args: GetRepoFileLineOutputArgs, opts?: InvokeOptions): Output<GetRepoFileLineResult>
    def get_repo_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) -> GetRepoFileLineResult
    def get_repo_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[GetRepoFileLineResult]
    func GetRepoFileLine(ctx *Context, args *GetRepoFileLineArgs, opts ...InvokeOption) (*GetRepoFileLineResult, error)
    func GetRepoFileLineOutput(ctx *Context, args *GetRepoFileLineOutputArgs, opts ...InvokeOption) GetRepoFileLineResultOutput

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

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

    The following arguments are supported:

    FilePath string
    (Required) 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
    (Required) 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
    (Required) 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
    (Required) 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
    (Required) 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
    (Required) 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.

    getRepoFileLine Result

    The following output properties are available:

    FilePath string
    Id string
    The provider-assigned unique ID for this managed resource.
    Lines List<GetRepoFileLineLine>
    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 []GetRepoFileLineLine
    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<GetRepoFileLineLine>
    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 GetRepoFileLineLine[]
    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 Sequence[devops.GetRepoFileLineLine]
    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

    GetRepoFileLineLine

    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.41.0 published on Wednesday, Jun 19, 2024 by Pulumi