Module: Aws

Defined in:
lib/aws-sdk-core.rb,
lib/aws-sdk-core/s3.rb,
lib/aws-sdk-core/client.rb,
lib/aws-sdk-core/errors.rb,
lib/aws-sdk-core/service.rb,
lib/aws-sdk-core/version.rb,
lib/aws-sdk-core/dynamodb.rb,
lib/aws-sdk-core/structure.rb,
lib/aws-sdk-core/tree_hash.rb,
lib/aws-sdk-core/signers/s3.rb,
lib/aws-sdk-core/signers/v2.rb,
lib/aws-sdk-core/signers/v3.rb,
lib/aws-sdk-core/signers/v4.rb,
lib/aws-sdk-core/xml/parser.rb,
lib/aws-sdk-core/credentials.rb,
lib/aws-sdk-core/json/parser.rb,
lib/aws-sdk-core/query/param.rb,
lib/aws-sdk-core/xml/builder.rb,
lib/aws-sdk-core/json/builder.rb,
lib/aws-sdk-core/paging/pager.rb,
lib/aws-sdk-core/s3/presigner.rb,
lib/aws-sdk-core/signers/base.rb,
lib/aws-sdk-core/query/handler.rb,
lib/aws-sdk-core/api/customizer.rb,
lib/aws-sdk-core/api/docstrings.rb,
lib/aws-sdk-core/api/documenter.rb,
lib/aws-sdk-core/waiters/errors.rb,
lib/aws-sdk-core/waiters/waiter.rb,
lib/aws-sdk-core/empty_structure.rb,
lib/aws-sdk-core/paging/provider.rb,
lib/aws-sdk-core/plugins/s3_md5s.rb,
lib/aws-sdk-core/signers/handler.rb,
lib/aws-sdk-core/query/param_list.rb,
lib/aws-sdk-core/waiters/provider.rb,
lib/aws-sdk-core/xml/default_list.rb,
lib/aws-sdk-core/xml/rest_handler.rb,
lib/aws-sdk-core/endpoint_provider.rb,
lib/aws-sdk-core/json/rest_handler.rb,
lib/aws-sdk-core/pageable_response.rb,
lib/aws-sdk-core/paging/null_pager.rb,
lib/aws-sdk-core/rest_body_handler.rb,
lib/aws-sdk-core/xml/error_handler.rb,
lib/aws-sdk-core/json/error_handler.rb,
lib/aws-sdk-core/plugins/s3_sse_cpk.rb,
lib/aws-sdk-core/plugins/user_agent.rb,
lib/aws-sdk-core/shared_credentials.rb,
lib/aws-sdk-core/query/param_builder.rb,
lib/aws-sdk-core/paging/null_provider.rb,
lib/aws-sdk-core/plugins/retry_errors.rb,
lib/aws-sdk-core/plugins/s3_redirects.rb,
lib/aws-sdk-core/api/operation_example.rb,
lib/aws-sdk-core/json/rpc_body_handler.rb,
lib/aws-sdk-core/plugins/protocols/ec2.rb,
lib/aws-sdk-core/plugins/s3_bucket_dns.rb,
lib/aws-sdk-core/waiters/null_provider.rb,
lib/aws-sdk-core/plugins/request_signer.rb,
lib/aws-sdk-core/plugins/sqs_queue_urls.rb,
lib/aws-sdk-core/plugins/protocols/query.rb,
lib/aws-sdk-core/plugins/response_paging.rb,
lib/aws-sdk-core/plugins/route_53_id_fix.rb,
lib/aws-sdk-core/query/ec2_param_builder.rb,
lib/aws-sdk-core/api/operation_documenter.rb,
lib/aws-sdk-core/dynamodb/attribute_value.rb,
lib/aws-sdk-core/json/rpc_headers_handler.rb,
lib/aws-sdk-core/json/simple_body_handler.rb,
lib/aws-sdk-core/credential_provider_chain.rb,
lib/aws-sdk-core/plugins/glacier_checksums.rb,
lib/aws-sdk-core/plugins/regional_endpoint.rb,
lib/aws-sdk-core/plugins/swf_read_timeouts.rb,
lib/aws-sdk-core/api/service_customizations.rb,
lib/aws-sdk-core/plugins/glacier_account_id.rb,
lib/aws-sdk-core/plugins/protocols/json_rpc.rb,
lib/aws-sdk-core/plugins/protocols/rest_xml.rb,
lib/aws-sdk-core/plugins/glacier_api_version.rb,
lib/aws-sdk-core/plugins/protocols/rest_json.rb,
lib/aws-sdk-core/plugins/s3_url_encoded_keys.rb,
lib/aws-sdk-core/instance_profile_credentials.rb,
lib/aws-sdk-core/plugins/global_configuration.rb,
lib/aws-sdk-core/plugins/s3_expect_100_continue.rb,
lib/aws-sdk-core/plugins/s3_location_constraint.rb,
lib/aws-sdk-core/plugins/csd_conditional_signing.rb,
lib/aws-sdk-core/plugins/dynamodb_extended_retries.rb,
lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb,
lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb,
lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb,
lib/aws-sdk-core/plugins/s3_complete_multipart_upload_fix.rb

Defined Under Namespace

Modules: Api, DynamoDB, Errors, Json, Paging, Plugins, Query, S3, Service, Signers, Waiters, Xml Classes: Client, CredentialProviderChain, Credentials, EmptyStructure, EndpointProvider, InstanceProfileCredentials, PageableResponse, RestBodyHandler, SharedCredentials, Structure, TreeHash

Constant Summary collapse

GEM_ROOT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

File.dirname(File.dirname(__FILE__))
APIS_DIR =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

File.join(GEM_ROOT, 'apis')
SERVICE_MODULE_NAMES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

services

%w(
  AutoScaling
  CloudFormation
  CloudFront
  CloudSearch
  CloudSearchDomain
  CloudTrail
  CloudWatch
  CloudWatchLogs
  CognitoIdentity
  CognitoSync
  DataPipeline
  DirectConnect
  DynamoDB
  EC2
  ElastiCache
  ElasticBeanstalk
  ElasticLoadBalancing
  ElasticTranscoder
  EMR
  Glacier
  IAM
  ImportExport
  Kinesis
  OpsWorks
  RDS
  Redshift
  Route53
  Route53Domains
  S3
  SES
  SimpleDB
  SNS
  SQS
  StorageGateway
  STS
  Support
  SWF
)
VERSION =
'2.0.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configHash

Returns a hash of default configuration options shared by all constructed clients.

Returns:

  • (Hash)

    Returns a hash of default configuration options shared by all constructed clients.



192
193
194
# File 'lib/aws-sdk-core.rb', line 192

def config
  @config
end

Class Method Details

.add_service(svc_name, options = {}) {|svc_name, svc_module, svc_files| ... } ⇒ Module<Service>

Registers a new service.

Aws.add_service('SvcName',
  api: '/path/to/svc.api.json',
  paginators: '/path/to/svc.paginators.json',
  resources: '/path/to/svc.resources.json')

Aws::SvcName::Client.new
#=> #<Aws::SvcName::Client>

Parameters:

  • svc_name (String)

    The name of the service. This will also be the namespace under Aws.

  • options[required,String,Hash,Seahorse::Model::Api] (Hash)

    a customizable set of options

  • options[String,Hash,Paging::Provider] (Hash)

    a customizable set of options

  • options[String] (Hash)

    a customizable set of options

Yield Parameters:

  • svc_name (String)
  • svc_module (Module<Service>)
  • svc_files (Hash<String,String>)

Returns:



239
240
241
242
243
244
245
246
247
# File 'lib/aws-sdk-core.rb', line 239

def add_service(svc_name, options = {})
  svc_module = Module.new { extend Service }
  const_set(svc_name, svc_module)
  @services[svc_name] = [svc_module, options]
  @service_added_callbacks.each do |callback|
    callback.call(svc_name.to_s, *@services[svc_name])
  end
  svc_module
end

.load_all_servicesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



250
251
252
253
254
# File 'lib/aws-sdk-core.rb', line 250

def load_all_services
  SERVICE_MODULE_NAMES.each do |const_name|
    const_get(const_name)
  end
end

.load_json(path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



216
217
218
# File 'lib/aws-sdk-core.rb', line 216

def load_json(path)
  MultiJson.load(File.open(path, 'r', encoding: 'UTF-8') { |f| f.read })
end

.service_added(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Yields to the given block for each service that has already been defined via add_service. Also yields to the given block for each new service added after the callback is registered.



207
208
209
210
211
212
213
# File 'lib/aws-sdk-core.rb', line 207

def service_added(&block)
  callback = Proc.new
  @services.each do |svc_name, (svc_module, options)|
    yield(svc_name, svc_module, options)
  end
  @service_added_callbacks << callback
end