1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ObjectStorage
  5. getObjectVersions
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.ObjectStorage.getObjectVersions

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

This data source provides the list of Object Versions in Oracle Cloud Infrastructure Object Storage service.

Lists the object versions in a bucket.

ListObjectVersions returns an ObjectVersionCollection containing at most 1000 object versions. To paginate through more object versions, use the returned opc-next-page value with the page request parameter.

To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testObjectVersions = oci.ObjectStorage.getObjectVersions({
    bucket: objectVersionBucket,
    namespace: objectVersionNamespace,
    delimiter: objectVersionDelimiter,
    end: objectVersionEnd,
    fields: objectVersionFields,
    prefix: objectVersionPrefix,
    start: objectVersionStart,
    startAfter: objectVersionStartAfter,
});
Copy
import pulumi
import pulumi_oci as oci

test_object_versions = oci.ObjectStorage.get_object_versions(bucket=object_version_bucket,
    namespace=object_version_namespace,
    delimiter=object_version_delimiter,
    end=object_version_end,
    fields=object_version_fields,
    prefix=object_version_prefix,
    start=object_version_start,
    start_after=object_version_start_after)
Copy
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.GetObjectVersions(ctx, &objectstorage.GetObjectVersionsArgs{
			Bucket:     objectVersionBucket,
			Namespace:  objectVersionNamespace,
			Delimiter:  pulumi.StringRef(objectVersionDelimiter),
			End:        pulumi.StringRef(objectVersionEnd),
			Fields:     pulumi.StringRef(objectVersionFields),
			Prefix:     pulumi.StringRef(objectVersionPrefix),
			Start:      pulumi.StringRef(objectVersionStart),
			StartAfter: pulumi.StringRef(objectVersionStartAfter),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testObjectVersions = Oci.ObjectStorage.GetObjectVersions.Invoke(new()
    {
        Bucket = objectVersionBucket,
        Namespace = objectVersionNamespace,
        Delimiter = objectVersionDelimiter,
        End = objectVersionEnd,
        Fields = objectVersionFields,
        Prefix = objectVersionPrefix,
        Start = objectVersionStart,
        StartAfter = objectVersionStartAfter,
    });

});
Copy
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.GetObjectVersionsArgs;
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 testObjectVersions = ObjectStorageFunctions.getObjectVersions(GetObjectVersionsArgs.builder()
            .bucket(objectVersionBucket)
            .namespace(objectVersionNamespace)
            .delimiter(objectVersionDelimiter)
            .end(objectVersionEnd)
            .fields(objectVersionFields)
            .prefix(objectVersionPrefix)
            .start(objectVersionStart)
            .startAfter(objectVersionStartAfter)
            .build());

    }
}
Copy
variables:
  testObjectVersions:
    fn::invoke:
      function: oci:ObjectStorage:getObjectVersions
      arguments:
        bucket: ${objectVersionBucket}
        namespace: ${objectVersionNamespace}
        delimiter: ${objectVersionDelimiter}
        end: ${objectVersionEnd}
        fields: ${objectVersionFields}
        prefix: ${objectVersionPrefix}
        start: ${objectVersionStart}
        startAfter: ${objectVersionStartAfter}
Copy

Using getObjectVersions

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 getObjectVersions(args: GetObjectVersionsArgs, opts?: InvokeOptions): Promise<GetObjectVersionsResult>
function getObjectVersionsOutput(args: GetObjectVersionsOutputArgs, opts?: InvokeOptions): Output<GetObjectVersionsResult>
Copy
def get_object_versions(bucket: Optional[str] = None,
                        delimiter: Optional[str] = None,
                        end: Optional[str] = None,
                        fields: Optional[str] = None,
                        filters: Optional[Sequence[_objectstorage.GetObjectVersionsFilter]] = None,
                        namespace: Optional[str] = None,
                        prefix: Optional[str] = None,
                        start: Optional[str] = None,
                        start_after: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetObjectVersionsResult
def get_object_versions_output(bucket: Optional[pulumi.Input[str]] = None,
                        delimiter: Optional[pulumi.Input[str]] = None,
                        end: Optional[pulumi.Input[str]] = None,
                        fields: Optional[pulumi.Input[str]] = None,
                        filters: Optional[pulumi.Input[Sequence[pulumi.Input[_objectstorage.GetObjectVersionsFilterArgs]]]] = None,
                        namespace: Optional[pulumi.Input[str]] = None,
                        prefix: Optional[pulumi.Input[str]] = None,
                        start: Optional[pulumi.Input[str]] = None,
                        start_after: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetObjectVersionsResult]
Copy
func GetObjectVersions(ctx *Context, args *GetObjectVersionsArgs, opts ...InvokeOption) (*GetObjectVersionsResult, error)
func GetObjectVersionsOutput(ctx *Context, args *GetObjectVersionsOutputArgs, opts ...InvokeOption) GetObjectVersionsResultOutput
Copy

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

public static class GetObjectVersions 
{
    public static Task<GetObjectVersionsResult> InvokeAsync(GetObjectVersionsArgs args, InvokeOptions? opts = null)
    public static Output<GetObjectVersionsResult> Invoke(GetObjectVersionsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetObjectVersionsResult> getObjectVersions(GetObjectVersionsArgs args, InvokeOptions options)
public static Output<GetObjectVersionsResult> getObjectVersions(GetObjectVersionsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:ObjectStorage/getObjectVersions:getObjectVersions
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Bucket This property is required. string
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
Namespace This property is required. string
The Object Storage namespace used for the request.
Delimiter string
When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
End string
Returns object names which are lexicographically strictly less than this parameter.
Fields string
Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.
Filters Changes to this property will trigger replacement. List<GetObjectVersionsFilter>
Prefix string
The string to use for matching against the start of object names in a list query.
Start string
Returns object names which are lexicographically greater than or equal to this parameter.
StartAfter string
Returns object names which are lexicographically strictly greater than this parameter.
Bucket This property is required. string
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
Namespace This property is required. string
The Object Storage namespace used for the request.
Delimiter string
When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
End string
Returns object names which are lexicographically strictly less than this parameter.
Fields string
Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.
Filters Changes to this property will trigger replacement. []GetObjectVersionsFilter
Prefix string
The string to use for matching against the start of object names in a list query.
Start string
Returns object names which are lexicographically greater than or equal to this parameter.
StartAfter string
Returns object names which are lexicographically strictly greater than this parameter.
bucket This property is required. String
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. String
The Object Storage namespace used for the request.
delimiter String
When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
end String
Returns object names which are lexicographically strictly less than this parameter.
fields String
Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.
filters Changes to this property will trigger replacement. List<GetObjectVersionsFilter>
prefix String
The string to use for matching against the start of object names in a list query.
start String
Returns object names which are lexicographically greater than or equal to this parameter.
startAfter String
Returns object names which are lexicographically strictly greater than this parameter.
bucket This property is required. string
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. string
The Object Storage namespace used for the request.
delimiter string
When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
end string
Returns object names which are lexicographically strictly less than this parameter.
fields string
Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.
filters Changes to this property will trigger replacement. GetObjectVersionsFilter[]
prefix string
The string to use for matching against the start of object names in a list query.
start string
Returns object names which are lexicographically greater than or equal to this parameter.
startAfter string
Returns object names which are lexicographically strictly greater than this parameter.
bucket This property is required. str
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. str
The Object Storage namespace used for the request.
delimiter str
When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
end str
Returns object names which are lexicographically strictly less than this parameter.
fields str
Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.
filters Changes to this property will trigger replacement. Sequence[objectstorage.GetObjectVersionsFilter]
prefix str
The string to use for matching against the start of object names in a list query.
start str
Returns object names which are lexicographically greater than or equal to this parameter.
start_after str
Returns object names which are lexicographically strictly greater than this parameter.
bucket This property is required. String
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. String
The Object Storage namespace used for the request.
delimiter String
When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
end String
Returns object names which are lexicographically strictly less than this parameter.
fields String
Object summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.
filters Changes to this property will trigger replacement. List<Property Map>
prefix String
The string to use for matching against the start of object names in a list query.
start String
Returns object names which are lexicographically greater than or equal to this parameter.
startAfter String
Returns object names which are lexicographically strictly greater than this parameter.

getObjectVersions Result

The following output properties are available:

Bucket string
Id string
The provider-assigned unique ID for this managed resource.
Items List<GetObjectVersionsItem>
An array of object version summaries.
Namespace string
Prefixes List<string>
Prefixes that are common to the results returned by the request if the request specified a delimiter.
Delimiter string
End string
Fields string
Filters List<GetObjectVersionsFilter>
Prefix string
Start string
StartAfter string
Bucket string
Id string
The provider-assigned unique ID for this managed resource.
Items []GetObjectVersionsItem
An array of object version summaries.
Namespace string
Prefixes []string
Prefixes that are common to the results returned by the request if the request specified a delimiter.
Delimiter string
End string
Fields string
Filters []GetObjectVersionsFilter
Prefix string
Start string
StartAfter string
bucket String
id String
The provider-assigned unique ID for this managed resource.
items List<GetObjectVersionsItem>
An array of object version summaries.
namespace String
prefixes List<String>
Prefixes that are common to the results returned by the request if the request specified a delimiter.
delimiter String
end String
fields String
filters List<GetObjectVersionsFilter>
prefix String
start String
startAfter String
bucket string
id string
The provider-assigned unique ID for this managed resource.
items GetObjectVersionsItem[]
An array of object version summaries.
namespace string
prefixes string[]
Prefixes that are common to the results returned by the request if the request specified a delimiter.
delimiter string
end string
fields string
filters GetObjectVersionsFilter[]
prefix string
start string
startAfter string
bucket str
id str
The provider-assigned unique ID for this managed resource.
items Sequence[objectstorage.GetObjectVersionsItem]
An array of object version summaries.
namespace str
prefixes Sequence[str]
Prefixes that are common to the results returned by the request if the request specified a delimiter.
delimiter str
end str
fields str
filters Sequence[objectstorage.GetObjectVersionsFilter]
prefix str
start str
start_after str
bucket String
id String
The provider-assigned unique ID for this managed resource.
items List<Property Map>
An array of object version summaries.
namespace String
prefixes List<String>
Prefixes that are common to the results returned by the request if the request specified a delimiter.
delimiter String
end String
fields String
filters List<Property Map>
prefix String
start String
startAfter String

Supporting Types

GetObjectVersionsFilter

Name This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
Values This property is required. List<string>
Regex bool
Name This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
Values This property is required. []string
Regex bool
name This property is required. String
The name of the object. Avoid entering confidential information. Example: test/object1.log
values This property is required. List<String>
regex Boolean
name This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
values This property is required. string[]
regex boolean
name This property is required. str
The name of the object. Avoid entering confidential information. Example: test/object1.log
values This property is required. Sequence[str]
regex bool
name This property is required. String
The name of the object. Avoid entering confidential information. Example: test/object1.log
values This property is required. List<String>
regex Boolean

GetObjectVersionsItem

ArchivalState This property is required. string
Archival state of an object. This field is set only for objects in Archive tier.
Etag This property is required. string
The current entity tag (ETag) for the object.
IsDeleteMarker This property is required. bool
This flag will indicate if the version is deleted or not.
Md5 This property is required. string
Base64-encoded MD5 hash of the object data.
Name This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
Size This property is required. string
Size of the object in bytes.
StorageTier This property is required. string
The storage tier that the object is stored in.
TimeCreated This property is required. string
The date and time the object was created, as described in RFC 2616.
TimeModified This property is required. string
The date and time the object was modified, as described in RFC 2616.
VersionId This property is required. string
VersionId of the object.
ArchivalState This property is required. string
Archival state of an object. This field is set only for objects in Archive tier.
Etag This property is required. string
The current entity tag (ETag) for the object.
IsDeleteMarker This property is required. bool
This flag will indicate if the version is deleted or not.
Md5 This property is required. string
Base64-encoded MD5 hash of the object data.
Name This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
Size This property is required. string
Size of the object in bytes.
StorageTier This property is required. string
The storage tier that the object is stored in.
TimeCreated This property is required. string
The date and time the object was created, as described in RFC 2616.
TimeModified This property is required. string
The date and time the object was modified, as described in RFC 2616.
VersionId This property is required. string
VersionId of the object.
archivalState This property is required. String
Archival state of an object. This field is set only for objects in Archive tier.
etag This property is required. String
The current entity tag (ETag) for the object.
isDeleteMarker This property is required. Boolean
This flag will indicate if the version is deleted or not.
md5 This property is required. String
Base64-encoded MD5 hash of the object data.
name This property is required. String
The name of the object. Avoid entering confidential information. Example: test/object1.log
size This property is required. String
Size of the object in bytes.
storageTier This property is required. String
The storage tier that the object is stored in.
timeCreated This property is required. String
The date and time the object was created, as described in RFC 2616.
timeModified This property is required. String
The date and time the object was modified, as described in RFC 2616.
versionId This property is required. String
VersionId of the object.
archivalState This property is required. string
Archival state of an object. This field is set only for objects in Archive tier.
etag This property is required. string
The current entity tag (ETag) for the object.
isDeleteMarker This property is required. boolean
This flag will indicate if the version is deleted or not.
md5 This property is required. string
Base64-encoded MD5 hash of the object data.
name This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
size This property is required. string
Size of the object in bytes.
storageTier This property is required. string
The storage tier that the object is stored in.
timeCreated This property is required. string
The date and time the object was created, as described in RFC 2616.
timeModified This property is required. string
The date and time the object was modified, as described in RFC 2616.
versionId This property is required. string
VersionId of the object.
archival_state This property is required. str
Archival state of an object. This field is set only for objects in Archive tier.
etag This property is required. str
The current entity tag (ETag) for the object.
is_delete_marker This property is required. bool
This flag will indicate if the version is deleted or not.
md5 This property is required. str
Base64-encoded MD5 hash of the object data.
name This property is required. str
The name of the object. Avoid entering confidential information. Example: test/object1.log
size This property is required. str
Size of the object in bytes.
storage_tier This property is required. str
The storage tier that the object is stored in.
time_created This property is required. str
The date and time the object was created, as described in RFC 2616.
time_modified This property is required. str
The date and time the object was modified, as described in RFC 2616.
version_id This property is required. str
VersionId of the object.
archivalState This property is required. String
Archival state of an object. This field is set only for objects in Archive tier.
etag This property is required. String
The current entity tag (ETag) for the object.
isDeleteMarker This property is required. Boolean
This flag will indicate if the version is deleted or not.
md5 This property is required. String
Base64-encoded MD5 hash of the object data.
name This property is required. String
The name of the object. Avoid entering confidential information. Example: test/object1.log
size This property is required. String
Size of the object in bytes.
storageTier This property is required. String
The storage tier that the object is stored in.
timeCreated This property is required. String
The date and time the object was created, as described in RFC 2616.
timeModified This property is required. String
The date and time the object was modified, as described in RFC 2616.
versionId This property is required. String
VersionId of the object.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi