Class ObjectStorageClient

    • Field Detail

      • SERVICE

        public static final Service SERVICE
        Service instance for ObjectStorage.
      • clientCommonLibraryVersion

        public final String clientCommonLibraryVersion
        Compatible SDK version, provided by the codegen.
      • minimumClientCommonLibraryVersionFromClient

        public final Optional<String> minimumClientCommonLibraryVersionFromClient
        Minimum compatible SDK version, maybe provided by the codegen.
    • Method Detail

      • setRegion

        public void setRegion​(Region region)
        Description copied from interface: ObjectStorage
        Sets the region to call (ex, Region.US_PHOENIX_1).

        Note, this will call setEndpoint after resolving the endpoint. If the service is not available in this Region, however, an IllegalArgumentException will be raised.

        Specified by:
        setRegion in interface ObjectStorage
        Parameters:
        region - The region of the service.
      • commitMultipartUpload

        public CommitMultipartUploadResponse commitMultipartUpload​(CommitMultipartUploadRequest request)
        Description copied from interface: ObjectStorage
        Commits a multipart upload, which involves checking part numbers and entity tags (ETags) of the parts, to create an aggregate object.
        Specified by:
        commitMultipartUpload in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • copyObject

        public CopyObjectResponse copyObject​(CopyObjectRequest request)
        Description copied from interface: ObjectStorage
        Creates a request to copy an object within a region or to another region.

        See [Object Names](https://docs.oracle.com/iaas/Content/Object/Tasks/managingobjects.htm#namerequirements) for object naming requirements.

        Specified by:
        copyObject in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • createBucket

        public CreateBucketResponse createBucket​(CreateBucketRequest request)
        Description copied from interface: ObjectStorage
        Creates a bucket in the given namespace with a bucket name and optional user-defined metadata.

        Avoid entering confidential information in bucket names.

        Specified by:
        createBucket in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • createMultipartUpload

        public CreateMultipartUploadResponse createMultipartUpload​(CreateMultipartUploadRequest request)
        Description copied from interface: ObjectStorage
        Starts a new multipart upload to a specific object in the given bucket in the given namespace.

        See [Object Names](https://docs.oracle.com/iaas/Content/Object/Tasks/managingobjects.htm#namerequirements) for object naming requirements.

        Specified by:
        createMultipartUpload in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • createRetentionRule

        public CreateRetentionRuleResponse createRetentionRule​(CreateRetentionRuleRequest request)
        Description copied from interface: ObjectStorage
        Creates a new retention rule in the specified bucket.

        The new rule will take effect typically within 30 seconds. Note that a maximum of 100 rules are supported on a bucket.

        Specified by:
        createRetentionRule in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • deleteBucket

        public DeleteBucketResponse deleteBucket​(DeleteBucketRequest request)
        Description copied from interface: ObjectStorage
        Deletes a bucket if the bucket is already empty.

        If the bucket is not empty, use deleteObject first. In addition, you cannot delete a bucket that has a multipart upload in progress or a pre-authenticated request associated with that bucket.

        Specified by:
        deleteBucket in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • getBucket

        public GetBucketResponse getBucket​(GetBucketRequest request)
        Description copied from interface: ObjectStorage
        Gets the current representation of the given bucket in the given Object Storage namespace.
        Specified by:
        getBucket in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • getNamespace

        public GetNamespaceResponse getNamespace​(GetNamespaceRequest request)
        Description copied from interface: ObjectStorage
        Each Oracle Cloud Infrastructure tenant is assigned one unique and uneditable Object Storage namespace.

        The namespace is a system-generated string assigned during account creation. For some older tenancies, the namespace string may be the tenancy name in all lower-case letters. You cannot edit a namespace.

        GetNamespace returns the name of the Object Storage namespace for the user making the request. If an optional compartmentId query parameter is provided, GetNamespace returns the namespace name of the corresponding tenancy, provided the user has access to it.

        Specified by:
        getNamespace in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • getNamespaceMetadata

        public GetNamespaceMetadataResponse getNamespaceMetadata​(GetNamespaceMetadataRequest request)
        Description copied from interface: ObjectStorage
        Gets the metadata for the Object Storage namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId.

        Any user with the OBJECTSTORAGE_NAMESPACE_READ permission will be able to see the current metadata. 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](https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm).

        Specified by:
        getNamespaceMetadata in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • getObject

        public GetObjectResponse getObject​(GetObjectRequest request)
        Description copied from interface: ObjectStorage
        Gets the metadata and body of an object.
        Specified by:
        getObject in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • getPrivateEndpoint

        public GetPrivateEndpointResponse getPrivateEndpoint​(GetPrivateEndpointRequest request)
        Description copied from interface: ObjectStorage
        Gets the current representation of the given Private Endpoint in the given Object Storage namespace.
        Specified by:
        getPrivateEndpoint in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • headBucket

        public HeadBucketResponse headBucket​(HeadBucketRequest request)
        Description copied from interface: ObjectStorage
        Efficiently checks to see if a bucket exists and gets the current entity tag (ETag) for the bucket.
        Specified by:
        headBucket in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • headObject

        public HeadObjectResponse headObject​(HeadObjectRequest request)
        Description copied from interface: ObjectStorage
        Gets the user-defined metadata and entity tag (ETag) for an object.
        Specified by:
        headObject in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • listBuckets

        public ListBucketsResponse listBuckets​(ListBucketsRequest request)
        Description copied from interface: ObjectStorage
        Gets a list of all BucketSummary items in a compartment.

        A BucketSummary contains only summary fields for the bucket and does not contain fields like the user-defined metadata.

        ListBuckets returns a BucketSummary containing at most 1000 buckets. To paginate through more buckets, 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](https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm).

        Specified by:
        listBuckets in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • listObjectVersions

        public ListObjectVersionsResponse listObjectVersions​(ListObjectVersionsRequest request)
        Description copied from interface: ObjectStorage
        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](https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm).

        Specified by:
        listObjectVersions in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • listObjects

        public ListObjectsResponse listObjects​(ListObjectsRequest request)
        Description copied from interface: ObjectStorage
        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](https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm).

        Specified by:
        listObjects in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • listPrivateEndpoints

        public ListPrivateEndpointsResponse listPrivateEndpoints​(ListPrivateEndpointsRequest request)
        Description copied from interface: ObjectStorage
        Gets a list of all PrivateEndpointSummary in a compartment associated with a namespace.

        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.

        Specified by:
        listPrivateEndpoints in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • listRetentionRules

        public ListRetentionRulesResponse listRetentionRules​(ListRetentionRulesRequest request)
        Description copied from interface: ObjectStorage
        List the retention rules for a bucket.

        The retention rules are sorted based on creation time, with the most recently created retention rule returned first.

        Specified by:
        listRetentionRules in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • makeBucketWritable

        public MakeBucketWritableResponse makeBucketWritable​(MakeBucketWritableRequest request)
        Description copied from interface: ObjectStorage
        Stops replication to the destination bucket and removes the replication policy.

        When the replication policy was created, this destination bucket became read-only except for new and changed objects replicated automatically from the source bucket. MakeBucketWritable removes the replication policy. This bucket is no longer the target for replication and is now writable, allowing users to make changes to bucket contents.

        Specified by:
        makeBucketWritable in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • putObject

        public PutObjectResponse putObject​(PutObjectRequest request)
        Description copied from interface: ObjectStorage
        Creates a new object or overwrites an existing object with the same name.

        The maximum object size allowed by PutObject is 50 GiB.

        See [Object Names](https://docs.oracle.com/iaas/Content/Object/Tasks/managingobjects.htm#namerequirements) for object naming requirements.

        See [Special Instructions for Object Storage PUT](https://docs.oracle.com/iaas/Content/API/Concepts/signingrequests.htm#ObjectStoragePut) for request signature requirements.

        Note: This operation consumes a stream.

        If the stream supports InputStream.mark(int) and InputStream.reset(), when a retry is necessary, the stream is reset so it starts at the beginning (or whatever the stream's position was at the time this operation is called}.

        Note this means that if the caller has used InputStream.mark(int) before, then the mark will not be the same anymore after this operation, and a subsequent call to InputStream.reset() by the caller will reset the stream not to the caller's mark, but to the position the stream was in when this operation was called.

        If the stream is a FileInputStream, and the stream's FileChannel position can be changed (like for a regular file), the stream will be wrapped in such a way that it does provide support for InputStream.mark(int) and InputStream.reset(). Then the same procedure as above is followed. If the stream's FileChannel position cannot be changed (like for a named pipe), then the stream's contents will be buffered in memory, as described below.

        If the stream does not support InputStream.mark(int) and InputStream.reset(), then the stream is wrapped in a BufferedInputStream, which means the entire contents may be buffered in memory. Then the same procedure as above is followed.

        The contents of the stream, except when the stream is a FileInputStream whose FileChannel position can be changed, should be less than 2 GiB in size if retries are used. This is because streams 2 GiB in size or larger do no guarantee that mark-and-reset can be performed. If the stream is larger, do not use built-in retries and manage retries yourself.

        Specified by:
        putObject in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • reencryptBucket

        public ReencryptBucketResponse reencryptBucket​(ReencryptBucketRequest request)
        Description copied from interface: ObjectStorage
        Re-encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket.

        (All data encryption keys are encrypted by a master encryption key. Master encryption keys are assigned to buckets and managed by Oracle by default, but you can assign a key that you created and control through the Oracle Cloud Infrastructure Key Management service.) The kmsKeyId property of the bucket determines which master encryption key is assigned to the bucket. If you assigned a different Key Management master encryption key to the bucket, you can call this API to re-encrypt all data encryption keys with the newly assigned key. Similarly, you might want to re-encrypt all data encryption keys if the assigned key has been rotated to a new key version since objects were last added to the bucket. If you call this API and there is no kmsKeyId associated with the bucket, the call will fail.

        Calling this API starts a work request task to re-encrypt the data encryption key of all objects in the bucket. Only objects created before the time of the API call will be re-encrypted. The call can take a long time, depending on how many objects are in the bucket and how big they are. This API returns a work request ID that you can use to retrieve the status of the work request task. All the versions of objects will be re-encrypted whether versioning is enabled or suspended at the bucket.

        Specified by:
        reencryptBucket in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • reencryptObject

        public ReencryptObjectResponse reencryptObject​(ReencryptObjectRequest request)
        Description copied from interface: ObjectStorage
        Re-encrypts the data encryption keys that encrypt the object and its chunks.

        By default, when you create a bucket, the Object Storage service manages the master encryption key used to encrypt each object’s data encryption keys. The encryption mechanism that you specify for the bucket applies to the objects it contains.

        You can alternatively employ one of these encryption strategies for an object:

        - You can assign a key that you created and control through the Oracle Cloud Infrastructure Vault service.

        - You can encrypt an object using your own encryption key. The key you supply is known as a customer-provided encryption key (SSE-C).

        Specified by:
        reencryptObject in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • renameObject

        public RenameObjectResponse renameObject​(RenameObjectRequest request)
        Description copied from interface: ObjectStorage
        Rename an object in the given Object Storage namespace.

        See [Object Names](https://docs.oracle.com/iaas/Content/Object/Tasks/managingobjects.htm#namerequirements) for object naming requirements.

        Specified by:
        renameObject in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • restoreObjects

        public RestoreObjectsResponse restoreObjects​(RestoreObjectsRequest request)
        Description copied from interface: ObjectStorage
        Restores the object specified by the objectName parameter.

        By default object will be restored for 24 hours. Duration can be configured using the hours parameter.

        Specified by:
        restoreObjects in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • updateBucket

        public UpdateBucketResponse updateBucket​(UpdateBucketRequest request)
        Description copied from interface: ObjectStorage
        Performs a partial or full update of a bucket’s user-defined metadata.

        Use UpdateBucket to move a bucket from one compartment to another within the same tenancy. Supply the compartmentID of the compartment that you want to move the bucket to. For more information about moving resources between compartments, see [Moving Resources to a Different Compartment](https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).

        Specified by:
        updateBucket in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • updateNamespaceMetadata

        public UpdateNamespaceMetadataResponse updateNamespaceMetadata​(UpdateNamespaceMetadataRequest request)
        Description copied from interface: ObjectStorage
        By default, buckets created using the Amazon S3 Compatibility API or the Swift API are created in the root compartment of the Oracle Cloud Infrastructure tenancy.

        You can change the default Swift/Amazon S3 compartmentId designation to a different compartmentId. All subsequent bucket creations will use the new default compartment, but no previously created buckets will be modified. A user must have OBJECTSTORAGE_NAMESPACE_UPDATE permission to make changes to the default compartments for Amazon S3 and Swift.

        Specified by:
        updateNamespaceMetadata in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • updatePrivateEndpoint

        public UpdatePrivateEndpointResponse updatePrivateEndpoint​(UpdatePrivateEndpointRequest request)
        Description copied from interface: ObjectStorage
        Performs a partial or full update of a user-defined data associated with the Private Endpoint.

        Use UpdatePrivateEndpoint to move a Private Endpoint from one compartment to another within the same tenancy. Supply the compartmentID of the compartment that you want to move the Private Endpoint to. Or use it to update the name, subnetId, endpointFqdn or privateEndpointIp or accessTargets of the Private Endpoint. For more information about moving resources between compartments, see [Moving Resources to a Different Compartment](https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).

        This API follows replace semantics (rather than merge semantics). That means if the body provides values for parameters and the resource has exisiting ones, this operation will replace those existing values.

        Specified by:
        updatePrivateEndpoint in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • uploadPart

        public UploadPartResponse uploadPart​(UploadPartRequest request)
        Description copied from interface: ObjectStorage
        Uploads a single part of a multipart upload.

        Note: This operation consumes a stream.

        If the stream supports InputStream.mark(int) and InputStream.reset(), when a retry is necessary, the stream is reset so it starts at the beginning (or whatever the stream's position was at the time this operation is called}.

        Note this means that if the caller has used InputStream.mark(int) before, then the mark will not be the same anymore after this operation, and a subsequent call to InputStream.reset() by the caller will reset the stream not to the caller's mark, but to the position the stream was in when this operation was called.

        If the stream is a FileInputStream, and the stream's FileChannel position can be changed (like for a regular file), the stream will be wrapped in such a way that it does provide support for InputStream.mark(int) and InputStream.reset(). Then the same procedure as above is followed. If the stream's FileChannel position cannot be changed (like for a named pipe), then the stream's contents will be buffered in memory, as described below.

        If the stream does not support InputStream.mark(int) and InputStream.reset(), then the stream is wrapped in a BufferedInputStream, which means the entire contents may be buffered in memory. Then the same procedure as above is followed.

        The contents of the stream, except when the stream is a FileInputStream whose FileChannel position can be changed, should be less than 2 GiB in size if retries are used. This is because streams 2 GiB in size or larger do no guarantee that mark-and-reset can be performed. If the stream is larger, do not use built-in retries and manage retries yourself.

        Specified by:
        uploadPart in interface ObjectStorage
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
      • getPaginators

        public ObjectStoragePaginators getPaginators()
        Description copied from interface: ObjectStorage
        Gets the pre-configured paginators available for list operations in this service which may return multiple pages of data.

        These paginators provide an Iterable interface so that service responses, or resources/records, can be iterated through without having to manually deal with pagination and page tokens.

        Specified by:
        getPaginators in interface ObjectStorage
        Returns:
        The service paginators.
      • useRealmSpecificEndpointTemplate

        public void useRealmSpecificEndpointTemplate​(boolean useOfRealmSpecificEndpointTemplateEnabled)
        This method should be used to enable or disable the use of realm-specific endpoint template.

        The default value is null. To enable the use of endpoint template defined for the realm in use, set the flag to true To disable the use of endpoint template defined for the realm in use, set the flag to false

        Parameters:
        useOfRealmSpecificEndpointTemplateEnabled - This flag can be set to true or false to enable or disable the use of realm-specific endpoint template respectively
      • populateServiceParametersInEndpoint

        public final void populateServiceParametersInEndpoint​(String endpoint,
                                                              Map<String,​Object> requiredParametersMap)
        Populate the parameters in the endpoint with its corresponding value and update the base endpoint.

        The value will be populated iff the parameter in endpoint is a required request path parameter or a required request query parameter. If not, the parameter in the endpoint will be ignored and left blank.

        Parameters:
        endpoint - The endpoint template in use
        requiredParametersMap - Map of parameter name as key and value set in request path or query parameter as value
      • updateBaseEndpoint

        public final void updateBaseEndpoint​(String endpoint)
        This method should be used for parameterized endpoint templates only.

        This does not include {region} and {secondLevelDomain} parameters.

        Parameters:
        endpoint - The updated endpoint to use
      • setEndpoint

        public final void setEndpoint​(String endpoint)
      • getEndpoint

        public final String getEndpoint()
      • refreshClient

        public final void refreshClient()
        Rebuild the backing HttpClient.

        This will call ClientConfigurators again, and can be used to e.g. refresh the SSL certificate.

      • getClientCommonLibraryVersion

        public String getClientCommonLibraryVersion()
      • getMinimumClientCommonLibraryVersionFromClient

        public Optional<String> getMinimumClientCommonLibraryVersionFromClient()