File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -48,18 +48,24 @@ def main(argv):
48
48
# Parse the command-line flags.
49
49
args = parser .parse_args (argv [1 :])
50
50
51
+ # [START list_bucket]
51
52
# Get the application default credentials. When running locally, these are
52
53
# available after running `gcloud auth login`. When running on compute
53
54
# engine, these are available from the environment.
54
55
credentials = GoogleCredentials .get_application_default ()
55
56
56
- # Construct the service object for interacting with the Cloud Storage API.
57
+ # Construct the service object for interacting with the Cloud Storage API -
58
+ # the 'storage' service, at version 'v1'.
59
+ # You can browse other available api services and versions here:
60
+ # https://developers.google.com/api-client-library/python/apis/
57
61
service = discovery .build ('storage' , 'v1' , credentials = credentials )
58
62
59
- # Make a request to buckets.get to retrieve information about the bucket.
63
+ # Make a request to buckets.get to retrieve a list of objects in the
64
+ # specified bucket.
60
65
req = service .buckets ().get (bucket = args .bucket )
61
66
resp = req .execute ()
62
67
print json .dumps (resp , indent = 2 )
68
+ # [END list_bucket]
63
69
64
70
# Create a request to objects.list to retrieve a list of objects.
65
71
fields_to_return = \
You can’t perform that action at this time.
0 commit comments