mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[docs::aws::storage] requests convert Rdoc to YARD format
This commit is contained in:
parent
f408d76754
commit
e99030c6b5
6 changed files with 100 additions and 118 deletions
|
@ -7,40 +7,35 @@ module Fog
|
|||
|
||||
# List multipart uploads for a bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# * bucket_name<~String> - Name of bucket to list multipart uploads for
|
||||
# * upload_id<~String> - upload id to list objects for
|
||||
# * options<~Hash> - config arguments for list. Defaults to {}.
|
||||
# * 'key-marker'<~String> - limits parts to only those that appear
|
||||
# lexicographically after this key.
|
||||
# * 'max-uploads'<~Integer> - limits number of uploads returned
|
||||
# * 'upload-id-marker'<~String> - limits uploads to only those that appear
|
||||
# lexicographically after this upload id.
|
||||
# @params bucket_name [String] Name of bucket to list multipart uploads for
|
||||
# @params upload_id [String] upload id to list objects for
|
||||
# @params options [Hash] config arguments for list. Defaults to {}.
|
||||
# @option options key-marker[String] limits parts to only those that appear lexicographically after this key.
|
||||
# @option options max-uploads [Integer] limits number of uploads returned
|
||||
# @option options upload-id-marker [String] limits uploads to only those that appear lexicographically after this upload id.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
# * 'Bucket'<~string> - Bucket where the multipart upload was initiated
|
||||
# * 'IsTruncated'<~Boolean> - Whether or not the listing is truncated
|
||||
# * 'KeyMarker'<~String> - first key in list, only upload ids after this lexographically will appear
|
||||
# * 'MaxUploads'<~Integer> - Maximum results to return
|
||||
# * 'NextKeyMarker'<~String> - last key in list, for further pagination
|
||||
# * 'NextUploadIdMarker'<~String> - last key in list, for further pagination
|
||||
# * 'Upload'<~Hash>:
|
||||
# * 'Initiated'<~Time> - Time when upload was initiated
|
||||
# * 'Initiator'<~Hash>:
|
||||
# * 'DisplayName'<~String> - Display name of upload initiator
|
||||
# * 'ID'<~String> - Id of upload initiator
|
||||
# * 'Key'<~String> - Key where multipart upload was initiated
|
||||
# * 'Owner'<~Hash>:
|
||||
# * 'DisplayName'<~String> - Display name of upload owner
|
||||
# * 'ID'<~String> - Id of upload owner
|
||||
# * 'StorageClass'<~String> - Storage class of object
|
||||
# * 'UploadId'<~String> - upload id of upload containing part
|
||||
# * 'UploadIdMarker'<String> - first key in list, only upload ids after this lexographically will appear
|
||||
# @return [Excon::Response] response:
|
||||
# * body [Hash]:
|
||||
# * Bucket [string] Bucket where the multipart upload was initiated
|
||||
# * IsTruncated [Boolean] Whether or not the listing is truncated
|
||||
# * KeyMarker [String] first key in list, only upload ids after this lexographically will appear
|
||||
# * MaxUploads [Integer] Maximum results to return
|
||||
# * NextKeyMarker [String] last key in list, for further pagination
|
||||
# * NextUploadIdMarker [String] last key in list, for further pagination
|
||||
# * Upload [Hash]:
|
||||
# * Initiated [Time] Time when upload was initiated
|
||||
# * Initiator [Hash]:
|
||||
# * DisplayName [String] Display name of upload initiator
|
||||
# * ID [String] Id of upload initiator
|
||||
# * Key [String] Key where multipart upload was initiated
|
||||
# * Owner [Hash]:
|
||||
# * DisplayName [String] Display name of upload owner
|
||||
# * ID [String] Id of upload owner
|
||||
# * StorageClass [String] Storage class of object
|
||||
# * UploadId [String] upload id of upload containing part
|
||||
# * UploadIdMarker [String] first key in list, only upload ids after this lexographically will appear
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListMPUpload.html
|
||||
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListMPUpload.html
|
||||
#
|
||||
def list_multipart_uploads(bucket_name, options = {})
|
||||
request({
|
||||
|
|
|
@ -7,37 +7,33 @@ module Fog
|
|||
|
||||
# List parts for a multipart upload
|
||||
#
|
||||
# ==== Parameters
|
||||
# * bucket_name<~String> - Name of bucket to list parts for
|
||||
# * object_name<~String> - Name of object to list parts for
|
||||
# * upload_id<~String> - upload id to list objects for
|
||||
# * options<~Hash> - config arguments for list. Defaults to {}.
|
||||
# * 'max-parts'<~Integer> - limits number of parts returned
|
||||
# * 'part-number-marker'<~String> - limits parts to only those that appear
|
||||
# lexicographically after this part number.
|
||||
# @param bucket_name [String] Name of bucket to list parts for
|
||||
# @param object_name [String] Name of object to list parts for
|
||||
# @param upload_id [String] upload id to list objects for
|
||||
# @param options [Hash] config arguments for list. Defaults to {}.
|
||||
# @option options max-parts [Integer] limits number of parts returned
|
||||
# @option options part-number-marker [String] limits parts to only those that appear lexicographically after this part number.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
# * 'Bucket'<~string> - Bucket where the multipart upload was initiated
|
||||
# * 'Initiator'<~Hash>:
|
||||
# * 'DisplayName'<~String> - Display name of upload initiator
|
||||
# * 'ID'<~String> - Id of upload initiator
|
||||
# * 'IsTruncated'<~Boolean> - Whether or not the listing is truncated
|
||||
# * 'Key'<~String> - Key where multipart upload was initiated
|
||||
# * 'MaxParts'<~String> - maximum number of replies alllowed in response
|
||||
# * 'NextPartNumberMarker'<~String> - last item in list, for further pagination
|
||||
# * 'Part'<~Array>:
|
||||
# * 'ETag'<~String> - ETag of part
|
||||
# * 'LastModified'<~Timestamp> - Last modified for part
|
||||
# * 'PartNumber'<~String> - Part number for part
|
||||
# * 'Size'<~Integer> - Size of part
|
||||
# * 'PartNumberMarker'<~String> - Part number after which listing begins
|
||||
# * 'StorageClass'<~String> - Storage class of object
|
||||
# * 'UploadId'<~String> - upload id of upload containing part
|
||||
# @return [Excon::Response] response:
|
||||
# * body [Hash]:
|
||||
# * Bucket [string] Bucket where the multipart upload was initiated
|
||||
# * Initiator [Hash]:
|
||||
# * DisplayName [String] Display name of upload initiator
|
||||
# * ID [String] Id of upload initiator
|
||||
# * IsTruncated [Boolean] Whether or not the listing is truncated
|
||||
# * Key [String] Key where multipart upload was initiated
|
||||
# * MaxParts [String] maximum number of replies alllowed in response
|
||||
# * NextPartNumberMarker [String] last item in list, for further pagination
|
||||
# * Part [Array]:
|
||||
# * ETag [String] ETag of part
|
||||
# * LastModified [Timestamp] Last modified for part
|
||||
# * PartNumber [String] Part number for part
|
||||
# * Size [Integer] Size of part
|
||||
# * PartNumberMarker [String] Part number after which listing begins
|
||||
# * StorageClass [String] Storage class of object
|
||||
# * UploadId [String] upload id of upload containing part
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html
|
||||
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html
|
||||
#
|
||||
def list_parts(bucket_name, object_name, upload_id, options = {})
|
||||
options['uploadId'] = upload_id
|
||||
|
|
|
@ -7,24 +7,22 @@ module Fog
|
|||
# Form should look like: <form action="http://#{bucket_name}.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
|
||||
# These hidden fields should then appear, followed by a field named 'file' which is either a textarea or file input.
|
||||
#
|
||||
# ==== Parameters
|
||||
# * options<~Hash>:
|
||||
# * acl<~String> - access control list, in ['private', 'public-read', 'public-read-write', 'authenticated-read', 'bucket-owner-read', 'bucket-owner-full-control']
|
||||
# * Cache-Control - same as REST header
|
||||
# * Content-Type - same as REST header
|
||||
# * Content-Disposition - same as REST header
|
||||
# * Content-Encoding - same as REST header
|
||||
# * Expires - same as REST header
|
||||
# * key - key for object, set to '${filename}' to use filename provided by user
|
||||
# * policy - security policy for upload
|
||||
# * success_action_redirect - url to redirct to upon success
|
||||
# * success_action_status - status code to return on success, in [200, 201, 204]
|
||||
# * x-amz-security-token - devpay security token
|
||||
# * x-amz-meta-... - meta data tags
|
||||
# @param options Hash:
|
||||
# @option options acl [String] access control list, in ['private', 'public-read', 'public-read-write', 'authenticated-read', 'bucket-owner-read', 'bucket-owner-full-control']
|
||||
# @option options Cache-Control [String] same as REST header
|
||||
# @option options Content-Type [String] same as REST header
|
||||
# @option options Content-Disposition [String] same as REST header
|
||||
# @option options Content-Encoding [String] same as REST header
|
||||
# @option options Expires same as REST header
|
||||
# @option options key key for object, set to '${filename}' to use filename provided by user
|
||||
# @option options policy security policy for upload
|
||||
# @option options success_action_redirect url to redirct to upon success
|
||||
# @option options success_action_status status code to return on success, in [200, 201, 204]
|
||||
# @option options x-amz-security token devpay security token
|
||||
# @option options x-amz-meta... meta data tags
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html
|
||||
|
||||
# @see http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html
|
||||
#
|
||||
def post_object_hidden_fields(options = {})
|
||||
if options['policy']
|
||||
options['policy'] = Base64.encode64(Fog::JSON.encode(options['policy'])).gsub("\n", "")
|
||||
|
|
|
@ -5,19 +5,16 @@ module Fog
|
|||
|
||||
# Create an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# * bucket_name<~String> - name of bucket to create
|
||||
# * options<~Hash> - config arguments for bucket. Defaults to {}.
|
||||
# * 'LocationConstraint'<~Symbol> - sets the location for the bucket
|
||||
# * 'x-amz-acl'<~String> - Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
|
||||
# @param bucket_name [String] name of bucket to create
|
||||
# @option options [Hash] config arguments for bucket. Defaults to {}.
|
||||
# @option options LocationConstraint [Symbol] sets the location for the bucket
|
||||
# @option options x-amz-acl [String] Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * status<~Integer> - 200
|
||||
# @return [Excon::Response] response:
|
||||
# * status [Integer] 200
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html
|
||||
|
||||
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html
|
||||
#
|
||||
def put_bucket(bucket_name, options = {})
|
||||
if location_constraint = options.delete('LocationConstraint')
|
||||
data =
|
||||
|
|
|
@ -6,26 +6,24 @@ module Fog
|
|||
require 'fog/aws/requests/storage/acl_utils'
|
||||
|
||||
# Change access control list for an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# * bucket_name<~String> - name of bucket to modify
|
||||
# * acl<~Hash>:
|
||||
# * Owner<~Hash>:
|
||||
# * ID<~String>: id of owner
|
||||
# * DisplayName<~String>: display name of owner
|
||||
# * AccessControlList<~Array>:
|
||||
# * Grantee<~Hash>:
|
||||
# * 'DisplayName'<~String> - Display name of grantee
|
||||
# * 'ID'<~String> - Id of grantee
|
||||
#
|
||||
# @param bucket_name [String] name of bucket to modify
|
||||
# @param acl [Hash]
|
||||
# * Owner [Hash]:
|
||||
# * ID [String]: id of owner
|
||||
# * DisplayName [String]: display name of owner
|
||||
# * AccessControlList [Array]:
|
||||
# * Grantee [Hash]:
|
||||
# * DisplayName [String] Display name of grantee
|
||||
# * ID [String] Id of grantee
|
||||
# or
|
||||
# * 'EmailAddress'<~String> - Email address of grantee
|
||||
# * EmailAddress [String] Email address of grantee
|
||||
# or
|
||||
# * 'URI'<~String> - URI of group to grant access for
|
||||
# * Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
|
||||
# * acl<~String> - Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
|
||||
# * URI [String] URI of group to grant access for
|
||||
# * Permission [String] Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
|
||||
# * acl [String] Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTacl.html
|
||||
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTacl.html
|
||||
|
||||
def put_bucket_acl(bucket_name, acl)
|
||||
data = ""
|
||||
|
|
|
@ -7,19 +7,17 @@ module Fog
|
|||
|
||||
# Sets the cors configuration for your bucket. If the configuration exists, Amazon S3 replaces it.
|
||||
#
|
||||
# ==== Parameters
|
||||
# * bucket_name<~String> - name of bucket to modify
|
||||
# * cors<~Hash>:
|
||||
# * CORSConfiguration<~Array>:
|
||||
# * ID<~String>: A unique identifier for the rule.
|
||||
# * AllowedMethod<~String>: An HTTP method that you want to allow the origin to execute.
|
||||
# * AllowedOrigin<~String>: An origin that you want to allow cross-domain requests from.
|
||||
# * AllowedHeader<~String>: Specifies which headers are allowed in a pre-flight OPTIONS request via the Access-Control-Request-Headers header.
|
||||
# * MaxAgeSeconds<~String>: The time in seconds that your browser is to cache the preflight response for the specified resource.
|
||||
# * ExposeHeader<~String>: One or more headers in the response that you want customers to be able to access from their applications.
|
||||
# @param bucket_name [String] name of bucket to modify
|
||||
# @param cors [Hash]
|
||||
# * CORSConfiguration [Array]:
|
||||
# * ID [String]: A unique identifier for the rule.
|
||||
# * AllowedMethod [String]: An HTTP method that you want to allow the origin to execute.
|
||||
# * AllowedOrigin [String]: An origin that you want to allow cross-domain requests from.
|
||||
# * AllowedHeader [String]: Specifies which headers are allowed in a pre-flight OPTIONS request via the Access-Control-Request-Headers header.
|
||||
# * MaxAgeSeconds [String]: The time in seconds that your browser is to cache the preflight response for the specified resource.
|
||||
# * ExposeHeader [String]: One or more headers in the response that you want customers to be able to access from their applications.
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTcors.html
|
||||
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTcors.html
|
||||
|
||||
def put_bucket_cors(bucket_name, cors)
|
||||
data = Fog::Storage::AWS.hash_to_cors(cors)
|
||||
|
|
Loading…
Add table
Reference in a new issue