2018-10-11 15:00:23 -07:00
< ? php
2018-12-28 10:35:52 -08:00
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2018-10-11 15:00:23 -07:00
// SPDX-License-Identifier: Apache-2.0
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
/*
* ABOUT THIS PHP SAMPLE => This sample is part of the SDK for PHP Developer Guide topic at
* https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/emc-examples-jobs.html
*
2019-02-01 20:05:05 -08:00
*
*
2018-10-11 15:00:23 -07:00
*/
2019-02-01 20:05:05 -08:00
// snippet-start:[mediaconvert.php.get_job.complete]
// snippet-start:[mediaconvert.php.get_job.import]
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
require 'vendor/autoload.php' ;
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
use Aws\Exception\AwsException ;
2019-02-01 20:05:05 -08:00
use Aws\MediaConvert\MediaConvertClient ;
2024-02-05 10:49:20 -07:00
2019-02-01 20:05:05 -08:00
// snippet-end:[mediaconvert.php.get_job.import]
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
/**
2019-04-09 17:45:01 -07:00
* Retrieve results from a specific completed transcoding job for AWS Elemental MediaConvert.
2018-10-11 15:00:23 -07:00
*
* This code expects that you have AWS credentials set up per:
* https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html
*/
2024-02-05 10:49:20 -07:00
2019-02-01 20:05:05 -08:00
//Create an AWSMediaConvert client object with your account specific endpoint.
// snippet-start:[mediaconvert.php.get_job.main]
2018-10-11 15:00:23 -07:00
$mediaConvertClient = new MediaConvertClient ([
'version' => '2017-08-29' ,
'region' => 'us-east-2' ,
2024-05-15 11:26:06 -04:00
'profile' => 'default'
2018-10-11 15:00:23 -07:00
]);
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
try {
$result = $mediaConvertClient -> getJob ([
'Id' => 'JOB_ID' ,
]);
} catch ( AwsException $e ) {
// output error message if fails
echo $e -> getMessage ();
echo " \n " ;
}
2024-02-05 10:49:20 -07:00
2019-02-01 20:05:05 -08:00
// snippet-end:[mediaconvert.php.get_job.main]
// snippet-end:[mediaconvert.php.get_job.complete]