Exemples d'utilisation d'Elastic Transcoder AWS CLI - AWS Command Line Interface

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

Exemples d'utilisation d'Elastic Transcoder AWS CLI

Les exemples de code suivants vous montrent comment effectuer des actions et implémenter des scénarios courants à l' AWS Command Line Interface aide d'Elastic Transcoder.

Les actions sont des extraits de code de programmes plus larges et doivent être exécutées dans leur contexte. Les actions vous indiquent comment appeler des fonctions de service individuelles, mais vous pouvez les visualiser dans leur contexte dans les scénarios correspondants.

Chaque exemple inclut un lien vers le code source complet, où vous trouverez des instructions sur la façon de configurer et d'exécuter le code en contexte.

Rubriques

Actions

L'exemple de code suivant montre comment utilisercancel-job.

AWS CLI

Pour annuler une offre d'emploi pour ElasticTranscoder

Cela annule la tâche spécifiée pour ElasticTranscoder.

Commande :

aws elastictranscoder cancel-job --id 3333333333333-abcde3
  • Pour API plus de détails, voir CancelJobla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utilisercreate-job.

AWS CLI

Pour créer un emploi pour ElasticTranscoder

L'create-jobexemple suivant crée une tâche pour ElasticTranscoder.

aws elastictranscoder create-job \ --pipeline-id 1111111111111-abcde1 \ --inputs file://inputs.json \ --outputs file://outputs.json \ --output-key-prefix "recipes/" \ --user-metadata file://user-metadata.json

Contenu de inputs.json :

[{ "Key":"ETS_example_file.mp4", "FrameRate":"auto", "Resolution":"auto", "AspectRatio":"auto", "Interlaced":"auto", "Container":"mp4" }]

Contenu de outputs.json :

[ { "Key":"webm/ETS_example_file-kindlefirehd.webm", "Rotate":"0", "PresetId":"1351620000001-100250" } ]

Contenu de user-metadata.json :

{ "Food type":"Italian", "Cook book":"recipe notebook" }

Sortie :

{ "Job": { "Status": "Submitted", "Inputs": [ { "Container": "mp4", "FrameRate": "auto", "Key": "ETS_example_file.mp4", "AspectRatio": "auto", "Resolution": "auto", "Interlaced": "auto" } ], "Playlists": [], "Outputs": [ { "Status": "Submitted", "Rotate": "0", "PresetId": "1351620000001-100250", "Watermarks": [], "Key": "webm/ETS_example_file-kindlefirehd.webm", "Id": "1" } ], "PipelineId": "3333333333333-abcde3", "OutputKeyPrefix": "recipes/", "UserMetadata": { "Cook book": "recipe notebook", "Food type": "Italian" }, "Output": { "Status": "Submitted", "Rotate": "0", "PresetId": "1351620000001-100250", "Watermarks": [], "Key": "webm/ETS_example_file-kindlefirehd.webm", "Id": "1" }, "Timing": { "SubmitTimeMillis": 1533838012298 }, "Input": { "Container": "mp4", "FrameRate": "auto", "Key": "ETS_example_file.mp4", "AspectRatio": "auto", "Resolution": "auto", "Interlaced": "auto" }, "Id": "1533838012294-example", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:job/1533838012294-example" } }
  • Pour API plus de détails, voir CreateJobla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utilisercreate-pipeline.

AWS CLI

Pour créer un pipeline pour ElasticTranscoder

L'create-pipelineexemple suivant crée un pipeline pour ElasticTranscoder.

aws elastictranscoder create-pipeline \ --name Default \ --input-bucket salesoffice.example.com-source \ --role arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role \ --notifications Progressing="",Completed="",Warning="",Error=arn:aws:sns:us-east-1:111222333444:ETS_Errors \ --content-config file://content-config.json \ --thumbnail-config file://thumbnail-config.json

Contenu de content-config.json :

{ "Bucket":"salesoffice.example.com-public-promos", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"Standard" }

Contenu de thumbnail-config.json :

{ "Bucket":"salesoffice.example.com-public-promos-thumbnails", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"ReducedRedundancy" }

Sortie :

{ "Pipeline": { "Status": "Active", "ContentConfig": { "Bucket": "salesoffice.example.com-public-promos", "StorageClass": "Standard", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Name": "Default", "ThumbnailConfig": { "Bucket": "salesoffice.example.com-public-promos-thumbnails", "StorageClass": "ReducedRedundancy", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Notifications": { "Completed": "", "Warning": "", "Progressing": "", "Error": "arn:aws:sns:us-east-1:123456789012:ETS_Errors" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "salesoffice.example.com-source", "Id": "1533765810590-example", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/1533765810590-example" }, "Warnings": [ { "Message": "The SNS notification topic for Error events and the pipeline are in different regions, which increases processing time for jobs in the pipeline and can incur additional charges. To decrease processing time and prevent cross-regional charges, use the same region for the SNS notification topic and the pipeline.", "Code": "6006" } ] }
  • Pour API plus de détails, voir CreatePipelinela section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utilisercreate-preset.

AWS CLI

Pour créer un préréglage pour ElasticTranscoder

L'create-presetexemple suivant crée un préréglage pour ElasticTranscoder.

aws elastictranscoder create-preset \ --name DefaultPreset \ --description "Use for published videos" \ --container mp4 \ --video file://video.json \ --audio file://audio.json \ --thumbnails file://thumbnails.json

Contenu de video.json :

{ "Codec":"H.264", "CodecOptions":{ "Profile":"main", "Level":"2.2", "MaxReferenceFrames":"3", "MaxBitRate":"", "BufferSize":"", "InterlacedMode":"Progressive", "ColorSpaceConversionMode":"None" }, "KeyframesMaxDist":"240", "FixedGOP":"false", "BitRate":"1600", "FrameRate":"auto", "MaxFrameRate":"30", "MaxWidth":"auto", "MaxHeight":"auto", "SizingPolicy":"Fit", "PaddingPolicy":"Pad", "DisplayAspectRatio":"auto", "Watermarks":[ { "Id":"company logo", "MaxWidth":"20%", "MaxHeight":"20%", "SizingPolicy":"ShrinkToFit", "HorizontalAlign":"Right", "HorizontalOffset":"10px", "VerticalAlign":"Bottom", "VerticalOffset":"10px", "Opacity":"55.5", "Target":"Content" } ] }

Contenu de audio.json :

{ "Codec":"AAC", "CodecOptions":{ "Profile":"AAC-LC" }, "SampleRate":"44100", "BitRate":"96", "Channels":"2" }

Contenu de thumbnails.json :

{ "Format":"png", "Interval":"120", "MaxWidth":"auto", "MaxHeight":"auto", "SizingPolicy":"Fit", "PaddingPolicy":"Pad" }

Sortie :

{ "Preset": { "Thumbnails": { "SizingPolicy": "Fit", "MaxWidth": "auto", "Format": "png", "PaddingPolicy": "Pad", "Interval": "120", "MaxHeight": "auto" }, "Container": "mp4", "Description": "Use for published videos", "Video": { "SizingPolicy": "Fit", "MaxWidth": "auto", "PaddingPolicy": "Pad", "MaxFrameRate": "30", "FrameRate": "auto", "MaxHeight": "auto", "KeyframesMaxDist": "240", "FixedGOP": "false", "Codec": "H.264", "Watermarks": [ { "SizingPolicy": "ShrinkToFit", "VerticalOffset": "10px", "VerticalAlign": "Bottom", "Target": "Content", "MaxWidth": "20%", "MaxHeight": "20%", "HorizontalAlign": "Right", "HorizontalOffset": "10px", "Opacity": "55.5", "Id": "company logo" } ], "CodecOptions": { "Profile": "main", "MaxBitRate": "32", "InterlacedMode": "Progressive", "Level": "2.2", "ColorSpaceConversionMode": "None", "MaxReferenceFrames": "3", "BufferSize": "5" }, "BitRate": "1600", "DisplayAspectRatio": "auto" }, "Audio": { "Channels": "2", "CodecOptions": { "Profile": "AAC-LC" }, "SampleRate": "44100", "Codec": "AAC", "BitRate": "96" }, "Type": "Custom", "Id": "1533765290724-example" "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:preset/1533765290724-example", "Name": "DefaultPreset" }, "Warning": "" }
  • Pour API plus de détails, voir CreatePresetla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserdelete-pipeline.

AWS CLI

Pour supprimer le ElasticTranscoder pipeline spécifié

Cela supprime le ElasticTranscoder pipeline spécifié.

Commande :

aws elastictranscoder delete-pipeline --id 1111111111111-abcde1

Sortie :

{ "Success":"true" }
  • Pour API plus de détails, voir DeletePipelinela section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserdelete-preset.

AWS CLI

Pour supprimer le ElasticTranscoder préréglage spécifié

Cela supprime le ElasticTranscoder préréglage spécifié.

Commande :

aws elastictranscoder delete-preset --id 5555555555555-abcde5
  • Pour API plus de détails, voir DeletePresetla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserlist-jobs-by-pipeline.

AWS CLI

Pour récupérer une liste de ElasticTranscoder tâches dans le pipeline spécifié

Cet exemple extrait une liste de ElasticTranscoder tâches dans le pipeline spécifié.

Commande :

aws elastictranscoder list-jobs-by-pipeline --pipeline-id 1111111111111-abcde1

Sortie :

{ "Jobs": [] }
  • Pour API plus de détails, voir ListJobsByPipelinela section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserlist-jobs-by-status.

AWS CLI

Pour récupérer une liste de ElasticTranscoder tâches dont le statut est Terminé

Cet exemple extrait une liste de ElasticTranscoder tâches dont le statut est Terminé.

Commande :

aws elastictranscoder list-jobs-by-status --status Complete

Sortie :

{ "Jobs": [] }
  • Pour API plus de détails, voir ListJobsByStatusla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserlist-pipelines.

AWS CLI

Pour récupérer une liste de ElasticTranscoder pipelines

Cet exemple extrait une liste de ElasticTranscoder pipelines.

Commande :

aws elastictranscoder list-pipelines

Sortie :

{ "Pipelines": [ { "Status": "Active", "ContentConfig": { "Bucket": "ets-example", "Permissions": [] }, "Name": "example-pipeline", "ThumbnailConfig": { "Bucket": "ets-example", "Permissions": [] }, "Notifications": { "Completed": "arn:aws:sns:us-west-2:123456789012:ets_example", "Warning": "", "Progressing": "", "Error": "" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "ets-example", "OutputBucket": "ets-example", "Id": "3333333333333-abcde3", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/3333333333333-abcde3" }, { "Status": "Paused", "ContentConfig": { "Bucket": "ets-example", "Permissions": [] }, "Name": "example-php-test", "ThumbnailConfig": { "Bucket": "ets-example", "Permissions": [] }, "Notifications": { "Completed": "", "Warning": "", "Progressing": "", "Error": "" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "ets-example", "OutputBucket": "ets-example", "Id": "3333333333333-abcde2", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/3333333333333-abcde2" }, { "Status": "Active", "ContentConfig": { "Bucket": "ets-west-output", "Permissions": [] }, "Name": "pipeline-west", "ThumbnailConfig": { "Bucket": "ets-west-output", "Permissions": [] }, "Notifications": { "Completed": "arn:aws:sns:us-west-2:123456789012:ets-notifications", "Warning": "", "Progressing": "", "Error": "" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "ets-west-input", "OutputBucket": "ets-west-output", "Id": "3333333333333-abcde1", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/3333333333333-abcde1" } ] }
  • Pour API plus de détails, voir ListPipelinesla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserlist-presets.

AWS CLI

Pour récupérer une liste de ElasticTranscoder préréglages

Cet exemple permet de récupérer une liste de ElasticTranscoder préréglages.

Commande :

aws elastictranscoder list-presets --max-items 2

Sortie :

{ "Presets": [ { "Container": "mp4", "Name": "KindleFireHD-preset", "Video": { "Resolution": "1280x720", "FrameRate": "30", "KeyframesMaxDist": "90", "FixedGOP": "false", "Codec": "H.264", "Watermarks": [], "CodecOptions": { "Profile": "main", "MaxReferenceFrames": "3", "ColorSpaceConversionMode": "None", "InterlacedMode": "Progressive", "Level": "4" }, "AspectRatio": "16:9", "BitRate": "2200" }, "Audio": { "Channels": "2", "CodecOptions": { "Profile": "AAC-LC" }, "SampleRate": "48000", "Codec": "AAC", "BitRate": "160" }, "Type": "Custom", "Id": "3333333333333-abcde2", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:preset/3333333333333-abcde2", "Thumbnails": { "AspectRatio": "16:9", "Interval": "60", "Resolution": "192x108", "Format": "png" } }, { "Thumbnails": { "AspectRatio": "16:9", "Interval": "60", "Resolution": "192x108", "Format": "png" }, "Container": "mp4", "Description": "Custom preset for transcoding jobs", "Video": { "Resolution": "1280x720", "FrameRate": "30", "KeyframesMaxDist": "90", "FixedGOP": "false", "Codec": "H.264", "Watermarks": [], "CodecOptions": { "Profile": "main", "MaxReferenceFrames": "3", "ColorSpaceConversionMode": "None", "InterlacedMode": "Progressive", "Level": "3.1" }, "AspectRatio": "16:9", "BitRate": "2200" }, "Audio": { "Channels": "2", "CodecOptions": { "Profile": "AAC-LC" }, "SampleRate": "44100", "Codec": "AAC", "BitRate": "160" }, "Type": "Custom", "Id": "3333333333333-abcde3", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:preset/3333333333333-abcde3", "Name": "Roman's Preset" } ], "NextToken": "eyJQYWdlVG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ==" }
  • Pour API plus de détails, voir ListPresetsla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserread-job.

AWS CLI

Pour récupérer une ElasticTranscoder tâche

Cet exemple permet de récupérer la ElasticTranscoder tâche spécifiée.

Commande :

aws elastictranscoder read-job --id 1533838012294-example

Sortie :

{ "Job": { "Status": "Progressing", "Inputs": [ { "Container": "mp4", "FrameRate": "auto", "Key": "ETS_example_file.mp4", "AspectRatio": "auto", "Resolution": "auto", "Interlaced": "auto" } ], "Playlists": [], "Outputs": [ { "Status": "Progressing", "Rotate": "0", "PresetId": "1351620000001-100250", "Watermarks": [], "Key": "webm/ETS_example_file-kindlefirehd.webm", "Id": "1" } ], "PipelineId": "3333333333333-abcde3", "OutputKeyPrefix": "recipes/", "UserMetadata": { "Cook book": "recipe notebook", "Food type": "Italian" }, "Output": { "Status": "Progressing", "Rotate": "0", "PresetId": "1351620000001-100250", "Watermarks": [], "Key": "webm/ETS_example_file-kindlefirehd.webm", "Id": "1" }, "Timing": { "SubmitTimeMillis": 1533838012298, "StartTimeMillis": 1533838013786 }, "Input": { "Container": "mp4", "FrameRate": "auto", "Key": "ETS_example_file.mp4", "AspectRatio": "auto", "Resolution": "auto", "Interlaced": "auto" }, "Id": "1533838012294-example", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:job/1533838012294-example" } }
  • Pour API plus de détails, voir ReadJobla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserread-pipeline.

AWS CLI

Pour récupérer un ElasticTranscoder pipeline

Cet exemple extrait le ElasticTranscoder pipeline spécifié.

Commande :

aws elastictranscoder read-pipeline --id 3333333333333-abcde3

Sortie :

{ "Pipeline": { "Status": "Active", "ContentConfig": { "Bucket": "ets-example", "StorageClass": "Standard", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Name": "Default", "ThumbnailConfig": { "Bucket": "ets-example", "StorageClass": "ReducedRedundancy", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Notifications": { "Completed": "", "Warning": "", "Progressing": "", "Error": "arn:aws:sns:us-east-1:123456789012:ETS_Errors" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "ets-example", "Id": "3333333333333-abcde3", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/3333333333333-abcde3" }, "Warnings": [ { "Message": "The SNS notification topic for Error events and the pipeline are in different regions, which increases processing time for jobs in the pipeline and can incur additional charges. To decrease processing time and prevent cross-regional charges, use the same region for the SNS notification topic and the pipeline.", "Code": "6006" } ] }
  • Pour API plus de détails, voir ReadPipelinela section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserread-preset.

AWS CLI

Pour récupérer un ElasticTranscoder préréglage

Cet exemple extrait le ElasticTranscoder préréglage spécifié.

Commande :

aws elastictranscoder read-preset --id 1351620000001-500020

Sortie :

{ "Preset": { "Thumbnails": { "SizingPolicy": "ShrinkToFit", "MaxWidth": "192", "Format": "png", "PaddingPolicy": "NoPad", "Interval": "300", "MaxHeight": "108" }, "Container": "fmp4", "Description": "System preset: MPEG-Dash Video - 4.8M", "Video": { "SizingPolicy": "ShrinkToFit", "MaxWidth": "1280", "PaddingPolicy": "NoPad", "FrameRate": "30", "MaxHeight": "720", "KeyframesMaxDist": "60", "FixedGOP": "true", "Codec": "H.264", "Watermarks": [ { "SizingPolicy": "ShrinkToFit", "VerticalOffset": "10%", "VerticalAlign": "Top", "Target": "Content", "MaxWidth": "10%", "MaxHeight": "10%", "HorizontalAlign": "Left", "HorizontalOffset": "10%", "Opacity": "100", "Id": "TopLeft" }, { "SizingPolicy": "ShrinkToFit", "VerticalOffset": "10%", "VerticalAlign": "Top", "Target": "Content", "MaxWidth": "10%", "MaxHeight": "10%", "HorizontalAlign": "Right", "HorizontalOffset": "10%", "Opacity": "100", "Id": "TopRight" }, { "SizingPolicy": "ShrinkToFit", "VerticalOffset": "10%", "VerticalAlign": "Bottom", "Target": "Content", "MaxWidth": "10%", "MaxHeight": "10%", "HorizontalAlign": "Left", "HorizontalOffset": "10%", "Opacity": "100", "Id": "BottomLeft" }, { "SizingPolicy": "ShrinkToFit", "VerticalOffset": "10%", "VerticalAlign": "Bottom", "Target": "Content", "MaxWidth": "10%", "MaxHeight": "10%", "HorizontalAlign": "Right", "HorizontalOffset": "10%", "Opacity": "100", "Id": "BottomRight" } ], "CodecOptions": { "Profile": "main", "MaxBitRate": "4800", "InterlacedMode": "Progressive", "Level": "3.1", "ColorSpaceConversionMode": "None", "MaxReferenceFrames": "3", "BufferSize": "9600" }, "BitRate": "4800", "DisplayAspectRatio": "auto" }, "Type": "System", "Id": "1351620000001-500020", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:preset/1351620000001-500020", "Name": "System preset: MPEG-Dash Video - 4.8M" } }
  • Pour API plus de détails, voir ReadPresetla section Référence des AWS CLI commandes.

L'exemple de code suivant montre comment utiliserupdate-pipeline-notifications.

AWS CLI

Pour mettre à jour les notifications d'un ElasticTranscoder pipeline

Cet exemple met à jour les notifications du ElasticTranscoder pipeline spécifié.

Commande :

aws elastictranscoder update-pipeline-notifications --id 1111111111111-abcde1 --notifications Progressing=arn:aws:sns:us-west-2:0123456789012:my-topic,Completed=arn:aws:sns:us-west-2:0123456789012:my-topic,Warning=arn:aws:sns:us-west-2:0123456789012:my-topic,Error=arn:aws:sns:us-east-1:111222333444:ETS_Errors

Sortie :

{ "Pipeline": { "Status": "Active", "ContentConfig": { "Bucket": "ets-example", "StorageClass": "Standard", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Name": "Default", "ThumbnailConfig": { "Bucket": "ets-example", "StorageClass": "ReducedRedundancy", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Notifications": { "Completed": "arn:aws:sns:us-west-2:0123456789012:my-topic", "Warning": "arn:aws:sns:us-west-2:0123456789012:my-topic", "Progressing": "arn:aws:sns:us-west-2:0123456789012:my-topic", "Error": "arn:aws:sns:us-east-1:111222333444:ETS_Errors" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "ets-example", "Id": "1111111111111-abcde1", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/1111111111111-abcde1" } }

L'exemple de code suivant montre comment utiliserupdate-pipeline-status.

AWS CLI

Pour mettre à jour le statut d'un ElasticTranscoder pipeline

Cet exemple met à jour l'état du ElasticTranscoder pipeline spécifié.

Commande :

aws elastictranscoder update-pipeline-status --id 1111111111111-abcde1 --status Paused

Sortie :

{ "Pipeline": { "Status": "Paused", "ContentConfig": { "Bucket": "ets-example", "StorageClass": "Standard", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Name": "Default", "ThumbnailConfig": { "Bucket": "ets-example", "StorageClass": "ReducedRedundancy", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Notifications": { "Completed": "", "Warning": "", "Progressing": "", "Error": "arn:aws:sns:us-east-1:803981987763:ETS_Errors" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "ets-example", "Id": "1111111111111-abcde1", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/1111111111111-abcde1" } }

L'exemple de code suivant montre comment utiliserupdate-pipeline.

AWS CLI

Pour mettre à jour un ElasticTranscoder pipeline

L'update-pipelineexemple suivant met à jour le ElasticTranscoder pipeline spécifié.

aws elastictranscoder update-pipeline \ --id 1111111111111-abcde1 --name DefaultExample \ --input-bucket salesoffice.example.com-source \ --role arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role \ --notifications Progressing="",Completed="",Warning="",Error=arn:aws:sns:us-east-1:111222333444:ETS_Errors \ --content-config file://content-config.json \ --thumbnail-config file://thumbnail-config.json

Contenu de content-config.json :

{ "Bucket":"salesoffice.example.com-public-promos", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"Standard" }

Contenu de thumbnail-config.json :

{ "Bucket":"salesoffice.example.com-public-promos-thumbnails", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"ReducedRedundancy" }

Sortie :

{ "Pipeline": { "Status": "Active", "ContentConfig": { "Bucket": "ets-example", "StorageClass": "Standard", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Name": "DefaultExample", "ThumbnailConfig": { "Bucket": "ets-example", "StorageClass": "ReducedRedundancy", "Permissions": [ { "Access": [ "FullControl" ], "Grantee": "marketing-promos@example.com", "GranteeType": "Email" } ] }, "Notifications": { "Completed": "", "Warning": "", "Progressing": "", "Error": "arn:aws:sns:us-east-1:111222333444:ETS_Errors" }, "Role": "arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "InputBucket": "ets-example", "Id": "3333333333333-abcde3", "Arn": "arn:aws:elastictranscoder:us-west-2:123456789012:pipeline/3333333333333-abcde3" }, "Warnings": [ { "Message": "The SNS notification topic for Error events and the pipeline are in different regions, which increases processing time for jobs in the pipeline and can incur additional charges. To decrease processing time and prevent cross-regional charges, use the same region for the SNS notification topic and the pipeline.", "Code": "6006" } ] }
  • Pour API plus de détails, voir UpdatePipelinela section Référence des AWS CLI commandes.