aws-sdk 1.8.5 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +1 -0
- data/README.rdoc +8 -0
- data/lib/aws-sdk.rb +39 -35
- data/lib/aws/api_config/CloudFront-2012-07-01.yml +2398 -0
- data/lib/aws/api_config/DirectConnect-2012-10-25.yml +475 -0
- data/lib/aws/api_config/DynamoDB-2011-12-05.yml +8 -0
- data/lib/aws/api_config/DynamoDB-2012-08-10.yml +1516 -0
- data/lib/aws/api_config/OpsWorks-2013-02-18.yml +2 -2
- data/lib/aws/auto_scaling.rb +44 -44
- data/lib/aws/auto_scaling/activity.rb +1 -1
- data/lib/aws/auto_scaling/activity_collection.rb +14 -15
- data/lib/aws/auto_scaling/client.rb +277 -277
- data/lib/aws/auto_scaling/config.rb +1 -1
- data/lib/aws/auto_scaling/group.rb +35 -36
- data/lib/aws/auto_scaling/group_collection.rb +10 -10
- data/lib/aws/auto_scaling/group_options.rb +19 -19
- data/lib/aws/auto_scaling/instance.rb +27 -27
- data/lib/aws/auto_scaling/instance_collection.rb +10 -10
- data/lib/aws/auto_scaling/launch_configuration.rb +3 -3
- data/lib/aws/auto_scaling/launch_configuration_collection.rb +1 -1
- data/lib/aws/auto_scaling/notification_configuration.rb +2 -2
- data/lib/aws/auto_scaling/notification_configuration_collection.rb +37 -38
- data/lib/aws/auto_scaling/scaling_policy.rb +3 -3
- data/lib/aws/auto_scaling/scaling_policy_collection.rb +6 -6
- data/lib/aws/auto_scaling/scaling_policy_options.rb +8 -7
- data/lib/aws/auto_scaling/scheduled_action.rb +3 -3
- data/lib/aws/auto_scaling/scheduled_action_collection.rb +28 -28
- data/lib/aws/auto_scaling/tag_collection.rb +30 -28
- data/lib/aws/cloud_formation.rb +95 -94
- data/lib/aws/cloud_formation/client.rb +136 -133
- data/lib/aws/cloud_formation/config.rb +1 -1
- data/lib/aws/cloud_formation/stack.rb +37 -37
- data/lib/aws/cloud_formation/stack_collection.rb +28 -27
- data/lib/aws/cloud_formation/stack_event.rb +9 -11
- data/lib/aws/cloud_formation/stack_output.rb +1 -1
- data/lib/aws/cloud_formation/stack_resource.rb +6 -6
- data/lib/aws/cloud_formation/stack_resource_collection.rb +11 -12
- data/lib/aws/cloud_formation/stack_resource_summary_collection.rb +11 -11
- data/lib/aws/cloud_formation/stack_summary_collection.rb +39 -39
- data/lib/aws/cloud_front.rb +21 -21
- data/lib/aws/cloud_front/client.rb +853 -652
- data/lib/aws/cloud_front/request.rb +3 -0
- data/lib/aws/cloud_search.rb +22 -22
- data/lib/aws/cloud_search/client.rb +322 -315
- data/lib/aws/cloud_search/config.rb +1 -1
- data/lib/aws/cloud_watch.rb +39 -39
- data/lib/aws/cloud_watch/alarm.rb +55 -37
- data/lib/aws/cloud_watch/alarm_collection.rb +18 -18
- data/lib/aws/cloud_watch/alarm_history_item_collection.rb +2 -2
- data/lib/aws/cloud_watch/client.rb +360 -146
- data/lib/aws/cloud_watch/config.rb +1 -1
- data/lib/aws/cloud_watch/metric.rb +15 -15
- data/lib/aws/cloud_watch/metric_alarm_collection.rb +17 -17
- data/lib/aws/cloud_watch/metric_collection.rb +16 -16
- data/lib/aws/cloud_watch/metric_statistics.rb +11 -11
- data/lib/aws/core.rb +243 -225
- data/lib/aws/core/async_handle.rb +13 -13
- data/lib/aws/core/cacheable.rb +14 -15
- data/lib/aws/core/client.rb +40 -15
- data/lib/aws/core/collection.rb +42 -46
- data/lib/aws/core/collection/with_limit_and_next_token.rb +1 -1
- data/lib/aws/core/collection/with_next_token.rb +1 -1
- data/lib/aws/core/configuration.rb +97 -133
- data/lib/aws/core/credential_providers.rb +16 -16
- data/lib/aws/core/data.rb +23 -23
- data/lib/aws/core/http/connection_pool.rb +348 -0
- data/lib/aws/core/http/net_http_handler.rb +17 -26
- data/lib/aws/core/http/patch.rb +102 -0
- data/lib/aws/core/http/request.rb +13 -19
- data/lib/aws/core/http/response.rb +2 -2
- data/lib/aws/core/lazy_error_classes.rb +17 -17
- data/lib/aws/core/log_formatter.rb +70 -104
- data/lib/aws/core/options/json_serializer.rb +1 -1
- data/lib/aws/core/options/validator.rb +4 -4
- data/lib/aws/core/page_result.rb +8 -8
- data/lib/aws/core/policy.rb +49 -49
- data/lib/aws/core/region.rb +72 -0
- data/lib/aws/core/region_collection.rb +106 -0
- data/lib/aws/core/resource.rb +5 -5
- data/lib/aws/core/response.rb +20 -17
- data/lib/aws/core/rest_request_builder.rb +4 -4
- data/lib/aws/core/service_interface.rb +24 -2
- data/lib/aws/core/signature/version_3.rb +2 -2
- data/lib/aws/core/uri_escape.rb +1 -1
- data/lib/aws/core/xml/frame_stack.rb +1 -1
- data/lib/aws/core/xml/grammar.rb +3 -4
- data/lib/aws/core/xml/sax_handlers/libxml.rb +2 -2
- data/lib/aws/core/xml/sax_handlers/nokogiri.rb +3 -3
- data/lib/aws/core/xml/sax_handlers/rexml.rb +5 -5
- data/lib/aws/core/xml/stub.rb +9 -9
- data/lib/aws/data_pipeline.rb +21 -21
- data/lib/aws/data_pipeline/client.rb +189 -133
- data/lib/aws/data_pipeline/config.rb +1 -1
- data/lib/aws/direct_connect.rb +74 -0
- data/lib/aws/direct_connect/client.rb +253 -0
- data/lib/aws/direct_connect/config.rb +18 -0
- data/lib/aws/direct_connect/errors.rb +22 -0
- data/lib/aws/direct_connect/request.rb +27 -0
- data/lib/aws/dynamo_db.rb +71 -69
- data/lib/aws/dynamo_db/attribute_collection.rb +53 -58
- data/lib/aws/dynamo_db/batch_get.rb +23 -23
- data/lib/aws/dynamo_db/batch_write.rb +43 -43
- data/lib/aws/dynamo_db/binary.rb +9 -9
- data/lib/aws/dynamo_db/client.rb +494 -509
- data/lib/aws/dynamo_db/client_base.rb +91 -0
- data/lib/aws/dynamo_db/client_v2.rb +825 -0
- data/lib/aws/dynamo_db/config.rb +1 -1
- data/lib/aws/dynamo_db/item.rb +10 -10
- data/lib/aws/dynamo_db/item_collection.rb +75 -75
- data/lib/aws/dynamo_db/table.rb +85 -85
- data/lib/aws/dynamo_db/table_collection.rb +13 -13
- data/lib/aws/ec2.rb +132 -142
- data/lib/aws/ec2/attachment.rb +31 -36
- data/lib/aws/ec2/attachment_collection.rb +1 -1
- data/lib/aws/ec2/availability_zone.rb +4 -4
- data/lib/aws/ec2/client.rb +2272 -2125
- data/lib/aws/ec2/config.rb +1 -1
- data/lib/aws/ec2/customer_gateway.rb +6 -6
- data/lib/aws/ec2/customer_gateway_collection.rb +6 -6
- data/lib/aws/ec2/dhcp_options.rb +3 -3
- data/lib/aws/ec2/dhcp_options_collection.rb +10 -10
- data/lib/aws/ec2/elastic_ip.rb +15 -15
- data/lib/aws/ec2/elastic_ip_collection.rb +11 -15
- data/lib/aws/ec2/export_task.rb +4 -4
- data/lib/aws/ec2/export_task_collection.rb +11 -11
- data/lib/aws/ec2/filtered_collection.rb +6 -8
- data/lib/aws/ec2/image.rb +46 -40
- data/lib/aws/ec2/image_collection.rb +44 -52
- data/lib/aws/ec2/instance.rb +64 -62
- data/lib/aws/ec2/instance_collection.rb +47 -50
- data/lib/aws/ec2/internet_gateway.rb +6 -6
- data/lib/aws/ec2/internet_gateway/attachment.rb +13 -13
- data/lib/aws/ec2/internet_gateway_collection.rb +3 -3
- data/lib/aws/ec2/key_pair.rb +3 -3
- data/lib/aws/ec2/key_pair_collection.rb +12 -12
- data/lib/aws/ec2/network_acl.rb +39 -39
- data/lib/aws/ec2/network_acl/association.rb +2 -2
- data/lib/aws/ec2/network_acl/entry.rb +22 -22
- data/lib/aws/ec2/network_acl_collection.rb +2 -2
- data/lib/aws/ec2/network_interface.rb +13 -4
- data/lib/aws/ec2/network_interface/attachment.rb +3 -3
- data/lib/aws/ec2/network_interface_collection.rb +5 -5
- data/lib/aws/ec2/permission_collection.rb +1 -1
- data/lib/aws/ec2/region.rb +6 -6
- data/lib/aws/ec2/region_collection.rb +1 -1
- data/lib/aws/ec2/reserved_instances_collection.rb +2 -2
- data/lib/aws/ec2/reserved_instances_offering_collection.rb +2 -2
- data/lib/aws/ec2/resource_tag_collection.rb +5 -5
- data/lib/aws/ec2/route_table.rb +14 -14
- data/lib/aws/ec2/route_table/association.rb +22 -22
- data/lib/aws/ec2/route_table/route.rb +8 -8
- data/lib/aws/ec2/route_table_collection.rb +3 -3
- data/lib/aws/ec2/security_group.rb +39 -41
- data/lib/aws/ec2/security_group_collection.rb +19 -21
- data/lib/aws/ec2/snapshot.rb +3 -3
- data/lib/aws/ec2/snapshot_collection.rb +11 -12
- data/lib/aws/ec2/subnet.rb +2 -2
- data/lib/aws/ec2/subnet_collection.rb +17 -17
- data/lib/aws/ec2/tag_collection.rb +1 -1
- data/lib/aws/ec2/tagged_collection.rb +7 -7
- data/lib/aws/ec2/tagged_item.rb +10 -10
- data/lib/aws/ec2/volume.rb +16 -16
- data/lib/aws/ec2/volume_collection.rb +9 -12
- data/lib/aws/ec2/vpc.rb +6 -6
- data/lib/aws/ec2/vpc_collection.rb +10 -10
- data/lib/aws/ec2/vpn_connection.rb +4 -4
- data/lib/aws/ec2/vpn_connection/telemetry.rb +1 -1
- data/lib/aws/ec2/vpn_connection_collection.rb +6 -6
- data/lib/aws/ec2/vpn_gateway.rb +2 -2
- data/lib/aws/ec2/vpn_gateway_collection.rb +5 -5
- data/lib/aws/elastic_beanstalk.rb +12 -12
- data/lib/aws/elastic_beanstalk/client.rb +376 -368
- data/lib/aws/elastic_beanstalk/config.rb +1 -1
- data/lib/aws/elastic_transcoder.rb +5 -5
- data/lib/aws/elastic_transcoder/client.rb +283 -283
- data/lib/aws/elastic_transcoder/config.rb +1 -1
- data/lib/aws/elasticache.rb +12 -12
- data/lib/aws/elasticache/client.rb +484 -479
- data/lib/aws/elasticache/config.rb +1 -1
- data/lib/aws/elb.rb +23 -23
- data/lib/aws/elb/availability_zone_collection.rb +34 -34
- data/lib/aws/elb/backend_server_policy_collection.rb +24 -24
- data/lib/aws/elb/client.rb +153 -153
- data/lib/aws/elb/config.rb +1 -1
- data/lib/aws/elb/errors.rb +1 -1
- data/lib/aws/elb/instance_collection.rb +20 -25
- data/lib/aws/elb/listener.rb +3 -3
- data/lib/aws/elb/listener_collection.rb +8 -8
- data/lib/aws/elb/load_balancer.rb +15 -16
- data/lib/aws/elb/load_balancer_collection.rb +36 -24
- data/lib/aws/elb/load_balancer_policy.rb +1 -1
- data/lib/aws/elb/load_balancer_policy_collection.rb +5 -5
- data/lib/aws/emr.rb +28 -26
- data/lib/aws/emr/client.rb +165 -149
- data/lib/aws/emr/config.rb +1 -1
- data/lib/aws/emr/instance_group.rb +1 -1
- data/lib/aws/emr/instance_group_collection.rb +1 -1
- data/lib/aws/emr/job_flow.rb +27 -26
- data/lib/aws/emr/job_flow_collection.rb +34 -34
- data/lib/aws/errors.rb +7 -7
- data/lib/aws/glacier.rb +21 -21
- data/lib/aws/glacier/archive_collection.rb +2 -2
- data/lib/aws/glacier/client.rb +139 -140
- data/lib/aws/glacier/config.rb +1 -1
- data/lib/aws/glacier/vault.rb +2 -2
- data/lib/aws/glacier/vault_collection.rb +1 -1
- data/lib/aws/iam.rb +133 -144
- data/lib/aws/iam/access_key.rb +17 -17
- data/lib/aws/iam/access_key_collection.rb +22 -22
- data/lib/aws/iam/account_alias_collection.rb +2 -2
- data/lib/aws/iam/client.rb +429 -420
- data/lib/aws/iam/collection.rb +1 -1
- data/lib/aws/iam/config.rb +2 -2
- data/lib/aws/iam/group.rb +8 -8
- data/lib/aws/iam/group_collection.rb +16 -16
- data/lib/aws/iam/group_policy_collection.rb +6 -6
- data/lib/aws/iam/group_user_collection.rb +3 -3
- data/lib/aws/iam/mfa_device.rb +1 -1
- data/lib/aws/iam/mfa_device_collection.rb +9 -9
- data/lib/aws/iam/policy_collection.rb +4 -4
- data/lib/aws/iam/resource.rb +2 -2
- data/lib/aws/iam/server_certificate.rb +1 -1
- data/lib/aws/iam/server_certificate_collection.rb +15 -15
- data/lib/aws/iam/signing_certificate.rb +29 -29
- data/lib/aws/iam/signing_certificate_collection.rb +23 -23
- data/lib/aws/iam/user.rb +33 -38
- data/lib/aws/iam/user_collection.rb +27 -27
- data/lib/aws/iam/user_group_collection.rb +3 -3
- data/lib/aws/iam/user_policy_collection.rb +6 -6
- data/lib/aws/iam/virtual_mfa_device.rb +12 -12
- data/lib/aws/iam/virtual_mfa_device_collection.rb +4 -4
- data/lib/aws/import_export.rb +22 -21
- data/lib/aws/import_export/client.rb +47 -43
- data/lib/aws/ops_works.rb +5 -5
- data/lib/aws/ops_works/client.rb +484 -438
- data/lib/aws/ops_works/config.rb +1 -1
- data/lib/aws/rails.rb +34 -34
- data/lib/aws/rds.rb +18 -18
- data/lib/aws/rds/client.rb +1286 -1277
- data/lib/aws/rds/config.rb +1 -1
- data/lib/aws/rds/db_instance.rb +15 -4
- data/lib/aws/rds/db_snapshot.rb +1 -1
- data/lib/aws/record.rb +50 -24
- data/lib/aws/record/abstract_base.rb +52 -60
- data/lib/aws/record/attributes.rb +79 -79
- data/lib/aws/record/conversion.rb +1 -1
- data/lib/aws/record/dirty_tracking.rb +69 -67
- data/lib/aws/record/errors.rb +21 -21
- data/lib/aws/record/exceptions.rb +2 -2
- data/lib/aws/record/hash_model.rb +20 -21
- data/lib/aws/record/hash_model/attributes.rb +13 -15
- data/lib/aws/record/hash_model/finder_methods.rb +46 -46
- data/lib/aws/record/hash_model/scope.rb +31 -31
- data/lib/aws/record/model.rb +136 -136
- data/lib/aws/record/model/attributes.rb +57 -59
- data/lib/aws/record/model/finder_methods.rb +67 -67
- data/lib/aws/record/model/scope.rb +48 -49
- data/lib/aws/record/naming.rb +1 -1
- data/lib/aws/record/scope.rb +23 -19
- data/lib/aws/record/validations.rb +253 -271
- data/lib/aws/record/validator.rb +3 -3
- data/lib/aws/record/validators/acceptance.rb +1 -3
- data/lib/aws/record/validators/block.rb +1 -3
- data/lib/aws/record/validators/confirmation.rb +1 -3
- data/lib/aws/record/validators/count.rb +2 -4
- data/lib/aws/record/validators/exclusion.rb +2 -4
- data/lib/aws/record/validators/format.rb +2 -4
- data/lib/aws/record/validators/inclusion.rb +1 -3
- data/lib/aws/record/validators/length.rb +5 -7
- data/lib/aws/record/validators/method.rb +1 -3
- data/lib/aws/record/validators/numericality.rb +6 -8
- data/lib/aws/record/validators/presence.rb +1 -3
- data/lib/aws/redshift.rb +14 -14
- data/lib/aws/redshift/client.rb +596 -592
- data/lib/aws/redshift/config.rb +1 -1
- data/lib/aws/route_53.rb +30 -30
- data/lib/aws/route_53/change_batch.rb +7 -7
- data/lib/aws/route_53/client.rb +188 -152
- data/lib/aws/route_53/hosted_zone.rb +4 -4
- data/lib/aws/route_53/hosted_zone_collection.rb +7 -7
- data/lib/aws/route_53/resource_record_set.rb +10 -10
- data/lib/aws/route_53/resource_record_set_collection.rb +6 -6
- data/lib/aws/s3.rb +79 -79
- data/lib/aws/s3/access_control_list.rb +44 -36
- data/lib/aws/s3/acl_options.rb +51 -51
- data/lib/aws/s3/bucket.rb +146 -146
- data/lib/aws/s3/bucket_collection.rb +21 -21
- data/lib/aws/s3/bucket_lifecycle_configuration.rb +81 -82
- data/lib/aws/s3/bucket_tag_collection.rb +4 -2
- data/lib/aws/s3/cipher_io.rb +5 -4
- data/lib/aws/s3/client.rb +89 -84
- data/lib/aws/s3/client/xml.rb +1 -1
- data/lib/aws/s3/config.rb +7 -1
- data/lib/aws/s3/cors_rule.rb +2 -0
- data/lib/aws/s3/cors_rule_collection.rb +42 -40
- data/lib/aws/s3/data_options.rb +16 -11
- data/lib/aws/s3/encryption_utils.rb +2 -2
- data/lib/aws/s3/errors.rb +7 -7
- data/lib/aws/s3/multipart_upload.rb +30 -33
- data/lib/aws/s3/multipart_upload_collection.rb +8 -6
- data/lib/aws/s3/object_collection.rb +35 -35
- data/lib/aws/s3/object_metadata.rb +6 -6
- data/lib/aws/s3/object_version.rb +4 -4
- data/lib/aws/s3/object_version_collection.rb +15 -15
- data/lib/aws/s3/policy.rb +2 -2
- data/lib/aws/s3/prefixed_collection.rb +9 -5
- data/lib/aws/s3/presigned_post.rb +39 -37
- data/lib/aws/s3/request.rb +11 -11
- data/lib/aws/s3/s3_object.rb +210 -200
- data/lib/aws/s3/tree.rb +25 -27
- data/lib/aws/s3/tree/child_collection.rb +3 -3
- data/lib/aws/s3/tree/leaf_node.rb +2 -2
- data/lib/aws/s3/tree/parent.rb +1 -1
- data/lib/aws/s3/website_configuration.rb +13 -13
- data/lib/aws/simple_db.rb +83 -83
- data/lib/aws/simple_db/attribute.rb +9 -7
- data/lib/aws/simple_db/attribute_collection.rb +22 -13
- data/lib/aws/simple_db/client.rb +107 -107
- data/lib/aws/simple_db/config.rb +7 -1
- data/lib/aws/simple_db/consistent_read_option.rb +5 -5
- data/lib/aws/simple_db/domain.rb +4 -2
- data/lib/aws/simple_db/domain_collection.rb +4 -4
- data/lib/aws/simple_db/domain_metadata.rb +5 -5
- data/lib/aws/simple_db/errors.rb +9 -9
- data/lib/aws/simple_db/item.rb +5 -5
- data/lib/aws/simple_db/item_collection.rb +83 -81
- data/lib/aws/simple_db/item_data.rb +4 -4
- data/lib/aws/simple_db/put_attributes.rb +3 -3
- data/lib/aws/simple_email_service.rb +140 -140
- data/lib/aws/simple_email_service/client.rb +82 -76
- data/lib/aws/simple_email_service/config.rb +1 -2
- data/lib/aws/simple_email_service/email_address_collection.rb +3 -3
- data/lib/aws/simple_email_service/identity.rb +8 -8
- data/lib/aws/simple_email_service/quotas.rb +8 -6
- data/lib/aws/simple_workflow.rb +106 -106
- data/lib/aws/simple_workflow/activity_task.rb +15 -22
- data/lib/aws/simple_workflow/activity_task_collection.rb +15 -15
- data/lib/aws/simple_workflow/activity_type.rb +23 -23
- data/lib/aws/simple_workflow/activity_type_collection.rb +23 -23
- data/lib/aws/simple_workflow/client.rb +1004 -956
- data/lib/aws/simple_workflow/config.rb +1 -1
- data/lib/aws/simple_workflow/count.rb +5 -5
- data/lib/aws/simple_workflow/decision_task.rb +129 -129
- data/lib/aws/simple_workflow/decision_task_collection.rb +59 -59
- data/lib/aws/simple_workflow/domain.rb +11 -11
- data/lib/aws/simple_workflow/domain_collection.rb +26 -26
- data/lib/aws/simple_workflow/history_event.rb +32 -32
- data/lib/aws/simple_workflow/history_event_collection.rb +3 -3
- data/lib/aws/simple_workflow/option_formatters.rb +5 -5
- data/lib/aws/simple_workflow/request.rb +1 -1
- data/lib/aws/simple_workflow/resource.rb +1 -1
- data/lib/aws/simple_workflow/type.rb +8 -8
- data/lib/aws/simple_workflow/type_collection.rb +15 -15
- data/lib/aws/simple_workflow/workflow_execution.rb +70 -72
- data/lib/aws/simple_workflow/workflow_execution_collection.rb +130 -130
- data/lib/aws/simple_workflow/workflow_type.rb +27 -25
- data/lib/aws/simple_workflow/workflow_type_collection.rb +20 -20
- data/lib/aws/sns.rb +25 -25
- data/lib/aws/sns/client.rb +55 -55
- data/lib/aws/sns/config.rb +1 -1
- data/lib/aws/sns/policy.rb +1 -1
- data/lib/aws/sns/subscription.rb +7 -7
- data/lib/aws/sns/subscription_collection.rb +5 -5
- data/lib/aws/sns/topic.rb +49 -49
- data/lib/aws/sns/topic_collection.rb +2 -2
- data/lib/aws/sns/topic_subscription_collection.rb +5 -5
- data/lib/aws/sqs.rb +20 -20
- data/lib/aws/sqs/client.rb +78 -78
- data/lib/aws/sqs/config.rb +1 -1
- data/lib/aws/sqs/errors.rb +12 -12
- data/lib/aws/sqs/queue.rb +66 -67
- data/lib/aws/sqs/queue_collection.rb +16 -8
- data/lib/aws/sqs/received_message.rb +7 -6
- data/lib/aws/storage_gateway.rb +21 -21
- data/lib/aws/storage_gateway/client.rb +269 -202
- data/lib/aws/storage_gateway/config.rb +1 -1
- data/lib/aws/sts.rb +10 -8
- data/lib/aws/sts/client.rb +35 -35
- data/lib/aws/sts/session.rb +3 -3
- data/lib/aws/version.rb +1 -2
- metadata +23 -21
- data/lib/aws/core/autoloader.rb +0 -64
- data/lib/net/http/connection_pool.rb +0 -226
- data/lib/net/http/connection_pool/connection.rb +0 -189
- data/lib/net/http/connection_pool/session.rb +0 -126
|
@@ -17,7 +17,7 @@ require 'time'
|
|
|
17
17
|
module AWS
|
|
18
18
|
class CloudWatch
|
|
19
19
|
|
|
20
|
-
#
|
|
20
|
+
# # Metric
|
|
21
21
|
#
|
|
22
22
|
# Represents a single metric.
|
|
23
23
|
#
|
|
@@ -26,8 +26,8 @@ module AWS
|
|
|
26
26
|
# @param [String] namespace The metric namespace.
|
|
27
27
|
# @param [String] metric_name The metric name.
|
|
28
28
|
# @param [Hash] options
|
|
29
|
-
# @option options [Array<Hash>] :dimensions An array of dimensions.
|
|
30
|
-
# Each hash must have a
|
|
29
|
+
# @option options [Array<Hash>] :dimensions An array of dimensions.
|
|
30
|
+
# Each hash must have a `:name` and a `value` key (with string values).
|
|
31
31
|
def initialize namespace, metric_name, options = {}
|
|
32
32
|
@namespace = namespace
|
|
33
33
|
@metric_name = metric_name
|
|
@@ -53,10 +53,10 @@ module AWS
|
|
|
53
53
|
|
|
54
54
|
# Publishes metric data points to Amazon CloudWatch.
|
|
55
55
|
# @param [Array<Hash>] metric_data An array of hashes. Each hash
|
|
56
|
-
# must pass
|
|
56
|
+
# must pass `:value` (number) or `:statistic_values` (hash).
|
|
57
57
|
# @return [nil]
|
|
58
58
|
def put_data *metric_data
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
metric_opts = {}
|
|
61
61
|
metric_opts[:metric_name] = metric_name
|
|
62
62
|
metric_opts[:dimensions] = dimensions unless dimensions.empty?
|
|
@@ -74,17 +74,17 @@ module AWS
|
|
|
74
74
|
|
|
75
75
|
# Gets statistics for this metric.
|
|
76
76
|
#
|
|
77
|
-
#
|
|
77
|
+
# metric = CloudWatch::Metric.new('my/namepace', 'metric-name')
|
|
78
78
|
#
|
|
79
|
-
#
|
|
80
|
-
#
|
|
81
|
-
#
|
|
82
|
-
#
|
|
79
|
+
# stats = metric.statistics(
|
|
80
|
+
# :start_time => Time.now - 3600,
|
|
81
|
+
# :end_time => Time.now,
|
|
82
|
+
# :statistics => ['Average'])
|
|
83
83
|
#
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
#
|
|
84
|
+
# stats.label #=> 'some-label'
|
|
85
|
+
# stats.each do |datapoint|
|
|
86
|
+
# # datapoint is a hash
|
|
87
|
+
# end
|
|
88
88
|
#
|
|
89
89
|
# @param [Hash] options
|
|
90
90
|
# @option options [Time,required] :start_time
|
|
@@ -111,7 +111,7 @@ module AWS
|
|
|
111
111
|
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
# @return [Boolean] Returns
|
|
114
|
+
# @return [Boolean] Returns `true` if this metric exists.
|
|
115
115
|
def exists?
|
|
116
116
|
!get_resource.data[:metrics].empty?
|
|
117
117
|
end
|
|
@@ -14,32 +14,32 @@
|
|
|
14
14
|
module AWS
|
|
15
15
|
class CloudWatch
|
|
16
16
|
|
|
17
|
-
#
|
|
17
|
+
# # MetricAlarmCollection
|
|
18
18
|
#
|
|
19
19
|
# Represents all alarms for a single metric.
|
|
20
20
|
#
|
|
21
|
-
#
|
|
21
|
+
# ## Getting an alarm by name
|
|
22
22
|
#
|
|
23
23
|
# If you know the name of the alarm, you can get a reference using
|
|
24
24
|
# the {#[]} method.
|
|
25
25
|
#
|
|
26
|
-
#
|
|
26
|
+
# metric.alarms['alarm-name']
|
|
27
27
|
#
|
|
28
|
-
#
|
|
28
|
+
# ## Enumerating Alarms
|
|
29
29
|
#
|
|
30
30
|
# You can enumerate all alarms for a metric using each (or any of the
|
|
31
31
|
# methods defined in {Core::Collection}).
|
|
32
32
|
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
33
|
+
# metric.alarms.each do |alarm|
|
|
34
|
+
# puts alarm.name
|
|
35
|
+
# end
|
|
36
36
|
#
|
|
37
|
-
#
|
|
37
|
+
# ## Filtering Alarms
|
|
38
38
|
#
|
|
39
39
|
# Use one of the filtering methods to reduce the number of alarms
|
|
40
40
|
# returned.
|
|
41
41
|
#
|
|
42
|
-
#
|
|
42
|
+
# metric.alarms.with_unit('Seconds').each {|alarm| ... }
|
|
43
43
|
#
|
|
44
44
|
class MetricAlarmCollection < AlarmCollection
|
|
45
45
|
|
|
@@ -80,15 +80,15 @@ module AWS
|
|
|
80
80
|
#
|
|
81
81
|
# @example Filtering by a 1 hour period
|
|
82
82
|
#
|
|
83
|
-
#
|
|
83
|
+
# metric.alarms.filter('period', 3600)
|
|
84
84
|
#
|
|
85
|
-
# @example Filtering by statistic
|
|
85
|
+
# @example Filtering by statistic
|
|
86
86
|
#
|
|
87
|
-
#
|
|
87
|
+
# my_metric = metrics.filter('statistic', 'maximum')
|
|
88
88
|
#
|
|
89
89
|
# @example Filtering by a unit
|
|
90
90
|
#
|
|
91
|
-
#
|
|
91
|
+
# metrics = metrics.filter('unit', 'Megabits')
|
|
92
92
|
#
|
|
93
93
|
# @param [String,Symbol] name
|
|
94
94
|
# @param [String,Integer] value
|
|
@@ -100,7 +100,7 @@ module AWS
|
|
|
100
100
|
|
|
101
101
|
# Returns a new collection that filters alarms by a period.
|
|
102
102
|
#
|
|
103
|
-
#
|
|
103
|
+
# metric.alarms.with_period(3600).each {|alarm| ... }
|
|
104
104
|
#
|
|
105
105
|
# @param [Integer] period
|
|
106
106
|
# @return [MetricAlarmCollection]
|
|
@@ -110,7 +110,7 @@ module AWS
|
|
|
110
110
|
|
|
111
111
|
# Returns a new collection that filters alarms by a statistic.
|
|
112
112
|
#
|
|
113
|
-
#
|
|
113
|
+
# metric.alarms.with_statistic('Average').each {|alarm| ... }
|
|
114
114
|
#
|
|
115
115
|
# @param [String] statistic
|
|
116
116
|
# @return [MetricAlarmCollection]
|
|
@@ -120,7 +120,7 @@ module AWS
|
|
|
120
120
|
|
|
121
121
|
# Returns a new collection that filters alarms by a unit.
|
|
122
122
|
#
|
|
123
|
-
#
|
|
123
|
+
# metric.alarms.with_unit('Percent').each {|alarm| ... }
|
|
124
124
|
#
|
|
125
125
|
# @param [String] unit
|
|
126
126
|
# @return [MetricAlarmCollection]
|
|
@@ -143,7 +143,7 @@ module AWS
|
|
|
143
143
|
|
|
144
144
|
alarm = Alarm.new_from(
|
|
145
145
|
:describe_alarms_for_metric,
|
|
146
|
-
details,
|
|
146
|
+
details,
|
|
147
147
|
details[:alarm_name],
|
|
148
148
|
:config => config)
|
|
149
149
|
|
|
@@ -63,17 +63,17 @@ module AWS
|
|
|
63
63
|
|
|
64
64
|
# Returns a collection filtered by the given dimension:
|
|
65
65
|
#
|
|
66
|
-
#
|
|
66
|
+
# metric = metrics.with_dimension('name', 'value').first
|
|
67
67
|
#
|
|
68
68
|
# You can chain calls to #with_dimension. Additional dimensions are
|
|
69
69
|
# added.
|
|
70
70
|
#
|
|
71
|
-
#
|
|
72
|
-
#
|
|
73
|
-
#
|
|
74
|
-
#
|
|
71
|
+
# metrics = metrics.
|
|
72
|
+
# with_dimension('d1', 'v1').
|
|
73
|
+
# with_dimension('d2', 'v2').
|
|
74
|
+
# with_dimension('d3', 'v3')
|
|
75
75
|
#
|
|
76
|
-
#
|
|
76
|
+
# metrics.each{|metric|} # filtered by all three dimensions
|
|
77
77
|
#
|
|
78
78
|
# @param [String] name
|
|
79
79
|
# @param [String] value
|
|
@@ -84,24 +84,24 @@ module AWS
|
|
|
84
84
|
|
|
85
85
|
# Returns a collection filtered by the given dimensions.
|
|
86
86
|
#
|
|
87
|
-
#
|
|
88
|
-
#
|
|
89
|
-
#
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
#
|
|
87
|
+
# metrics.with_dimensions([
|
|
88
|
+
# { :name => 'd1', :value => 'v1' },
|
|
89
|
+
# { :name => 'd2', :value => 'v2' },
|
|
90
|
+
# { :name => 'd3', :value => 'v3' },
|
|
91
|
+
# ]).each do |metric|
|
|
92
|
+
# # ...
|
|
93
|
+
# end
|
|
94
94
|
#
|
|
95
95
|
# Multiple calls to #with_dimensions will add to previous dimensions.
|
|
96
96
|
# @param [Array<Hash>] dimensions An array of dimensions. Each dimension
|
|
97
|
-
# should be a Hash with a
|
|
97
|
+
# should be a Hash with a `:name` and `:value`.
|
|
98
98
|
# @return [MetricCollection]
|
|
99
99
|
def with_dimensions *dimensions
|
|
100
100
|
dimensions = @filters[:dimensions] || []
|
|
101
101
|
dimensions += dimensions.flatten
|
|
102
102
|
filter(:dimensions, dimensions)
|
|
103
103
|
end
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
protected
|
|
106
106
|
|
|
107
107
|
def _each_item next_token, options = {}, &block
|
|
@@ -113,7 +113,7 @@ module AWS
|
|
|
113
113
|
resp.data[:metrics].each do |details|
|
|
114
114
|
|
|
115
115
|
metric = Metric.new_from(
|
|
116
|
-
:list_metrics, details,
|
|
116
|
+
:list_metrics, details,
|
|
117
117
|
details[:namespace],
|
|
118
118
|
details[:metric_name],
|
|
119
119
|
details.merge(:config => config))
|
|
@@ -18,22 +18,22 @@ module AWS
|
|
|
18
18
|
#
|
|
19
19
|
# This class is an enumerable collection of data points.
|
|
20
20
|
#
|
|
21
|
-
#
|
|
21
|
+
# ## Enumerating Statistics
|
|
22
22
|
#
|
|
23
|
-
#
|
|
23
|
+
# metric = CloudWatch::Metric.new('my/namepace', 'metric-name')
|
|
24
24
|
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
25
|
+
# stats = metric.statistics(
|
|
26
|
+
# :start_time => Time.now - 3600,
|
|
27
|
+
# :end_time => Time.now,
|
|
28
|
+
# :statistics => ['Average'])
|
|
29
29
|
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
30
|
+
# stats.label #=> 'some-label'
|
|
31
|
+
# stats.each do |datapoint|
|
|
32
|
+
# # datapoint is a hash
|
|
33
|
+
# end
|
|
34
34
|
#
|
|
35
35
|
# @see Core::Collection
|
|
36
|
-
#
|
|
36
|
+
#
|
|
37
37
|
class MetricStatistics
|
|
38
38
|
|
|
39
39
|
include Core::Collection::Simple
|
data/lib/aws/core.rb
CHANGED
|
@@ -12,19 +12,21 @@
|
|
|
12
12
|
# language governing permissions and limitations under the License.
|
|
13
13
|
|
|
14
14
|
require 'aws/version'
|
|
15
|
-
require 'aws/core/autoloader'
|
|
16
15
|
|
|
17
16
|
# AWS is the root module for all of the Amazon Web Services. It is also
|
|
18
17
|
# where you can configure you access to AWS.
|
|
19
18
|
#
|
|
20
|
-
#
|
|
19
|
+
# # Supported Services
|
|
21
20
|
#
|
|
22
21
|
# The currently supported services are:
|
|
23
22
|
#
|
|
24
23
|
# * {AWS::AutoScaling}
|
|
25
24
|
# * {AWS::CloudFormation}
|
|
25
|
+
# * {AWS::CloudFront}
|
|
26
26
|
# * {AWS::CloudSearch}
|
|
27
27
|
# * {AWS::CloudWatch}
|
|
28
|
+
# * {AWS::DataPipeline}
|
|
29
|
+
# * {AWS::DirectConnect}
|
|
28
30
|
# * {AWS::DynamoDB}
|
|
29
31
|
# * {AWS::EC2}
|
|
30
32
|
# * {AWS::ElastiCache}
|
|
@@ -33,25 +35,27 @@ require 'aws/core/autoloader'
|
|
|
33
35
|
# * {AWS::ELB}
|
|
34
36
|
# * {AWS::EMR}
|
|
35
37
|
# * {AWS::Glacier}
|
|
36
|
-
# * {AWS::OpsWorks}
|
|
37
38
|
# * {AWS::IAM}
|
|
38
|
-
# * {AWS::
|
|
39
|
+
# * {AWS::ImportExport}
|
|
40
|
+
# * {AWS::OpsWorks}
|
|
39
41
|
# * {AWS::RDS}
|
|
42
|
+
# * {AWS::Redshift}
|
|
40
43
|
# * {AWS::Route53}
|
|
41
44
|
# * {AWS::S3}
|
|
42
|
-
# * {AWS::SNS}
|
|
43
|
-
# * {AWS::SQS}
|
|
44
|
-
# * {AWS::STS}
|
|
45
45
|
# * {AWS::SimpleDB}
|
|
46
46
|
# * {AWS::SimpleEmailService}
|
|
47
47
|
# * {AWS::SimpleWorkflow}
|
|
48
|
+
# * {AWS::SNS}
|
|
49
|
+
# * {AWS::SQS}
|
|
50
|
+
# * {AWS::StorageGateway}
|
|
51
|
+
# * {AWS::STS}
|
|
48
52
|
#
|
|
49
|
-
#
|
|
53
|
+
# # AWS::Record
|
|
50
54
|
#
|
|
51
55
|
# In addition to the above services, bundled is an ORM based on AWS services
|
|
52
56
|
# See {AWS::Record} for more information.
|
|
53
57
|
#
|
|
54
|
-
#
|
|
58
|
+
# # Configuration
|
|
55
59
|
#
|
|
56
60
|
# You call {AWS.config} with a hash of options to configure your
|
|
57
61
|
# access to the Amazon Web Services.
|
|
@@ -61,9 +65,10 @@ require 'aws/core/autoloader'
|
|
|
61
65
|
#
|
|
62
66
|
# AWS.config(
|
|
63
67
|
# :access_key_id => 'ACCESS_KEY_ID',
|
|
64
|
-
# :secret_access_key => 'SECRET_ACCESS_KEY'
|
|
68
|
+
# :secret_access_key => 'SECRET_ACCESS_KEY',
|
|
69
|
+
# :region => 'us-west-2')
|
|
65
70
|
#
|
|
66
|
-
#
|
|
71
|
+
# ## Rails
|
|
67
72
|
#
|
|
68
73
|
# If you are loading AWS inside a Rails web application, it is recommended to
|
|
69
74
|
# place your configuration inside:
|
|
@@ -77,103 +82,127 @@ require 'aws/core/autoloader'
|
|
|
77
82
|
#
|
|
78
83
|
module AWS
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
# @private
|
|
86
|
+
SERVICES = {
|
|
87
|
+
'AutoScaling' => 'auto_scaling',
|
|
88
|
+
'CloudFormation' => 'cloud_formation',
|
|
89
|
+
'CloudFront' => 'cloud_front',
|
|
90
|
+
'CloudSearch' => 'cloud_search',
|
|
91
|
+
'CloudWatch' => 'cloud_watch',
|
|
92
|
+
'DynamoDB' => 'dynamo_db',
|
|
93
|
+
'DataPipeline' => 'data_pipeline',
|
|
94
|
+
'EC2' => 'ec2',
|
|
95
|
+
'ElastiCache' => 'elasticache',
|
|
96
|
+
'ElasticBeanstalk' => 'elastic_beanstalk',
|
|
97
|
+
'ElasticTranscoder' => 'elastic_transcoder',
|
|
98
|
+
'ELB' => 'elb',
|
|
99
|
+
'EMR' => 'emr',
|
|
100
|
+
'Glacier' => 'glacier',
|
|
101
|
+
'IAM' => 'iam',
|
|
102
|
+
'ImportExport' => 'import_export',
|
|
103
|
+
'OpsWorks' => 'ops_works',
|
|
104
|
+
'RDS' => 'rds',
|
|
105
|
+
'Redshift' => 'redshift',
|
|
106
|
+
'Route53' => 'route_53',
|
|
107
|
+
'S3' => 's3',
|
|
108
|
+
'SimpleDB' => 'simple_db',
|
|
109
|
+
'SimpleEmailService' => 'simple_email_service',
|
|
110
|
+
'SimpleWorkflow' => 'simple_workflow',
|
|
111
|
+
'SNS' => 'sns',
|
|
112
|
+
'SQS' => 'sqs',
|
|
113
|
+
'StorageGateway' => 'storage_gateway',
|
|
114
|
+
'STS' => 'sts',
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# @private
|
|
118
|
+
ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
|
119
|
+
|
|
120
|
+
autoload :Errors, 'aws/errors'
|
|
83
121
|
|
|
84
122
|
module Core
|
|
85
123
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
autoload :Inflection, 'inflection'
|
|
97
|
-
autoload :JSONParser, 'json_parser'
|
|
98
|
-
|
|
99
|
-
autoload :JSONClient, 'json_client'
|
|
100
|
-
autoload :JSONRequestBuilder, 'json_request_builder'
|
|
101
|
-
autoload :JSONResponseParser, 'json_response_parser'
|
|
102
|
-
|
|
103
|
-
autoload :LazyErrorClasses, 'lazy_error_classes'
|
|
104
|
-
autoload :LogFormatter, 'log_formatter'
|
|
105
|
-
autoload :MetaUtils, 'meta_utils'
|
|
106
|
-
autoload :ManagedFile, 'managed_file'
|
|
107
|
-
autoload :Model, 'model'
|
|
108
|
-
autoload :Naming, 'naming'
|
|
109
|
-
autoload :OptionGrammar, 'option_grammar'
|
|
110
|
-
autoload :PageResult, 'page_result'
|
|
111
|
-
autoload :Policy, 'policy'
|
|
112
|
-
|
|
113
|
-
autoload :QueryClient, 'query_client'
|
|
114
|
-
autoload :QueryRequestBuilder, 'query_request_builder'
|
|
115
|
-
autoload :QueryResponseParser, 'query_response_parser'
|
|
116
|
-
|
|
117
|
-
autoload :Resource, 'resource'
|
|
118
|
-
autoload :ResourceCache, 'resource_cache'
|
|
119
|
-
autoload :Response, 'response'
|
|
120
|
-
autoload :ResponseCache, 'response_cache'
|
|
121
|
-
|
|
122
|
-
autoload :RESTClient, 'rest_xml_client'
|
|
123
|
-
autoload :RESTJSONClient, 'rest_json_client'
|
|
124
|
-
autoload :RESTXMLClient, 'rest_xml_client'
|
|
125
|
-
autoload :RESTRequestBuilder, 'rest_request_builder'
|
|
126
|
-
autoload :RESTResponseParser, 'rest_response_parser'
|
|
127
|
-
|
|
128
|
-
autoload :ServiceInterface, 'service_interface'
|
|
129
|
-
autoload :Signer, 'signer'
|
|
130
|
-
autoload :UriEscape, 'uri_escape'
|
|
124
|
+
autoload :AsyncHandle, 'aws/core/async_handle'
|
|
125
|
+
autoload :Cacheable, 'aws/core/cacheable'
|
|
126
|
+
autoload :Client, 'aws/core/client'
|
|
127
|
+
autoload :Collection, 'aws/core/collection'
|
|
128
|
+
autoload :Configuration, 'aws/core/configuration'
|
|
129
|
+
autoload :CredentialProviders, 'aws/core/credential_providers'
|
|
130
|
+
autoload :Data, 'aws/core/data'
|
|
131
|
+
autoload :IndifferentHash, 'aws/core/indifferent_hash'
|
|
132
|
+
autoload :Inflection, 'aws/core/inflection'
|
|
133
|
+
autoload :JSONParser, 'aws/core/json_parser'
|
|
131
134
|
|
|
132
|
-
|
|
135
|
+
autoload :JSONClient, 'aws/core/json_client'
|
|
136
|
+
autoload :JSONRequestBuilder, 'aws/core/json_request_builder'
|
|
137
|
+
autoload :JSONResponseParser, 'aws/core/json_response_parser'
|
|
138
|
+
|
|
139
|
+
autoload :LazyErrorClasses, 'aws/core/lazy_error_classes'
|
|
140
|
+
autoload :LogFormatter, 'aws/core/log_formatter'
|
|
141
|
+
autoload :MetaUtils, 'aws/core/meta_utils'
|
|
142
|
+
autoload :ManagedFile, 'aws/core/managed_file'
|
|
143
|
+
autoload :Model, 'aws/core/model'
|
|
144
|
+
autoload :Naming, 'aws/core/naming'
|
|
145
|
+
autoload :OptionGrammar, 'aws/core/option_grammar'
|
|
146
|
+
autoload :PageResult, 'aws/core/page_result'
|
|
147
|
+
autoload :Policy, 'aws/core/policy'
|
|
148
|
+
|
|
149
|
+
autoload :QueryClient, 'aws/core/query_client'
|
|
150
|
+
autoload :QueryRequestBuilder, 'aws/core/query_request_builder'
|
|
151
|
+
autoload :QueryResponseParser, 'aws/core/query_response_parser'
|
|
152
|
+
|
|
153
|
+
autoload :Region, 'aws/core/region'
|
|
154
|
+
autoload :RegionCollection, 'aws/core/region_collection'
|
|
155
|
+
|
|
156
|
+
autoload :Resource, 'aws/core/resource'
|
|
157
|
+
autoload :ResourceCache, 'aws/core/resource_cache'
|
|
158
|
+
autoload :Response, 'aws/core/response'
|
|
159
|
+
autoload :ResponseCache, 'aws/core/response_cache'
|
|
160
|
+
|
|
161
|
+
autoload :RESTClient, 'aws/core/rest_xml_client'
|
|
162
|
+
autoload :RESTJSONClient, 'aws/core/rest_json_client'
|
|
163
|
+
autoload :RESTXMLClient, 'aws/core/rest_xml_client'
|
|
164
|
+
autoload :RESTRequestBuilder, 'aws/core/rest_request_builder'
|
|
165
|
+
autoload :RESTResponseParser, 'aws/core/rest_response_parser'
|
|
166
|
+
|
|
167
|
+
autoload :ServiceInterface, 'aws/core/service_interface'
|
|
168
|
+
autoload :Signer, 'aws/core/signer'
|
|
169
|
+
autoload :UriEscape, 'aws/core/uri_escape'
|
|
133
170
|
|
|
134
171
|
module Options
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
autoload :Validator, 'validator'
|
|
139
|
-
end
|
|
172
|
+
autoload :JSONSerializer, 'aws/core/options/json_serializer'
|
|
173
|
+
autoload :XMLSerializer, 'aws/core/options/xml_serializer'
|
|
174
|
+
autoload :Validator, 'aws/core/options/validator'
|
|
140
175
|
end
|
|
141
176
|
|
|
142
177
|
module Signature
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
autoload :Version4, 'version_4'
|
|
148
|
-
end
|
|
178
|
+
autoload :Version2, 'aws/core/signature/version_2'
|
|
179
|
+
autoload :Version3, 'aws/core/signature/version_3'
|
|
180
|
+
autoload :Version3HTTPS, 'aws/core/signature/version_3_https'
|
|
181
|
+
autoload :Version4, 'aws/core/signature/version_4'
|
|
149
182
|
end
|
|
150
183
|
|
|
151
184
|
module XML
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
end
|
|
185
|
+
|
|
186
|
+
autoload :Parser, 'aws/core/xml/parser'
|
|
187
|
+
autoload :Grammar, 'aws/core/xml/grammar'
|
|
188
|
+
autoload :Stub, 'aws/core/xml/stub'
|
|
189
|
+
autoload :Frame, 'aws/core/xml/frame'
|
|
190
|
+
autoload :RootFrame, 'aws/core/xml/root_frame'
|
|
191
|
+
autoload :FrameStack, 'aws/core/xml/frame_stack'
|
|
160
192
|
|
|
161
193
|
module SaxHandlers
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
autoload :REXML, 'rexml'
|
|
165
|
-
end
|
|
194
|
+
autoload :Nokogiri, 'aws/core/xml/sax_handlers/nokogiri'
|
|
195
|
+
autoload :REXML, 'aws/core/xml/sax_handlers/rexml'
|
|
166
196
|
end
|
|
167
197
|
|
|
168
198
|
end
|
|
169
199
|
|
|
170
200
|
module Http
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
end
|
|
201
|
+
autoload :ConnectionPool, 'aws/core/http/connection_pool'
|
|
202
|
+
autoload :Handler, 'aws/core/http/handler'
|
|
203
|
+
autoload :NetHttpHandler, 'aws/core/http/net_http_handler'
|
|
204
|
+
autoload :Request, 'aws/core/http/request'
|
|
205
|
+
autoload :Response, 'aws/core/http/response'
|
|
177
206
|
end
|
|
178
207
|
|
|
179
208
|
end
|
|
@@ -186,25 +215,24 @@ module AWS
|
|
|
186
215
|
# The global configuration for AWS. Generally you set your preferred
|
|
187
216
|
# configuration operations once after loading the aws-sdk gem.
|
|
188
217
|
#
|
|
189
|
-
#
|
|
190
|
-
#
|
|
191
|
-
#
|
|
192
|
-
#
|
|
193
|
-
#
|
|
194
|
-
# })
|
|
218
|
+
# AWS.config({
|
|
219
|
+
# :access_key_id => 'ACCESS_KEY_ID',
|
|
220
|
+
# :secret_access_key => 'SECRET_ACCESS_KEY',
|
|
221
|
+
# :region => 'us-west-2',
|
|
222
|
+
# })
|
|
195
223
|
#
|
|
196
224
|
# When using AWS classes they will always default to use configuration
|
|
197
225
|
# values defined in {AWS.config}.
|
|
198
226
|
#
|
|
199
|
-
#
|
|
227
|
+
# AWS.config(:max_retries => 2)
|
|
200
228
|
#
|
|
201
|
-
#
|
|
202
|
-
#
|
|
229
|
+
# sqs = AWS::SQS.new
|
|
230
|
+
# sqs.config.max_retries #=> 2
|
|
203
231
|
#
|
|
204
232
|
# If you want to change a configuration value for a single instance you
|
|
205
233
|
# pass the new configuration value to that object's initializer:
|
|
206
234
|
#
|
|
207
|
-
#
|
|
235
|
+
# AWS::SQS.new(:max_retries => 0)
|
|
208
236
|
#
|
|
209
237
|
# @note Changing the global configuration does not affect objects
|
|
210
238
|
# that have already been constructed.
|
|
@@ -220,50 +248,36 @@ module AWS
|
|
|
220
248
|
# @option options [String,nil] :session_token AWS secret token
|
|
221
249
|
# credential.
|
|
222
250
|
#
|
|
223
|
-
# @option options [String] :
|
|
224
|
-
# The service endpoint for Auto Scaling.
|
|
225
|
-
#
|
|
226
|
-
# @option options [String] :cloud_formation_endpoint ('cloudformation.us-east-1.amazonaws.com')
|
|
227
|
-
# The service endpoint for AWS CloudFormation.
|
|
228
|
-
#
|
|
229
|
-
# @option options [String] :cloud_front_endpoint ('cloudfront.amazonaws.com')
|
|
230
|
-
# The service endpoint for Amazon CloudFront.
|
|
231
|
-
#
|
|
232
|
-
# @option options [String] :cloud_search ('cloudsearch.us-east-1.amazonaws.com')
|
|
233
|
-
# The service endpoint for Amazon CloudSearch.
|
|
251
|
+
# @option options [String] :region ('us-east-1') The default AWS region.
|
|
234
252
|
#
|
|
235
|
-
# @option options [
|
|
236
|
-
# The service endpoint for Amazon CloudWatch.
|
|
237
|
-
#
|
|
238
|
-
# @option options [Boolean] :dynamo_db_big_decimals (true) When +true+,
|
|
253
|
+
# @option options [Boolean] :dynamo_db_big_decimals (true) When `true`,
|
|
239
254
|
# {DynamoDB} will convert number values returned by {DynamoDB::Client}
|
|
240
|
-
# from strings to BigDecimal objects. If you set this to
|
|
255
|
+
# from strings to BigDecimal objects. If you set this to `false`,
|
|
241
256
|
# they will be converted from strings into floats (with a potential
|
|
242
257
|
# loss of precision).
|
|
243
258
|
#
|
|
244
|
-
# @option options [String] :dynamo_db_endpoint ('dynamodb.amazonaws.com')
|
|
245
|
-
# The service endpoint for Amazon DynamoDB.
|
|
246
|
-
#
|
|
247
259
|
# @option options [Boolean] :dynamo_db_retry_throughput_errors (true) When
|
|
248
260
|
# true, AWS::DynamoDB::Errors::ProvisionedThroughputExceededException
|
|
249
261
|
# errors will be retried.
|
|
250
262
|
#
|
|
251
|
-
# @option options [
|
|
252
|
-
#
|
|
253
|
-
#
|
|
254
|
-
#
|
|
255
|
-
#
|
|
256
|
-
#
|
|
257
|
-
#
|
|
258
|
-
#
|
|
259
|
-
# @option options [
|
|
260
|
-
#
|
|
261
|
-
#
|
|
262
|
-
#
|
|
263
|
-
#
|
|
264
|
-
#
|
|
265
|
-
#
|
|
266
|
-
#
|
|
263
|
+
# @option options [Float] :http_continue_timeout (1) The number of
|
|
264
|
+
# seconds to wait for a "100-continue" response before sending the request
|
|
265
|
+
# payload. **This option has no effect unless the `:http_continue_threshold`
|
|
266
|
+
# is configured to a positive integer and the payload exeedes the
|
|
267
|
+
# threshold.** NOTE: currently there is a bug in Net::HTTP.
|
|
268
|
+
# You must call `AWS.patch_net_http_100_continue!` for this feature to work.
|
|
269
|
+
# Not supported in Ruby < 1.9.
|
|
270
|
+
#
|
|
271
|
+
# @option options [Integer,false] :http_continue_threshold (false) If a request
|
|
272
|
+
# body exceedes the `:http_continue_threshold` size (in bytes), then
|
|
273
|
+
# an "Expect" header will be added to the request with the value of
|
|
274
|
+
# "100-continue". This will cause the SDK to wait up to
|
|
275
|
+
# `:http_continue_timeout` seconds for a 100 Contiue HTTP response
|
|
276
|
+
# before sending the request payload. By default, this feature
|
|
277
|
+
# is disbled. Set this option to a positive number of bytes
|
|
278
|
+
# to enable 100 continues. NOTE: currently there is a bug in Net::HTTP.
|
|
279
|
+
# You must call `AWS.patch_net_http_100_continue!` for this feature to work.
|
|
280
|
+
# Not supported in Ruby < 1.9.
|
|
267
281
|
#
|
|
268
282
|
# @option options [Object] :http_handler (AWS::Core::Http::NetHttpHandler)
|
|
269
283
|
# The http handler that sends requests to AWS.
|
|
@@ -273,55 +287,49 @@ module AWS
|
|
|
273
287
|
# longer be used.
|
|
274
288
|
#
|
|
275
289
|
# @option options [Integer] :http_open_timeout (15) The number of seconds
|
|
276
|
-
# before the
|
|
290
|
+
# before the `:http_handler` should timeout while trying to open a new
|
|
277
291
|
# HTTP session.
|
|
278
292
|
#
|
|
279
293
|
# @option options [Integer] :http_read_timeout (60) The number of seconds
|
|
280
|
-
# before the
|
|
294
|
+
# before the `:http_handler` should timeout while waiting for a HTTP
|
|
281
295
|
# response.
|
|
282
296
|
#
|
|
283
|
-
# @option options [Boolean] :http_wire_trace (false) When
|
|
284
|
-
# http handler will log all wire traces to the
|
|
285
|
-
#
|
|
297
|
+
# @option options [Boolean] :http_wire_trace (false) When `true`, the
|
|
298
|
+
# http handler will log all wire traces to the `:logger`. If a
|
|
299
|
+
# `:logger` is not configured, then wire traces will be sent to
|
|
286
300
|
# standard out.
|
|
287
301
|
#
|
|
288
|
-
# @option options [String] :iam_endpoint ('iam.amazonaws.com') The
|
|
289
|
-
# service endpoint for AWS Identity Access Management (IAM).
|
|
290
|
-
#
|
|
291
|
-
# @option options [String] :import_export_endpoint ('importexport.amazonaws.com')
|
|
292
|
-
# The service endpoint for AWS Import/Export.
|
|
293
|
-
#
|
|
294
302
|
# @option options [Logger,nil] :logger (nil) A logger to send
|
|
295
303
|
# log messages to. Here is an example that logs to standard out.
|
|
296
304
|
#
|
|
297
|
-
#
|
|
298
|
-
#
|
|
305
|
+
# require 'logger'
|
|
306
|
+
# AWS.config(:logger => Logger.new($stdout))
|
|
299
307
|
#
|
|
300
308
|
# @option options [Symbol] :log_level (:info) The level log messages are
|
|
301
|
-
# sent to the logger with (e.g.
|
|
302
|
-
#
|
|
309
|
+
# sent to the logger with (e.g. `:notice`, `:info`, `:warn`,
|
|
310
|
+
# `:debug`, etc).
|
|
303
311
|
#
|
|
304
312
|
# @option options [Object] :log_formatter The log formatter is responsible
|
|
305
313
|
# for building log messages from responses. You can quickly change
|
|
306
314
|
# log formats by providing a pre-configured log formatter.
|
|
307
315
|
#
|
|
308
|
-
#
|
|
316
|
+
# AWS.config(:log_formatter => AWS::Core::LogFormatter.colored)
|
|
309
317
|
#
|
|
310
318
|
# Here is a list of pre-configured log formatters:
|
|
311
319
|
#
|
|
312
|
-
#
|
|
313
|
-
#
|
|
314
|
-
#
|
|
315
|
-
#
|
|
320
|
+
# * `AWS::Core::LogFormatter.default`
|
|
321
|
+
# * `AWS::Core::LogFormatter.short`
|
|
322
|
+
# * `AWS::Core::LogFormatter.debug`
|
|
323
|
+
# * `AWS::Core::LogFormatter.colored`
|
|
316
324
|
#
|
|
317
325
|
# You can also create an instance of AWS::Core::LogFormatter
|
|
318
326
|
# with a custom log message pattern. See {Core::LogFormatter} for
|
|
319
327
|
# a complete list of pattern substitutions.
|
|
320
328
|
#
|
|
321
|
-
#
|
|
322
|
-
#
|
|
329
|
+
# pattern = "[AWS :operation :duration] :error_message"
|
|
330
|
+
# AWS.config(:log_formatter => AWS::Core::LogFormatter.new(pattern))
|
|
323
331
|
#
|
|
324
|
-
# Lastly you can pass any object that responds to
|
|
332
|
+
# Lastly you can pass any object that responds to `#format` accepting
|
|
325
333
|
# and instance of {Core::Response} and returns a string.
|
|
326
334
|
#
|
|
327
335
|
# @option options [Integer] :max_retries (3) The maximum number of times
|
|
@@ -333,25 +341,10 @@ module AWS
|
|
|
333
341
|
# to send service requests through. You can pass a URI object or a
|
|
334
342
|
# URI string:
|
|
335
343
|
#
|
|
336
|
-
#
|
|
337
|
-
#
|
|
338
|
-
# @option options [String] :ops_works_endpoint ('opsworks.us-east-1.amazonaws.com')
|
|
339
|
-
# The service endpoint for AWS OpsWorks.
|
|
340
|
-
#
|
|
341
|
-
# @option options [String] :redshift_endpoint ('redshift.us-east-1.amazonaws.com')
|
|
342
|
-
# The service endpoint for Amazon Redshift.
|
|
343
|
-
#
|
|
344
|
-
# @option options [String] :rds_endpoint ('rds.us-east-1.amazonaws.com')
|
|
345
|
-
# The service endpoint for Amazon Relational Database Service (RDS).
|
|
346
|
-
#
|
|
347
|
-
# @option options [String] :route_53_endpoint ('route53.amazonaws.com')
|
|
348
|
-
# The service endpoint for Amazon Route 53.
|
|
349
|
-
#
|
|
350
|
-
# @option options [String] :s3_endpoint ('s3.amazonaws.com') The
|
|
351
|
-
# service endpoint for Amazon S3.
|
|
344
|
+
# AWS.config(:proxy_uri => 'https://user:password@my.proxy:443/path?query')
|
|
352
345
|
#
|
|
353
346
|
# @option options [Boolean] :s3_force_path_style (false) When
|
|
354
|
-
#
|
|
347
|
+
# `true`, requests will always use path style. This can be useful
|
|
355
348
|
# for testing environments.
|
|
356
349
|
#
|
|
357
350
|
# @option options [Integer] :s3_multipart_max_parts (10000) The maximum
|
|
@@ -359,9 +352,9 @@ module AWS
|
|
|
359
352
|
#
|
|
360
353
|
# @option options [Integer] :s3_multipart_threshold (16777216) When
|
|
361
354
|
# uploading data to S3, if the number of bytes to send exceeds
|
|
362
|
-
#
|
|
355
|
+
# `:s3_multipart_threshold` then a multi part session is automatically
|
|
363
356
|
# started and the data is sent up in chunks. The size of each part
|
|
364
|
-
# is specified by
|
|
357
|
+
# is specified by `:s3_multipart_min_part_size`. Defaults to
|
|
365
358
|
# 16777216 (16MB).
|
|
366
359
|
#
|
|
367
360
|
# @option options [Integer] :s3_multipart_min_part_size (5242880) The
|
|
@@ -370,18 +363,18 @@ module AWS
|
|
|
370
363
|
#
|
|
371
364
|
# @option options [Symbol] :s3_server_side_encryption (nil) The
|
|
372
365
|
# algorithm to use when encrypting object data on the server
|
|
373
|
-
# side. The only valid value is
|
|
366
|
+
# side. The only valid value is `:aes256`, which specifies that
|
|
374
367
|
# the object should be stored using the AES encryption algorithm
|
|
375
|
-
# with 256 bit keys. Defaults to
|
|
368
|
+
# with 256 bit keys. Defaults to `nil`, meaning server side
|
|
376
369
|
# encryption is not used unless specified on each individual
|
|
377
370
|
# call to upload an object. This option controls the default
|
|
378
371
|
# behavior for the following methods:
|
|
379
372
|
#
|
|
380
|
-
#
|
|
381
|
-
#
|
|
382
|
-
#
|
|
383
|
-
#
|
|
384
|
-
#
|
|
373
|
+
# * {S3::S3Object#write}
|
|
374
|
+
# * {S3::S3Object#multipart_upload}
|
|
375
|
+
# * {S3::S3Object#copy_from} and {S3::S3Object#copy_to}
|
|
376
|
+
# * {S3::S3Object#presigned_post}
|
|
377
|
+
# * {S3::Bucket#presigned_post}
|
|
385
378
|
#
|
|
386
379
|
# @option options [OpenSSL::PKey::RSA, String] :s3_encryption_key (nil)
|
|
387
380
|
# If this is set, AWS::S3::S3Object #read and #write methods will always
|
|
@@ -390,23 +383,14 @@ module AWS
|
|
|
390
383
|
# means that client-side encryption will not be used.
|
|
391
384
|
#
|
|
392
385
|
# @option options [Symbol] :s3_encryption_materials_location (:metadata)
|
|
393
|
-
# When set to
|
|
386
|
+
# When set to `:instruction_file`, AWS::S3::S3Object will store
|
|
394
387
|
# encryption materials in a separate object, instead of the object
|
|
395
388
|
# metadata.
|
|
396
389
|
#
|
|
397
|
-
# @option options [String] :simple_db_endpoint ('sdb.amazonaws.com')
|
|
398
|
-
# The service endpoint for Amazon SimpleDB.
|
|
399
|
-
#
|
|
400
390
|
# @option options [Boolean] :simple_db_consistent_reads (false) Determines
|
|
401
391
|
# if all SimpleDB read requests should be done consistently.
|
|
402
392
|
# Consistent reads are slower, but reflect all changes to SDB.
|
|
403
393
|
#
|
|
404
|
-
# @option options [String] :simple_email_service_endpoint ('email.us-east-1.amazonaws.com')
|
|
405
|
-
# The service endpoint for Amazon Simple Email Service.
|
|
406
|
-
#
|
|
407
|
-
# @option options [String] :simple_workflow_endpoint ('swf.us-east-1.amazonaws.com')
|
|
408
|
-
# The service endpoint for Amazon Simple Workflow Service.
|
|
409
|
-
#
|
|
410
394
|
# @option options [CredentialProviders::Provider] :credential_provider (AWS::Core::CredentialProviders::DefaultProvider.new)
|
|
411
395
|
# Returns the credential provider. The default credential provider
|
|
412
396
|
# attempts to check for statically assigned credentials, ENV credentials
|
|
@@ -415,7 +399,7 @@ module AWS
|
|
|
415
399
|
# @option options [String] :ssl_ca_file The path to a CA cert bundle in
|
|
416
400
|
# PEM format.
|
|
417
401
|
#
|
|
418
|
-
# If
|
|
402
|
+
# If `:ssl_verify_peer` is `true` (the default) this bundle will be
|
|
419
403
|
# used to validate the server certificate in each HTTPS request.
|
|
420
404
|
# The AWS SDK for Ruby ships with a CA cert bundle, which is the
|
|
421
405
|
# default value for this option.
|
|
@@ -423,31 +407,19 @@ module AWS
|
|
|
423
407
|
# @option options [String] :ssl_ca_path (nil)
|
|
424
408
|
# The path the a CA cert directory.
|
|
425
409
|
#
|
|
426
|
-
# @option options [Boolean] :ssl_verify_peer (true) When
|
|
410
|
+
# @option options [Boolean] :ssl_verify_peer (true) When `true`
|
|
427
411
|
# the HTTP handler validate server certificates for HTTPS requests.
|
|
428
412
|
#
|
|
429
413
|
# This option should only be disabled for diagnostic purposes;
|
|
430
|
-
# leaving this option set to
|
|
414
|
+
# leaving this option set to `false` exposes your application to
|
|
431
415
|
# man-in-the-middle attacks and can pose a serious security
|
|
432
416
|
# risk.
|
|
433
417
|
#
|
|
434
|
-
# @option options [Boolean] :stub_requests (false) When
|
|
418
|
+
# @option options [Boolean] :stub_requests (false) When `true` requests
|
|
435
419
|
# are not sent to AWS, instead empty responses are generated and
|
|
436
420
|
# returned to each service request.
|
|
437
421
|
#
|
|
438
|
-
# @option options [
|
|
439
|
-
# service endpoint for Amazon SNS.
|
|
440
|
-
#
|
|
441
|
-
# @option options [String] :sqs_endpoint ('sqs.us-east-1.amazonaws.com') The
|
|
442
|
-
# service endpoint for Amazon SQS.
|
|
443
|
-
#
|
|
444
|
-
# @option options [String] :storage_gateway_endpoint ('storagegateway.us-east-1.amazonaws.com')
|
|
445
|
-
# The service endpoint for AWS Storage Gateway.
|
|
446
|
-
#
|
|
447
|
-
# @option options [String] :sts_endpoint ('sts.amazonaws.com') The
|
|
448
|
-
# service endpoint for AWS Security Token Service.
|
|
449
|
-
#
|
|
450
|
-
# @option options [Boolean] :use_ssl (true) When +true+, all requests
|
|
422
|
+
# @option options [Boolean] :use_ssl (true) When `true`, all requests
|
|
451
423
|
# to AWS are sent using HTTPS instead vanilla HTTP.
|
|
452
424
|
#
|
|
453
425
|
# @option options [String] :user_agent_prefix (nil) A string prefix to
|
|
@@ -462,6 +434,31 @@ module AWS
|
|
|
462
434
|
@@config
|
|
463
435
|
end
|
|
464
436
|
|
|
437
|
+
# Returns a collection that represents public (non-gov-cloud) AWS
|
|
438
|
+
# regions. You can use this collection to get a specific region by name
|
|
439
|
+
# or to enumerate all regions.
|
|
440
|
+
#
|
|
441
|
+
# When enumerating regions, a single HTTP request is made to get a current
|
|
442
|
+
# list of regions (this is cached). When getting a region by name
|
|
443
|
+
# no requests are made.
|
|
444
|
+
#
|
|
445
|
+
# @example Getting a region by name
|
|
446
|
+
#
|
|
447
|
+
# region = AWS.regions['us-west-1']
|
|
448
|
+
# region.dynamo_db.tables.map(&:name)
|
|
449
|
+
#
|
|
450
|
+
# @example Enumerating all regions
|
|
451
|
+
#
|
|
452
|
+
# AWS.regions.each do |region|
|
|
453
|
+
# puts "EC2 Instances in #{region.name}:"
|
|
454
|
+
# puts region.ec2.instances.map(&:id)
|
|
455
|
+
# end
|
|
456
|
+
#
|
|
457
|
+
# @return [Core::RegionCollection]
|
|
458
|
+
def regions
|
|
459
|
+
Core::RegionCollection.new
|
|
460
|
+
end
|
|
461
|
+
|
|
465
462
|
# @note Memoization is currently only supported for the EC2 APIs;
|
|
466
463
|
# other APIs are unaffected by the status of memoization. To
|
|
467
464
|
# protect your code from future changes in memoization support,
|
|
@@ -510,18 +507,18 @@ module AWS
|
|
|
510
507
|
# For example, consider the following code to get the most
|
|
511
508
|
# recently launched EC2 instance:
|
|
512
509
|
#
|
|
513
|
-
#
|
|
510
|
+
# latest = ec2.instances.sort_by(&:launch_time).last
|
|
514
511
|
#
|
|
515
512
|
# The above code would make N+1 requests (where N is the number of
|
|
516
513
|
# instances in the account); iterating the collection of instances
|
|
517
|
-
# is one request, and
|
|
514
|
+
# is one request, and `Enumerable#sort_by` calls
|
|
518
515
|
# {AWS::EC2::Instance#launch_time} for each instance, causing
|
|
519
516
|
# another request per instance. We can rewrite the code as
|
|
520
517
|
# follows to make only one request:
|
|
521
518
|
#
|
|
522
|
-
#
|
|
523
|
-
#
|
|
524
|
-
#
|
|
519
|
+
# latest = AWS.memoize do
|
|
520
|
+
# ec2.instances.sort_by(&:launch_time).last
|
|
521
|
+
# end
|
|
525
522
|
#
|
|
526
523
|
# Iterating the collection still causes a request, but each
|
|
527
524
|
# subsequent call to {AWS::EC2::Instance#launch_time} uses the
|
|
@@ -534,17 +531,17 @@ module AWS
|
|
|
534
531
|
# relatively small numbers of requests. The cached responses are
|
|
535
532
|
# used in two ways while memoization is enabled:
|
|
536
533
|
#
|
|
537
|
-
#
|
|
538
|
-
#
|
|
539
|
-
#
|
|
540
|
-
#
|
|
541
|
-
#
|
|
534
|
+
# * Before making a request, the SDK checks the cache for a
|
|
535
|
+
# response to a request with the same signature (credentials,
|
|
536
|
+
# service endpoint, operation name, and parameters). If such a
|
|
537
|
+
# response is found, it is used instead of making a new
|
|
538
|
+
# request.
|
|
542
539
|
#
|
|
543
|
-
#
|
|
544
|
-
#
|
|
545
|
-
#
|
|
546
|
-
#
|
|
547
|
-
#
|
|
540
|
+
# * Before retrieving data for an attribute of a resource
|
|
541
|
+
# (e.g. {AWS::EC2::Instance#launch_time}), the SDK attempts to
|
|
542
|
+
# find a cached response that contains the requested data. If
|
|
543
|
+
# such a response is found, the cached data is returned instead
|
|
544
|
+
# of making a new request.
|
|
548
545
|
#
|
|
549
546
|
# When memoization is disabled, all previously cached responses
|
|
550
547
|
# are discarded.
|
|
@@ -583,5 +580,26 @@ module AWS
|
|
|
583
580
|
nil
|
|
584
581
|
end
|
|
585
582
|
|
|
583
|
+
# Eagerly loads all AWS classes/modules registered with autoload.
|
|
584
|
+
# @return [nil]
|
|
585
|
+
def eager_autoload! klass_or_module = AWS
|
|
586
|
+
klass_or_module.constants.each do |const_name|
|
|
587
|
+
if path = klass_or_module.autoload?(const_name)
|
|
588
|
+
require(path)
|
|
589
|
+
if const = klass_or_module.const_get(const_name) and const.is_a?(Module)
|
|
590
|
+
eager_autoload!(const)
|
|
591
|
+
end
|
|
592
|
+
end
|
|
593
|
+
end
|
|
594
|
+
end
|
|
595
|
+
|
|
596
|
+
# Patches Net::HTTP, fixing a bug in how it handles non 100-continue
|
|
597
|
+
# responses while waiting for a 100-continue.
|
|
598
|
+
def patch_net_http_100_continue!
|
|
599
|
+
require 'aws/core/http/patch'
|
|
600
|
+
AWS::Core::Http.patch_net_http_100_continue!
|
|
601
|
+
nil
|
|
602
|
+
end
|
|
603
|
+
|
|
586
604
|
end
|
|
587
605
|
end
|