I have a JSON file named countries/list.json
I want to publish the content with gcloud
CLI.
{"countries": [ {"id": "SE","name": "Sweden" }, {"id": "UK","name": "United Kingdom" } ]}
Accoring to the CLI docs I should be able to use
gcloud pubsub topics publish projects/<PROJECT>/topics/<TOPIC>--message=$(jq -c "." countries/list.json) --attribute "Content-Type=application/json"
This results in
ERROR: (gcloud.pubsub.topics.publish) unrecognized arguments: Kingdom"}]}
If I change "United Kingdom"
to "United-Kingdom"
it works, but that is not what I want.