Objekte im OCI bucket verschieben

Gerade bin ich wohl über einer meiner Meisterstreiche in Sachen Dokumentation gestolpert. In der oracle cloud lassen sich Objekte nicht einfach verschieben, stattdessen geschieht dies über einen Umweg von Kopier- und Löschvorgängen.

There is no direct "move file" functionality within the oracle cloud. Instead the procedure is to copy the file to another bucket and delete it in the old one. The copy process is handled asynchronously by a worker which
can be asked about the current status of the request (1). Using the function copy_object (2) also yields a response object (3) which includes a opc-work-request-id within its headers (not request-id!). This id can be used to ask the worker about its current status using the get_work_request function who in return answers with a
response object (4). Hidden inside this response' data (not header) you can find the current status. We want to wait until the copy actually COMPLETED before deleting the file in the source bucket. Funny enough (4) says that the status for a finished request is SUCCEEDED, while (5) says it is COMPLETED. Printing out the actual status, gives us COMPLETED (10.09.2020) which is used here.

    (1): copying objects in oracle: https://docs.cloud.oracle.com/en-us/iaas/Content/Object/Tasks/copyingobjects.htm
    (2): documentation of the object_storage_client and its functions:
    (3): documentation of the Response class and possible attributes:
    (4): handling async work requests and their current status:
    (5): documentation of the workrequest class

Kommentar verfassen

Your email address will not be published. Required fields are marked *

hungsblog | Nguyen Hung Manh | Dresden
Nach oben scrollen