qiniu v0.3.2 Qiniu.Resource

Module to managing resource

See http://developer.qiniu.com/docs/v6/api/reference/rs/

Summary

Functions

Batch operations for mix of stat, copy, move and delete

Change type(MIME type) of the entry

Copy one entry to another dest key

Delete an entry

Fetch resource from a url, and store it in your own bucket

List resources in one bucket

Move an entry to another dest

For the bucket which sets image storing, fetch resource from image source and store to this bucket. If the entry exists in this bucket, override the entry with the resource of image storing

Get the metadata of the resource

Functions

batch(ops)

Batch operations for mix of stat, copy, move and delete

Fields

  • ops - Array of all operations like [[:stat, "b:k"], [:copy, "b:k", "b1:k1"]]
chgm(entry_uri, mime)

Change type(MIME type) of the entry

Fields

  • uri - URI of the entry, ":"
  • mime - MIME type to change
copy(source_uri, dest_uri)

Copy one entry to another dest key

Fields

  • source_uri - uri of your source entry, ":"
  • dest_uri - uri of your dest entry, ":"
delete(uri)

Delete an entry

Fields

  • uri - uri of your entry to delete, ":"
fetch(url, entry_uri)

Fetch resource from a url, and store it in your own bucket

Fields

  • url - URL of the external resource
  • entry_uri - URI of your entry, ":"
list(bucket, opts \\ [])

List resources in one bucket

Fields

  • bucket - the bucket to list

Options

  • :limit - Number to list(1~1000), default is 1000
  • :prefix - Prefix of resources to list, default is ""
  • :delimiter - Directory separator to list common prefix, default is ""
  • :marker - Marker of last request, which can act as starting point of this request, default is ""
move(source_uri, dest_uri)

Move an entry to another dest

Fields

  • source_uri - uri of your source entry, ":"
  • dest_uri - uri of your dest entry, ":"
prefetch(uri)

For the bucket which sets image storing, fetch resource from image source and store to this bucket. If the entry exists in this bucket, override the entry with the resource of image storing.

Fields

  • uri - URI of destiny entry, ":"
stat(entry_uri)

Get the metadata of the resource

Fields

  • entry_uri - uri of your resource entry, ":"