Google Cloud Batch V1 Client - Class JobNotification (1.4.0)

Reference documentation and code samples for the Google Cloud Batch V1 Client class JobNotification.

Notification configurations.

Generated from protobuf message google.cloud.batch.v1.JobNotification

Namespace

Google \ Cloud \ Batch \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ pubsub_topic string

The Pub/Sub topic where notifications for the job, like state changes, will be published. If undefined, no Pub/Sub notifications are sent for this job. Specify the topic using the following format: projects/{project}/topics/{topic}. Notably, if you want to specify a Pub/Sub topic that is in a different project than the job, your administrator must grant your project's Batch service agent permission to publish to that topic. For more information about configuring Pub/Sub notifications for a job, see https://cloud.google.com/batch/docs/enable-notifications.

↳ message JobNotification\Message

The attribute requirements of messages to be sent to this Pub/Sub topic. Without this field, no message will be sent.

getPubsubTopic

The Pub/Sub topic where notifications for the job, like state changes, will be published. If undefined, no Pub/Sub notifications are sent for this job.

Specify the topic using the following format: projects/{project}/topics/{topic}. Notably, if you want to specify a Pub/Sub topic that is in a different project than the job, your administrator must grant your project's Batch service agent permission to publish to that topic. For more information about configuring Pub/Sub notifications for a job, see https://cloud.google.com/batch/docs/enable-notifications.

Returns
Type Description
string

setPubsubTopic

The Pub/Sub topic where notifications for the job, like state changes, will be published. If undefined, no Pub/Sub notifications are sent for this job.

Specify the topic using the following format: projects/{project}/topics/{topic}. Notably, if you want to specify a Pub/Sub topic that is in a different project than the job, your administrator must grant your project's Batch service agent permission to publish to that topic. For more information about configuring Pub/Sub notifications for a job, see https://cloud.google.com/batch/docs/enable-notifications.

Parameter
Name Description
var string
Returns
Type Description
$this

getMessage

The attribute requirements of messages to be sent to this Pub/Sub topic.

Without this field, no message will be sent.

Returns
Type Description
JobNotification\Message|null

hasMessage

clearMessage

setMessage

The attribute requirements of messages to be sent to this Pub/Sub topic.

Without this field, no message will be sent.

Parameter
Name Description
var JobNotification\Message
Returns
Type Description
$this

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月21日 UTC.