Your application is using an Object Storage bucket named app-data in the namespace vision, to store both persistent and temporary data.
Every week all the temporary data should be deleted to limit the storage consumption.
Currently you need to navigate to the Object Storage page using the web console, select the appropriate bucket to view all the objects and delete the temporary ones.
To simplify the task you have configured the application to save all the temporary data with /temp prefix.
You have also decided to use the Command Line Interface (CLI) to perform this operation.
What is the command you should use to speed up the data cleanup? (Choose the best answer.)
Click on the arrows to vote for the correct answer
A. B. C. D.B.
The best command to use to delete temporary data from the Object Storage bucket named app-data in the namespace vision is option B: oci os object bulk-delete "ns vision" "bn app-data" --prefix /temp --force.
Here's a detailed explanation of each answer:
A. oci os object delete "ns vision "bn app"data ""prefix /temp This command is incorrect because it's missing the --prefix
and --force
flags, which are required to delete objects based on a prefix and to force the deletion without confirmation. Also, there's an unnecessary space after "ns vision" that could cause errors.
B. oci os object bulk-delete "ns vision" "bn app-data" --prefix /temp --force This command is the correct answer. It uses the oci os object bulk-delete
command to delete all objects with the prefix "/temp" in the "app-data" bucket in the "vision" namespace. The --force
flag is used to bypass the confirmation prompt and speed up the deletion process.
C. oci objectstorage bulk-delete "ns vision" "bn app-data" --prefix /temp --force This command is incorrect because the correct command for bulk deletion in OCI Object Storage is oci os object bulk-delete
, not oci objectstorage bulk-delete
.
D. oci os object delete app-data in vision where prefix = /temp This command is incorrect because it's not a valid OCI CLI command. There's no option to use the where
clause in OCI CLI commands, and the oci os object delete
command can only delete one object at a time, not all objects with a certain prefix.
In summary, the correct command to delete all temporary data with a prefix of "/temp" from the "app-data" bucket in the "vision" namespace is:
luaoci os object bulk-delete "ns vision" "bn app-data" --prefix /temp --force
This command will help you speed up the data cleanup process and avoid the need to manually select and delete each temporary object in the web console.