gcs_list()

Read(179) Label: storage bucket, list,

Description:

List storage buckets in the Google Cloud Storage platform or files in the specified storage bucket.

Syntax:

gcs_list(fd,[bucket])

Note:

External library function (See External Library Guide).

 

The function lists storage buckets in the Google Cloud Storage platform or files in the specified storage bucket. The returned table sequence contains files or certain properties of the storage bucket.

 

When all parameters are present, list all files in the specified storage bucket named bucket; in this case in the returned table sequence, Key field represents file name, Size represents file size which use byte as the unit, and Date represents the creation time or the last modified time of the current file.

 

When parameter bucket is absent, list all storage bucket on the GCS platform; in the returned table sequence, Key represents bucket name and Size field won’t be displayed.

Parameter:

fd

GCS connection object

bucket

Storage bucket name

Return value:

Table sequence

Example:

 

A

 

1

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

 

2

=gcs_open(A1)

Connect to the GCS service.

3

=gcs_list(A2, "test1")

Return a list of all fiels in storage bucket test1.

4

=gcs_list(A2)

Return a list of storage buckets.

5

>gcs_close(A2)

Close GCS connection.