AaronDT
AaronDT

Reputation: 4060

Google Cloud API: how to save json response when using gcloud command

I am following the quickstart page on how to send an API request to Google Cloud Video API.

As such I am using the gcloud command:

gcloud ml video detect-labels gs://cloud-ml-sandbox/video/chicago.mp4

Which returns the json response as intended. However, the response is just a printout to my console.

Now I would like to know if there is any way to save/write the json response to a file?

Upvotes: 0

Views: 1349

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75810

If you are using linux, redirect the standard output to a file with >

With Windows, the same thing seems working. But I don't have a Windows OS for testing.

In addition, if you want to select only some parts in the response (only the business part and not the technical/protocol parts) you can use the --format param https://cloud.google.com/sdk/gcloud/reference/topic/formats

Upvotes: 1

Related Questions