restore_archived_object ( $bucket, $filename, $days, $opt )

Restore an object archived in Amazon Glacier back to Amazon S3.

Access

public

Parameters

Parameter

Type

Required

Description

$bucket

string

Required

The name of the bucket to use.

$filename

string

Required

The file name for the object.

$days

integer

Required

The number of days until the targeted objects are to be moved or expired from the bucket. Must be a positive integer.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Source

Method defined in services/s3.class.php | Toggle source view (18 lines) | View on GitHub

public function restore_archived_object($bucket, $filename, $days, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['verb'] = 'POST';
    $opt['resource'] = $filename;
    $opt['sub_resource'] = 'restore';
    $opt['headers'] = array(
        'Content-Type' => 'application/xml'
    );

    $xml = simplexml_load_string($this->restore_request_xml, $this->parser_class);
    $xml->addChild('Days', (integer) $days);

    $opt['body'] = $xml->asXML();

    // Authenticate to S3
    return $this->authenticate($bucket, $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback