Pub/Sub-Benachrichtigungen für Jobaktualisierungen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird erläutert, wie Sie ein Pub/Sub-Thema konfigurieren, das Sie zum Empfangen von Jobstatusaktualisierungen über die Transcoder API verwenden können.
Aktualisierungen des Jobstatus konfigurieren
So erhalten Sie aktuelle Informationen zum Jobstatus:
Wenn Sie kein vorhandenes Pub/Sub-Thema haben, erstellen Sie ein Thema.
Informationen zum Erstellen eines Pub/Sub-Themas finden Sie unter Themen und Abos verwalten.
Achten Sie darauf, das Feld pubsubDestination in der Jobkonfiguration zu konfigurieren.
Suchen Sie das Dienstkonto service-PROJECT_NUMBER@gcp-sa-transcoder.iam.gserviceaccount.com in der Google Cloud Console, wobei PROJECT_NUMBER die Projektnummer des Projekts ist, in dem Sie die Transcoder API aktiviert haben und aus dem Sie den Feed erstellen möchten.
Rufen Sie in der Google Cloud Console die Seite IAM auf.
Klicken Sie auf das Kästchen Von Google bereitgestellte Rollenzuweisungen einschließen.
Prüfen Sie, ob für das Dienstkonto die Berechtigung pubsub.topics.publish aktiviert ist.
Berichte zum Jobstatus
Der Jobstatus wird gemeldet, wenn der Job fehlschlägt oder erfolgreich abgeschlossen wird. Es werden keine anderen Statusänderungen gemeldet. Der Jobstatus wird im JobResult-Nachrichtenformat ausgegeben:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Pub/Sub notifications for job updates\n\nThis page explains how to configure a Pub/Sub topic that you can use\nto receive job status updates from the Transcoder API.\n\nConfigure job status updates\n----------------------------\n\nTo receive job status updates, do the following:\n\n1. If you don't have an existing Pub/Sub topic, create a topic.\n To learn how to create a Pub/Sub topic, see\n [Managing topics and subscriptions](/pubsub/docs/admin).\n\n2. Make sure to configure the\n [`pubsubDestination`](/transcoder/docs/reference/rest/v1/JobConfig#FIELDS.pubsub_destination)\n field in the job configuration.\n\n {\n \"config\": {\n \"pubsubDestination\": {\n \"topic\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/topics/\u003cvar translate=\"no\"\u003emy-topic-id\u003c/var\u003e\"\n }\n }\n }\n\n3. [Create a job](/transcoder/docs/how-to/jobs) to enable the\n [Google-managed Transcoder service account](/iam/docs/service-account-types#google-managed).\n\n4. Find the\n `service-`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`@gcp-sa-transcoder.iam.gserviceaccount.com`\n service account in the Google Cloud console, where\n \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e is the project number of the project you enabled\n the Transcoder API in and you plan to create the feed from.\n\n 1. In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/iam-admin/iam/project)\n 2. Select the **Include Google-provided role grants** checkbox.\n\n5. Make sure the service account has the `pubsub.topics.publish` permission\n enabled.\n\nJob status reporting\n--------------------\n\nJob status is reported once the job fails or finishes successfully. No other\nstate changes are reported. Job status is reported using the `JobResult` message\nformat: \n\n Resource PubSubMessage\n {\n job: {\n object (JobResult)\n }\n }\n\n JobResult\n {\n name: string;\n state: string;\n error: {\n object (Status)\n }\n }\n\nFor more information, refer to the following:\n\n- [Job state](/transcoder/docs/reference/rest/v1/projects.locations.jobs#processingstate)\n- [Job status](/transcoder/docs/reference/rest/v1/projects.locations.jobs#status)\n- [Troubleshooting job errors](/transcoder/docs/troubleshooting)"]]