Your data engineering team manages a streaming Dataflow pipeline that should run 24/7 in the us-central1 region. A Cloud Function executed by a service account must run a gcloud command to obtain the job's current lifecycle state (for example RUNNING, FAILED, DONE) so it can decide whether to alert on failures. The script must be read-only and must not modify the job. Which gcloud command satisfies this requirement?
gcloud dataflow jobs list --region=us-central1 --filter="id=$JOB_ID" --format='value(state)'
The gcloud dataflow jobs describe command is designed to retrieve metadata about a single job. When you supply the job ID and region, the command returns a full JSON response that includes the field currentState, which reports values such as JOB_STATE_RUNNING, JOB_STATE_FAILED, or JOB_STATE_DONE. Adding a --format flag lets a script extract only that field without altering the job in any way.
The jobs list command can show multiple jobs and does not return the explicit currentState field in a structured way; parsing its tabular output is unreliable. The jobs update command would attempt to change job settings, violating the read-only requirement. operations describe expects an operation ID, not a Dataflow job ID, so it will fail for regular job monitoring.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the gcloud dataflow jobs describe command?
Open an interactive chat with Bash
How does --format='value(currentState)' simplify scripting in gcloud commands?
Open an interactive chat with Bash
Why is gcloud dataflow jobs list unreliable for lifecycle state monitoring?
Open an interactive chat with Bash
What is the purpose of the gcloud dataflow jobs describe command?
Open an interactive chat with Bash
What does the --format='value(currentState)' flag do in this command?
Open an interactive chat with Bash
Why does gcloud dataflow operations describe not work for job monitoring?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .