1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ObjectStorage
  5. getObject
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.ObjectStorage.getObject

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides details about a specific Object resource in Oracle Cloud Infrastructure Object Storage service.

    Gets the metadata and body of an object.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testObject = oci.ObjectStorage.getObject({
        bucket: objectBucket,
        namespace: objectNamespace,
        object: objectObject,
        httpResponseCacheControl: objectHttpResponseCacheControl,
        httpResponseContentDisposition: objectHttpResponseContentDisposition,
        httpResponseContentEncoding: objectHttpResponseContentEncoding,
        httpResponseContentLanguage: objectHttpResponseContentLanguage,
        httpResponseContentType: objectHttpResponseContentType,
        httpResponseExpires: objectHttpResponseExpires,
        versionId: testVersion.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_object = oci.ObjectStorage.get_object(bucket=object_bucket,
        namespace=object_namespace,
        object=object_object,
        http_response_cache_control=object_http_response_cache_control,
        http_response_content_disposition=object_http_response_content_disposition,
        http_response_content_encoding=object_http_response_content_encoding,
        http_response_content_language=object_http_response_content_language,
        http_response_content_type=object_http_response_content_type,
        http_response_expires=object_http_response_expires,
        version_id=test_version["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/ObjectStorage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ObjectStorage.GetObject(ctx, &objectstorage.GetObjectArgs{
    			Bucket:                         objectBucket,
    			Namespace:                      objectNamespace,
    			Object:                         objectObject,
    			HttpResponseCacheControl:       pulumi.StringRef(objectHttpResponseCacheControl),
    			HttpResponseContentDisposition: pulumi.StringRef(objectHttpResponseContentDisposition),
    			HttpResponseContentEncoding:    pulumi.StringRef(objectHttpResponseContentEncoding),
    			HttpResponseContentLanguage:    pulumi.StringRef(objectHttpResponseContentLanguage),
    			HttpResponseContentType:        pulumi.StringRef(objectHttpResponseContentType),
    			HttpResponseExpires:            pulumi.StringRef(objectHttpResponseExpires),
    			VersionId:                      pulumi.StringRef(testVersion.Id),
    		}, 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 testObject = Oci.ObjectStorage.GetObject.Invoke(new()
        {
            Bucket = objectBucket,
            Namespace = objectNamespace,
            Object = objectObject,
            HttpResponseCacheControl = objectHttpResponseCacheControl,
            HttpResponseContentDisposition = objectHttpResponseContentDisposition,
            HttpResponseContentEncoding = objectHttpResponseContentEncoding,
            HttpResponseContentLanguage = objectHttpResponseContentLanguage,
            HttpResponseContentType = objectHttpResponseContentType,
            HttpResponseExpires = objectHttpResponseExpires,
            VersionId = testVersion.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ObjectStorage.ObjectStorageFunctions;
    import com.pulumi.oci.ObjectStorage.inputs.GetObjectArgs;
    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 testObject = ObjectStorageFunctions.getObject(GetObjectArgs.builder()
                .bucket(objectBucket)
                .namespace(objectNamespace)
                .object(objectObject)
                .httpResponseCacheControl(objectHttpResponseCacheControl)
                .httpResponseContentDisposition(objectHttpResponseContentDisposition)
                .httpResponseContentEncoding(objectHttpResponseContentEncoding)
                .httpResponseContentLanguage(objectHttpResponseContentLanguage)
                .httpResponseContentType(objectHttpResponseContentType)
                .httpResponseExpires(objectHttpResponseExpires)
                .versionId(testVersion.id())
                .build());
    
        }
    }
    
    variables:
      testObject:
        fn::invoke:
          Function: oci:ObjectStorage:getObject
          Arguments:
            bucket: ${objectBucket}
            namespace: ${objectNamespace}
            object: ${objectObject}
            httpResponseCacheControl: ${objectHttpResponseCacheControl}
            httpResponseContentDisposition: ${objectHttpResponseContentDisposition}
            httpResponseContentEncoding: ${objectHttpResponseContentEncoding}
            httpResponseContentLanguage: ${objectHttpResponseContentLanguage}
            httpResponseContentType: ${objectHttpResponseContentType}
            httpResponseExpires: ${objectHttpResponseExpires}
            versionId: ${testVersion.id}
    

    Using getObject

    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 getObject(args: GetObjectArgs, opts?: InvokeOptions): Promise<GetObjectResult>
    function getObjectOutput(args: GetObjectOutputArgs, opts?: InvokeOptions): Output<GetObjectResult>
    def get_object(base64_encode_content: Optional[bool] = None,
                   bucket: Optional[str] = None,
                   content_length_limit: Optional[int] = None,
                   http_response_cache_control: Optional[str] = None,
                   http_response_content_disposition: Optional[str] = None,
                   http_response_content_encoding: Optional[str] = None,
                   http_response_content_language: Optional[str] = None,
                   http_response_content_type: Optional[str] = None,
                   http_response_expires: Optional[str] = None,
                   namespace: Optional[str] = None,
                   object: Optional[str] = None,
                   version_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetObjectResult
    def get_object_output(base64_encode_content: Optional[pulumi.Input[bool]] = None,
                   bucket: Optional[pulumi.Input[str]] = None,
                   content_length_limit: Optional[pulumi.Input[int]] = None,
                   http_response_cache_control: Optional[pulumi.Input[str]] = None,
                   http_response_content_disposition: Optional[pulumi.Input[str]] = None,
                   http_response_content_encoding: Optional[pulumi.Input[str]] = None,
                   http_response_content_language: Optional[pulumi.Input[str]] = None,
                   http_response_content_type: Optional[pulumi.Input[str]] = None,
                   http_response_expires: Optional[pulumi.Input[str]] = None,
                   namespace: Optional[pulumi.Input[str]] = None,
                   object: Optional[pulumi.Input[str]] = None,
                   version_id: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetObjectResult]
    func GetObject(ctx *Context, args *GetObjectArgs, opts ...InvokeOption) (*GetObjectResult, error)
    func GetObjectOutput(ctx *Context, args *GetObjectOutputArgs, opts ...InvokeOption) GetObjectResultOutput

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

    public static class GetObject 
    {
        public static Task<GetObjectResult> InvokeAsync(GetObjectArgs args, InvokeOptions? opts = null)
        public static Output<GetObjectResult> Invoke(GetObjectInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetObjectResult> getObject(GetObjectArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:ObjectStorage/getObject:getObject
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    Namespace string
    The Object Storage namespace used for the request.
    Object string
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    Base64EncodeContent bool
    ContentLengthLimit int
    The limit of the content length of the object body to download from the object store. The default is 1Mb.
    HttpResponseCacheControl string
    Specify this query parameter to override the Cache-Control response header in the GetObject response.
    HttpResponseContentDisposition string
    Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.
    HttpResponseContentEncoding string
    Specify this query parameter to override the Content-Encoding response header in the GetObject response.
    HttpResponseContentLanguage string
    Specify this query parameter to override the Content-Language response header in the GetObject response.
    HttpResponseContentType string
    Specify this query parameter to override the Content-Type response header in the GetObject response.
    HttpResponseExpires string
    Specify this query parameter to override the Expires response header in the GetObject response.
    VersionId string
    VersionId used to identify a particular version of the object
    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    Namespace string
    The Object Storage namespace used for the request.
    Object string
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    Base64EncodeContent bool
    ContentLengthLimit int
    The limit of the content length of the object body to download from the object store. The default is 1Mb.
    HttpResponseCacheControl string
    Specify this query parameter to override the Cache-Control response header in the GetObject response.
    HttpResponseContentDisposition string
    Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.
    HttpResponseContentEncoding string
    Specify this query parameter to override the Content-Encoding response header in the GetObject response.
    HttpResponseContentLanguage string
    Specify this query parameter to override the Content-Language response header in the GetObject response.
    HttpResponseContentType string
    Specify this query parameter to override the Content-Type response header in the GetObject response.
    HttpResponseExpires string
    Specify this query parameter to override the Expires response header in the GetObject response.
    VersionId string
    VersionId used to identify a particular version of the object
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace String
    The Object Storage namespace used for the request.
    object String
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    base64EncodeContent Boolean
    contentLengthLimit Integer
    The limit of the content length of the object body to download from the object store. The default is 1Mb.
    httpResponseCacheControl String
    Specify this query parameter to override the Cache-Control response header in the GetObject response.
    httpResponseContentDisposition String
    Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.
    httpResponseContentEncoding String
    Specify this query parameter to override the Content-Encoding response header in the GetObject response.
    httpResponseContentLanguage String
    Specify this query parameter to override the Content-Language response header in the GetObject response.
    httpResponseContentType String
    Specify this query parameter to override the Content-Type response header in the GetObject response.
    httpResponseExpires String
    Specify this query parameter to override the Expires response header in the GetObject response.
    versionId String
    VersionId used to identify a particular version of the object
    bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace string
    The Object Storage namespace used for the request.
    object string
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    base64EncodeContent boolean
    contentLengthLimit number
    The limit of the content length of the object body to download from the object store. The default is 1Mb.
    httpResponseCacheControl string
    Specify this query parameter to override the Cache-Control response header in the GetObject response.
    httpResponseContentDisposition string
    Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.
    httpResponseContentEncoding string
    Specify this query parameter to override the Content-Encoding response header in the GetObject response.
    httpResponseContentLanguage string
    Specify this query parameter to override the Content-Language response header in the GetObject response.
    httpResponseContentType string
    Specify this query parameter to override the Content-Type response header in the GetObject response.
    httpResponseExpires string
    Specify this query parameter to override the Expires response header in the GetObject response.
    versionId string
    VersionId used to identify a particular version of the object
    bucket str
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace str
    The Object Storage namespace used for the request.
    object str
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    base64_encode_content bool
    content_length_limit int
    The limit of the content length of the object body to download from the object store. The default is 1Mb.
    http_response_cache_control str
    Specify this query parameter to override the Cache-Control response header in the GetObject response.
    http_response_content_disposition str
    Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.
    http_response_content_encoding str
    Specify this query parameter to override the Content-Encoding response header in the GetObject response.
    http_response_content_language str
    Specify this query parameter to override the Content-Language response header in the GetObject response.
    http_response_content_type str
    Specify this query parameter to override the Content-Type response header in the GetObject response.
    http_response_expires str
    Specify this query parameter to override the Expires response header in the GetObject response.
    version_id str
    VersionId used to identify a particular version of the object
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace String
    The Object Storage namespace used for the request.
    object String
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    base64EncodeContent Boolean
    contentLengthLimit Number
    The limit of the content length of the object body to download from the object store. The default is 1Mb.
    httpResponseCacheControl String
    Specify this query parameter to override the Cache-Control response header in the GetObject response.
    httpResponseContentDisposition String
    Specify this query parameter to override the value of the Content-Disposition response header in the GetObject response.
    httpResponseContentEncoding String
    Specify this query parameter to override the Content-Encoding response header in the GetObject response.
    httpResponseContentLanguage String
    Specify this query parameter to override the Content-Language response header in the GetObject response.
    httpResponseContentType String
    Specify this query parameter to override the Content-Type response header in the GetObject response.
    httpResponseExpires String
    Specify this query parameter to override the Expires response header in the GetObject response.
    versionId String
    VersionId used to identify a particular version of the object

    getObject Result

    The following output properties are available:

    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    CacheControl string
    Content string
    The object to upload to the object store.
    ContentDisposition string
    ContentEncoding string
    The content encoding of the object.
    ContentLanguage string
    The content language of the object.
    ContentLength string
    The content length of the body.
    ContentMd5 string
    The base-64 encoded MD5 hash of the body.
    ContentType string
    The content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata Dictionary<string, string>
    Optional user-defined metadata key and value. Note: Metadata keys are case-insensitive and all returned keys will be lower case.
    Namespace string
    The top-level namespace used for the request.
    Object string
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    StorageTier string
    The storage tier that the object is stored in.
    VersionId string
    Base64EncodeContent bool
    ContentLengthLimit int
    HttpResponseCacheControl string
    HttpResponseContentDisposition string
    HttpResponseContentEncoding string
    HttpResponseContentLanguage string
    HttpResponseContentType string
    HttpResponseExpires string
    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    CacheControl string
    Content string
    The object to upload to the object store.
    ContentDisposition string
    ContentEncoding string
    The content encoding of the object.
    ContentLanguage string
    The content language of the object.
    ContentLength string
    The content length of the body.
    ContentMd5 string
    The base-64 encoded MD5 hash of the body.
    ContentType string
    The content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata map[string]string
    Optional user-defined metadata key and value. Note: Metadata keys are case-insensitive and all returned keys will be lower case.
    Namespace string
    The top-level namespace used for the request.
    Object string
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    StorageTier string
    The storage tier that the object is stored in.
    VersionId string
    Base64EncodeContent bool
    ContentLengthLimit int
    HttpResponseCacheControl string
    HttpResponseContentDisposition string
    HttpResponseContentEncoding string
    HttpResponseContentLanguage string
    HttpResponseContentType string
    HttpResponseExpires string
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    cacheControl String
    content String
    The object to upload to the object store.
    contentDisposition String
    contentEncoding String
    The content encoding of the object.
    contentLanguage String
    The content language of the object.
    contentLength String
    The content length of the body.
    contentMd5 String
    The base-64 encoded MD5 hash of the body.
    contentType String
    The content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String,String>
    Optional user-defined metadata key and value. Note: Metadata keys are case-insensitive and all returned keys will be lower case.
    namespace String
    The top-level namespace used for the request.
    object String
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    storageTier String
    The storage tier that the object is stored in.
    versionId String
    base64EncodeContent Boolean
    contentLengthLimit Integer
    httpResponseCacheControl String
    httpResponseContentDisposition String
    httpResponseContentEncoding String
    httpResponseContentLanguage String
    httpResponseContentType String
    httpResponseExpires String
    bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    cacheControl string
    content string
    The object to upload to the object store.
    contentDisposition string
    contentEncoding string
    The content encoding of the object.
    contentLanguage string
    The content language of the object.
    contentLength string
    The content length of the body.
    contentMd5 string
    The base-64 encoded MD5 hash of the body.
    contentType string
    The content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call.
    id string
    The provider-assigned unique ID for this managed resource.
    metadata {[key: string]: string}
    Optional user-defined metadata key and value. Note: Metadata keys are case-insensitive and all returned keys will be lower case.
    namespace string
    The top-level namespace used for the request.
    object string
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    storageTier string
    The storage tier that the object is stored in.
    versionId string
    base64EncodeContent boolean
    contentLengthLimit number
    httpResponseCacheControl string
    httpResponseContentDisposition string
    httpResponseContentEncoding string
    httpResponseContentLanguage string
    httpResponseContentType string
    httpResponseExpires string
    bucket str
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    cache_control str
    content str
    The object to upload to the object store.
    content_disposition str
    content_encoding str
    The content encoding of the object.
    content_language str
    The content language of the object.
    content_length str
    The content length of the body.
    content_md5 str
    The base-64 encoded MD5 hash of the body.
    content_type str
    The content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call.
    id str
    The provider-assigned unique ID for this managed resource.
    metadata Mapping[str, str]
    Optional user-defined metadata key and value. Note: Metadata keys are case-insensitive and all returned keys will be lower case.
    namespace str
    The top-level namespace used for the request.
    object str
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    storage_tier str
    The storage tier that the object is stored in.
    version_id str
    base64_encode_content bool
    content_length_limit int
    http_response_cache_control str
    http_response_content_disposition str
    http_response_content_encoding str
    http_response_content_language str
    http_response_content_type str
    http_response_expires str
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    cacheControl String
    content String
    The object to upload to the object store.
    contentDisposition String
    contentEncoding String
    The content encoding of the object.
    contentLanguage String
    The content language of the object.
    contentLength String
    The content length of the body.
    contentMd5 String
    The base-64 encoded MD5 hash of the body.
    contentType String
    The content type of the object. Defaults to 'application/octet-stream' if not overridden during the PutObject call.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String>
    Optional user-defined metadata key and value. Note: Metadata keys are case-insensitive and all returned keys will be lower case.
    namespace String
    The top-level namespace used for the request.
    object String
    The name of the object. Avoid entering confidential information. Example: test/object1.log
    storageTier String
    The storage tier that the object is stored in.
    versionId String
    base64EncodeContent Boolean
    contentLengthLimit Number
    httpResponseCacheControl String
    httpResponseContentDisposition String
    httpResponseContentEncoding String
    httpResponseContentLanguage String
    httpResponseContentType String
    httpResponseExpires String

    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 v2.17.0 published on Friday, Nov 15, 2024 by Pulumi