javaamazon-web-servicesamazon-elastic-transcoder

Unable to get all predefined Presets from AWS Elastic Transcoder


I am trying to get the all Presets from AWS Elastic Transcoder but the following code returns only 50 out of 62

List<Preset> presets = amazonElasticTranscoder.listPresets().getPresets();
  1. How do I get all presets (include custom presets)??
  2. Is there any possible to get Preset using presetName??

Solution

  • The responses from AWS come in pages of 50. To get the next page, take the nextPageToken from the ListPresetsResult you got, and use it in another call:

    ListPresetsRequest request = new ListPresetsRequest();
    request.setPageToken(result.getNextPageToken());
    amazonElasticTranscoder.listPresets(request);
    

    There doesn't seem to be a way to find a preset by name in the Java API.