Skip to content

Commit f26a97e

Browse files
chore: Migrate gsutil usage to gcloud storage (#10213)
1 parent fcf5208 commit f26a97e

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

pubsub/streaming-analytics/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Dataflow].
5151
BUCKET_NAME=your-gcs-bucket
5252
PROJECT_NAME=$(gcloud config get-value project)
5353

54-
gsutil mb gs://$BUCKET_NAME
54+
gcloud storage buckets create gs://$BUCKET_NAME
5555
```
5656

5757
1. Start a [Google Cloud Scheduler] job that publishes one message to a [Google
@@ -155,7 +155,7 @@ in the [GCP Console Storage page]. You may need to wait a few minutes for the
155155
files to appear.
156156

157157
```bash
158-
gsutil ls gs://$BUCKET_NAME/samples/
158+
gcloud storage ls gs://$BUCKET_NAME/samples/
159159
```
160160

161161
## Cleanup
@@ -185,10 +185,10 @@ gsutil ls gs://$BUCKET_NAME/samples/
185185

186186
```bash
187187
# Delete only the files created by this sample.
188-
gsutil -m rm -rf "gs://$BUCKET_NAME/samples/output*"
188+
gcloud storage rm --recursive --continue-on-error "gs://$BUCKET_NAME/samples/output*"
189189
190190
# [optional] Remove the Cloud Storage bucket.
191-
gsutil rb gs://$BUCKET_NAME
191+
gcloud storage buckets delete gs://$BUCKET_NAME
192192
```
193193

194194
[Google Cloud Pub/Sub]: https://cloud.google.com/pubsub/docs/

pubsublite/streaming-analytics/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Resources needed for this example:
5555
export PROJECT_ID=$(gcloud config get-value project)
5656
export BUCKET=your-gcs-bucket
5757

58-
gsutil mb gs://$BUCKET
58+
gcloud storage buckets create gs://$BUCKET
5959
```
6060

6161
1. Create a Pub/Sub Lite topic and subscription. Set `LITE_LOCATION` to a
@@ -130,7 +130,7 @@ mvn compile exec:java \
130130
Storage bucket.
131131

132132
```sh
133-
gsutil ls "gs://$BUCKET/samples/output*"
133+
gcloud storage ls "gs://$BUCKET/samples/output*"
134134
```
135135

136136
## (Optional) Creating a custom Dataflow template
@@ -199,21 +199,21 @@ input parameters.
199199
1. Delete the Cloud Storage objects:
200200

201201
```sh
202-
gsutil -m rm -rf "gs://$BUCKET/samples/output*"
202+
gcloud storage rm --recursive --continue-on-error "gs://$BUCKET/samples/output*"
203203
```
204204

205205
1. Delete the template image in Cloud Registry and delete the Flex template if
206206
you have created them.
207207

208208
```sh
209209
gcloud container images delete $TEMPLATE_IMAGE
210-
gsutil rm $TEMPLATE_PATH
210+
gcloud storage rm $TEMPLATE_PATH
211211
```
212212

213213
1. Delete the Cloud Storage bucket:
214214

215215
```sh
216-
gsutil rb "gs://$BUCKET"
216+
gcloud storage buckets delete "gs://$BUCKET"
217217
```
218218

219219
[Apache Beam]: https://beam.apache.org/

0 commit comments

Comments
 (0)