bitbucket 2.50.0 published on Wednesday, Oct 8, 2025 by drfaust92
bitbucket.getFile
Start a Neo task
Explain and create a bitbucket.getFile resource
bitbucket 2.50.0 published on Wednesday, Oct 8, 2025 by drfaust92
Datasource to retrieve file content or metadata information
OAuth2 Scopes: repository
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bitbucket from "@pulumi/bitbucket";
const test = bitbucket.getFile({
commit: "main",
format: "meta",
includeCommit: true,
includeCommitLinks: true,
path: "path/to/my/doc.py",
repoSlug: "myrepo",
workspace: "myworkspace",
});
import pulumi
import pulumi_bitbucket as bitbucket
test = bitbucket.get_file(commit="main",
format="meta",
include_commit=True,
include_commit_links=True,
path="path/to/my/doc.py",
repo_slug="myrepo",
workspace="myworkspace")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/bitbucket/v2/bitbucket"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bitbucket.GetFile(ctx, &bitbucket.GetFileArgs{
Commit: "main",
Format: pulumi.StringRef("meta"),
IncludeCommit: pulumi.BoolRef(true),
IncludeCommitLinks: pulumi.BoolRef(true),
Path: "path/to/my/doc.py",
RepoSlug: "myrepo",
Workspace: "myworkspace",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bitbucket = Pulumi.Bitbucket;
return await Deployment.RunAsync(() =>
{
var test = Bitbucket.GetFile.Invoke(new()
{
Commit = "main",
Format = "meta",
IncludeCommit = true,
IncludeCommitLinks = true,
Path = "path/to/my/doc.py",
RepoSlug = "myrepo",
Workspace = "myworkspace",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.bitbucket.BitbucketFunctions;
import com.pulumi.bitbucket.inputs.GetFileArgs;
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 test = BitbucketFunctions.getFile(GetFileArgs.builder()
.commit("main")
.format("meta")
.includeCommit(true)
.includeCommitLinks(true)
.path("path/to/my/doc.py")
.repoSlug("myrepo")
.workspace("myworkspace")
.build());
}
}
variables:
test:
fn::invoke:
function: bitbucket:getFile
arguments:
commit: main
format: meta
includeCommit: true
includeCommitLinks: true
path: path/to/my/doc.py
repoSlug: myrepo
workspace: myworkspace
Using getFile
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 getFile(args: GetFileArgs, opts?: InvokeOptions): Promise<GetFileResult>
function getFileOutput(args: GetFileOutputArgs, opts?: InvokeOptions): Output<GetFileResult>def get_file(commit: Optional[str] = None,
format: Optional[str] = None,
id: Optional[str] = None,
include_commit: Optional[bool] = None,
include_commit_links: Optional[bool] = None,
include_links: Optional[bool] = None,
path: Optional[str] = None,
repo_slug: Optional[str] = None,
workspace: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFileResult
def get_file_output(commit: Optional[pulumi.Input[str]] = None,
format: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
include_commit: Optional[pulumi.Input[bool]] = None,
include_commit_links: Optional[pulumi.Input[bool]] = None,
include_links: Optional[pulumi.Input[bool]] = None,
path: Optional[pulumi.Input[str]] = None,
repo_slug: Optional[pulumi.Input[str]] = None,
workspace: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFileResult]func GetFile(ctx *Context, args *GetFileArgs, opts ...InvokeOption) (*GetFileResult, error)
func GetFileOutput(ctx *Context, args *GetFileOutputArgs, opts ...InvokeOption) GetFileResultOutput> Note: This function is named GetFile in the Go SDK.
public static class GetFile
{
public static Task<GetFileResult> InvokeAsync(GetFileArgs args, InvokeOptions? opts = null)
public static Output<GetFileResult> Invoke(GetFileInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetFileResult> getFile(GetFileArgs args, InvokeOptions options)
public static Output<GetFileResult> getFile(GetFileArgs args, InvokeOptions options)
fn::invoke:
function: bitbucket:index/getFile:getFile
arguments:
# arguments dictionaryThe following arguments are supported:
- Commit string
- Commit hash or branch name
- Path string
- Path to file (starting from commit)
- Repo
Slug string - Repo slug or UUID
- Workspace string
- Workspace slug or UUID
- Format string
- Format if file to return: content/base64 content or metadata.
- Id string
- The ID of this resource.
- Include
Commit bool - Whether to include the commit for the file metadata or not.
- Include
Commit boolLinks - Whether to include the commit links for the file metadata or not.
- Include
Links bool - Whether to include the links for the file metadata or not.
- Commit string
- Commit hash or branch name
- Path string
- Path to file (starting from commit)
- Repo
Slug string - Repo slug or UUID
- Workspace string
- Workspace slug or UUID
- Format string
- Format if file to return: content/base64 content or metadata.
- Id string
- The ID of this resource.
- Include
Commit bool - Whether to include the commit for the file metadata or not.
- Include
Commit boolLinks - Whether to include the commit links for the file metadata or not.
- Include
Links bool - Whether to include the links for the file metadata or not.
- commit String
- Commit hash or branch name
- path String
- Path to file (starting from commit)
- repo
Slug String - Repo slug or UUID
- workspace String
- Workspace slug or UUID
- format String
- Format if file to return: content/base64 content or metadata.
- id String
- The ID of this resource.
- include
Commit Boolean - Whether to include the commit for the file metadata or not.
- include
Commit BooleanLinks - Whether to include the commit links for the file metadata or not.
- include
Links Boolean - Whether to include the links for the file metadata or not.
- commit string
- Commit hash or branch name
- path string
- Path to file (starting from commit)
- repo
Slug string - Repo slug or UUID
- workspace string
- Workspace slug or UUID
- format string
- Format if file to return: content/base64 content or metadata.
- id string
- The ID of this resource.
- include
Commit boolean - Whether to include the commit for the file metadata or not.
- include
Commit booleanLinks - Whether to include the commit links for the file metadata or not.
- include
Links boolean - Whether to include the links for the file metadata or not.
- commit str
- Commit hash or branch name
- path str
- Path to file (starting from commit)
- repo_
slug str - Repo slug or UUID
- workspace str
- Workspace slug or UUID
- format str
- Format if file to return: content/base64 content or metadata.
- id str
- The ID of this resource.
- include_
commit bool - Whether to include the commit for the file metadata or not.
- include_
commit_ boollinks - Whether to include the commit links for the file metadata or not.
- include_
links bool - Whether to include the links for the file metadata or not.
- commit String
- Commit hash or branch name
- path String
- Path to file (starting from commit)
- repo
Slug String - Repo slug or UUID
- workspace String
- Workspace slug or UUID
- format String
- Format if file to return: content/base64 content or metadata.
- id String
- The ID of this resource.
- include
Commit Boolean - Whether to include the commit for the file metadata or not.
- include
Commit BooleanLinks - Whether to include the commit links for the file metadata or not.
- include
Links Boolean - Whether to include the links for the file metadata or not.
getFile Result
The following output properties are available:
- Commit string
- commit information (see below for nested schema)
- Content string
- Raw string content of path return (not escaped).
- Content
B64 string - Base64-encoded version of path return, safe for embedding.
- Id string
- The ID of this resource.
- Metadatas
List<Get
File Metadata> - (List of Object) Parsed metadata of path (JSON/XML), if available (see below for nested schema)
- Path string
- file path
- Repo
Slug string - Workspace string
- Format string
- Include
Commit bool - Include
Commit boolLinks - Include
Links bool
- Commit string
- commit information (see below for nested schema)
- Content string
- Raw string content of path return (not escaped).
- Content
B64 string - Base64-encoded version of path return, safe for embedding.
- Id string
- The ID of this resource.
- Metadatas
[]Get
File Metadata - (List of Object) Parsed metadata of path (JSON/XML), if available (see below for nested schema)
- Path string
- file path
- Repo
Slug string - Workspace string
- Format string
- Include
Commit bool - Include
Commit boolLinks - Include
Links bool
- commit String
- commit information (see below for nested schema)
- content String
- Raw string content of path return (not escaped).
- content
B64 String - Base64-encoded version of path return, safe for embedding.
- id String
- The ID of this resource.
- metadatas
List<Get
File Metadata> - (List of Object) Parsed metadata of path (JSON/XML), if available (see below for nested schema)
- path String
- file path
- repo
Slug String - workspace String
- format String
- include
Commit Boolean - include
Commit BooleanLinks - include
Links Boolean
- commit string
- commit information (see below for nested schema)
- content string
- Raw string content of path return (not escaped).
- content
B64 string - Base64-encoded version of path return, safe for embedding.
- id string
- The ID of this resource.
- metadatas
Get
File Metadata[] - (List of Object) Parsed metadata of path (JSON/XML), if available (see below for nested schema)
- path string
- file path
- repo
Slug string - workspace string
- format string
- include
Commit boolean - include
Commit booleanLinks - include
Links boolean
- commit str
- commit information (see below for nested schema)
- content str
- Raw string content of path return (not escaped).
- content_
b64 str - Base64-encoded version of path return, safe for embedding.
- id str
- The ID of this resource.
- metadatas
Sequence[Get
File Metadata] - (List of Object) Parsed metadata of path (JSON/XML), if available (see below for nested schema)
- path str
- file path
- repo_
slug str - workspace str
- format str
- include_
commit bool - include_
commit_ boollinks - include_
links bool
- commit String
- commit information (see below for nested schema)
- content String
- Raw string content of path return (not escaped).
- content
B64 String - Base64-encoded version of path return, safe for embedding.
- id String
- The ID of this resource.
- metadatas List<Property Map>
- (List of Object) Parsed metadata of path (JSON/XML), if available (see below for nested schema)
- path String
- file path
- repo
Slug String - workspace String
- format String
- include
Commit Boolean - include
Commit BooleanLinks - include
Links Boolean
Supporting Types
GetFileMetadata
- Commits
List<Get
File Metadata Commit> - Commit hash or branch name
- Escaped
Path string - escaped file path
- Links
List<Get
File Metadata Link> - Commit links (see below for nested schema)
- Mime
Type string - file MIME type
- Path string
- Path to file (starting from commit)
- Size double
- file size
- Type string
- Commit type
- Commits
[]Get
File Metadata Commit - Commit hash or branch name
- Escaped
Path string - escaped file path
- Links
[]Get
File Metadata Link - Commit links (see below for nested schema)
- Mime
Type string - file MIME type
- Path string
- Path to file (starting from commit)
- Size float64
- file size
- Type string
- Commit type
- commits
List<Get
File Metadata Commit> - Commit hash or branch name
- escaped
Path String - escaped file path
- links
List<Get
File Metadata Link> - Commit links (see below for nested schema)
- mime
Type String - file MIME type
- path String
- Path to file (starting from commit)
- size Double
- file size
- type String
- Commit type
- commits
Get
File Metadata Commit[] - Commit hash or branch name
- escaped
Path string - escaped file path
- links
Get
File Metadata Link[] - Commit links (see below for nested schema)
- mime
Type string - file MIME type
- path string
- Path to file (starting from commit)
- size number
- file size
- type string
- Commit type
- commits
Sequence[Get
File Metadata Commit] - Commit hash or branch name
- escaped_
path str - escaped file path
- links
Sequence[Get
File Metadata Link] - Commit links (see below for nested schema)
- mime_
type str - file MIME type
- path str
- Path to file (starting from commit)
- size float
- file size
- type str
- Commit type
- commits List<Property Map>
- Commit hash or branch name
- escaped
Path String - escaped file path
- links List<Property Map>
- Commit links (see below for nested schema)
- mime
Type String - file MIME type
- path String
- Path to file (starting from commit)
- size Number
- file size
- type String
- Commit type
GetFileMetadataCommit
- Hash string
- Commit hash
- Links
List<Get
File Metadata Commit Link> - Commit links (see below for nested schema)
- Type string
- Commit type
- Hash string
- Commit hash
- Links
[]Get
File Metadata Commit Link - Commit links (see below for nested schema)
- Type string
- Commit type
- hash String
- Commit hash
- links
List<Get
File Metadata Commit Link> - Commit links (see below for nested schema)
- type String
- Commit type
- hash string
- Commit hash
- links
Get
File Metadata Commit Link[] - Commit links (see below for nested schema)
- type string
- Commit type
- hash str
- Commit hash
- links
Sequence[Get
File Metadata Commit Link] - Commit links (see below for nested schema)
- type str
- Commit type
- hash String
- Commit hash
- links List<Property Map>
- Commit links (see below for nested schema)
- type String
- Commit type
GetFileMetadataCommitLink
- Htmls
List<Get
File Metadata Commit Link Html> - HTML link (see below for nested schema)
- Selves
List<Get
File Metadata Commit Link Self> - File self link (see below for nested schema)
- Htmls
[]Get
File Metadata Commit Link Html - HTML link (see below for nested schema)
- Selves
[]Get
File Metadata Commit Link Self - File self link (see below for nested schema)
- htmls
List<Get
File Metadata Commit Link Html> - HTML link (see below for nested schema)
- selves
List<Get
File Metadata Commit Link Self> - File self link (see below for nested schema)
- htmls
Get
File Metadata Commit Link Html[] - HTML link (see below for nested schema)
- selves
Get
File Metadata Commit Link Self[] - File self link (see below for nested schema)
- htmls
Sequence[Get
File Metadata Commit Link Html] - HTML link (see below for nested schema)
- selves
Sequence[Get
File Metadata Commit Link Self] - File self link (see below for nested schema)
- htmls List<Property Map>
- HTML link (see below for nested schema)
- selves List<Property Map>
- File self link (see below for nested schema)
GetFileMetadataCommitLinkHtml
- Href string
- URL link
- Href string
- URL link
- href String
- URL link
- href string
- URL link
- href str
- URL link
- href String
- URL link
GetFileMetadataCommitLinkSelf
- Href string
- URL link
- Href string
- URL link
- href String
- URL link
- href string
- URL link
- href str
- URL link
- href String
- URL link
GetFileMetadataLink
- Histories
List<Get
File Metadata Link History> - File history link (see below for nested schema)
- Metas
List<Get
File Metadata Link Meta> - File metadata link (see below for nested schema)
- Selves
List<Get
File Metadata Link Self> - File self link (see below for nested schema)
- Histories
[]Get
File Metadata Link History - File history link (see below for nested schema)
- Metas
[]Get
File Metadata Link Meta - File metadata link (see below for nested schema)
- Selves
[]Get
File Metadata Link Self - File self link (see below for nested schema)
- histories
List<Get
File Metadata Link History> - File history link (see below for nested schema)
- metas
List<Get
File Metadata Link Meta> - File metadata link (see below for nested schema)
- selves
List<Get
File Metadata Link Self> - File self link (see below for nested schema)
- histories
Get
File Metadata Link History[] - File history link (see below for nested schema)
- metas
Get
File Metadata Link Meta[] - File metadata link (see below for nested schema)
- selves
Get
File Metadata Link Self[] - File self link (see below for nested schema)
- histories
Sequence[Get
File Metadata Link History] - File history link (see below for nested schema)
- metas
Sequence[Get
File Metadata Link Meta] - File metadata link (see below for nested schema)
- selves
Sequence[Get
File Metadata Link Self] - File self link (see below for nested schema)
- histories List<Property Map>
- File history link (see below for nested schema)
- metas List<Property Map>
- File metadata link (see below for nested schema)
- selves List<Property Map>
- File self link (see below for nested schema)
GetFileMetadataLinkHistory
- Href string
- URL link
- Href string
- URL link
- href String
- URL link
- href string
- URL link
- href str
- URL link
- href String
- URL link
GetFileMetadataLinkMeta
- Href string
- URL link
- Href string
- URL link
- href String
- URL link
- href string
- URL link
- href str
- URL link
- href String
- URL link
GetFileMetadataLinkSelf
- Href string
- URL link
- Href string
- URL link
- href String
- URL link
- href string
- URL link
- href str
- URL link
- href String
- URL link
Package Details
- Repository
- bitbucket drfaust92/terraform-provider-bitbucket
- License
- Notes
- This Pulumi package is based on the
bitbucketTerraform Provider.
bitbucket 2.50.0 published on Wednesday, Oct 8, 2025 by drfaust92
