umegaya / lua-aws

pure-lua implementation of aws REST APIs
122 stars 35 forks source link

S3 not supported #20

Closed CriztianiX closed 8 years ago

CriztianiX commented 9 years ago

Trying to use s3 does not work, There are not s3 signer and, rest-xml request,

umegaya commented 9 years ago

@CriztianiX yes, both are not implemented, yet. it may take time. (because I'm busy now :<) when you need it (ASAP?)

CriztianiX commented 9 years ago

@umegaya yes... at the moment i've using awscli from lua with os.execute("awscli s3 ...") but, I do not think it's right

lblasc commented 9 years ago

@umegaya any news on this? Thanks!

CriztianiX commented 9 years ago

@lblasc I'm starting a project that use aws-cli from lua.. maybe it will be helpful for you... https://github.com/CriztianiX/luaws

Some example using s3 taken from tests

  describe("-> S3 -> #s3", function()
    it("should create a bucket", function()
      local bucket = luaws:S3():createBucket({
        Bucket = os.getenv("AWS_BUCKET"),
        ACL = "public-read"
      })
      assert.same({
        Location = "/luaws"
      }, bucket)
    end)
    it("should put an object", function()
      local object = luaws:S3():putObject({
        Key = "LICENSE",
        Bucket = os.getenv("AWS_BUCKET"),
        ACL = "public-read"
      })
      assert.are_not.equals(nil, object.ETag)
    end)
    it("should delete an object", function()
      local object = luaws:S3():deleteObject({
        Bucket = os.getenv("AWS_BUCKET"),
        Key = "LICENSE"
      })
      assert.equals(nil, object)
    end)
    it("should delete a bucket", function()
      local object = luaws:S3():deleteBucket({
        Bucket = os.getenv("AWS_BUCKET")
      })

      assert.equals(nil, object)
    end)
    it("should list buckets", function()
      local buckets = luaws:S3():listBuckets()
      assert.are_not.equals(nil, buckets.Buckets)
    end)
  end)
lblasc commented 9 years ago

@CriztianiX thanks! But @umegaya approach is much more cleaner than executing external tools. Also for s3 you can also use lua-spore (https://github.com/fperrad/lua-Spore/blob/master/test/23-aws.t).

anyway Kinesis is working fine, now I would like to get s3 with the same library.

umegaya commented 9 years ago

@CriztianiX @lblasc hi, I have started working on it, but implementing rest-xml seems to need large effort. please wait for next update, and if you need it ASAP, maybe better to take CriztianiX's approach. thanks!

lblasc commented 9 years ago

@umegaya Thanks! I'll wait.

umegaya commented 9 years ago

@lblasc @CriztianiX can you check my fix is suitable for your use-case? it should test with fundamental functionality of s3, but I only test this branch with ~30kb file IO.

feel free to report bug or improvement idea. thanks!

umegaya commented 8 years ago

@lblasc @CriztianiX hi, due to fix for #22, I will merge it first. thank you for reporting this :D