Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi
oci.DevOps.getRepoFileLine
Explore with Pulumi AI
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/v2/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:
- File
Path string - (Required) A filter to return file contents of the specified paths.
- Repository
Id string - Unique repository identifier.
- Revision string
- Retrieve file lines from specific revision.
- Start
Line intNumber - Line number from where to start returning file lines.
- File
Path string - (Required) A filter to return file contents of the specified paths.
- Repository
Id string - Unique repository identifier.
- Revision string
- Retrieve file lines from specific revision.
- Start
Line intNumber - Line number from where to start returning file lines.
- file
Path String - (Required) A filter to return file contents of the specified paths.
- repository
Id String - Unique repository identifier.
- revision String
- Retrieve file lines from specific revision.
- start
Line IntegerNumber - Line number from where to start returning file lines.
- file
Path string - (Required) A filter to return file contents of the specified paths.
- repository
Id string - Unique repository identifier.
- revision string
- Retrieve file lines from specific revision.
- start
Line numberNumber - 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_ intnumber - Line number from where to start returning file lines.
- file
Path String - (Required) A filter to return file contents of the specified paths.
- repository
Id String - Unique repository identifier.
- revision String
- Retrieve file lines from specific revision.
- start
Line NumberNumber - Line number from where to start returning file lines.
getRepoFileLine Result
The following output properties are available:
- File
Path string - Id string
- The provider-assigned unique ID for this managed resource.
- Lines
List<Get
Repo File Line Line> - The list of lines in the file.
- Repository
Id string - Revision string
- Start
Line intNumber
- File
Path string - Id string
- The provider-assigned unique ID for this managed resource.
- Lines
[]Get
Repo File Line Line - The list of lines in the file.
- Repository
Id string - Revision string
- Start
Line intNumber
- file
Path String - id String
- The provider-assigned unique ID for this managed resource.
- lines
List<Get
Repo File Line Line> - The list of lines in the file.
- repository
Id String - revision String
- start
Line IntegerNumber
- file
Path string - id string
- The provider-assigned unique ID for this managed resource.
- lines
Get
Repo File Line Line[] - The list of lines in the file.
- repository
Id string - revision string
- start
Line numberNumber
- file_
path str - id str
- The provider-assigned unique ID for this managed resource.
- lines
Sequence[devops.
Get Repo File Line Line] - The list of lines in the file.
- repository_
id str - revision str
- start_
line_ intnumber
- file
Path String - id String
- The provider-assigned unique ID for this managed resource.
- lines List<Property Map>
- The list of lines in the file.
- repository
Id String - revision String
- start
Line NumberNumber
Supporting Types
GetRepoFileLineLine
- Line
Content string - The content of the line.
- Line
Number int - The line number.
- Line
Content string - The content of the line.
- Line
Number int - The line number.
- line
Content String - The content of the line.
- line
Number Integer - The line number.
- line
Content string - The content of the line.
- line
Number number - The line number.
- line_
content str - The content of the line.
- line_
number int - The line number.
- line
Content String - The content of the line.
- line
Number 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.