|
NAMEos_object -DESCRIPTIONAVAILABLE COMMANDS
bulk-delete
DescriptionDeletes all objects in a bucket which match the provided criteria.Usageoci os object bulk-delete [OPTIONS] Required Parameters
The name of the bucket. Optional Parameters
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.
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.
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
Do not ask for confirmation prior to performing the bulk delete.
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
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
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’
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]
Delete all objects with the given prefix. Omit this parameter to delete all objects in the bucket. Examples
Deleting all objects in the bucketoci os object bulk-delete -ns mynamespace -bn mybucket Delete all objects that match a given prefixoci 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. Limiting deleted objects using a prefix and delimiteroci 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 / Previewing what would be deletedoci 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 Do not prompt for deleteoci 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. Global ParametersUse 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 ExamplesCopy 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 bulk-delete-versions
DescriptionDeletes all object versions in a bucket which match the provided criteria.Usageoci os object bulk-delete-versions [OPTIONS] Required Parameters
The name of the bucket. Optional Parameters
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.
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.
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
Do not ask for confirmation prior to performing the bulk delete.
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
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
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’
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.
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]
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
Deleting all object versions in the bucketoci os object bulk-delete-versions -ns mynamespace -bn mybucket Delete all object versions that match a given prefixoci 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. Limiting deleted objects using a prefix and delimiteroci 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 / Deleting all object versions using object nameoci 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 Previewing what would be deletedoci 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 Do not prompt for deleteoci 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. Global ParametersUse 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 ExamplesCopy 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 bulk-download
DescriptionDownloads all objects which match the given prefix to a given directory.Usageoci os object bulk-download [OPTIONS] Required Parameters
The name of the bucket.
The directory where retrieved objects will be placed as files. This directory will be created if it does not exist. Optional Parameters
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.
Prints the list of files to be downloaded.
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
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
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
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
Objects larger than this size (in MiB) will be downloaded in multiple parts. The minimum allowable threshold is 128 MiB.
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’
Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.
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
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.
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 (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.
Retrieve all objects with the given prefix. Omit this parameter to get all objects in the bucket Examples
Download all objects in the bucketoci os object bulk-download -ns mynamespace -bn mybucket --download-dir path/to/download/directory Download all objects that match a given prefixoci 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. Limiting downloaded objects using a prefix and delimiteroci 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 / Overwriting or skipping filesoci 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. Global ParametersUse 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 ExamplesDescriptionDownload all objects in the bucket excluding ‘.cache’ directory.Commandoci os object bulk-download -bn "cli-test" --download-dir ~/cliDirectory --exclude '.cache/*' Output{ "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 bulk-upload
DescriptionUploads all files in a given directory and all subdirectories.Usageoci os object bulk-upload [OPTIONS] Required Parameters
The name of the bucket.
The directory which contains files to upload. Files in the directory and all subdirectories will be uploaded. Optional Parameters
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.
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.
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.
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.
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.
[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
Prints the list of files to be uploaded.
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
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
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
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
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”}’
Object Storage namespace. If not provided, this parameter will be obtained internally using a call to ‘oci os ns get’
Symbolic links will be ignored while traversing the local filesystem.
Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.
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.
A prefix to apply to the names of all files being uploaded
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.
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.
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 (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.
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 the checksum of the uploaded object with the local file. Examples
?Upload all files from a given directoryoci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory Forcing object overwrite to resolve object name collision?If a file being uploaded already exists in Object Storage, it can be overwritten without a prompt by using the --overwrite flag.oci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory --overwrite Prevent object overwrite to resolve object name collision?If a file being uploaded already exists in Object Storage, it can be preserved (not overwritten) without a prompt by using the --no-overwrite flag.oci os object bulk-upload -ns mynamespace -bn mybucket --src-dir path/to/upload/directory --no-overwrite Applying metadataMetadata 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 Global ParametersUse 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 ExamplesDescriptionupload all objects in the bucket excluding ‘.cache’ directory.Commandoci os object bulk-upload -bn "cli-test" --src-dir ~/cliDirectory --exclude '.cache/*' Output{ "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 copy
DescriptionCreates 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. Usageoci os object copy [OPTIONS] Required Parameters
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
The destination bucket the object will be copied to.
The name of the object to be copied. Optional Parameters
The destination namespace object will be copied to.
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.
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.
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.
The destination name for the copy object.
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
The destination region object will be copied to.
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
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
The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.
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’
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.
A file containing the base64-encoded string of the AES-256 encryption key associated with the source object.
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.
VersionId of the object to copy. If not provided then current version is copied by default.
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
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. Global ParametersUse 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 ExamplesCopy 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 delete
DescriptionDeletes an object.Usageoci os object delete [OPTIONS] Required Parameters
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
The name of the object. Avoid entering confidential information. Example: test/object1.log Optional Parameters
Perform deletion without prompting for confirmation.
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
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.
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’
VersionId used to identify a particular version of the object Global ParametersUse 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 ExamplesCopy 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 get
DescriptionGets the metadata and body of an object.
Usageoci os object get [OPTIONS] Required Parameters
The name of the bucket.
The name of the file that will receive the object content, or ‘-‘ to write to STDOUT.
The name of the object. Optional Parameters
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
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
This value will be used in Cache-Control header of the response.
This value will be used in Content-Disposition header of the response.
This value will be used in Content-Encoding header of the response
This value will be used in Content-Language header of the response.
This value will be used in Content-Type header of the response.
This value will be used in Expires header of the response
The entity tag to match.
The entity tag to avoid matching.
Objects larger than this size (in MiB) will be downloaded in multiple parts. The minimum allowable threshold is 128 MiB.
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’
Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.
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 (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.
Byte range to fetch. Follows https://tools.ietf.org/html/rfc7233#section-2.1. Example: bytes=2-10
VersionId used to identify a particular version of the object Global ParametersUse 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 ExamplesCopy 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 head
DescriptionGets the user-defined metadata and entity tag for an object.
Usageoci os object head [OPTIONS] Required Parameters
The name of the bucket.
The name of the object. Optional Parameters
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
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
The entity tag to match.
The entity tag to avoid matching.
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’
VersionId used to identify a particular version of the object Global ParametersUse 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 ExamplesCopy 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 list
DescriptionLists the objects in a bucket.
Usageoci os object list [OPTIONS] Required Parameters
The name of the bucket. Optional Parameters
Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.
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.
Only object names less than this parameter will be returned.
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]
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
The maximum number of items to return. [default: 100]
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’
When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.
Only object names that begin with this prefix will be returned.
Only object names greater or equal to this parameter will be returned.
Print output to stdout as it is fetched so the full response is not stored in memory. This only works with --all. Global ParametersUse 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 ExamplesDescriptionList objects in a bucketCommandoci os object list --bucket-name CLITest Output{ "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": [] } DescriptionList objects in a bucket with common prefixCommandoci os object list --bucket-name CLITest --prefix test Output{ "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 list-object-versions
DescriptionLists 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>. Usageoci os object list-object-versions [OPTIONS] Required Parameters
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1 Optional Parameters
Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.
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.
Object names returned by a list query must be strictly less than this parameter.
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]
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
The maximum number of items to return.
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’
The page at which to start retrieving results.
When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.
The string to use for matching against the start of object names in a list query.
Object names returned by a list query must be greater or equal to this parameter.
Object names returned by a list query must be greater than this parameter. Global ParametersUse 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 put
DescriptionCreates 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):
Usageoci os object put [OPTIONS] Required Parameters
The name of the bucket.
The file to load as the content of the object, or ‘-‘ to read from STDIN. Optional Parameters
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.
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.
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.
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.
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)”
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.
If the object will be uploaded in multiple parts, this option disables those parts from being uploaded in parallel.
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
If the object name already exists, overwrite the existing object without a confirmation prompt.
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
The entity tag to match.
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”}’
The name of the object. Default value is the filename excluding the path. Required if reading object from STDIN.
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’
Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.
If the object name already exists, do not overwrite the existing object.
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.
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 (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.
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 the checksum of the uploaded object with the local file. Global ParametersUse 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 ExamplesCopy 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 reencrypt
DescriptionRe-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:
Usageoci os object reencrypt [OPTIONS] Required Parameters
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
The name of the object. Avoid entering confidential information. Example: test/object1.log Optional Parameters
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
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
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.
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’
A file containing the base64-encoded string of the AES-256 encryption key associated with the source object.
VersionId used to identify a particular version of the object Global ParametersUse 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 ExamplesCopy 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 rename
DescriptionRename 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. Usageoci os object rename [OPTIONS] Required Parameters
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
The new name of the source object. Avoid entering confidential information.
The name of the source object to be renamed. Optional Parameters
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
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’
The if-match entity tag (ETag) of the new object.
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.
The if-match entity tag (ETag) of the source object. Global ParametersUse 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 ExamplesCopy 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 restore
DescriptionRestores 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.Usageoci os object restore [OPTIONS] Required Parameters
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
A object which was in an archived state and need to be restored. Optional Parameters
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
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.
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’
The versionId of the object to restore. Current object version is used by default. Global ParametersUse 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 ExamplesCopy 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 restore-status
DescriptionGets the restore status for an object.
Usageoci os object restore-status [OPTIONS] Required Parameters
The name of the bucket.
The name of the object. Optional Parameters
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
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’ Global ParametersUse 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 ExamplesCopy 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 resume-put
DescriptionResume a previous multipart put.
Usageoci os object resume-put [OPTIONS] Required Parameters
The name of the bucket.
The file to load as the content of the object.
Upload ID to resume. Optional Parameters
If the object will be uploaded in multiple parts, this option disables those parts from being uploaded in parallel.
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
The name of the object. Default value is the filename excluding the path.
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’
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 (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. Global ParametersUse 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 ExamplesCopy 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 sync
DescriptionSynchronizes 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.Usageoci os object sync [OPTIONS] Required Parameters
The name of the bucket. Optional Parameters
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.
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.
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.
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.
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 files/objects that exist in the destination but not in the source. No files or objects are deleted by default.
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.
Prints the list of files that would be uploaded, downloaded or deleted without actually performing any actions.
A file containing the base64-encoded string of the AES-256 encryption key associated with the object.
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
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
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
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”}’
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’
Symbolic links will be ignored while traversing the local filesystem.
Do not transfer the file in multiple parts. By default, files above 128 MiB will be transferred in multiple parts, then combined.
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 (in MiB) to use when downloading an object in multiple parts. The minimum allowable size is 128 MiB.
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.
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.
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 Global ParametersUse 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 ExamplesDescriptionThis 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.Commandoci os object sync --bn backup --src-dir . Output{ "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==" } } } DescriptionThis 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.Commandoci os object sync --bn backup --dest-dir /export/backup --delete Output{ "deleted-files": [ "/export/backup/unwanted_file.pdf" ], "download-failures": {}, "downloaded-objects": [ "web2.html", "web3.html", "text2.txt", "text1.txt", "web1.html" ], "skipped-objects": [] } DescriptionThis 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.Commandoci os object sync --bn backups --prefix 20210719/ --src-dir /export/docs --exclude '*.bak' --exclude '*.toc' Output{ "deleted-files": [], "download-failures": {}, "downloaded-objects": [ "web2.html", "web3.html", "text2.txt", "text1.txt", "web1.html" ], "skipped-objects": [] } DescriptionThis command will sync only pdf files under the specified date prefix in the bucket to the local directory.Commandoci os object sync --bn backups --prefix 20210721/ --dest-dir /export/docs --include '*.pdf' --delete Output{ "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 update-storage-tier
DescriptionChanges the storage tier of the object specified by the objectName parameter.Usageoci os object update-storage-tier [OPTIONS] Required Parameters
The name of the bucket. Example: my-bucket1
The name of the object for which the storage tier needs to be changed.
The storage tier that the object should be moved to. Accepted values are: Archive, InfrequentAccess, Standard Optional Parameters
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
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’
The versionId of the object. Current object version is used by default. Global ParametersUse 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 ExamplesCopy 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 AUTHOROracleCOPYRIGHT2016, 2022, Oracle
Visit the GSP FreeBSD Man Page Interface. |