SIGN IN SIGN UP

Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below.

0 0 1 Java
2023-04-07 15:15:39 -04:00
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/**
* Before running this C++ code example, set up your development environment, including your credentials.
*
* For more information, see the following documentation topic:
*
* https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/getting-started.html
*
* For information on the structure of the code examples and how to build and run the examples, see
* https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/getting-started-code-examples.html.
*
**/
#include <aws/core/Aws.h>
#include <aws/mediaconvert/MediaConvertClient.h>
#include <aws/mediaconvert/model/GetJobRequest.h>
2023-04-07 15:15:39 -04:00
#include "mediaconvert_samples.h"
// snippet-start:[cpp.example_code.mediaconvert.GetJob]
//! Retrieve the information for a specific completed transcoding job.
/*!
\param jobID: A job ID.
\param clientConfiguration: AWS client configuration.
\return bool: Function succeeded.
*/
bool AwsDoc::MediaConvert::getJob(const Aws::String &jobID,
const Aws::Client::ClientConfiguration &clientConfiguration) {
Aws::MediaConvert::MediaConvertClient client(clientConfiguration);
2023-04-07 15:15:39 -04:00
Aws::MediaConvert::Model::GetJobRequest request;
request.SetId(jobID);
const Aws::MediaConvert::Model::GetJobOutcome outcome = client.GetJob(
request);
if (outcome.IsSuccess()) {
std::cout << outcome.GetResult().GetJob().Jsonize().View().WriteReadable()
<< std::endl;
}
else {
std::cerr << "DescribeEndpoints error - " << outcome.GetError().GetMessage()
<< std::endl;
}
2023-04-07 15:15:39 -04:00
return outcome.IsSuccess();
}
// snippet-end:[cpp.example_code.mediaconvert.GetJob]
/*
*
* main function
*
* Usage: 'run_get_job <job_id>'
*
*/
#ifndef TESTING_BUILD
int main(int argc, char **argv) {
if (argc < 2) {
std::cout << R"(
Usage:
run_get_job <job_id>
Where:
job_id - A transcoding job ID.
)";
}
Aws::SDKOptions options;
2023-04-07 15:15:39 -04:00
Aws::InitAPI(options);
{
Aws::String jobID = argv[1];
Aws::Client::ClientConfiguration clientConfig;
// Optional: Set to the AWS Region (overrides config file).
// clientConfig.region = "us-east-1";
AwsDoc::MediaConvert::getJob(jobID, clientConfig);
}
Aws::ShutdownAPI(options);
return 0;
}
#endif // TESTING_BUILD