ねじれたアプリケーションから Google のクラウド ストレージにファイルを配置する必要があります。
Amazon を使用していましたtxAWSが、現在は GCS を使用しています。これを可能にするものが存在するかどうかわかりません。
txAWSGCSで使えますか?奇妙な質問のように聞こえるかもしれませんが、GCS でboto'sを使用することは可能です。S3ConnectiontxAWS
ねじれたアプリケーションから Google のクラウド ストレージにファイルを配置する必要があります。
Amazon を使用していましたtxAWSが、現在は GCS を使用しています。これを可能にするものが存在するかどうかわかりません。
txAWSGCSで使えますか?奇妙な質問のように聞こえるかもしれませんが、GCS でboto'sを使用することは可能です。S3ConnectiontxAWS
GCS JSON APIでTwisted Web クライアントを使用することをお勧めします。バケットの内容を一覧表示する例を次に示します。
import json
from twisted.internet import reactor
from twisted.internet.defer import Deferred
from twisted.internet.protocol import Protocol
from twisted.web.client import Agent
from twisted.web.error import Error
from twisted.web.http_headers import Headers
GCS_BASE_URL = 'https://www.googleapis.com/storage/v1beta1'
GCS_API_KEY = '<your-api-key>'
GCS_BUCKET = '<your-bucket>'
class ResponseAccumulate(Protocol):
def __init__(self, finished):
self.finished = finished
self.fullbuffer = ''
def dataReceived(self, bytes):
print 'Received %d bytes.' % len(bytes)
self.fullbuffer += bytes
def connectionLost(self, reason):
if isinstance(reason, Error):
print 'Finished receiving body:', reason.getErrorMessage()
else:
parsed = json.loads(self.fullbuffer)
print 'Bucket contents:'
for item in parsed['items']:
print ' ', item['id']
self.finished.callback(None)
agent = Agent(reactor)
d = agent.request(
'GET',
'%s/b/%s/o?key=%s' % (GCS_BASE_URL, GCS_BUCKET, GCS_API_KEY),
Headers({'User-Agent': ['Twisted Web Client Example']}),
None)
def cbResponse(response):
print 'Response received', response.code
finished = Deferred()
response.deliverBody(ResponseAccumulate(finished))
return finished
d.addCallback(cbResponse)
def cbShutdown(ignored):
reactor.stop()
d.addBoth(cbShutdown)
reactor.run()