Method: Aws::S3::ObjectSummary#restore_object
- Defined in:
- lib/aws-sdk-s3/object_summary.rb
#restore_object(options = {}) ⇒ Types::RestoreObjectOutput
Examples:
Request syntax with placeholder values
Request syntax with placeholder values
object_summary.restore_object({
version_id: "ObjectVersionId",
restore_request: {
days: 1,
glacier_job_parameters: {
tier: "Standard", # required, accepts Standard, Bulk, Expedited
},
type: "SELECT", # accepts SELECT
tier: "Standard", # accepts Standard, Bulk, Expedited
description: "Description",
select_parameters: {
input_serialization: { # required
csv: {
file_header_info: "USE", # accepts USE, IGNORE, NONE
comments: "Comments",
quote_escape_character: "QuoteEscapeCharacter",
record_delimiter: "RecordDelimiter",
field_delimiter: "FieldDelimiter",
quote_character: "QuoteCharacter",
allow_quoted_record_delimiter: false,
},
compression_type: "NONE", # accepts NONE, GZIP, BZIP2
json: {
type: "DOCUMENT", # accepts DOCUMENT, LINES
},
parquet: {
},
},
expression_type: "SQL", # required, accepts SQL
expression: "Expression", # required
output_serialization: { # required
csv: {
quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED
quote_escape_character: "QuoteEscapeCharacter",
record_delimiter: "RecordDelimiter",
field_delimiter: "FieldDelimiter",
quote_character: "QuoteCharacter",
},
json: {
record_delimiter: "RecordDelimiter",
},
},
},
output_location: {
s3: {
bucket_name: "BucketName", # required
prefix: "LocationPrefix", # required
encryption: {
encryption_type: "AES256", # required, accepts AES256, aws:fsx, aws:kms, aws:kms:dsse
kms_key_id: "SSEKMSKeyId",
kms_context: "KMSContext",
},
canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
access_control_list: [
{
grantee: {
display_name: "DisplayName",
email_address: "EmailAddress",
id: "ID",
type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group
uri: "URI",
},
permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP
},
],
tagging: {
tag_set: [ # required
{
key: "ObjectKey", # required
value: "Value", # required
},
],
},
user_metadata: [
{
name: "MetadataKey",
value: "MetadataValue",
},
],
storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE, FSX_OPENZFS, FSX_ONTAP
},
},
},
request_payer: "requester", # accepts requester
checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
expected_bucket_owner: "AccountId",
})
Parameters:
-
options
(Hash)
(defaults to: {})
—
({})
Options Hash (options):
-
:version_id
(String)
—
VersionId used to reference a specific version of the object.
-
:restore_request
(Types::RestoreRequest)
—
Container for restore job parameters.
-
:request_payer
(String)
—
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets] in the *Amazon S3 User Guide*.
<note markdown=“1”> This functionality is not supported for directory buckets.
</note>[1]: docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
-
:checksum_algorithm
(String)
—
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz-checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code ‘400 Bad Request`. For more information, see [Checking object integrity] in the *Amazon S3 User Guide*.If you provide an individual checksum, Amazon S3 ignores any provided
ChecksumAlgorithmparameter.[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
-
:expected_bucket_owner
(String)
—
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code ‘403 Forbidden` (access denied).
Returns:
2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 |
# File 'lib/aws-sdk-s3/object_summary.rb', line 2814 def restore_object(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.restore_object(options) end resp.data end |