0
Googleのクラウドシェル上ではなく、Googleのアプリエンジン上で動作quickstart.py
GoogleのクラウドストレージなぜGoogleのクラウドストレージquickstart.pyはGoogleのクラウドシェルで動作しますが、Googleのアプリケーションエンジンでは動作しませんか?
quickstart.py
def run_quickstart():
# [START storage_quickstart]
# Imports the Google Cloud client library
from google.cloud import storage
# Instantiates a client
storage_client = storage.Client()
bucket_name = 'mygoolgeappproject.appspot.com'
bucket = storage_client.get_bucket(bucket_name)
blobs = bucket.list_blobs()`enter code here`
for blob in blobs:
print(blob.name)
# The name for the new bucket
#bucket_name = 'mygoolgeappproject.appspot.com'
# Creates the new bucket
#bucket = storage_client.create_bucket(bucket_name)
#print('Bucket {} created.'.format(bucket.name))
# [END storage_quickstart]
if __name__ == '__main__':
run_quickstart()