create_job ( $job_type, $manifest, $validate_only, $opt )

This operation initiates the process of scheduling an upload or download of your data. You include in the request a manifest that describes the data transfer specifics. The response to the request includes a job ID, which you can use in other operations, a signature that you use to identify your storage device, and the address where you should ship your storage device.

Access

public

Parameters

Parameter

Type

Required

Description

$job_type

string

Required

Specifies whether the job to initiate is an import or export job. [Allowed values: Import, Export]

$manifest

string

Required

The UTF-8 encoded text of the manifest file.

$validate_only

boolean

Required

Validate the manifest and parameter values in the request but do not actually create a job.

$opt

array

Optional

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

  • ManifestAddendum - string - Optional - For internal use only.
  • 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.

Examples

Create a new import job.

See Manifest File Parameters for information about creating manifests.

$ies = new AmazonImportExport();

// Create a new manifest
$manifest = CFManifest::map(array(
	'manifestVersion' => '2.0',
	'bucket' => 'my-bucket',
	'eraseDevice' => 'no',
	'deviceId' => 49382,
	'accessKeyId' => $ies->key,
	'returnAddress' => array(
		'name' => 'Amazon.com ATTN Joe Random',
		'street1' => '120 Nosuch Ave S.',
		'city' => 'Seattle',
		'stateOrProvince' => 'WA',
		'postalCode' => 91111,
		'phoneNumber' => '206-266-0000',
		'country' => 'USA'
	)
));

$response = $ies->create_job('Import', $manifest, 'false');

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

See Also

Source

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

public function create_job($job_type, $manifest, $validate_only, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['JobType'] = $job_type;
    $opt['Manifest'] = $manifest;
    $opt['ValidateOnly'] = $validate_only;
    
    return $this->authenticate('CreateJob', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback