更新管道 - Amazon Elastic Transcoder

通过以下方式节省成本并获得更多功能 AWS Elemental MediaConvert

MediaConvert 是一项较新的基于文件的视频转码服务,它提供了一套全面的高级转码功能,按需费率起价为每分钟 0.0075 美元。阅读更多

已经在使用 Amazon Elastic Transcoder? 迁移到很简单 MediaConvert。有关更多信息,请参阅本概述,其中包含有关迁移过程的重要信息以及指向其他资源的链接。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

更新管道

描述

要更新管道的设置,请将 PUT 请求发送到 /2012-09-25/pipelines/ pipelineId 资源。

重要

在更改管道设置时,您的更改会立即生效。除了您在更改设置以后提交的任务外,还会影响您已提交但 Elastic Transcoder 尚未开始处理的任务。

如何更新和删除值

要更新值,请指定新值,例如:

"GranteeType":"Canonical"

要保持值不变,请执行下列操作之一:

  • 指定当前值。

  • 指定空值。这既适用于单个对象(例如 "Role":null),也适用于数组(例如 "ContentConfig":null)。

  • 忽略来自请求的 JSON 对象。这既适用于单个对象(例如 Role),也适用于数组(例如 ContentConfig)。

要删除当前值,请指定空值。例如,要删除一条通知,请指定空字符串:"Progressing":""。要删除数组中的所有值,请指定空数组:"Permissions":[]

例如,如果您不再希望在 Elastic Transcoder 处理任务过程中遇到警告时收到通知,并且您不希望更改任何其他通知设置,可以在请求中为 Notifications 指定以下内容:

... "Notifications":{ "Warning":"" }, ...

请求

语法

PUT /2012-09-25/pipelines/pipelineId HTTP/1.1 Content-Type: application/json; charset=UTF-8 Accept: */* Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443 x-amz-date: 20130114T174952Z Authorization: AWS4-HMAC-SHA256 Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request, SignedHeaders=host;x-amz-date;x-amz-target, Signature=calculated-signature Content-Length: number of characters in the JSON string { "Id":"pipelineId", "Name":"pipeline name", "InputBucket":"Amazon S3 bucket that contains files to transcode and graphics to use as watermarks", "OutputBucket":"Use this, or use ContentConfig:Bucket plus ThumbnailConfig:Bucket", "Role":"IAM role ARN", "AwsKmsKeyArn":"AWS-KMS key arn of the AWS-KMS key you want to use with this pipeline", "Notifications":{ "Progressing":"SNS topic to notify when Elastic Transcoder has started to process the job", "Complete":"SNS topic to notify when Elastic Transcoder has finished processing the job", "Warning":"SNS topic to notify when Elastic Transcoder encounters a warning condition" "Error":"SNS topic to notify when Elastic Transcoder encounters an error condition" }, "ContentConfig":{ "Bucket":"Use this plus ThumbnailConfig:Bucket, or use OutputBucket", "Permissions":[ { "GranteeType":"Canonical|Email|Group", "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account"| AllUsers|AuthenticatedUsers|LogDelivery", "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ] }, {...} ], "StorageClass":"Standard|ReducedRedundancy" }, "ThumbnailConfig":{ "Bucket":"Use this plus ContentConfig:Bucket, or use OutputBucket", "Permissions":[ { "GranteeType":"Canonical|Email|Group", "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account"| AllUsers|AuthenticatedUsers|LogDelivery", "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ] }, {...} ], "StorageClass":"Standard|ReducedRedundancy" }, "Status":"Active|Paused" }

请求参数

此操作不使用请求参数。

请求标头

此操作仅使用所有操作通用的请求标头。有关通用请求标头的信息,请参阅 HTTP 标头内容

请求正文

请求正文中的 JSON 字符串包含 UpdatePipeline 操作的输入对象。有关输入对象的更多信息,请参阅 您在创建 Elastic Transcoder 管道时指定的设置

Id

管道的标识符。您可以使用此值来标识要在其中执行各种操作的管道,例如创建任务或预设。

状态

管道的当前状态:

  • Active:管道正在处理任务。

  • Paused:管道当前未处理任务。

响应

语法

Status: 202 Accepted x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9 Content-Type: application/json Content-Length: number of characters in the response Date: Mon, 14 Jan 2013 06:01:47 GMT { "Id":"Id for the new pipeline", "Name":"pipeline name", "InputBucket":"Amazon S3 bucket that contains files to transcode and graphics to use as watermarks", "OutputBucket":"Use this, or use ContentConfig:Bucket plus ThumbnailConfig:Bucket", "Role":"IAM role ARN", "AwsKmsKeyArn":"AWS-KMS key id", "Notifications":{ "Progressing":"SNS topic to notify when when Elastic Transcoder has started to process the job", "Complete":"SNS topic to notify when Elastic Transcoder has finished processing the job", "Warning":"SNS topic to notify when when Elastic Transcoder encounters a warning condition", "Error":"SNS topic to notify when Elastic Transcoder encounters an error condition" }, "ContentConfig":{ "Bucket":"Use this plus ThumbnailConfig:Bucket, or use OutputBucket", "Permissions":[ { "GranteeType":"Canonical|Email|Group", "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account| AllUsers|AuthenticatedUsers|LogDelivery", "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ] }, {...} ], "StorageClass":"Standard|ReducedRedundancy" }, "ThumbnailConfig":{ "Bucket":"Use this plus ContentConfig:Bucket, or use OutputBucket", "Permissions":[ { "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ], "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account| AllUsers|AuthenticatedUsers|LogDelivery", "GranteeType":"Canonical|Email|Group" }, {...} ], "StorageClass":"Standard|ReducedRedundancy" }, "Status":"Active|Paused", "(自动)Warnings": [ { "Code": "6000|6001|6002|6003|6004|6005|6006|6007|6008", "Message": "The code message" }, {...} ] }

响应标头

此操作仅使用大多数响应通用的响应标头。有关通用响应标头的信息,请参阅 HTTP 响应

响应正文

创建管道时,Elastic Transcoder 将返回在请求中指定的值。有关更多信息,请参见 请求正文

Elastic Transcoder 还包括以下警告(如果适用):

(自动)Warnings

当您创建使用其他区域资源的管道时,Elastic Transcoder 会返回一个或多个警告。您的管道仍在创建中,但处理时间可能会增加并产生跨区域费用。警告的格式如下所示:

代码

消息——与警告代码关联的消息。

以下列表给出有效的警告代码及其消息:

6000

输入存储桶和管道位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请为输入存储桶和管道使用相同的区域。

6001

ContentConfig 存储桶和管道位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请为 ContentConfig 存储桶和管道使用相同的区域。

6002

ThumbnailConfig 存储桶和管道位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请为 ThumbnailConfig 存储桶和管道使用相同的区域。

6003

正在进行的事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。

6004

警告事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。

6005

完成事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。

6006

错误事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。

6007

为此管道指定的 AWS KMS 密钥和 ContentConfig 存储桶位于不同的区域,这会导致使用 s3-aws-kms 加密模式的输出失败。要使用 s3-aws-kms 加密模式,请对 KMS 密钥和 ContentConfig 存储桶使用相同的区域。

6008

为此管道指定的 AWS KMS 密钥和 ThumbnailConfig 存储桶位于不同的区域,这会导致使用 s3-aws-kms 加密模式的输出失败。要使用 s3-aws-kms 加密模式,请对 KMS 密钥和 ThumbnailConfig 存储桶使用相同的区域。

错误

有关 Elastic Transcoder 异常和错误消息的信息,请参阅 处理 Elastic Transcoder 中的错误

示例

以下请求示例会更新 ID 为 1111111111111-abcde1 的管道。

示例请求

PUT /2012-09-25/pipelines/1111111111111-abcde1 HTTP/1.1 Content-Type: application/json; charset=UTF-8 Accept: */* Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443 x-amz-date: 20130114T174952Z Authorization: AWS4-HMAC-SHA256 Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request, SignedHeaders=host;x-amz-date;x-amz-target, Signature=calculated-signature Content-Length: number of characters in the JSON string { "Id":"1111111111111-abcde1" "Name":"Default", "InputBucket":"salesoffice.example.com-source", "OutputBucket":"salesoffice.example.com-output", "Role":"arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "AwsKmsKeyArn":"base64 encoded key from KMS", "Notifications":{ "Progressing":"", "Complete":"", "Warning":"", "Error":"arn:aws:sns:us-east-1:111222333444:ET_Errors" }, "ContentConfig":{ "Bucket":"salesoffice.example.com-public-promos", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"Standard" }, "ThumbnailConfig":{ "Bucket":"salesoffice.example.com-public-promos-thumbnails", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"ReducedRedundancy" }, "Status":"Active" }

示例响应

Status: 202 Accepted x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9 Content-Type: application/json Content-Length: number of characters in the response Date: Mon, 14 Jan 2013 06:01:47 GMT { "Id":"1111111111111-abcde1", "Name":"Default", "InputBucket":"salesoffice.example.com-source", "OutputBucket":"salesoffice.example.com-output", "Role":"arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "AwsKmsKeyArn":"base64 encoded key from KMS", "Notifications":{ "Progressing":"", "Complete":"", "Warning":"", "Error":"arn:aws:sns:us-east-1:111222333444:ET_Errors" }, "ContentConfig":{ "Bucket":"salesoffice.example.com-public-promos", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"Standard" }, "ThumbnailConfig":{ "Bucket":"salesoffice.example.com-public-promos-thumbnails", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"ReducedRedundancy" }, "Status":"Active", "Warnings": [ { "Code": "6000", "Message": "The input bucket 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 input bucket and the pipeline." }, {...} ] }