1
0
Fork 0
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:
Weston Platter 2013-01-10 22:31:16 -06:00
parent f408d76754
commit e99030c6b5
6 changed files with 100 additions and 118 deletions

View file

@ -7,40 +7,35 @@ module Fog
# List multipart uploads for a bucket # List multipart uploads for a bucket
# #
# ==== Parameters # @params bucket_name [String] Name of bucket to list multipart uploads for
# * bucket_name<~String> - Name of bucket to list multipart uploads for # @params upload_id [String] upload id to list objects for
# * upload_id<~String> - upload id to list objects for # @params options [Hash] config arguments for list. Defaults to {}.
# * options<~Hash> - config arguments for list. Defaults to {}. # @option options key-marker[String] limits parts to only those that appear lexicographically after this key.
# * 'key-marker'<~String> - limits parts to only those that appear # @option options max-uploads [Integer] limits number of uploads returned
# lexicographically after this key. # @option options upload-id-marker [String] limits uploads to only those that appear lexicographically after this upload id.
# * 'max-uploads'<~Integer> - limits number of uploads returned
# * 'upload-id-marker'<~String> - limits uploads to only those that appear
# lexicographically after this upload id.
# #
# ==== Returns # @return [Excon::Response] response:
# * response<~Excon::Response>: # * body [Hash]:
# * body<~Hash>: # * Bucket [string] Bucket where the multipart upload was initiated
# * 'Bucket'<~string> - Bucket where the multipart upload was initiated # * IsTruncated [Boolean] Whether or not the listing is truncated
# * 'IsTruncated'<~Boolean> - Whether or not the listing is truncated # * KeyMarker [String] first key in list, only upload ids after this lexographically will appear
# * 'KeyMarker'<~String> - first key in list, only upload ids after this lexographically will appear # * MaxUploads [Integer] Maximum results to return
# * 'MaxUploads'<~Integer> - Maximum results to return # * NextKeyMarker [String] last key in list, for further pagination
# * 'NextKeyMarker'<~String> - last key in list, for further pagination # * NextUploadIdMarker [String] last key in list, for further pagination
# * 'NextUploadIdMarker'<~String> - last key in list, for further pagination # * Upload [Hash]:
# * 'Upload'<~Hash>: # * Initiated [Time] Time when upload was initiated
# * 'Initiated'<~Time> - Time when upload was initiated # * Initiator [Hash]:
# * 'Initiator'<~Hash>: # * DisplayName [String] Display name of upload initiator
# * 'DisplayName'<~String> - Display name of upload initiator # * ID [String] Id of upload initiator
# * 'ID'<~String> - Id of upload initiator # * Key [String] Key where multipart upload was initiated
# * 'Key'<~String> - Key where multipart upload was initiated # * Owner [Hash]:
# * 'Owner'<~Hash>: # * DisplayName [String] Display name of upload owner
# * 'DisplayName'<~String> - Display name of upload owner # * ID [String] Id of upload owner
# * 'ID'<~String> - Id of upload owner # * StorageClass [String] Storage class of object
# * 'StorageClass'<~String> - Storage class of object # * UploadId [String] upload id of upload containing part
# * 'UploadId'<~String> - upload id of upload containing part # * UploadIdMarker [String] first key in list, only upload ids after this lexographically will appear
# * 'UploadIdMarker'<String> - first key in list, only upload ids after this lexographically will appear
# #
# ==== See Also # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListMPUpload.html
# http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListMPUpload.html
# #
def list_multipart_uploads(bucket_name, options = {}) def list_multipart_uploads(bucket_name, options = {})
request({ request({

View file

@ -7,37 +7,33 @@ module Fog
# List parts for a multipart upload # List parts for a multipart upload
# #
# ==== Parameters # @param bucket_name [String] Name of bucket to list parts for
# * bucket_name<~String> - Name of bucket to list parts for # @param object_name [String] Name of object to list parts for
# * object_name<~String> - Name of object to list parts for # @param upload_id [String] upload id to list objects for
# * upload_id<~String> - upload id to list objects for # @param options [Hash] config arguments for list. Defaults to {}.
# * options<~Hash> - config arguments for list. Defaults to {}. # @option options max-parts [Integer] limits number of parts returned
# * '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.
# * 'part-number-marker'<~String> - limits parts to only those that appear
# lexicographically after this part number.
# #
# ==== Returns # @return [Excon::Response] response:
# * response<~Excon::Response>: # * body [Hash]:
# * body<~Hash>: # * Bucket [string] Bucket where the multipart upload was initiated
# * 'Bucket'<~string> - Bucket where the multipart upload was initiated # * Initiator [Hash]:
# * 'Initiator'<~Hash>: # * DisplayName [String] Display name of upload initiator
# * 'DisplayName'<~String> - Display name of upload initiator # * ID [String] Id of upload initiator
# * 'ID'<~String> - Id of upload initiator # * IsTruncated [Boolean] Whether or not the listing is truncated
# * 'IsTruncated'<~Boolean> - Whether or not the listing is truncated # * Key [String] Key where multipart upload was initiated
# * 'Key'<~String> - Key where multipart upload was initiated # * MaxParts [String] maximum number of replies alllowed in response
# * 'MaxParts'<~String> - maximum number of replies alllowed in response # * NextPartNumberMarker [String] last item in list, for further pagination
# * 'NextPartNumberMarker'<~String> - last item in list, for further pagination # * Part [Array]:
# * 'Part'<~Array>: # * ETag [String] ETag of part
# * 'ETag'<~String> - ETag of part # * LastModified [Timestamp] Last modified for part
# * 'LastModified'<~Timestamp> - Last modified for part # * PartNumber [String] Part number for part
# * 'PartNumber'<~String> - Part number for part # * Size [Integer] Size of part
# * 'Size'<~Integer> - Size of part # * PartNumberMarker [String] Part number after which listing begins
# * 'PartNumberMarker'<~String> - Part number after which listing begins # * StorageClass [String] Storage class of object
# * 'StorageClass'<~String> - Storage class of object # * UploadId [String] upload id of upload containing part
# * 'UploadId'<~String> - upload id of upload containing part
# #
# ==== See Also # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html
# http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html
# #
def list_parts(bucket_name, object_name, upload_id, options = {}) def list_parts(bucket_name, object_name, upload_id, options = {})
options['uploadId'] = upload_id options['uploadId'] = upload_id

View file

@ -7,24 +7,22 @@ module Fog
# Form should look like: <form action="http://#{bucket_name}.s3.amazonaws.com/" method="post" enctype="multipart/form-data"> # 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. # These hidden fields should then appear, followed by a field named 'file' which is either a textarea or file input.
# #
# ==== Parameters # @param options Hash:
# * 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']
# * 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
# * Cache-Control - same as REST header # @option options Content-Type [String] same as REST header
# * Content-Type - same as REST header # @option options Content-Disposition [String] same as REST header
# * Content-Disposition - same as REST header # @option options Content-Encoding [String] same as REST header
# * Content-Encoding - same as REST header # @option options Expires same as REST header
# * Expires - same as REST header # @option options key key for object, set to '${filename}' to use filename provided by user
# * key - key for object, set to '${filename}' to use filename provided by user # @option options policy security policy for upload
# * policy - security policy for upload # @option options success_action_redirect url to redirct to upon success
# * success_action_redirect - url to redirct to upon success # @option options success_action_status status code to return on success, in [200, 201, 204]
# * success_action_status - status code to return on success, in [200, 201, 204] # @option options x-amz-security token devpay security token
# * x-amz-security-token - devpay security token # @option options x-amz-meta... meta data tags
# * x-amz-meta-... - meta data tags
# #
# ==== See Also # @see http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html #
def post_object_hidden_fields(options = {}) def post_object_hidden_fields(options = {})
if options['policy'] if options['policy']
options['policy'] = Base64.encode64(Fog::JSON.encode(options['policy'])).gsub("\n", "") options['policy'] = Base64.encode64(Fog::JSON.encode(options['policy'])).gsub("\n", "")

View file

@ -5,19 +5,16 @@ module Fog
# Create an S3 bucket # Create an S3 bucket
# #
# ==== Parameters # @param bucket_name [String] name of bucket to create
# * bucket_name<~String> - name of bucket to create # @option options [Hash] config arguments for bucket. Defaults to {}.
# * options<~Hash> - config arguments for bucket. Defaults to {}. # @option options LocationConstraint [Symbol] sets the location for the bucket
# * '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']
# * 'x-amz-acl'<~String> - Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
# #
# ==== Returns # @return [Excon::Response] response:
# * response<~Excon::Response>: # * status [Integer] 200
# * status<~Integer> - 200
# #
# ==== See Also # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html #
def put_bucket(bucket_name, options = {}) def put_bucket(bucket_name, options = {})
if location_constraint = options.delete('LocationConstraint') if location_constraint = options.delete('LocationConstraint')
data = data =

View file

@ -6,26 +6,24 @@ module Fog
require 'fog/aws/requests/storage/acl_utils' require 'fog/aws/requests/storage/acl_utils'
# Change access control list for an S3 bucket # Change access control list for an S3 bucket
# #
# ==== Parameters # @param bucket_name [String] name of bucket to modify
# * bucket_name<~String> - name of bucket to modify # @param acl [Hash]
# * acl<~Hash>: # * Owner [Hash]:
# * Owner<~Hash>: # * ID [String]: id of owner
# * ID<~String>: id of owner # * DisplayName [String]: display name of owner
# * DisplayName<~String>: display name of owner # * AccessControlList [Array]:
# * AccessControlList<~Array>: # * Grantee [Hash]:
# * Grantee<~Hash>: # * DisplayName [String] Display name of grantee
# * 'DisplayName'<~String> - Display name of grantee # * ID [String] Id of grantee
# * 'ID'<~String> - Id of grantee
# or # or
# * 'EmailAddress'<~String> - Email address of grantee # * EmailAddress [String] Email address of grantee
# or # or
# * 'URI'<~String> - URI of group to grant access for # * URI [String] URI of group to grant access for
# * Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP] # * 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'] # * acl [String] Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
# #
# ==== See Also # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTacl.html
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTacl.html
def put_bucket_acl(bucket_name, acl) def put_bucket_acl(bucket_name, acl)
data = "" data = ""

View file

@ -7,19 +7,17 @@ module Fog
# Sets the cors configuration for your bucket. If the configuration exists, Amazon S3 replaces it. # Sets the cors configuration for your bucket. If the configuration exists, Amazon S3 replaces it.
# #
# ==== Parameters # @param bucket_name [String] name of bucket to modify
# * bucket_name<~String> - name of bucket to modify # @param cors [Hash]
# * cors<~Hash>: # * CORSConfiguration [Array]:
# * CORSConfiguration<~Array>: # * ID [String]: A unique identifier for the rule.
# * ID<~String>: A unique identifier for the rule. # * AllowedMethod [String]: An HTTP method that you want to allow the origin to execute.
# * 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.
# * 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.
# * 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.
# * 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.
# * ExposeHeader<~String>: One or more headers in the response that you want customers to be able to access from their applications.
# #
# ==== See Also # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTcors.html
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUTcors.html
def put_bucket_cors(bucket_name, cors) def put_bucket_cors(bucket_name, cors)
data = Fog::Storage::AWS.hash_to_cors(cors) data = Fog::Storage::AWS.hash_to_cors(cors)