» Data Source: oci_objectstorage_object_versions

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

Lists the object versions in a bucket.

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

data "oci_objectstorage_object_versions" "test_object_versions" {
    #Required
    bucket = "${var.object_version_bucket}"
    namespace = "${var.object_version_namespace}"

    #Optional
    delimiter = "${var.object_version_delimiter}"
    end = "${var.object_version_end}"
    fields = "${var.object_version_fields}"
    prefix = "${var.object_version_prefix}"
    start = "${var.object_version_start}"
    start_after = "${var.object_version_start_after}"
}

» Argument Reference

The following arguments are supported:

  • bucket - (Required) The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
  • delimiter - (Optional) 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 - (Optional) Object names returned by a list query must be strictly less than this parameter.
  • fields - (Optional) Object summary in list of objects includes the 'name' field. This parameter can also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time) and 'timeModified' (object modification date and time). Value of this parameter should be a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified'
  • namespace - (Required) The Object Storage namespace used for the request.
  • prefix - (Optional) The string to use for matching against the start of object names in a list query.
  • start - (Optional) Object names returned by a list query must be greater or equal to this parameter.
  • start_after - (Optional) Object names returned by a list query must be greater than this parameter.

» Attributes Reference

The following attributes are exported:

» ObjectVersion Reference

The following attributes are exported:

  • items - An array of object version summaries.
    • etag - The current entity tag (ETag) for the object.
    • is_delete_marker - This flag will indicate if the version is deleted or not.
    • md5 - Base64-encoded MD5 hash of the object data.
    • name - The name of the object. Avoid entering confidential information. Example: test/object1.log
    • size - Size of the object in bytes.
    • time_created - The date and time the object was created, as described in RFC 2616.
    • time_modified - The date and time the object was modified, as described in RFC 2616.
    • version_id - VersionId of the object.
  • prefixes - Prefixes that are common to the results returned by the request if the request specified a delimiter.