1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ObjectStorage
  5. getObjects
Oracle Cloud Infrastructure v1.33.0 published on Thursday, Apr 25, 2024 by Pulumi

oci.ObjectStorage.getObjects

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.33.0 published on Thursday, Apr 25, 2024 by Pulumi

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

    Lists the objects in a bucket. By default, ListObjects returns object names only. See the fields parameter for other fields that you can optionally include in ListObjects response.

    ListObjects returns at most 1000 objects. To paginate through more objects, use the returned ’nextStartWith' value with the ‘start’ parameter. To filter which objects ListObjects returns, use the ‘start’ and ’end’ parameters.

    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

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    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.GetObjectsArgs;
    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 testObjects = ObjectStorageFunctions.getObjects(GetObjectsArgs.builder()
                .bucket(objectBucket)
                .namespace(objectNamespace)
                .delimiter(objectDelimiter)
                .end(objectEnd)
                .fields(objectFields)
                .prefix(objectPrefix)
                .start(objectStart)
                .startAfter(objectStartAfter)
                .build());
    
        }
    }
    
    variables:
      testObjects:
        fn::invoke:
          Function: oci:ObjectStorage:getObjects
          Arguments:
            bucket: ${objectBucket}
            namespace: ${objectNamespace}
            delimiter: ${objectDelimiter}
            end: ${objectEnd}
            fields: ${objectFields}
            prefix: ${objectPrefix}
            start: ${objectStart}
            startAfter: ${objectStartAfter}
    

    Using getObjects

    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 getObjects(args: GetObjectsArgs, opts?: InvokeOptions): Promise<GetObjectsResult>
    function getObjectsOutput(args: GetObjectsOutputArgs, opts?: InvokeOptions): Output<GetObjectsResult>
    def get_objects(bucket: Optional[str] = None,
                    delimiter: Optional[str] = None,
                    end: Optional[str] = None,
                    filters: Optional[Sequence[_objectstorage.GetObjectsFilter]] = None,
                    namespace: Optional[str] = None,
                    prefix: Optional[str] = None,
                    start: Optional[str] = None,
                    start_after: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetObjectsResult
    def get_objects_output(bucket: Optional[pulumi.Input[str]] = None,
                    delimiter: Optional[pulumi.Input[str]] = None,
                    end: Optional[pulumi.Input[str]] = None,
                    filters: Optional[pulumi.Input[Sequence[pulumi.Input[_objectstorage.GetObjectsFilterArgs]]]] = 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[GetObjectsResult]
    func GetObjects(ctx *Context, args *GetObjectsArgs, opts ...InvokeOption) (*GetObjectsResult, error)
    func GetObjectsOutput(ctx *Context, args *GetObjectsOutputArgs, opts ...InvokeOption) GetObjectsResultOutput

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

    public static class GetObjects 
    {
        public static Task<GetObjectsResult> InvokeAsync(GetObjectsArgs args, InvokeOptions? opts = null)
        public static Output<GetObjectsResult> Invoke(GetObjectsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetObjectsResult> getObjects(GetObjectsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:ObjectStorage/getObjects:getObjects
      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.
    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
    Object names returned by a list query must be strictly less than this parameter.
    Filters List<GetObjectsFilter>
    Prefix string
    The string to use for matching against the start of object names in a list query.
    Start string
    Object names returned by a list query must be greater or equal to this parameter.
    StartAfter string
    Object names returned by a list query must be greater than this parameter.
    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.
    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
    Object names returned by a list query must be strictly less than this parameter.
    Filters []GetObjectsFilter
    Prefix string
    The string to use for matching against the start of object names in a list query.
    Start string
    Object names returned by a list query must be greater or equal to this parameter.
    StartAfter string
    Object names returned by a list query must be greater than this parameter.
    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.
    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
    Object names returned by a list query must be strictly less than this parameter.
    filters List<GetObjectsFilter>
    prefix String
    The string to use for matching against the start of object names in a list query.
    start String
    Object names returned by a list query must be greater or equal to this parameter.
    startAfter String
    Object names returned by a list query must be greater than this parameter.
    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.
    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
    Object names returned by a list query must be strictly less than this parameter.
    filters GetObjectsFilter[]
    prefix string
    The string to use for matching against the start of object names in a list query.
    start string
    Object names returned by a list query must be greater or equal to this parameter.
    startAfter string
    Object names returned by a list query must be greater than this parameter.
    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.
    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
    Object names returned by a list query must be strictly less than this parameter.
    filters Sequence[objectstorage.GetObjectsFilter]
    prefix str
    The string to use for matching against the start of object names in a list query.
    start str
    Object names returned by a list query must be greater or equal to this parameter.
    start_after str
    Object names returned by a list query must be greater than this parameter.
    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.
    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
    Object names returned by a list query must be strictly less than this parameter.
    filters List<Property Map>
    prefix String
    The string to use for matching against the start of object names in a list query.
    start String
    Object names returned by a list query must be greater or equal to this parameter.
    startAfter String
    Object names returned by a list query must be greater than this parameter.

    getObjects Result

    The following output properties are available:

    Bucket string
    Id string
    The provider-assigned unique ID for this managed resource.
    Namespace string
    Objects List<GetObjectsObject>
    The list of list_objects.
    Prefixes List<string>
    Delimiter string
    End string
    Filters List<GetObjectsFilter>
    Prefix string
    Start string
    StartAfter string
    Bucket string
    Id string
    The provider-assigned unique ID for this managed resource.
    Namespace string
    Objects []GetObjectsObject
    The list of list_objects.
    Prefixes []string
    Delimiter string
    End string
    Filters []GetObjectsFilter
    Prefix string
    Start string
    StartAfter string
    bucket String
    id String
    The provider-assigned unique ID for this managed resource.
    namespace String
    objects List<GetObjectsObject>
    The list of list_objects.
    prefixes List<String>
    delimiter String
    end String
    filters List<GetObjectsFilter>
    prefix String
    start String
    startAfter String
    bucket string
    id string
    The provider-assigned unique ID for this managed resource.
    namespace string
    objects GetObjectsObject[]
    The list of list_objects.
    prefixes string[]
    delimiter string
    end string
    filters GetObjectsFilter[]
    prefix string
    start string
    startAfter string
    bucket str
    id str
    The provider-assigned unique ID for this managed resource.
    namespace str
    objects Sequence[objectstorage.GetObjectsObject]
    The list of list_objects.
    prefixes Sequence[str]
    delimiter str
    end str
    filters Sequence[objectstorage.GetObjectsFilter]
    prefix str
    start str
    start_after str
    bucket String
    id String
    The provider-assigned unique ID for this managed resource.
    namespace String
    objects List<Property Map>
    The list of list_objects.
    prefixes List<String>
    delimiter String
    end String
    filters List<Property Map>
    prefix String
    start String
    startAfter String

    Supporting Types

    GetObjectsFilter

    Name string
    The name of the object.
    Values List<string>
    Regex bool
    Name string
    The name of the object.
    Values []string
    Regex bool
    name String
    The name of the object.
    values List<String>
    regex Boolean
    name string
    The name of the object.
    values string[]
    regex boolean
    name str
    The name of the object.
    values Sequence[str]
    regex bool
    name String
    The name of the object.
    values List<String>
    regex Boolean

    GetObjectsObject

    ArchivalState string
    Etag string
    The current entity tag (ETag) for the object.
    Md5 string
    Base64-encoded MD5 hash of the object data.
    Name string
    The name of the object.
    Size string
    Size of the object in bytes.
    StorageTier string
    The storage tier that the object is stored in.

    • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
    TimeCreated string
    The date and time the object was created, as described in RFC 2616.
    TimeModified string
    The date and time the object was modified, as described in RFC 2616.
    ArchivalState string
    Etag string
    The current entity tag (ETag) for the object.
    Md5 string
    Base64-encoded MD5 hash of the object data.
    Name string
    The name of the object.
    Size string
    Size of the object in bytes.
    StorageTier string
    The storage tier that the object is stored in.

    • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
    TimeCreated string
    The date and time the object was created, as described in RFC 2616.
    TimeModified string
    The date and time the object was modified, as described in RFC 2616.
    archivalState String
    etag String
    The current entity tag (ETag) for the object.
    md5 String
    Base64-encoded MD5 hash of the object data.
    name String
    The name of the object.
    size String
    Size of the object in bytes.
    storageTier String
    The storage tier that the object is stored in.

    • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
    timeCreated String
    The date and time the object was created, as described in RFC 2616.
    timeModified String
    The date and time the object was modified, as described in RFC 2616.
    archivalState string
    etag string
    The current entity tag (ETag) for the object.
    md5 string
    Base64-encoded MD5 hash of the object data.
    name string
    The name of the object.
    size string
    Size of the object in bytes.
    storageTier string
    The storage tier that the object is stored in.

    • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
    timeCreated string
    The date and time the object was created, as described in RFC 2616.
    timeModified string
    The date and time the object was modified, as described in RFC 2616.
    archival_state str
    etag str
    The current entity tag (ETag) for the object.
    md5 str
    Base64-encoded MD5 hash of the object data.
    name str
    The name of the object.
    size str
    Size of the object in bytes.
    storage_tier str
    The storage tier that the object is stored in.

    • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
    time_created str
    The date and time the object was created, as described in RFC 2616.
    time_modified str
    The date and time the object was modified, as described in RFC 2616.
    archivalState String
    etag String
    The current entity tag (ETag) for the object.
    md5 String
    Base64-encoded MD5 hash of the object data.
    name String
    The name of the object.
    size String
    Size of the object in bytes.
    storageTier String
    The storage tier that the object is stored in.

    • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
    timeCreated String
    The date and time the object was created, as described in RFC 2616.
    timeModified String
    The date and time the object was modified, as described in RFC 2616.

    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 v1.33.0 published on Thursday, Apr 25, 2024 by Pulumi