Reputation: 171
I'm attempting to use the mb
command to create a bucket on Google Cloud Storage but am getting
CommandException: The mb command requires a URL that specifies a bucket.
The odd part is that while
gsutil mb gs://foo/bar1
returns this error,
gsutil ls gs://foo/bar2
correctly lists files in gs://foo/bar2.
I don't see how gs://foo/bar2
can be a valid URL while gs://foo/bar1
isn't. Is anyone able to shed some light here?
Upvotes: 6
Views: 3923
Reputation: 38399
gsutil mb
makes a bucket. "gs://foo" specifies a bucket, specifically the bucket 'foo'. "gs://foo/bar1" specifies an object rather than just a bucket. "foo/bar1" isn't a bucket.
Upvotes: 0
Reputation: 2593
gs://foo/bar1
is a URL that specifies an object, bar1
, within a bucket, foo
. The gsutil mb
command requires a URL signifying a bucket, e.g. gs://foo
. The gsutil ls
command can accept both bucket and object URLs.
Upvotes: 4