Ecco il Fog walkthrough of creating a file (an S3 object) in a directory (an S3 bucket):Come creare un oggetto S3 in un bucket con una chiamata di nebbia?
connection = Fog::Storage.new({
:provider => 'AWS',
:aws_access_key_id => YOUR_AWS_ACCESS_KEY_ID,
:aws_secret_access_key => YOUR_AWS_SECRET_ACCESS_KEY
})
directory = connection.directories.create(
:key => "fog-demo-#{Time.now.to_i}", # globally unique name
:public => true
)
file = directory.files.create(
:key => 'resume.html',
:body => File.open("/path/to/my/resume.html"),
:public => true
)
ma sembra a me come se questo richiede 2 chiamate API:
connection.directories.create
directory.files.create
Se ho già la directory (un bucket S3) creato, come posso creare un file (un oggetto S3) con una sola chiamata di nebbia?
Ciò richiede tuttavia diverse autorizzazioni di accesso: * ListAllMyBuckets * e * GetBucketLocation * su tutti i bucket. – schmijos
@JosuaSchmid Buona cattura! :) – facundofarias
Ciò rende una richiesta extra non necessaria. – mipmip