2013-11-09 1 views
0

Amazon Glacier에서 내 보관 파일을 삭제하려고합니다. 나는 PHP SDK2와 함께 PHP를 통해 그것을하고있다. 은 내가 ArchiveID 얻기 위해 작업을 시작했습니다 .. 약간의 문제가있다 : A는 그 작업이 완료 볼 수있는 몇 시간 후Amazon Glacier PHP 및 작업

$this->client->initiateJob(array(
    'accountId' => '-', 
    'vaultName' => $aValutName, 
    'Type' => "inventory-retrieval") 
); 

을, 그래서 나는 그것이 ID를 사용하여 작업의를 얻기 위해 노력하고 있어요 :

$res = $this->client->getJobOutput(array(
     'accountId' => '-', 
     'vaultName' => $aValutName, 
     'jobId' => $aJobID, 
    )); 

내가 그런 일을 주어진 오전 응 답으로 "archiveDescription는"비어있는 이유

Guzzle\Service\Resource\Model Object 
(
    [structure:protected] => 
    [data:protected] => Array 
     (
      [body] => Guzzle\Http\EntityBody Object 
       (
        [contentEncoding:protected] => 
        [rewindFunction:protected] => 
        [stream:protected] => Resource id #152 
        [size:protected] => 
        [cache:protected] => Array 
         (
          [wrapper_type] => PHP 
          [stream_type] => TEMP 
          [mode] => w+b 
          [unread_bytes] => 0 
          [seekable] => 1 
          [uri] => php://temp 
          [is_local] => 1 
          [is_readable] => 1 
          [is_writable] => 1 
         ) 

        [customData:protected] => Array 
         (
          [default] => 1 
         ) 

       ) 

      [checksum] => 
      [status] => 200 
      [contentRange] => 
      [acceptRanges] => bytes 
      [contentType] => application/json 
      [archiveDescription] => 
     ) 

) 

이 enybody 생각을 했습니까? D

MK,

아마 .... 어떤 도움

고맙습니다 ArchiveID 그래서 난 내 아카이브를 삭제 할 수있을 것입니다 얻을 수있는 또 다른 방법이있다.

답변

0

확인이 솔루션은 ... 너무 쉬웠다

public function getJobResult($aValutName, $aJobID) { 
    $res = $this->client->getJobOutput(array(
     'accountId' => '-', 
     'vaultName' => $aValutName, 
     'jobId' => $aJobID, 
    )); 
    $body = EntityBody::factory($res['body']); 
    $body->rewind(); 
    $inventory = stream_get_contents($body->getStream()); 
    $ArchiveList = json_decode($inventory,1)['ArchiveList']; 
    $res = array(); 
    foreach($ArchiveList as $archive): 
     $res[]=$archive['ArchiveId']; 
    endforeach; 


    return $res; 
}