GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OS_OBJECT(1) OCI CLI Command Reference OS_OBJECT(1)

os_object -

  • bulk-delete
  • bulk-delete-versions
  • bulk-download
  • bulk-upload
  • copy
  • delete
  • get
  • head
  • list
  • list-object-versions
  • put
  • reencrypt
  • rename
  • restore
  • restore-status
  • resume-put
  • sync
  • update-storage-tier

  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Deleting all objects in the bucket
  • Delete all objects that match a given prefix
  • Limiting deleted objects using a prefix and delimiter
  • Previewing what would be deleted
  • Do not prompt for delete

  • Global Parameters
  • Examples

Deletes all objects in a bucket which match the provided criteria.

oci os object bulk-delete [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--delimiter [text]

When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are deleted. Scanned objects whose names contain the delimiter have part of their name up to the last occurrence of the delimiter (after the optional prefix) returned as a set of prefixes. Note: Only ‘/’ is a supported delimiter character at this time.

--dry-run

Displays a list of objects which would be deleted by this command, if it were run without –dry-run. If –dry-run is passed, no objects will actually be deleted.

--exclude [text]

Only process files which do not match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple patterns. Supported pattern symbols are: ?

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in sequence

[!sequence]: Matches any character not in sequence

--force

Do not ask for confirmation prior to performing the bulk delete.

--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 process files which match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple patterns. Supported pattern symbols are: ?

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in sequence

[!sequence]: Matches any character not in sequence

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--parallel-operations-count [integer]

The number of parallel operations to perform. Decreasing this value will make the process less resource intensive but it may take longer. Increasing this value may decrease the time taken, but the process will consume more system resources and network bandwidth. The maximum is 1000. [default: 10]

--prefix [text]

Delete all objects with the given prefix. Omit this parameter to delete all objects in the bucket.

Examples



----



 oci os object bulk-delete -ns mynamespace -bn mybucket


 oci os object bulk-delete -ns mynamespace -bn mybucket --prefix level1/level2/ --prefix myprefix


You can delete all objects that match a given prefix by specifying the –prefix flag. In the above example, “–prefix myprefix” would match object names such as myprefix_textfile1.txt, myprefix_myImage.png etc.

If you have named your objects so that they exist in Object Storage as a hierarchy, e.g. level1/level2/level3/myobject.txt, then you can delete objects at a given level (and all sub levels) by specifying a prefix:

 oci os object bulk-delete -ns mynamespace -bn mybucket --prefix level1/level2/


This will delete all objects of the form level1/level2/<object name>, level1/level2/leve3/<object name>, level1/level2/leve3/level4/<object name> etc.

 oci os object bulk-delete -ns mynamespace -bn mybucket --prefix level1/level2/ --delimiter /


If you have named your objects so that they exist in Object Storage as a hierarchy, e.g. level1/level2/level3/myobject.txt, and you only want to delete objects at a given level of the hierarchy, e.g. example everything of the form level1/level2/<object name> but not level1/level2/leve3/<object name> or any other sub-levels, you can specify a prefix and delimiter. Currently the only supported delimiter is /

 oci os object bulk-delete -ns mynamespace -bn mybucket --dry-run
 oci os object bulk-delete -ns mynamespace -bn mybucket --prefix level1/level2/ --dry-run
 oci os object bulk-delete -ns mynamespace -bn mybucket --prefix level1/level2/ --delimiter / --dry-run


For any bulk-delete command you can get a list of all objects which would be deleted, but without actually deleting them, by using the –dry-run flag

 oci os object bulk-delete -ns mynamespace -bn mybucket --force
 oci os object bulk-delete -ns mynamespace -bn mybucket --prefix level1/level2/ --force
 oci os object bulk-delete -ns mynamespace -bn mybucket --prefix level1/level2/ --delimiter / --force


By default, the bulk-delete command will prompt you prior to deleting objects. To suppress this prompt, pass the –force option.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/bulk-delete.html#cmdoption-bucket-name
    oci os object bulk-delete --bucket-name $bucket_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Deleting all object versions in the bucket
  • Delete all object versions that match a given prefix
  • Limiting deleted objects using a prefix and delimiter
  • Deleting all object versions using object name
  • Previewing what would be deleted
  • Do not prompt for delete

  • Global Parameters
  • Examples

Deletes all object versions in a bucket which match the provided criteria.

oci os object bulk-delete-versions [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--delimiter [text]

When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are deleted. Scanned objects whose names contain the delimiter have part of their name up to the last occurrence of the delimiter (after the optional prefix) returned as a set of prefixes. Note: Only ‘/’ is a supported delimiter character at this time.

--dry-run

Displays a list of objects which would be deleted by this command, if it were run without –dry-run. If –dry-run is passed, no objects will actually be deleted.

--exclude [text]

Only process files which do not match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple patterns. Supported pattern symbols are: ?

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in sequence

[!sequence]: Matches any character not in sequence

--force

Do not ask for confirmation prior to performing the bulk delete.

--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 process files which match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple patterns. Supported pattern symbols are: ?

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in sequence

[!sequence]: Matches any character not in sequence

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--object-name [text]

Delete all versions of the given objectName. Only one of prefix or objectName can be given as input. Omit this parameter to delete all objects in the bucket.

--parallel-operations-count [integer]

The number of parallel operations to perform. Decreasing this value will make the process less resource intensive but it may take longer. Increasing this value may decrease the time taken, but the process will consume more system resources and network bandwidth. The maximum is 1000. [default: 10]

--prefix [text]

Delete all object versions with the given prefix. Only one of prefix or objectName can be given as input. Omit this parameter to delete all objects in the bucket.

Examples



----



 oci os object bulk-delete-versions -ns mynamespace -bn mybucket


 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --prefix level1/level2/ --prefix myprefix


You can delete all object versions that match a given prefix by specifying the –prefix flag. In the above example, “–prefix myprefix” would match object names such as myprefix_textfile1.txt, myprefix_myImage.png etc.

If you have named your objects so that they exist in Object Storage as a hierarchy, e.g. level1/level2/level3/myobject.txt, then you can delete objects at a given level (and all sub levels) by specifying a prefix:

 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --prefix level1/level2/


This will delete all object versions of the form level1/level2/<object name>, level1/level2/leve3/<object name>, level1/level2/leve3/level4/<object name> etc.

 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --prefix level1/level2/ --delimiter /


If you have named your objects so that they exist in Object Storage as a hierarchy, e.g. level1/level2/level3/myobject.txt, and you only want to delete objects at a given level of the hierarchy, e.g. example everything of the form level1/level2/<object name> but not level1/level2/leve3/<object name> or any other sub-levels, you can specify a prefix and delimiter. Currently the only supported delimiter is /

 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --object-name <object name>


You can delete all object versions that match a given object name by specifying the –object-name flag. Both -object-name and -prefix cannot be given in the same command

 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --dry-run
 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --prefix level1/level2/ --dry-run
 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --prefix level1/level2/ --delimiter / --dry-run


For any bulk-delete-versions command you can get a list of all object versions which would be deleted, but without actually deleting them, by using the –dry-run flag

 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --force
 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --prefix level1/level2/ --force
 oci os object bulk-delete-versions -ns mynamespace -bn mybucket --prefix level1/level2/ --delimiter / --force


By default, the bulk-delete-versions command will prompt you prior to deleting objects. To suppress this prompt, pass the –force option.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/bulk-delete-versions.html#cmdoption-bucket-name
    oci os object bulk-delete-versions --bucket-name $bucket_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Download all objects in the bucket
  • Download all objects that match a given prefix
  • Limiting downloaded objects using a prefix and delimiter
  • Overwriting or skipping files

  • Global Parameters
  • Examples
  • Description
  • Command
  • Output


Downloads all objects which match the given prefix to a given directory.

oci os object bulk-download [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--dest-dir, --download-dir [text]

The directory where retrieved objects will be placed as files. This directory will be created if it does not exist.

--delimiter [text]

When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned. Scanned objects whose names contain the delimiter have part of their name up to the last occurrence of the delimiter (after the optional prefix) returned as a set of prefixes. Note: Only ‘/’ is a supported delimiter character at this time.

--dry-run

Prints the list of files to be downloaded.

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--exclude [text]

Only process files which do not match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple 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 process files which match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple patterns. Supported pattern symbols are: ?

*: Matches everything

?: Matches any single character

[sequence]: Matches any character in sequence

[!sequence]: Matches any character not in sequence

--multipart-download-threshold [integer range]

Objects larger than this size (in MiB) will be downloaded in multiple parts. The minimum allowable threshold is 128 MiB.

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--no-multipart

Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.

--no-overwrite

If a file with the same name as an object already exists in the download directory, do not overwite it. If neither this flag nor –overwrite is specified, you will be prompted each time a file would be overwritten

--overwrite

If a file with the same name as an object already exists in the download directory, overwrite it. If neither this flag nor –no-overwrite is specified, you will be prompted each time a file would be overwritten.

--parallel-operations-count [integer range]

The number of parallel operations to perform. Decreasing this value will make the process less resource intensive but it may take longer. Increasing this value may decrease the time taken, but the process will consume more system resources and network bandwidth. The maximum is 1000. [default: 10]

--part-size [integer range]

Part size (in MiB) to use when the file is split into multiple parts and then combined. Part size must be greater than 10 MiB and defaults to 128 MiB.

--prefix [text]

Retrieve all objects with the given prefix. Omit this parameter to get all objects in the bucket

Examples



----



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


 oci os object bulk-download -ns mynamespace -bn mybucket --download-dir path/to/download/directory --prefix myprefix


You can download all objects that match a given prefix by specifying the –prefix flag. In the above example, “–prefix myprefix” would match object names such as myPrefix_textfile1.txt, myPrefix_myImage.png etc.

If you have named your objects so that they exist in Object Storage as a hierarchy, e.g. level1/level2/level3/myobject.txt, then you can download objects at a given level (and all sub levels) by specifying a prefix:

 oci os object bulk-download -ns mynamespace -bn mybucket --download-dir path/to/download/directory --prefix level1/level2/


This will download all objects of the form level1/level2/<object name>, level1/level2/leve3/<object name>, level1/level2/leve3/level4/<object name> etc.

 oci os object bulk-download -ns mynamespace -bn mybucket --download-dir path/to/download/directory --prefix level1/level2/ --delimiter /


If you have named your objects so that they exist in Object Storage as a hierarchy, e.g. level1/level2/level3/myobject.txt, and you only want to download objects at a given level of the hierarchy, e.g. example everything of the form level1/level2/<object name> but not level1/level2/leve3/<object name> or any other sub-levels, you can specify a prefix and delimiter. Currently the only supported delimiter is /

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


If files with the same name as the objects being downloaded already exist in the download directory, you can opt to overwrite them with the –overwrite option, or preserve them with the –no-overwrite option.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Download all objects in the bucket excluding ‘.cache’ directory.

 oci os object bulk-download -bn "cli-test" --download-dir ~/cliDirectory --exclude '.cache/*'


{
 "data": [
      {
           "download-failures": {},
           "skipped-objects": []
      }
 ]
}


Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/bulk-download.html#cmdoption-bucket-name
    export download_dir=<substitute-value-of-download_dir> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/bulk-download.html#cmdoption-download-dir
    oci os object bulk-download --bucket-name $bucket_name --download-dir $download_dir


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • ?Upload all files from a given directory
  • Forcing object overwrite to resolve object name collision
  • Prevent object overwrite to resolve object name collision
  • Applying metadata

  • Global Parameters
  • Examples
  • Description
  • Command
  • Output


Uploads all files in a given directory and all subdirectories.

oci os object bulk-upload [OPTIONS]


-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.

--cache-control [text]

The optional Cache-Control header that defines the caching behavior value to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify objects that require caching restrictions.

--content-disposition [text]

The optional Content-Disposition header that defines presentational information for the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to let users download objects with custom filenames in a browser.

--content-encoding [text]

The optional Content-Encoding header that defines the content encoding of the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to determine what decoding mechanisms need to be applied to obtain the media-type specified by the Content-Type header of the object.

--content-language [text]

The optional Content-Language header that defines the content language of the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and differentiate objects based on a particular language.

--content-type [text]

The optional Content-Type header that defines the standard MIME type format of the object to be returned in GetObject and HeadObject responses. Content type defaults to ‘application/octet-stream’ if not specified. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and perform special operations on text only objects.

--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

--dry-run

Prints the list of files to be uploaded.

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--exclude [text]

Only process files which do not match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple 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 process files which match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple 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-follow-symlinks

Symbolic links will be ignored while traversing the local filesystem.

--no-multipart

Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.

--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.

--prefix, --object-prefix [text]

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

--opc-sse-kms-key-id [text]

The OCID of a master encryption key used to call the Key Management Service to generate a data encryption key or to encrypt or decrypt a data encryption key.

--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 the process less resource intensive but it may take longer. Increasing this value may decrease the time taken, but the process will consume more system resources and network bandwidth. The maximum is 1000. [default: 10]

--part-size [integer]

Part size (in MiB) to use when the file is split into multiple parts and then combined. Part size must be greater than 10 MiB and defaults to 128 MiB.

--storage-tier [text]

The storage tier that the objects should be stored in. If not specified, the objects will be stored in the same storage tier as the bucket.

Accepted values are:

Archive, InfrequentAccess, Standard


--verify-checksum

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

Examples



----



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


?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


?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


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


Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

upload all objects in the bucket excluding ‘.cache’ directory.

 oci os object bulk-upload -bn "cli-test" --src-dir ~/cliDirectory --exclude '.cache/*'


{
 "data": [
      {
           "skipped-objects": [],
           "upload-failures": {},
           "uploaded-objects": {
                "text.txt": {
                     "etag": "cd7a12ad-683c-4a76-a846-f7cb6544428f",
                     "last-modified": "Tue, 29 Sep 2020 17:35:54 GMT",
                     "opc-content-md5": "1B2M2Y8AsgTpgAmY7PhCfg=="
                }
           }
      }
 ]
}


Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/bulk-upload.html#cmdoption-bucket-name
    export src_dir=<substitute-value-of-src_dir> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/bulk-upload.html#cmdoption-src-dir
    oci os object bulk-upload --bucket-name $bucket_name --src-dir $src_dir


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Creates a request to copy an object within a region or to another region.

See Object Names <https://docs.cloud.oracle.com/Content/Object/Tasks/managingobjects.htm#namerequirements> for object naming requirements.

oci os object copy [OPTIONS]


--bucket-name, -bn [text]

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

--destination-bucket [text]

The destination bucket the object will be copied to.

--source-object-name [text]

The name of the object to be copied.

--destination-namespace [text]

The destination namespace object will be copied to.

--destination-object-if-match-e-tag [text]

The entity tag (ETag) to match against that of the destination object (an object intended to be overwritten). Used to confirm that the destination object stored under a given name is the version of that object storing a specified entity tag.

--destination-object-if-none-match-e-tag [text]

The entity tag (ETag) to avoid matching. The only valid value is ‘*’, which indicates that the request should fail if the object already exists in the destination bucket.

--destination-object-metadata [complex type]

Arbitrary string keys and values for the user-defined metadata for the object. Keys must be in “opc-meta-

*
” format. Avoid entering confidential information. Metadata key-value pairs entered in this field are assigned to the destination object. If you enter no metadata values, the destination object will inherit any existing metadata values associated with the source object. This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax.

--destination-object-name [text]

The destination name for the copy object.

--destination-object-storage-tier [text]

The storage tier that the object should be stored in. If not specified, the object will be stored in the same storage tier as the bucket.

Accepted values are:

Archive, InfrequentAccess, Standard


--destination-region [text]

The destination region object will be copied to.

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--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

--max-wait-seconds [integer]

The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.

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

The Object Storage namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--opc-sse-kms-key-id [text]

The OCID <https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm> of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.

--source-encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the source object.

--source-object-if-match-e-tag [text]

The entity tag (ETag) to match against that of the source object. Used to confirm that the source object with a given name is the version of that object storing a specified ETag.

--source-version-id [text]

VersionId of the object to copy. If not provided then current version is copied by default.

--wait-for-state [text]

This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.

Accepted values are:

ACCEPTED, CANCELED, CANCELING, COMPLETED, FAILED, IN_PROGRESS


--wait-interval-seconds [integer]

Check every --wait-interval-seconds to see whether the work request to see if it has reached the state defined by --wait-for-state. Defaults to 30 seconds.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/copy.html#cmdoption-bucket-name
    export destination_bucket=<substitute-value-of-destination_bucket> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/copy.html#cmdoption-destination-bucket
    export source_object_name=<substitute-value-of-source_object_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/copy.html#cmdoption-source-object-name
    oci os object copy --bucket-name $bucket_name --destination-bucket $destination_bucket --source-object-name $source_object_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Deletes an object.

oci os object delete [OPTIONS]


--bucket-name, -bn [text]

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

--object-name, --name [text]

The name of the object. Avoid entering confidential information. Example: test/object1.log

--force

Perform deletion without prompting for confirmation.

--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

--if-match [text]

The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

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

The Object Storage namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--version-id [text]

VersionId used to identify a particular version of the object

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/delete.html#cmdoption-bucket-name
    export object_name=<substitute-value-of-object_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/delete.html#cmdoption-object-name
    oci os object delete --bucket-name $bucket_name --object-name $object_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Gets the metadata and body of an object.
Example:
oci os object get -ns mynamespace -bn mybucket –name myfile.txt –file /Users/me/myfile.txt

oci os object get [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--file [filename]

The name of the file that will receive the object content, or ‘-‘ to write to STDOUT.

--name [text]

The name of the object.

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--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

--http-response-cache-control [text]

This value will be used in Cache-Control header of the response.

--http-response-content-disposition [text]

This value will be used in Content-Disposition header of the response.

--http-response-content-encoding [text]

This value will be used in Content-Encoding header of the response

--http-response-content-language [text]

This value will be used in Content-Language header of the response.

--http-response-content-type [text]

This value will be used in Content-Type header of the response.

--http-response-expires [text]

This value will be used in Expires header of the response

--if-match [text]

The entity tag to match.

--if-none-match [text]

The entity tag to avoid matching.

--multipart-download-threshold [integer range]

Objects larger than this size (in MiB) will be downloaded in multiple parts. The minimum allowable threshold is 128 MiB.

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--no-multipart

Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.

--parallel-download-count [integer range]

The number of parallel operations to perform when downloading an object in multiple parts. Decreasing this value will make multipart downloads less resource intensive but they may take longer. Increasing this value may improve download times, but the download process will consume more system resources and network bandwidth. [default: 10]

--part-size [integer range]

Part size (in MiB) to use when the file is split into multiple parts and then combined. Part size must be greater than 10 MiB and defaults to 128 MiB.

--range [text]

Byte range to fetch. Follows https://tools.ietf.org/html/rfc7233#section-2.1. Example: bytes=2-10

--version-id [text]

VersionId used to identify a particular version of the object

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/get.html#cmdoption-bucket-name
    export file=<substitute-value-of-file> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/get.html#cmdoption-file
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/get.html#cmdoption-name
    oci os object get --bucket-name $bucket_name --file $file --name $name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Gets the user-defined metadata and entity tag for an object.
Example:
oci os object head -ns mynamespace -bn mybucket –name myfile.txt

oci os object head [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--name [text]

The name of the object.

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--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

--if-match [text]

The entity tag to match.

--if-none-match [text]

The entity tag to avoid matching.

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--version-id [text]

VersionId used to identify a particular version of the object

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/head.html#cmdoption-bucket-name
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/head.html#cmdoption-name
    oci os object head --bucket-name $bucket_name --name $name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples
  • Description
  • Command
  • Output
  • Description
  • Command
  • Output


Lists the objects in a bucket.
Example:
oci os object list -ns mynamespace -bn mybucket –fields name,size,timeCreated

oci os object list [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--all

Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.

--delimiter [text]

When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned. Scanned objects whose names contain the delimiter have part of their name up to the last occurrence of the delimiter (after the optional prefix) returned as a set of prefixes. Note: Only ‘/’ is a supported delimiter character at this time.

--end [text]

Only object names less than this parameter will be returned.

--fields [text]

Object summary in list of objects includes the ‘name’ field. This parameter may also include ‘size’ (object size in bytes), ‘md5’, ‘timeCreated’ (object creation date and time), ‘timeModified’ (object modification date and time), ‘storageTier’ and ‘archivalState’ fields. Value of this parameter should be a comma separated, case-insensitive list of those field names. [default: name,size,etag,md5,timeCreated,timeModified,storageTier,archivalState]

--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

--limit [integer]

The maximum number of items to return. [default: 100]

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--page-size [integer]

When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.

--prefix [text]

Only object names that begin with this prefix will be returned.

--start [text]

Only object names greater or equal to this parameter will be returned.

--stream-output

Print output to stdout as it is fetched so the full response is not stored in memory. This only works with --all.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

List objects in a bucket

 oci os object list --bucket-name CLITest


{
 "data": [
      {
           "md5": "55sYrq31fJ1VgHfEGIh2hg==",
           "name": "test/FileOne.json",
           "size": 1785862,
           "time-created": "2019-08-13T23:31:02.981000+00:00"
      },
      {
           "md5": "uzobT/eOYWpieAdIu1lc2w==",
           "name": "test/FileTwo.json",
           "size": 466,
           "time-created": "2019-08-13T20:09:54.148000+00:00"
      },
      {
           "md5": "uzobT/eOYWpieAdIu1lc2w==",
           "name": "FileThree.json",
           "size": 468,
           "time-created": "2019-08-13T22:09:54.148000+00:00"
      }
 ],
 "prefixes": []
}


List objects in a bucket with common prefix

 oci os object list --bucket-name CLITest --prefix test


{
 "data": [
      {
           "md5": "55sYrq31fJ1VgHfEGIh2hg==",
           "name": "test/FileOne.json",
           "size": 1785862,
           "time-created": "2019-08-13T23:31:02.981000+00:00"
      },
      {
           "md5": "uzobT/eOYWpieAdIu1lc2w==",
           "name": "test/FileTwo.json",
           "size": 466,
           "time-created": "2019-08-13T20:09:54.148000+00:00"
      }
 ],
 "prefixes": []
}


Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/list.html#cmdoption-bucket-name
    oci os object list --bucket-name $bucket_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters

Lists the object versions in a bucket.

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.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm>.

oci os object list-object-versions [OPTIONS]


--bucket-name, --bucket, -bn [text]

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

--all

Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.

--delimiter [text]

When this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only ‘/’ is a supported delimiter character at this time.

--end [text]

Object names returned by a list query must be strictly less than this parameter.

--fields [text]

Object summary in list of objects includes the ‘name’ field. This parameter can also include ‘size’ (object size in bytes), ‘etag’, ‘md5’, ‘timeCreated’ (object creation date and time), ‘timeModified’ (object modification date and time), ‘storageTier’ and ‘archivalState’. Value of this parameter should be a comma-separated, case-insensitive list of those field names. For example ‘name,size,etag,md5,timeCreated,timeModified,storageTier,archivalState’ Allowed values are: name, size, etag, md5, timeCreated, timeModified, storageTier, archivalState. [default: name,size,etag,md5,timeCreated,timeModified,storageTier,archivalState]

--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

--limit [integer]

The maximum number of items to return.

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

The Object Storage namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--page [text]

The page at which to start retrieving results.

--page-size [integer]

When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.

--prefix [text]

The string to use for matching against the start of object names in a list query.

--start [text]

Object names returned by a list query must be greater or equal to this parameter.

--start-after [text]

Object names returned by a list query must be greater than this parameter.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Creates a new object or overwrites an existing one.

The object can be uploaded as a single part or as multiple parts. Below are the rules for whether an object will be uploaded via single or multipart upload (listed in order of precedence):

  • If the object is being uploaded from STDIN, it will be uploaded as a multipart upload (if the object content is smaller than –part-size, default for STDIN is 10 MiB, the multipart upload may contain only one part, but it will still use the MultipartUpload API)
  • If the –no-multipart flag is specified, the object will be uploaded as a single part regardless of size (specifying –no-multipart when uploading from STDIN will result in an error)
  • If the object is larger than –part-size, it will be uploaded as multiple parts
  • If the object is empty it will be uploaded as a single part



Example:
oci os object put -ns mynamespace -bn mybucket –name myfile.txt –file /Users/me/myfile.txt –metadata ‘{“key1”:”value1”,”key2”:”value2”}’

oci os object put [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--file [filename]

The file to load as the content of the object, or ‘-‘ to read from STDIN.

--cache-control [text]

The optional Cache-Control header that defines the caching behavior value to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify objects that require caching restrictions.

--content-disposition [text]

The optional Content-Disposition header that defines presentational information for the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to let users download objects with custom filenames in a browser.

--content-encoding [text]

The optional Content-Encoding header that defines the content encoding of the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to determine what decoding mechanisms need to be applied to obtain the media-type specified by the Content-Type header of the object.

--content-language [text]

The optional Content-Language header that defines the content language of the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and differentiate objects based on a particular language.

--content-md5 [text]

The optional base-64 header that defines the encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message: “The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)”

--content-type [text]

The optional Content-Type header that defines the standard MIME type format of the object to be returned in GetObject and HeadObject responses. Content type defaults to ‘application/octet-stream’ if not specified. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and perform special operations on text only objects.

--disable-parallel-uploads

If the object will be uploaded in multiple parts, this option disables those parts from being uploaded in parallel.

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--force

If the object name already exists, overwrite the existing object without a confirmation prompt.

--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

--if-match [text]

The entity tag to match.

--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”}’

--name [text]

The name of the object. Default value is the filename excluding the path. Required if reading object from STDIN.

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--no-multipart

Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.

--no-overwrite

If the object name already exists, do not overwrite the existing object.

--opc-sse-kms-key-id [text]

The OCID of a master encryption key used to call the Key Management Service to generate a data encryption key or to encrypt or decrypt a data encryption key.

--parallel-upload-count [integer range]

The number of parallel operations to perform. Decreasing this value will make the process less resource intensive but it may take longer. Increasing this value may decrease the time taken, but the process will consume more system resources and network bandwidth. The maximum is 1000.

--part-size [integer]

Part size (in MiB) to use when the file is split into multiple parts and then combined. Part size must be greater than 10 MiB and defaults to 128 MiB.

--storage-tier [text]

The storage tier that the objects should be stored in. If not specified, the objects will be stored in the same storage tier as the bucket.

Accepted values are:

Archive, InfrequentAccess, Standard


--verify-checksum

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

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/put.html#cmdoption-bucket-name
    export file=<substitute-value-of-file> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/put.html#cmdoption-file
    oci os object put --bucket-name $bucket_name --file $file


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

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).

oci os object reencrypt [OPTIONS]


--bucket-name, -bn [text]

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

--object-name, -on, --name [text]

The name of the object. Avoid entering confidential information. Example: test/object1.log

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--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

--kms-key-id [text]

The OCID <https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm> of the master encryption key used to call the Vault service to re-encrypt the data encryption keys associated with the object and its chunks. If the kmsKeyId value is empty, whether null or an empty string, the API will perform re-encryption by using the kmsKeyId associated with the bucket or the master encryption key managed by Oracle, depending on the bucket encryption mechanism.

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

The Object Storage namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--source-encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the source object.

--version-id [text]

VersionId used to identify a particular version of the object

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/reencrypt.html#cmdoption-bucket-name
    export object_name=<substitute-value-of-object_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/reencrypt.html#cmdoption-object-name
    oci os object reencrypt --bucket-name $bucket_name --object-name $object_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Rename an object in the given Object Storage namespace.

See Object Names <https://docs.cloud.oracle.com/Content/Object/Tasks/managingobjects.htm#namerequirements> for object naming requirements.

oci os object rename [OPTIONS]


--bucket-name, --bucket, -bn [text]

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

--new-name [text]

The new name of the source object. Avoid entering confidential information.

--source-name, --name [text]

The name of the source object to be renamed.

--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

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

The Object Storage namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--new-obj-if-match-e-tag, --new-if-match [text]

The if-match entity tag (ETag) of the new object.

--new-obj-if-none-match-e-tag, --new-if-none-match [text]

The if-none-match entity tag (ETag) of the new object. The only valid value is ‘*’, which indicates request should fail if the new object already exists.

--src-obj-if-match-e-tag, --src-if-match [text]

The if-match entity tag (ETag) of the source object.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/rename.html#cmdoption-bucket-name
    export new_name=<substitute-value-of-new_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/rename.html#cmdoption-new-name
    export source_name=<substitute-value-of-source_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/rename.html#cmdoption-source-name
    oci os object rename --bucket-name $bucket_name --new-name $new_name --source-name $source_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Restores one or more objects specified by the objectName parameter. By default objects will be restored for 24 hours. Duration can be configured using the hours parameter.

oci os object restore [OPTIONS]


-bn, --bucket, --bucket-name [text]

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

--name [text]

A object which was in an archived state and need to be restored.

--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

--hours [integer]

The number of hours for which this object will be restored. By default objects will be restored for 24 hours. You can instead configure the duration using the hours parameter.

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--version-id [text]

The versionId of the object to restore. Current object version is used by default.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/restore.html#cmdoption-bucket-name
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/restore.html#cmdoption-name
    oci os object restore --bucket-name $bucket_name --name $name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Gets the restore status for an object.
Example:
oci os object restore-status -ns mynamespace -bn mybucket –name myfile.txt

oci os object restore-status [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--name [text]

The name of the object.

--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

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/restore-status.html#cmdoption-bucket-name
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/restore-status.html#cmdoption-name
    oci os object restore-status --bucket-name $bucket_name --name $name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Resume a previous multipart put.
Example:
oci os object resume-put -ns mynamespace -bn mybucket –name myfile.txt –file /Users/me/myfile.txt –upload-id my-upload-id

oci os object resume-put [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--file [filename]

The file to load as the content of the object.

--upload-id [text]

Upload ID to resume.

--disable-parallel-uploads

If the object will be uploaded in multiple parts, this option disables those parts from being uploaded in parallel.

--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

--name [text]

The name of the object. Default value is the filename excluding the path.

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

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--parallel-upload-count [integer range]

The number of parallel operations to perform. Decreasing this value will make the process less resource intensive but it may take longer. Increasing this value may decrease the time taken, but the process will consume more system resources and network bandwidth. The maximum is 1000.

--part-size [integer]

Part size (in MiB) to use when the file is split into multiple parts and then combined. Part size must be greater than 10 MiB and defaults to 128 MiB.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/resume-put.html#cmdoption-bucket-name
    export file=<substitute-value-of-file> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/resume-put.html#cmdoption-file
    export upload_id=<substitute-value-of-upload_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/resume-put.html#cmdoption-upload-id
    oci os object resume-put --bucket-name $bucket_name --file $file --upload-id $upload_id


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples
  • Description
  • Command
  • Output
  • Description
  • Command
  • Output
  • Description
  • Command
  • Output
  • Description
  • Command
  • Output


Synchronizes a filesystem directory with objects in a bucket. Traverses sub-directories copying new and modified files or objects from the source to the destination and optionally deleting those that are not present in the source.

oci os object sync [OPTIONS]


-bn, --bucket-name [text]

The name of the bucket.

--cache-control [text]

The optional Cache-Control header that defines the caching behavior value to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify objects that require caching restrictions.

--content-disposition [text]

The optional Content-Disposition header that defines presentational information for the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to let users download objects with custom filenames in a browser.

--content-encoding [text]

The optional Content-Encoding header that defines the content encoding of the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to determine what decoding mechanisms need to be applied to obtain the media-type specified by the Content-Type header of the object.

--content-language [text]

The optional Content-Language header that defines the content language of the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and differentiate objects based on a particular language.

--content-type [text]

The optional Content-Type header that defines the standard MIME type format of the object to be returned in GetObject and HeadObject responses. Content type defaults to ‘application/octet-stream’ if not specified. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and perform special operations on text only objects.

--delete

delete files/objects that exist in the destination but not in the source. No files or objects are deleted by default.

--dest-dir [text]

The directory into which objects in a bucket will be synced as files. This directory will be created if it does not exist. An object will require downloading if it does not exist in the local directory or if it exists, either the size of the object differs from the size of the local file or the last modified time of the object is newer than the last modified time of the local file. Objects in Archive tier which have not been restored will not be downloaded.

--dry-run

Prints the list of files that would be uploaded, downloaded or deleted without actually performing any actions.

--encryption-key-file [filename]

A file containing the base64-encoded string of the AES-256 encryption key associated with the object.

--exclude [text]

Only process files which do not match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple 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 process files which match the specified pattern. Patterns are applied relative to the current directory. This option can be specified multiple times to match on multiple 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]

The top-level namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--no-follow-symlinks

Symbolic links will be ignored while traversing the local filesystem.

--no-multipart

Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.

--parallel-operations-count [integer range]

The number of parallel operations to perform. Decreasing this value will make the process less resource intensive but it may take longer. Increasing this value may decrease the time taken, but the process will consume more system resources and network bandwidth. The maximum is 1000. [default: 10]

--part-size [integer range]

Part size (in MiB) to use when downloading an object in multiple parts. The minimum allowable size is 128 MiB.

--prefix [text]

When specified with –src-dir, the files are uploaded as objects with the specified prefix. When specified with –dest-dir, only objects with the specified prefix are downloaded but the prefix is not added to the file names.

--src-dir [text]

The directory from which the files will be synced to a bucket as objects. A local file will require uploading if the size of the local file is different than the size of the object, the last modified time of the local file is newer than the last modified time of the object, or the local file does not exist under the specified bucket and prefix.

--storage-tier [text]

The storage tier that the objects should be stored in. If not specified, the objects will be stored in the same storage tier as the bucket.

Accepted values are:

Archive, InfrequentAccess, Standard


Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

This command will sync the current directory to a bucket in object storage. Any file will be uploaded if an object by that name does not exist under the specified bucket or if it exists, either the size of the file differs from the size of the object or the last modified time of the file is newer than the last modified time of the object. No object will be deleted from the bucket.

 oci os object sync --bn backup --src-dir .


{
 "skipped-objects": [
      "file1.pdf",
      "file2.pdf",
      "file3.pdf"
 ],
 "upload-failures": {},
 "uploaded-objects": {
      "text1.txt": {
           "etag": "e3ff97e5-8270-463d-932b-a59896df3325",
           "last-modified": "Wed, 21 Jul 2021 16:07:22 GMT",
           "opc-content-md5": "1B2M2Y8AsgTpgAmY7PhCfg=="
      },
      "web1.html": {
           "etag": "32f57ee7-691e-44cf-8a21-69b69327ba83",
           "last-modified": "Wed, 21 Jul 2021 16:07:22 GMT",
           "opc-content-md5": "1B2M2Y8AsgTpgAmY7PhCfg=="
      }
 }
}


This command will sync the contents of a bucket to a local directory. An object be downloaded if a file by that name does not exist in the directory or if it exists, either the size of the object differs from the size of the file or the last modified time of the object is newer than the last modified time of the file. Any object that does not exist in the bucket but is found in the file system will be deleted.

 oci os object sync --bn backup --dest-dir /export/backup --delete


{
 "deleted-files": [
      "/export/backup/unwanted_file.pdf"
 ],
 "download-failures": {},
 "downloaded-objects": [
      "web2.html",
      "web3.html",
      "text2.txt",
      "text1.txt",
      "web1.html"
 ],
 "skipped-objects": []
}


This command will sync files (except for .bak and .toc files) as objects under the specified date prefix. It will also delete any files under the specified prefix (except for bak and .toc files) that are currently not found in the local directory.

 oci os object sync --bn backups --prefix 20210719/ --src-dir /export/docs --exclude '*.bak' --exclude '*.toc'


{
 "deleted-files": [],
 "download-failures": {},
 "downloaded-objects": [
      "web2.html",
      "web3.html",
      "text2.txt",
      "text1.txt",
      "web1.html"
 ],
 "skipped-objects": []
}


This command will sync only pdf files under the specified date prefix in the bucket to the local directory.

 oci os object sync --bn backups --prefix 20210721/ --dest-dir /export/docs --include '*.pdf' --delete


{
 "deleted-files": [
      "/export/docs/unwanted_file.pdf"
 ],
 "download-failures": {},
 "downloaded-objects": [
      "file3.pdf",
      "file2.pdf",
      "file1.pdf"
 ],
 "skipped-objects": []
}


Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/sync.html#cmdoption-bucket-name
    oci os object sync --bucket-name $bucket_name


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Changes the storage tier of the object specified by the objectName parameter.

oci os object update-storage-tier [OPTIONS]


--bucket-name, --bucket, -bn [text]

The name of the bucket. Example: my-bucket1

--object-name [text]

The name of the object for which the storage tier needs to be changed.

--storage-tier [text]

The storage tier that the object should be moved to.

Accepted values are:

Archive, InfrequentAccess, Standard


--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

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

The Object Storage namespace used for the request. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’

--version-id [text]

The versionId of the object. Current object version is used by default.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export bucket_name=<substitute-value-of-bucket_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/update-storage-tier.html#cmdoption-bucket-name
    export object_name=<substitute-value-of-object_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/update-storage-tier.html#cmdoption-object-name
    export storage_tier=<substitute-value-of-storage_tier> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/os/object/update-storage-tier.html#cmdoption-storage-tier
    oci os object update-storage-tier --bucket-name $bucket_name --object-name $object_name --storage-tier $storage_tier


Oracle

2016, 2022, Oracle
May 17, 2022 3.9.1

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.