bulk-upload

Description

Uploads all files in a given directory and all subdirectories.

Usage

oci os object bulk-upload [OPTIONS]

Required Parameters

-bn, --bucket-name [text]

The name of the bucket.

--src-dir [text]

The directory which contains files to upload. Files in the directory and all subdirectories will be uploaded.

Optional Parameters

--content-encoding [text]

The content encoding to apply to all files being uploaded.

--content-language [text]

The content language to apply to all files being uploaded.

--content-type [text]

The content type to apply to all files being uploaded. If content type is set to auto, then the CLI will guess the content type of the file.

--disable-parallel-uploads

[DEPRECATED] This option is no longer used. If a file in the directory will be uploaded in multiple parts, this option disables those parts from being uploaded in parallel. This applies to all files being uploaded in multiple parts

--exclude [text]

Only upload files which do not match the provided pattern. Patterns are taken relative to the CURRENT directory. This option can be provided mulitple times to match on mulitple patterns. Supported pattern symbols are: 

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in sequence

[!sequence]: Matches any character not in sequence

--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id --> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

For examples on usage of this option, please see our "using CLI with advanced JSON options" link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--include [text]

Only upload files which match the provided pattern. Patterns are taken relative to the CURRENT directory. This option can be provided mulitple times to match on mulitple patterns. Supported pattern symbols are: 

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in sequence

[!sequence]: Matches any character not in sequence

--metadata [text]

Arbitrary string keys and values for user-defined metadata. This will be applied to all files being uploaded. Must be in JSON format. Example: '{"key1":"value1","key2":"value2"}'

-ns, --namespace, --namespace-name [text]

Object Storage namespace. If not provided, this parameter will be obtained internally using a call to 'oci os ns get'

--no-multipart

Do not use multipart uploads to upload the file in parts. By default, files above 128 MiB will be uploaded in multiple parts, then combined server-side. This applies to all files being uploaded

--no-overwrite

If a file being uploaded already exists in Object Storage with the same name, do not overwite the object. If neither this flag nor --overwrite is specified, you will be prompted each time an object with the same name would be overwritten.

--object-prefix [text]

A prefix to apply to the names of all files being uploaded

--overwrite

If a file being uploaded already exists in Object Storage with the same name, overwrite the existing object in Object Storage without a confirmation prompt. If neither this flag nor --no-overwrite is specified, you will be prompted each time an object with the same name would be overwritten.

Specifying this flag will also allow for faster uploads as the CLI will not initially check whether or not the files with the same name already exist in Object Storage.

--parallel-upload-count [integer range]

The number of parallel operations to perform. Decreasing this value will make bulk uploads less resource intensive but they may take longer. Increasing this value may improve bulk upload times, but the upload process will consume more system resources and network bandwidth. The maximum is 1000. [default: 10]

--part-size [integer]

Part size (in MiB) to use if uploading via multipart upload operations. This applies to all files which will be uploaded in multiple parts. Part size must be greater than 10 MiB

--verify-checksum

Verify the checksum of the uploaded object with the local file.

Examples

Upload all files from a given directory

oci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory

Forcing object overwrite to resolve object name collision

If a file being uploaded already exists in Object Storage, it can be overwritten without a prompt by using the --overwrite flag.

oci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory --overwrite

Prevent object overwrite to resolve object name collision

If a file being uploaded already exists in Object Storage, it can be preserved (not overwritten) without a prompt by using the --no-overwrite flag.

oci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory --no-overwrite

Applying metadata

Metadata can be applied when the files are put into Object Storage by specifying the --metadata flag and passing metadata either via a file or as a string on the command line.

Note

The same metadata will be applied to all uploaded files.

oci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory --metadata '{"key1":"value1","key2":"value2"}'
oci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory --metadata file://path/to/my/metadata.json