artifactory v8.4.0 published on Tuesday, Nov 19, 2024 by Pulumi
artifactory.getFile
Explore with Pulumi AI
# Artifactory File Data Source
Provides an Artifactory file datasource. This can be used to download a file from a given Artifactory repository.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";
const my-file = artifactory.getFile({
repository: "repo-key",
path: "/path/to/the/artifact.zip",
outputPath: "tmp/artifact.zip",
});
import pulumi
import pulumi_artifactory as artifactory
my_file = artifactory.get_file(repository="repo-key",
path="/path/to/the/artifact.zip",
output_path="tmp/artifact.zip")
package main
import (
"github.com/pulumi/pulumi-artifactory/sdk/v8/go/artifactory"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := artifactory.GetFile(ctx, &artifactory.GetFileArgs{
Repository: "repo-key",
Path: "/path/to/the/artifact.zip",
OutputPath: "tmp/artifact.zip",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Artifactory = Pulumi.Artifactory;
return await Deployment.RunAsync(() =>
{
var my_file = Artifactory.GetFile.Invoke(new()
{
Repository = "repo-key",
Path = "/path/to/the/artifact.zip",
OutputPath = "tmp/artifact.zip",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.artifactory.ArtifactoryFunctions;
import com.pulumi.artifactory.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 my-file = ArtifactoryFunctions.getFile(GetFileArgs.builder()
.repository("repo-key")
.path("/path/to/the/artifact.zip")
.outputPath("tmp/artifact.zip")
.build());
}
}
variables:
my-file:
fn::invoke:
Function: artifactory:getFile
Arguments:
repository: repo-key
path: /path/to/the/artifact.zip
outputPath: tmp/artifact.zip
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(force_overwrite: Optional[bool] = None,
output_path: Optional[str] = None,
path: Optional[str] = None,
path_is_aliased: Optional[bool] = None,
repository: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFileResult
def get_file_output(force_overwrite: Optional[pulumi.Input[bool]] = None,
output_path: Optional[pulumi.Input[str]] = None,
path: Optional[pulumi.Input[str]] = None,
path_is_aliased: Optional[pulumi.Input[bool]] = None,
repository: 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: artifactory:index/getFile:getFile
arguments:
# arguments dictionary
The following arguments are supported:
- Output
Path string - The local path the file should be downloaded to.
- Path string
- The path to the file within the repository.
- Repository string
- Name of the repository where the file is stored.
- Force
Overwrite bool - If set to true, an existing file in the output_path will be overwritten. Default:
false
- Path
Is boolAliased - If set to
true
, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory if the file exists. When using a smart remote repository, it is recommended to set this attribute totrue
. This is necessary to ensure that the provider fetches the artifact directly from Artifactory. If this attribute is not set or is set tofalse
, there is a risk of fetching the-cache
directory in Artifactory, potentially resulting in resource expiration and a 404 error.
- Output
Path string - The local path the file should be downloaded to.
- Path string
- The path to the file within the repository.
- Repository string
- Name of the repository where the file is stored.
- Force
Overwrite bool - If set to true, an existing file in the output_path will be overwritten. Default:
false
- Path
Is boolAliased - If set to
true
, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory if the file exists. When using a smart remote repository, it is recommended to set this attribute totrue
. This is necessary to ensure that the provider fetches the artifact directly from Artifactory. If this attribute is not set or is set tofalse
, there is a risk of fetching the-cache
directory in Artifactory, potentially resulting in resource expiration and a 404 error.
- output
Path String - The local path the file should be downloaded to.
- path String
- The path to the file within the repository.
- repository String
- Name of the repository where the file is stored.
- force
Overwrite Boolean - If set to true, an existing file in the output_path will be overwritten. Default:
false
- path
Is BooleanAliased - If set to
true
, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory if the file exists. When using a smart remote repository, it is recommended to set this attribute totrue
. This is necessary to ensure that the provider fetches the artifact directly from Artifactory. If this attribute is not set or is set tofalse
, there is a risk of fetching the-cache
directory in Artifactory, potentially resulting in resource expiration and a 404 error.
- output
Path string - The local path the file should be downloaded to.
- path string
- The path to the file within the repository.
- repository string
- Name of the repository where the file is stored.
- force
Overwrite boolean - If set to true, an existing file in the output_path will be overwritten. Default:
false
- path
Is booleanAliased - If set to
true
, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory if the file exists. When using a smart remote repository, it is recommended to set this attribute totrue
. This is necessary to ensure that the provider fetches the artifact directly from Artifactory. If this attribute is not set or is set tofalse
, there is a risk of fetching the-cache
directory in Artifactory, potentially resulting in resource expiration and a 404 error.
- output_
path str - The local path the file should be downloaded to.
- path str
- The path to the file within the repository.
- repository str
- Name of the repository where the file is stored.
- force_
overwrite bool - If set to true, an existing file in the output_path will be overwritten. Default:
false
- path_
is_ boolaliased - If set to
true
, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory if the file exists. When using a smart remote repository, it is recommended to set this attribute totrue
. This is necessary to ensure that the provider fetches the artifact directly from Artifactory. If this attribute is not set or is set tofalse
, there is a risk of fetching the-cache
directory in Artifactory, potentially resulting in resource expiration and a 404 error.
- output
Path String - The local path the file should be downloaded to.
- path String
- The path to the file within the repository.
- repository String
- Name of the repository where the file is stored.
- force
Overwrite Boolean - If set to true, an existing file in the output_path will be overwritten. Default:
false
- path
Is BooleanAliased - If set to
true
, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory if the file exists. When using a smart remote repository, it is recommended to set this attribute totrue
. This is necessary to ensure that the provider fetches the artifact directly from Artifactory. If this attribute is not set or is set tofalse
, there is a risk of fetching the-cache
directory in Artifactory, potentially resulting in resource expiration and a 404 error.
getFile Result
The following output properties are available:
- Created string
- The time & date when the file was created.
- Created
By string - The user who created the file.
- Download
Uri string - The URI that can be used to download the file.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified string - The time & date when the file was last modified.
- Last
Updated string - The time & date when the file was last updated.
- Md5 string
- MD5 checksum of the file.
- Mimetype string
- The mimetype of the file.
- Modified
By string - The user who last modified the file.
- Output
Path string - Path string
- Repository string
- Sha1 string
- SHA1 checksum of the file.
- Sha256 string
- SHA256 checksum of the file.
- Size int
- The size of the file.
- Force
Overwrite bool - Path
Is boolAliased
- Created string
- The time & date when the file was created.
- Created
By string - The user who created the file.
- Download
Uri string - The URI that can be used to download the file.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified string - The time & date when the file was last modified.
- Last
Updated string - The time & date when the file was last updated.
- Md5 string
- MD5 checksum of the file.
- Mimetype string
- The mimetype of the file.
- Modified
By string - The user who last modified the file.
- Output
Path string - Path string
- Repository string
- Sha1 string
- SHA1 checksum of the file.
- Sha256 string
- SHA256 checksum of the file.
- Size int
- The size of the file.
- Force
Overwrite bool - Path
Is boolAliased
- created String
- The time & date when the file was created.
- created
By String - The user who created the file.
- download
Uri String - The URI that can be used to download the file.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified String - The time & date when the file was last modified.
- last
Updated String - The time & date when the file was last updated.
- md5 String
- MD5 checksum of the file.
- mimetype String
- The mimetype of the file.
- modified
By String - The user who last modified the file.
- output
Path String - path String
- repository String
- sha1 String
- SHA1 checksum of the file.
- sha256 String
- SHA256 checksum of the file.
- size Integer
- The size of the file.
- force
Overwrite Boolean - path
Is BooleanAliased
- created string
- The time & date when the file was created.
- created
By string - The user who created the file.
- download
Uri string - The URI that can be used to download the file.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Modified string - The time & date when the file was last modified.
- last
Updated string - The time & date when the file was last updated.
- md5 string
- MD5 checksum of the file.
- mimetype string
- The mimetype of the file.
- modified
By string - The user who last modified the file.
- output
Path string - path string
- repository string
- sha1 string
- SHA1 checksum of the file.
- sha256 string
- SHA256 checksum of the file.
- size number
- The size of the file.
- force
Overwrite boolean - path
Is booleanAliased
- created str
- The time & date when the file was created.
- created_
by str - The user who created the file.
- download_
uri str - The URI that can be used to download the file.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
modified str - The time & date when the file was last modified.
- last_
updated str - The time & date when the file was last updated.
- md5 str
- MD5 checksum of the file.
- mimetype str
- The mimetype of the file.
- modified_
by str - The user who last modified the file.
- output_
path str - path str
- repository str
- sha1 str
- SHA1 checksum of the file.
- sha256 str
- SHA256 checksum of the file.
- size int
- The size of the file.
- force_
overwrite bool - path_
is_ boolaliased
- created String
- The time & date when the file was created.
- created
By String - The user who created the file.
- download
Uri String - The URI that can be used to download the file.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified String - The time & date when the file was last modified.
- last
Updated String - The time & date when the file was last updated.
- md5 String
- MD5 checksum of the file.
- mimetype String
- The mimetype of the file.
- modified
By String - The user who last modified the file.
- output
Path String - path String
- repository String
- sha1 String
- SHA1 checksum of the file.
- sha256 String
- SHA256 checksum of the file.
- size Number
- The size of the file.
- force
Overwrite Boolean - path
Is BooleanAliased
Package Details
- Repository
- artifactory pulumi/pulumi-artifactory
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
artifactory
Terraform Provider.