- AWS Code Sample demonstrates how to get information about all completed AWS Elemental MediaConvert jobs.

/* * Copyright, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * * * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES * OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and * limitations under the License. */ package com.example.mediaconvert; import; import; import; import; import; import; import; import; import; import java.util.List; public class ListJobs { public static void main(String[] args) { Region region = Region.US_WEST_2; MediaConvertClient mc = MediaConvertClient.builder() .region(region) .build(); listCompleteJobs(mc); } public static void listCompleteJobs(MediaConvertClient mc) { try { DescribeEndpointsResponse res = mc.describeEndpoints(DescribeEndpointsRequest.builder() .maxResults(20) .build()); if (res.endpoints().size() <= 0) { System.out.println("Cannot find MediaConvert service endpoint URL!"); System.exit(1); } String endpointURL = res.endpoints().get(0).url(); MediaConvertClient emc = MediaConvertClient.builder() .region(Region.US_WEST_2) .endpointOverride(URI.create(endpointURL)) .build(); ListJobsRequest jobsRequest = ListJobsRequest.builder() .maxResults(10) .status("COMPLETE") .build(); ListJobsResponse jobsResponse = emc.listJobs(jobsRequest); List<Job> jobs =; for (Job job: jobs) { System.out.println("The ARN of the job is : "+job.arn()); } } catch (SdkException e) { System.out.println(e.toString()); } } }

Sample Details

Service: AWS Elemental MediaConvert

Last tested: 7/30/2020

Author: smacdon - AWS

Type: full-example