8.3 Using the Cloud Storage Command
You can invoke the Cloud Storage command in SQLcl with
cloudstorage or cloud_storage or
cs.
The cloudstorage command performs cloud
storage operations such as listing, uploading, downloading,
previewing, and deleting objects.
The cloudstorage command uses the current
Cloud Storage settings by default. Individual commands can override
the configured URI by using the -uri option.
For a list of the Cloud Storage command options in SQLcl, enter:
help cs
Listing Resources
Lists compartments, buckets, or objects.
cs list {{-compartment|-c} [compartment] | {-bucket|-b} <compartment> | {-object|-o} [bucket]} [-uri|-u <uri>]
Specify one of the following: -compartment,
-bucket or -object. These
options are mutually exclusive.
-
-bucketrequires a compartment. -
-objectaccepts an optional bucket.
If no bucket is supplied, SQLcl uses the bucket from the current cloudstorage URI.
Examples:
cs list -compartment
cs list -compartment my_compartment
cs list -bucket my_compartment
cs list -object
cs list -object my_bucket
Deleting Objects
cs delete [-uri|-u <uri>] <object>
cs get [-dbdirectory|-dir <directory>] [-uri|-u <uri>] <object>cs put [-qualifier|-q <object>] [-dbdirectory|-dir <directory>] [-uri|-u <uri>] <file>cs peek [-position|-pos <position>] [-size|-sz <size>] [-uri|-u <uri>] <object>Each cloudstorage
action command supports -uri and
-u to temporarily override the configured
Cloud Storage URI.
Note:
The -uri option overrides the configured Cloud
Storage URI for the current command only. The configured URI
remains unchanged.
Example:
cs get -uri https://objectstorage... my_object
cs put -uri https://objectstorage... my_file