put¶
Description¶
Creates a new data file or replaces an existing one with the same name and type.
Required Parameters¶
-
--apm-domain-id[text]¶
The APM Domain ID the request is intended for.
-
--apm-type[text]¶
The type of the data file.
-
--data-file-body[text]¶
The data file to be uploaded.
-
--data-file-name[text]¶
The name of the data file.
Optional Parameters¶
-
--content-disposition[text]¶
Optional parameter that provides presentation information for how the content should be displayed or handled by the recipient.
For example, to prompt a file download with a custom filename: attachment; filename=”example.txt”
-
--content-encoding[text]¶
Optional parameter indicating the content encodings applied to the request body (e.g., gzip, deflate). This value can be used by recipients to determine how to decode the content.
-
--content-language[text]¶
Optional parameter that indicates the natural language of the content. This value can be used by clients or intermediaries to select or display content based on language preferences.
-
--content-md5[text]¶
Optional base64-encoded MD5 hash of the request body. If provided, the server will perform a data integrity check by computing the MD5 of the received content and comparing it to the supplied value.
If the values do not match, the request will be rejected with an HTTP 400 error and a message such as:
“The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)”
-
--content-type[text]¶
Optional parameter specifying the media type (MIME type) of the request or response body. If not specified, the default is application/octet-stream.
This value can be used by recipients to determine how to interpret or render the content.
-
--from-json[text]¶
Provide input to this command as a JSON document from a file using the file://path-to/file syntax.
The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.
Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.
For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions
-
--metadata[text]¶
A string containing a JSON-encoded object with metadata related to the uploaded file or resource. Example: {“fileName”:”report.pdf”,”uploader”:”jane.doe”,”category”:”financial”}
Global Parameters¶
Use oci --help for help on global parameters.
--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --connection-timeout, --debug, --defaults-file, --enable-dual-stack, --enable-propagation, --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, --proxy, --query, --raw-output, --read-timeout, --realm-specific-endpoint, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v
Example using required parameter¶
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 and appropriate security policies before trying the examples.
export apm_domain_id=<substitute-value-of-apm_domain_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/apm-config/data-file/put.html#cmdoption-apm-domain-id
export apm_type=<substitute-value-of-apm_type> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/apm-config/data-file/put.html#cmdoption-apm-type
export data_file_body=<substitute-value-of-data_file_body> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/apm-config/data-file/put.html#cmdoption-data-file-body
export data_file_name=<substitute-value-of-data_file_name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/apm-config/data-file/put.html#cmdoption-data-file-name
oci apm-config data-file put --apm-domain-id $apm_domain_id --apm-type $apm_type --data-file-body $data_file_body --data-file-name $data_file_name