Script must list Bigtable instances, Memorystore instances, and Cloud SQL databases in a project and accept a user-provided filter expression. How should you retrieve and filter results?
Choose an answer
Tap an option to check your answer.
Correct answer: Run gcloud bigtable instances list, gcloud redis instances list, and gcloud sql databases list. Use --filter flag with each command, and then display the results.
Why this is the answer
The correct approach is to use the gcloud command-line tool with its built-in filtering capabilities. The gcloud bigtable instances list, gcloud redis instances list, and gcloud sql databases list commands are the standard way to retrieve lists of these services. The --filter flag, available with most gcloud commands, allows you to apply a user-provided filter expression directly at the command execution level, efficiently reducing the data returned before it's processed further. This is generally more efficient than retrieving all data and then filtering it in your application. The options involving HBase API, Redis API, and MySQL connection are incorrect because these are client libraries or protocols for interacting with the data within the databases, not for listing the instances themselves. While you could potentially list Cloud SQL databases via a MySQL connection to a specific instance, it's not the standard or comprehensive way to list all Cloud SQL instances in a project, and it doesn't apply to Bigtable or Memorystore instances. Filtering within the application after retrieving all results is less efficient than using the --filter flag directly.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed