Bird
0
0

Which gcloud CLI command correctly publishes a message 'Hello' to a Pub/Sub topic named 'updates'?

easy📝 Syntax Q3 of 15
GCP - Cloud Pub/Sub
Which gcloud CLI command correctly publishes a message 'Hello' to a Pub/Sub topic named 'updates'?
Agcloud pubsub publish updates --data='Hello'
Bgcloud pubsub topics publish updates --message='Hello'
Cgcloud pubsub topics send updates --message='Hello'
Dgcloud pubsub topics create updates --message='Hello'
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct command structure

    The correct command uses 'gcloud pubsub topics publish'.
  2. Step 2: Correct flag for message

    The flag to specify message content is '--message'.
  3. Final Answer:

    gcloud pubsub topics publish updates --message='Hello' -> Option B
  4. Quick Check:

    Use 'topics publish' with '--message' flag [OK]
Quick Trick: Use 'gcloud pubsub topics publish' with --message [OK]
Common Mistakes:
  • Using 'publish' without 'topics'
  • Incorrect flag like --data instead of --message
  • Confusing 'create' with 'publish' command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes