适用于作业更新的 Pub/Sub 通知
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页面介绍了如何配置 Pub/Sub 主题,您可以利用该主题从 Transcoder API 接收作业状态更新。
如需接收作业状态更新,请执行以下操作:
如果您还没有 Pub/Sub 主题,请创建一个主题。
如需了解如何创建 Pub/Sub 主题,请参阅管理主题和订阅。
确保在作业配置中配置 pubsubDestination
字段。
{
"config": {
"pubsubDestination": {
"topic": "projects/PROJECT_ID/topics/my-topic-id"
}
}
}
创建作业以启用 Google 代管的 Transcoder 服务账号。
在 Google Cloud 控制台中找到 service-PROJECT_NUMBER@gcp-sa-transcoder.iam.gserviceaccount.com
服务帐号,其中 PROJECT_NUMBER 是您启用了 Transcoder API 且打算根据其创建 Feed 的项目的编号。
在 Google Cloud 控制台中,转到 IAM 页面。
转到 IAM
选中包括 Google 提供的角色授权复选框。
确保该服务账号已启用 pubsub.topics.publish
权限。
作业状态报告
作业失败或成功完成后,系统会报告作业状态。而不会报告其他状态变化。作业状态使用 JobResult
消息格式进行报告:
Resource PubSubMessage
{
job: {
object (JobResult)
}
}
JobResult
{
name: string;
state: string;
error: {
object (Status)
}
}
如需了解详情,请参阅以下资源:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-02-18。
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]