gcs_bucket()

Read(550) Label: storage bucket, create, check,

Description:

Manage Google cloud storage buckets.

Syntax:

gcs_bucket(fd,bucket)

Note:

This external library function (See External Library Guide) manages storage buckets, including create, delete and check whether a bucket exists or not. When not working with any options, the function only finds whether a storage bucket exists.

Parameter:

fd

GCS connection object.

bucket

Storage bucket name.

Option:

@c

Create a storage bucket; won’t create anew if the storage bucket having the same name already exists.

@d

Delete a storage bucket; cannot delete a non-empty bucket.

Return value:

Boolean value

Example:

 

A

 

1

=file("F:/gcs.json").read()

Read a JSON file.

2

=gcs_open(A1)

Connect to the GCS service.

3

=gcs_bucket(A2,"test")

Check whether the bucket named test exists or not.

4

=gcs_bucket@d(A2,"test1")

Check whether the bucket named test1 exists or not, and delete it if it exists (cannot delete it if it isn’t empty) .

5

=gcs_bucket@c(A2,"test2")

Check whether the bucket named test2 exists or not, and create a bucket named test2 if it does not exist.

6

>gcs_close(A2)

Close the GCS connection.