mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
cleanup/format docs and note areas lacking coverage
This commit is contained in:
parent
1a7a98e78d
commit
5a7b8a32a4
3 changed files with 211 additions and 175 deletions
|
@ -16,16 +16,16 @@ module Fog
|
|||
# :aws_secret_access_key in order to create a connection
|
||||
#
|
||||
# ==== Examples
|
||||
# sdb = SimpleDB.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
# sdb = SimpleDB.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
#
|
||||
# ==== Parameters
|
||||
# options<~Hash>:: config arguments for connection. Defaults to {}.
|
||||
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
||||
#
|
||||
# ==== Returns
|
||||
# SimpleDB object with connection to aws.
|
||||
# * EC2 object with connection to aws.
|
||||
def initialize(options={})
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@aws_secret_access_key = options[:aws_secret_access_key]
|
||||
|
@ -39,9 +39,9 @@ module Fog
|
|||
# Acquire an elastic IP address.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :public_ip<~String>:: The acquired address
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :public_ip<~String> - The acquired address
|
||||
def allocate_address
|
||||
request({
|
||||
'Action' => 'AllocateAddress'
|
||||
|
@ -51,15 +51,15 @@ module Fog
|
|||
# Create a new key pair
|
||||
#
|
||||
# ==== Parameters
|
||||
# :key_name<~String>:: Unique name for key pair.
|
||||
# * key_name<~String> - Unique name for key pair.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :key_name<~String>:: Name of key
|
||||
# :key_fingerprint<~String>:: SHA-1 digest of DER encoded private key
|
||||
# :key_material<~String>:: Unencrypted encoded PEM private key
|
||||
# :request_id<~String>:: Id of request
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :key_name<~String> - Name of key
|
||||
# * :key_fingerprint<~String> - SHA-1 digest of DER encoded private key
|
||||
# * :key_material<~String> - Unencrypted encoded PEM private key
|
||||
# * :request_id<~String> - Id of request
|
||||
def create_key_pair(key_name)
|
||||
request({
|
||||
'Action' => 'CreateKeyPair',
|
||||
|
@ -70,13 +70,13 @@ module Fog
|
|||
# Create a new security group
|
||||
#
|
||||
# ==== Parameters
|
||||
# :group_name<~String>:: Name of the security group.
|
||||
# :group_description<~String>:: Description of group.
|
||||
# * group_name<~String> - Name of the security group.
|
||||
# * group_description<~String> - Description of group.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :return<~Boolean>:: success?
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :return<~Boolean> - success?
|
||||
def create_security_group(name, description)
|
||||
request({
|
||||
'Action' => 'CreateSecurityGroup',
|
||||
|
@ -88,19 +88,19 @@ module Fog
|
|||
# Create an EBS volume
|
||||
#
|
||||
# ==== Parameters
|
||||
# :availability_zone<~String>:: availability zone to create volume in
|
||||
# :size<~Integer>:: Size in GiBs for volume. Must be between 1 and 1024.
|
||||
# :snapshot_id<~String>:: Optional, snapshot to create volume from
|
||||
# * availability_zone<~String> - availability zone to create volume in
|
||||
# * size<~Integer> - Size in GiBs for volume. Must be between 1 and 1024.
|
||||
# * snapshot_id<~String> - Optional, snapshot to create volume from
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# :body<~Hash>::
|
||||
# :volume_id<~String>:: Reference to volume
|
||||
# :size<~Integer>:: Size in GiBs for volume
|
||||
# :status<~String>:: State of volume
|
||||
# :create_time<~Time>:: Timestamp for creation
|
||||
# :availability_zone<~String>:: Availability zone for volume
|
||||
# :snapshot_id<~String>:: Snapshot volume was created from, if any
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :volume_id<~String> - Reference to volume
|
||||
# * :size<~Integer> - Size in GiBs for volume
|
||||
# * :status<~String> - State of volume
|
||||
# * :create_time<~Time> - Timestamp for creation
|
||||
# * :availability_zone<~String> - Availability zone for volume
|
||||
# * :snapshot_id<~String> - Snapshot volume was created from, if any
|
||||
def create_volume(availability_zone, size, snapshot_id = nil)
|
||||
request({
|
||||
'Action' => 'CreateVolume',
|
||||
|
@ -113,12 +113,12 @@ module Fog
|
|||
# Delete a key pair that you own
|
||||
#
|
||||
# ==== Parameters
|
||||
# :key_name<~String>:: Name of the key pair.
|
||||
# * key_name<~String> - Name of the key pair.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :return<~Boolean>:: success?
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :return<~Boolean> - success?
|
||||
def delete_key_pair(key_name)
|
||||
request({
|
||||
'Action' => 'DeleteKeyPair',
|
||||
|
@ -129,12 +129,12 @@ module Fog
|
|||
# Delete a security group that you own
|
||||
#
|
||||
# ==== Parameters
|
||||
# :group_name<~String>:: Name of the security group.
|
||||
# * group_name<~String> - Name of the security group.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :return<~Boolean>:: success?
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :return<~Boolean> - success?
|
||||
def delete_security_group(name)
|
||||
request({
|
||||
'Action' => 'DeleteSecurityGroup',
|
||||
|
@ -145,12 +145,12 @@ module Fog
|
|||
# Delete an EBS volume
|
||||
#
|
||||
# ==== Parameters
|
||||
# volume_id<~String>:: Id of volume to delete.
|
||||
# * volume_id<~String> - Id of volume to delete.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :return<~Boolean>:: success?
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :return<~Boolean> - success?
|
||||
def delete_volume(volume_id)
|
||||
request({
|
||||
'Action' => 'DeleteVolume',
|
||||
|
@ -161,15 +161,15 @@ module Fog
|
|||
# Describe all or specified IP addresses.
|
||||
#
|
||||
# ==== Parameters
|
||||
# public_ips<~Array>:: List of ips to describe, defaults to all
|
||||
# * public_ips<~Array> - List of ips to describe, defaults to all
|
||||
#
|
||||
# ==== Returns
|
||||
# response:
|
||||
# body<~Hash>::
|
||||
# :request_id<~String>:: Id of request
|
||||
# :address_set<~Array>:: Addresses
|
||||
# :instance_id<~String>:: instance for ip address
|
||||
# :public_ip<~String>:: ip address for instance
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :request_id<~String> - Id of request
|
||||
# * :address_set<~Array>:
|
||||
# * :instance_id<~String> - instance for ip address
|
||||
# * :public_ip<~String> - ip address for instance
|
||||
def describe_addresses(public_ips = [])
|
||||
params = indexed_params('PublicIp', public_ips)
|
||||
request({
|
||||
|
@ -180,24 +180,24 @@ module Fog
|
|||
# Describe all or specified images.
|
||||
#
|
||||
# ==== Params
|
||||
# :options<~Hash>:: Optional params
|
||||
# :executable_by<~String>:: Only return images the user specified by
|
||||
# executable_by has explicit permission to launch
|
||||
# :image_id<~Array>:: Ids of images to describe
|
||||
# :owner<~String>:: Only return images belonging to owner.
|
||||
# * options<~Hash> - Optional params
|
||||
# * :executable_by<~String> - Only return images that the executable_by
|
||||
# user has explicit permission to launch
|
||||
# * :image_id<~Array> - Ids of images to describe
|
||||
# * :owner<~String> - Only return images belonging to owner.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id<~String>:: Id of request
|
||||
# :image_set<~Array>:: Images
|
||||
# :architecture<~String>:: Architecture of the image
|
||||
# :image_id<~String>:: Id of the image
|
||||
# :image_location<~String>:: Location of the image
|
||||
# :image_owner_id<~String>:: Id of the owner of the image
|
||||
# :image_state<~String>:: State of the image
|
||||
# :image_type<~String>:: Type of the image
|
||||
# :is_public<~Boolean:: Whether or not the image is public
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :request_id<~String> - Id of request
|
||||
# * :image_set<~Array>:
|
||||
# * :architecture<~String> - Architecture of the image
|
||||
# * :image_id<~String> - Id of the image
|
||||
# * :image_location<~String> - Location of the image
|
||||
# * :image_owner_id<~String> - Id of the owner of the image
|
||||
# * :image_state<~String> - State of the image
|
||||
# * :image_type<~String> - Type of the image
|
||||
# * :is_public<~Boolean> - Whether or not the image is public
|
||||
def describe_images(options = {})
|
||||
params = {}
|
||||
if options[:image_id]
|
||||
|
@ -213,12 +213,12 @@ module Fog
|
|||
# Describe all or specified instances
|
||||
#
|
||||
# ==== Parameters
|
||||
# instance_id<~Array>:: List of instance ids to describe, defaults to all
|
||||
# * instance_id<~Array> - List of instance ids to describe, defaults to all
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id<~String>:: Id of request
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :request_id<~String> - Id of request
|
||||
def describe_instances(instance_id = [])
|
||||
params = indexed_params('InstanceId', instance_id)
|
||||
request({
|
||||
|
@ -229,15 +229,15 @@ module Fog
|
|||
# Describe all or specified key pairs
|
||||
#
|
||||
# ==== Parameters
|
||||
# key_name<~Array>:: List of key names to describe, defaults to all
|
||||
# * key_name<~Array>:: List of key names to describe, defaults to all
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id<~String>:: Id of request
|
||||
# :key_set<~Array>:: Key pairs
|
||||
# :key_name<~String>:: Name of key
|
||||
# :key_fingerprint<~String>:: Fingerprint of key
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :request_id<~String> - Id of request
|
||||
# * :key_set<~Array>:
|
||||
# * :key_name<~String> - Name of key
|
||||
# * :key_fingerprint<~String> - Fingerprint of key
|
||||
def describe_key_pairs(key_name = [])
|
||||
params = indexed_params('KeyName', key_name)
|
||||
request({
|
||||
|
@ -248,9 +248,10 @@ module Fog
|
|||
# Describe all or specified security groups
|
||||
#
|
||||
# ==== Parameters
|
||||
# group_name<~Array>:: List of groups to describe, defaults to all
|
||||
# * group_name<~Array> - List of groups to describe, defaults to all
|
||||
#
|
||||
# === Returns
|
||||
# FIXME: docs
|
||||
def describe_security_groups(group_name = [])
|
||||
params = indexed_params('GroupName', group_name)
|
||||
request({
|
||||
|
@ -261,24 +262,24 @@ module Fog
|
|||
# Describe all or specified volumes.
|
||||
#
|
||||
# ==== Parameters
|
||||
# volume_ids<~Array>:: List of volumes to describe, defaults to all
|
||||
# * volume_ids<~Array> - List of volumes to describe, defaults to all
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# volume_set<~Array>::
|
||||
# :volume_id<~String>:: Reference to volume
|
||||
# :size<~Integer>:: Size in GiBs for volume
|
||||
# :status<~String>:: State of volume
|
||||
# :create_time<~Time>:: Timestamp for creation
|
||||
# :availability_zone<~String>:: Availability zone for volume
|
||||
# :snapshot_id<~String>:: Snapshot volume was created from, if any
|
||||
# :attachment_set<~Array>::
|
||||
# :attachment_time<~Time>:: Timestamp for attachment
|
||||
# :device<~String>:: How volue is exposed to instance
|
||||
# :instance_id<~String>:: Reference to attached instance
|
||||
# :status<~String>:: Attachment state
|
||||
# :volume_id<~String>:: Reference to volume
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :volume_set<~Array>:
|
||||
# * :volume_id<~String> - Reference to volume
|
||||
# * :size<~Integer> - Size in GiBs for volume
|
||||
# * :status<~String> - State of volume
|
||||
# * :create_time<~Time> - Timestamp for creation
|
||||
# * :availability_zone<~String> - Availability zone for volume
|
||||
# * :snapshot_id<~String> - Snapshot volume was created from, if any
|
||||
# * :attachment_set<~Array>:
|
||||
# * :attachment_time<~Time> - Timestamp for attachment
|
||||
# * :device<~String> - How value is exposed to instance
|
||||
# * :instance_id<~String> - Reference to attached instance
|
||||
# * :status<~String> - Attachment state
|
||||
# * :volume_id<~String> - Reference to volume
|
||||
def describe_volumes(volume_ids = [])
|
||||
params = indexed_params('VolumeId', volume_ids)
|
||||
request({
|
||||
|
@ -289,9 +290,9 @@ module Fog
|
|||
# Release an elastic IP address.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :return<~Boolean>:: success?
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :return<~Boolean> - success?
|
||||
def release_address(public_ip)
|
||||
request({
|
||||
'Action' => 'ReleaseAddress',
|
||||
|
|
|
@ -18,16 +18,16 @@ module Fog
|
|||
# :aws_secret_access_key in order to create a connection
|
||||
#
|
||||
# ==== Examples
|
||||
# sdb = S3.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
# sdb = S3.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
#
|
||||
# ==== Parameters
|
||||
# options<~Hash>:: config arguments for connection. Defaults to {}.
|
||||
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
||||
#
|
||||
# ==== Returns
|
||||
# S3 object with connection to aws.
|
||||
# * S3 object with connection to aws.
|
||||
def initialize(options={})
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@aws_secret_access_key = options[:aws_secret_access_key]
|
||||
|
@ -39,6 +39,9 @@ module Fog
|
|||
end
|
||||
|
||||
# List information about S3 buckets for authorized user
|
||||
#
|
||||
# ==== Parameters
|
||||
# FIXME: docs
|
||||
def get_service
|
||||
request({
|
||||
:headers => {},
|
||||
|
@ -52,9 +55,9 @@ module Fog
|
|||
# Create an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# bucket_name<~String>:: name of bucket to create
|
||||
# options<~Hash>:: config arguments for bucket. Defaults to {}.
|
||||
# :location_constraint sets the location for the bucket
|
||||
# * bucket_name<~String> - name of bucket to create
|
||||
# * options<~Hash> - config arguments for bucket. Defaults to {}.
|
||||
# * :location_constraint<~Symbol> - sets the location for the bucket
|
||||
def put_bucket(bucket_name, options = {})
|
||||
if options[:location_constraint]
|
||||
data =
|
||||
|
@ -78,8 +81,8 @@ DATA
|
|||
# Change who pays for requests to an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# bucket_name<~String>:: name of bucket to modify
|
||||
# payer<~String>:: valid values are BucketOwner or Requester
|
||||
# * bucket_name<~String> - name of bucket to modify
|
||||
# * payer<~String> - valid values are BucketOwner or Requester
|
||||
def put_request_payment(bucket_name, payer)
|
||||
data =
|
||||
<<-DATA
|
||||
|
@ -100,13 +103,13 @@ DATA
|
|||
# List information about objects in an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# bucket_name<~String>:: name of bucket to list object keys from
|
||||
# options<~Hash>:: config arguments for list. Defaults to {}.
|
||||
# :prefix limits object keys to those beginning with its value.
|
||||
# :marker limits object keys to only those that appear
|
||||
# * bucket_name<~String> - name of bucket to list object keys from
|
||||
# * options<~Hash> - config arguments for list. Defaults to {}.
|
||||
# * :prefix - limits object keys to those beginning with its value.
|
||||
# * :marker - limits object keys to only those that appear
|
||||
# lexicographically after its value.
|
||||
# :maxkeys limits number of object keys returned
|
||||
# :delimiter causes keys with the same string between the prefix
|
||||
# * maxkeys - limits number of object keys returned
|
||||
# * :delimiter - causes keys with the same string between the prefix
|
||||
# value and the first occurence of delimiter to be rolled up
|
||||
def get_bucket(bucket_name, options = {})
|
||||
options['max-keys'] = options.delete(:maxkeys) if options[:maxkeys]
|
||||
|
@ -125,6 +128,12 @@ DATA
|
|||
end
|
||||
|
||||
# Get configured payer for an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# * bucket_name<~String> - name of bucket to get payer for
|
||||
#
|
||||
# ==== Returns
|
||||
# FIXME: docs
|
||||
def get_request_payment(bucket_name)
|
||||
request({
|
||||
:headers => {},
|
||||
|
@ -136,6 +145,12 @@ DATA
|
|||
end
|
||||
|
||||
# Get location constraint for an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# * bucket_name<~String> - name of bucket to get location constraint for
|
||||
#
|
||||
# ==== Returns
|
||||
# FIXME: docs
|
||||
def get_bucket_location(bucket_name)
|
||||
request({
|
||||
:headers => {},
|
||||
|
@ -149,7 +164,10 @@ DATA
|
|||
# Delete an S3 bucket
|
||||
#
|
||||
# ==== Parameters
|
||||
# bucket_name<~String>:: name of bucket to delete
|
||||
# * bucket_name<~String> - name of bucket to delete
|
||||
#
|
||||
# ==== Returns
|
||||
# FIXME: docs
|
||||
def delete_bucket(bucket_name)
|
||||
request({
|
||||
:headers => {},
|
||||
|
@ -159,6 +177,7 @@ DATA
|
|||
end
|
||||
|
||||
# Create an object in an S3 bucket
|
||||
# FIXME: docs
|
||||
def put_object(bucket_name, object_name, object, options = {})
|
||||
file = parse_file(object)
|
||||
request({
|
||||
|
@ -171,6 +190,7 @@ DATA
|
|||
end
|
||||
|
||||
# Copy an object from one S3 bucket to another
|
||||
# FIXME: docs
|
||||
def copy_object(source_bucket_name, source_object_name, destination_bucket_name, destination_object_name)
|
||||
request({
|
||||
:headers => { 'x-amz-copy-source' => "/#{source_bucket_name}/#{source_object_name}" },
|
||||
|
@ -182,6 +202,7 @@ DATA
|
|||
end
|
||||
|
||||
# Get an object from S3
|
||||
# FIXME: docs
|
||||
def get_object(bucket_name, object_name)
|
||||
request({
|
||||
:headers => {},
|
||||
|
@ -192,6 +213,7 @@ DATA
|
|||
end
|
||||
|
||||
# Get headers for an object from S3
|
||||
# FIXME: docs
|
||||
def head_object(bucket_name, object_name)
|
||||
request({
|
||||
:headers => {},
|
||||
|
@ -202,6 +224,7 @@ DATA
|
|||
end
|
||||
|
||||
# Delete an object from S3
|
||||
# FIXME: docs
|
||||
def delete_object(bucket_name, object_name)
|
||||
request({
|
||||
:headers => {},
|
||||
|
|
|
@ -16,16 +16,16 @@ module Fog
|
|||
# :aws_secret_access_key in order to create a connection
|
||||
#
|
||||
# ==== Examples
|
||||
# sdb = SimpleDB.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
# sdb = SimpleDB.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
#
|
||||
# ==== Parameters
|
||||
# options<~Hash>:: config arguments for connection. Defaults to {}.
|
||||
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
||||
#
|
||||
# ==== Returns
|
||||
# SimpleDB object with connection to aws.
|
||||
# * SimpleDB object with connection to aws.
|
||||
def initialize(options={})
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@aws_secret_access_key = options[:aws_secret_access_key]
|
||||
|
@ -40,11 +40,14 @@ module Fog
|
|||
# Create a SimpleDB domain
|
||||
#
|
||||
# ==== Parameters
|
||||
# domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# * domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
||||
#
|
||||
# ==== Returns
|
||||
# Hash:: The :request_id and :box_usage values for the request.
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
def create_domain(domain_name)
|
||||
request({
|
||||
'Action' => 'CreateDomain',
|
||||
|
@ -55,11 +58,14 @@ module Fog
|
|||
# Delete a SimpleDB domain
|
||||
#
|
||||
# ==== Parameters
|
||||
# domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# * domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
||||
#
|
||||
# ==== Returns
|
||||
# Hash:: The :request_id and :box_usage values for the request.
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
def delete_domain(domain_name)
|
||||
request({
|
||||
'Action' => 'DeleteDomain',
|
||||
|
@ -70,17 +76,18 @@ module Fog
|
|||
# List SimpleDB domains
|
||||
#
|
||||
# ==== Parameters
|
||||
# options<~Hash>:: options, defaults to {}
|
||||
# :max_number_of_domains<~Integer>:: number of domains to return
|
||||
# * options<~Hash> - options, defaults to {}
|
||||
# *max_number_of_domains<~Integer> - number of domains to return
|
||||
# between 1 and 100, defaults to 100
|
||||
# :next_token<~String>:: Offset token to start listing, defaults to nil
|
||||
# *next_token<~String> - Offset token to start listing, defaults to nil
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id and :box_usage
|
||||
# :domains array of domain names.
|
||||
# :next_token offset to start with if there are are more domains to list
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
# * :domains - array of domain names.
|
||||
# * :next_token - offset to start with if there are are more domains to list
|
||||
def list_domains(options = {})
|
||||
request({
|
||||
'Action' => 'ListDomains',
|
||||
|
@ -92,19 +99,19 @@ module Fog
|
|||
# List metadata for SimpleDB domain
|
||||
#
|
||||
# ==== Parameters
|
||||
# domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# * domain_name<~String> - Name of domain. Must be between 3 and 255 of the
|
||||
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :timestamp last update time for metadata.
|
||||
# :item_count number of items in domain
|
||||
# :attribute_value_count number of all name/value pairs in domain
|
||||
# :attribute_name_count number of unique attribute names in domain
|
||||
# :item_name_size_bytes total size of item names in domain, in bytes
|
||||
# :attribute_values_size_bytes total size of attributes, in bytes
|
||||
# :attribute_names_size_bytes total size of unique attribute names, in bytes
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :attribute_name_count - number of unique attribute names in domain
|
||||
# * :attribute_names_size_bytes - total size of unique attribute names, in bytes
|
||||
# * :attribute_value_count - number of all name/value pairs in domain
|
||||
# * :attribute_values_size_bytes - total size of attributes, in bytes
|
||||
# * :item_count - number of items in domain
|
||||
# * :item_name_size_bytes - total size of item names in domain, in bytes
|
||||
# * :timestamp - last update time for metadata.
|
||||
def domain_metadata(domain_name)
|
||||
request({
|
||||
'Action' => 'DomainMetadata',
|
||||
|
@ -115,9 +122,9 @@ module Fog
|
|||
# Put items attributes into a SimpleDB domain
|
||||
#
|
||||
# ==== Parameters
|
||||
# domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# * domain_name<~String> - Name of domain. Must be between 3 and 255 of the
|
||||
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
||||
# items<~Hash>:: Keys are the items names and may use any UTF-8
|
||||
# * items<~Hash> - Keys are the items names and may use any UTF-8
|
||||
# characters valid in xml. Control characters and sequences not allowed
|
||||
# in xml are not valid. Can be up to 1024 bytes long. Values are the
|
||||
# attributes to add to the given item and may use any UTF-8 characters
|
||||
|
@ -125,9 +132,10 @@ module Fog
|
|||
# not valid. Each name and value can be up to 1024 bytes long.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id and :box_usage
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
def batch_put_attributes(domain_name, items, replace_attributes = Hash.new([]))
|
||||
request({
|
||||
'Action' => 'BatchPutAttributes',
|
||||
|
@ -138,20 +146,21 @@ module Fog
|
|||
# Put item attributes into a SimpleDB domain
|
||||
#
|
||||
# ==== Parameters
|
||||
# domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# * domain_name<~String> - Name of domain. Must be between 3 and 255 of the
|
||||
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
||||
# item_name<~String>:: Name of the item. May use any UTF-8 characters valid
|
||||
# * item_name<~String> - Name of the item. May use any UTF-8 characters valid
|
||||
# in xml. Control characters and sequences not allowed in xml are not
|
||||
# valid. Can be up to 1024 bytes long.
|
||||
# attributes<~Hash>:: Name/value pairs to add to the item. Attribute names
|
||||
# * attributes<~Hash> - Name/value pairs to add to the item. Attribute names
|
||||
# and values may use any UTF-8 characters valid in xml. Control characters
|
||||
# and sequences not allowed in xml are not valid. Each name and value can
|
||||
# be up to 1024 bytes long.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id and :box_usage
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
def put_attributes(domain_name, item_name, attributes, replace_attributes = [])
|
||||
batch_put_attributes(domain_name, { item_name => attributes }, { item_name => replace_attributes })
|
||||
end
|
||||
|
@ -159,21 +168,22 @@ module Fog
|
|||
# List metadata for SimpleDB domain
|
||||
#
|
||||
# ==== Parameters
|
||||
# domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# * domain_name<~String> - Name of domain. Must be between 3 and 255 of the
|
||||
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
||||
# item_name<~String>:: Name of the item. May use any UTF-8 characters valid
|
||||
# * item_name<~String> - Name of the item. May use any UTF-8 characters valid
|
||||
# in xml. Control characters and sequences not allowed in xml are not
|
||||
# valid. Can be up to 1024 bytes long.
|
||||
# attributes<~Hash>:: Name/value pairs to remove from the item. Defaults to
|
||||
# * attributes<~Hash> - Name/value pairs to remove from the item. Defaults to
|
||||
# nil, which will delete the entire item. Attribute names and values may
|
||||
# use any UTF-8 characters valid in xml. Control characters and sequences
|
||||
# not allowed in xml are not valid. Each name and value can be up to 1024
|
||||
# bytes long.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id and :box_usage
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
def delete_attributes(domain_name, item_name, attributes = nil)
|
||||
request({
|
||||
'Action' => 'DeleteAttributes',
|
||||
|
@ -185,22 +195,23 @@ module Fog
|
|||
# List metadata for SimpleDB domain
|
||||
#
|
||||
# ==== Parameters
|
||||
# domain_name<~String>:: Name of domain. Must be between 3 and 255 of the
|
||||
# * domain_name<~String> - Name of domain. Must be between 3 and 255 of the
|
||||
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
||||
# item_name<~String>:: Name of the item. May use any UTF-8 characters valid
|
||||
# * item_name<~String> - Name of the item. May use any UTF-8 characters valid
|
||||
# in xml. Control characters and sequences not allowed in xml are not
|
||||
# valid. Can be up to 1024 bytes long.
|
||||
# attributes<~Hash>:: Name/value pairs to return from the item. Defaults to
|
||||
# * attributes<~Hash> - Name/value pairs to return from the item. Defaults to
|
||||
# nil, which will return all attributes. Attribute names and values may use
|
||||
# any UTF-8 characters valid in xml. Control characters and sequences not
|
||||
# allowed in xml are not valid. Each name and value can be up to 1024
|
||||
# bytes long.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id and :box_usage
|
||||
# :attributes list of attribute name/values for the item
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
# * :attributes - list of attribute name/values for the item
|
||||
def get_attributes(domain_name, item_name, attributes = nil)
|
||||
request({
|
||||
'Action' => 'GetAttributes',
|
||||
|
@ -212,16 +223,17 @@ module Fog
|
|||
# Select item data from SimpleDB
|
||||
#
|
||||
# ==== Parameters
|
||||
# select_expression<~String>:: Expression to query domain with.
|
||||
# next_token<~String>:: Offset token to start list, defaults to nil.
|
||||
# * select_expression<~String> - Expression to query domain with.
|
||||
# * next_token<~String> - Offset token to start list, defaults to nil.
|
||||
#
|
||||
# ==== Returns
|
||||
# response::
|
||||
# body<~Hash>::
|
||||
# :request_id and :box_usage
|
||||
# :items list of attribute name/values for the items formatted as
|
||||
# * response<~Fog::AWS::Response>:
|
||||
# * body<~Hash>:
|
||||
# * :box_usage
|
||||
# * :request_id
|
||||
# * :items - list of attribute name/values for the items formatted as
|
||||
# { 'item_name' => { 'attribute_name' => ['attribute_value'] }}
|
||||
# :next_token offset to start with if there are are more domains to list
|
||||
# * :next_token - offset to start with if there are are more domains to list
|
||||
def select(select_expression, next_token = nil)
|
||||
request({
|
||||
'Action' => 'Select',
|
||||
|
|
Loading…
Add table
Reference in a new issue