测试角色 - Amazon Elastic Transcoder

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

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

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

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

测试角色

描述

要测试管道的设置以确保 Elastic Transcoder 可以创建和处理任务,请将 POST 请求发送到 /2012-09-25/roleTests 资源。

请求

语法

POST /2012-09-25/roleTests 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 { "InputBucket":"Amazon S3 bucket that contains files to transcode", "OutputBucket":"Amazon S3 bucket in which to save transcoded files", "Role":"IAM ARN for the role to test", "Topics": [ "ARN of SNS topic to test" ] }

请求参数

此操作不使用请求参数。

请求标头

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

请求正文

请求正文中的 JSON 字符串包含以下对象。

InputBucket

其中保存您要转码的媒体文件的 Amazon S3 存储桶。Test Role 尝试从此存储桶读取。

OutputBucket

您希望 Elastic Transcoder 将已转码文件保存到其中的 Amazon S3 存储桶。Test Role 尝试从此存储桶读取。

角色

您希望 Elastic Transcoder 用于转码任务的角色的 IAM Amazon 资源名称 (ARN)。Test Role 将尝试代入指定角色。

主题

您希望 Test Role 向其发送测试通知的一个或多个 Amazon Simple Notification Service (Amazon SNS) 主题的 ARN。如果不使用 Amazon SNS 通知,您可以指定空列表。

响应

语法

Status: 200 OK 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 { "Messages": [ "error messages, if any" ], "Success": "true | false" }

响应标头

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

响应正文

测试管道设置时,Elastic Transcoder 将返回以下值。

消息

如果 Success 的值为 falseMessages 会包含一条或多条消息的数组,说明哪些测试失败。

成功

如果操作成功,则此值为 true;否则,该值为 false

错误

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

示例

示例请求

POST /2012-09-25/roleTests 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 { "InputBucket":"salesoffice.example.com-source", "OutputBucket":"salesoffice.example.com-public-promos", "Role":"arn:aws:iam::123456789012:role/transcode-service", "Topics": ["arn:aws:sns:us-east-1:111222333444:ETS_Errors", "arn:aws:sns:us-east-1:111222333444:ETS_Progressing"] }

示例响应

Status: 201 Created 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 { "Messages":[ "The role arn:aws:iam::123456789012:role/transcode-service does not have access to the bucket: salesoffice.example.com-source", "The role arn:aws:iam::123456789012:role/transcode-service does not have access to the topic: arn:aws:sns:us-east-1:111222333444:ETS_Errors" ], "Success": "false" }