in clone_mediaconvert_resources/clone_mediaconvert_resources.py [0:0]
def get_presets(source_client, file):
try:
response = source_client.list_presets(ListBy='NAME')
results = response['Presets']
while "NextToken" in response:
response = source_client.list_presets(NextToken=response["NextToken"])
results.extend(response["Presets"])
if len(results) == 0:
return
else:
path = clean_presets(results, file)
return path
except botocore.exceptions.ClientError as error:
if error.response['Error']['Code'] == 'AccessDeniedException':
print("No Permissions to access the MediaConvert API and get output presets,"
" please check the AWS CLI credentials")
exit(-1)
except:
print("Error processing preset resources in source region")