File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -48,18 +48,24 @@ def main(argv):
4848 # Parse the command-line flags.
4949 args = parser .parse_args (argv [1 :])
5050
51+ # [START list_bucket]
5152 # Get the application default credentials. When running locally, these are
5253 # available after running `gcloud auth login`. When running on compute
5354 # engine, these are available from the environment.
5455 credentials = GoogleCredentials .get_application_default ()
5556
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/
5761 service = discovery .build ('storage' , 'v1' , credentials = credentials )
5862
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.
6065 req = service .buckets ().get (bucket = args .bucket )
6166 resp = req .execute ()
6267 print json .dumps (resp , indent = 2 )
68+ # [END list_bucket]
6369
6470 # Create a request to objects.list to retrieve a list of objects.
6571 fields_to_return = \
You can’t perform that action at this time.
0 commit comments