fog-aws 3.5.0 → 3.28.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 +4 -4
- data/CHANGELOG.md +12 -765
- data/LICENSE.md +1 -1
- data/README.md +117 -7
- data/fog-aws.gemspec +14 -11
- data/lib/fog/aws/auto_scaling.rb +1 -1
- data/lib/fog/aws/beanstalk.rb +1 -1
- data/lib/fog/aws/cdn.rb +1 -1
- data/lib/fog/aws/cloud_formation.rb +1 -1
- data/lib/fog/aws/cloud_watch.rb +1 -1
- data/lib/fog/aws/compute.rb +8 -5
- data/lib/fog/aws/credential_fetcher.rb +89 -7
- data/lib/fog/aws/data_pipeline.rb +1 -1
- data/lib/fog/aws/dns.rb +137 -1
- data/lib/fog/aws/dynamodb.rb +1 -1
- data/lib/fog/aws/ecs.rb +1 -1
- data/lib/fog/aws/elasticache.rb +6 -4
- data/lib/fog/aws/elb.rb +2 -2
- data/lib/fog/aws/elbv2.rb +72 -0
- data/lib/fog/aws/emr.rb +1 -1
- data/lib/fog/aws/glacier.rb +84 -22
- data/lib/fog/aws/iam.rb +1 -1
- data/lib/fog/aws/kinesis.rb +24 -16
- data/lib/fog/aws/kms.rb +1 -1
- data/lib/fog/aws/lambda.rb +1 -1
- data/lib/fog/aws/models/compute/dhcp_option.rb +1 -1
- data/lib/fog/aws/models/compute/flavors.rb +3803 -531
- data/lib/fog/aws/models/compute/network_interfaces.rb +1 -1
- data/lib/fog/aws/models/compute/security_group.rb +13 -5
- data/lib/fog/aws/models/compute/server.rb +6 -2
- data/lib/fog/aws/models/compute/servers.rb +2 -0
- data/lib/fog/aws/models/compute/snapshot.rb +7 -6
- data/lib/fog/aws/models/compute/vpc.rb +8 -2
- data/lib/fog/aws/models/elasticache/cluster.rb +1 -1
- data/lib/fog/aws/models/storage/directories.rb +1 -0
- data/lib/fog/aws/models/storage/directory.rb +0 -1
- data/lib/fog/aws/models/storage/file.rb +168 -23
- data/lib/fog/aws/models/storage/files.rb +33 -2
- data/lib/fog/aws/parsers/compute/create_snapshot.rb +1 -1
- data/lib/fog/aws/parsers/compute/create_subnet.rb +33 -6
- data/lib/fog/aws/parsers/compute/describe_security_groups.rb +18 -4
- data/lib/fog/aws/parsers/compute/describe_subnets.rb +33 -6
- data/lib/fog/aws/parsers/dns/create_hosted_zone.rb +1 -1
- data/lib/fog/aws/parsers/dns/get_hosted_zone.rb +3 -3
- data/lib/fog/aws/parsers/dns/list_hosted_zones.rb +3 -1
- data/lib/fog/aws/parsers/elbv2/create_load_balancer.rb +88 -0
- data/lib/fog/aws/parsers/elbv2/describe_listeners.rb +110 -0
- data/lib/fog/aws/parsers/elbv2/describe_load_balancers.rb +88 -0
- data/lib/fog/aws/parsers/elbv2/describe_tags.rb +53 -0
- data/lib/fog/aws/parsers/elbv2/empty.rb +10 -0
- data/lib/fog/aws/parsers/iam/get_group_policy.rb +1 -1
- data/lib/fog/aws/parsers/iam/get_role_policy.rb +1 -1
- data/lib/fog/aws/parsers/iam/get_user_policy.rb +1 -1
- data/lib/fog/aws/parsers/iam/list_server_certificates.rb +1 -1
- data/lib/fog/aws/parsers/iam/policy_version.rb +1 -1
- data/lib/fog/aws/parsers/rds/db_cluster_parser.rb +1 -1
- data/lib/fog/aws/parsers/rds/db_parser.rb +1 -1
- data/lib/fog/aws/parsers/rds/modify_db_subnet_group.rb +1 -1
- data/lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb +1 -1
- data/lib/fog/aws/parsers/storage/get_object_tagging.rb +33 -0
- data/lib/fog/aws/parsers/storage/upload_part_copy_object.rb +18 -0
- data/lib/fog/aws/parsers/sts/assume_role_with_web_identity.rb +1 -1
- data/lib/fog/aws/rds.rb +1 -1
- data/lib/fog/aws/redshift.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/attach_load_balancer_target_groups.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/describe_scaling_activities.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +1 -1
- data/lib/fog/aws/requests/cloud_formation/create_change_set.rb +1 -1
- data/lib/fog/aws/requests/cloud_formation/create_stack.rb +1 -1
- data/lib/fog/aws/requests/cloud_formation/get_template_summary.rb +1 -1
- data/lib/fog/aws/requests/cloud_formation/update_stack.rb +1 -1
- data/lib/fog/aws/requests/cloud_watch/list_metrics.rb +1 -1
- data/lib/fog/aws/requests/compute/authorize_security_group_egress.rb +1 -1
- data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +16 -1
- data/lib/fog/aws/requests/compute/create_network_interface.rb +8 -5
- data/lib/fog/aws/requests/compute/create_subnet.rb +3 -3
- data/lib/fog/aws/requests/compute/create_vpc.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_network_interfaces.rb +2 -2
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -0
- data/lib/fog/aws/requests/compute/modify_network_interface_attribute.rb +1 -1
- data/lib/fog/aws/requests/compute/modify_volume.rb +1 -1
- data/lib/fog/aws/requests/compute/request_spot_instances.rb +1 -1
- data/lib/fog/aws/requests/compute/revoke_security_group_egress.rb +1 -1
- data/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/compute/run_instances.rb +64 -0
- data/lib/fog/aws/requests/compute/stop_instances.rb +11 -3
- data/lib/fog/aws/requests/data_pipeline/deactivate_pipeline.rb +1 -1
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +0 -133
- data/lib/fog/aws/requests/ecs/list_task_definitions.rb +1 -1
- data/lib/fog/aws/requests/efs/create_file_system.rb +1 -1
- data/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +2 -2
- data/lib/fog/aws/requests/elasticache/describe_engine_default_parameters.rb +1 -1
- data/lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb +1 -1
- data/lib/fog/aws/requests/elbv2/add_tags.rb +45 -0
- data/lib/fog/aws/requests/elbv2/create_load_balancer.rb +160 -0
- data/lib/fog/aws/requests/elbv2/describe_listeners.rb +38 -0
- data/lib/fog/aws/requests/elbv2/describe_load_balancers.rb +100 -0
- data/lib/fog/aws/requests/elbv2/describe_tags.rb +50 -0
- data/lib/fog/aws/requests/elbv2/remove_tags.rb +45 -0
- data/lib/fog/aws/requests/glacier/initiate_job.rb +1 -1
- data/lib/fog/aws/requests/glacier/initiate_multipart_upload.rb +1 -1
- data/lib/fog/aws/requests/kinesis/list_streams.rb +1 -1
- data/lib/fog/aws/requests/lambda/invoke.rb +7 -7
- data/lib/fog/aws/requests/rds/add_tags_to_resource.rb +12 -10
- data/lib/fog/aws/requests/rds/authorize_db_security_group_ingress.rb +2 -2
- data/lib/fog/aws/requests/rds/create_db_cluster.rb +1 -1
- data/lib/fog/aws/requests/rds/describe_db_snapshots.rb +1 -1
- data/lib/fog/aws/requests/rds/list_tags_for_resource.rb +10 -7
- data/lib/fog/aws/requests/rds/modify_db_instance.rb +1 -1
- data/lib/fog/aws/requests/rds/modify_db_parameter_group.rb +1 -1
- data/lib/fog/aws/requests/rds/remove_tags_from_resource.rb +9 -8
- data/lib/fog/aws/requests/ses/send_raw_email.rb +1 -1
- data/lib/fog/aws/requests/sqs/change_message_visibility.rb +1 -1
- data/lib/fog/aws/requests/sqs/delete_message.rb +1 -1
- data/lib/fog/aws/requests/storage/copy_object.rb +2 -1
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +18 -8
- data/lib/fog/aws/requests/storage/get_bucket.rb +2 -2
- data/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object.rb +1 -1
- data/lib/fog/aws/requests/storage/get_object_tagging.rb +41 -0
- data/lib/fog/aws/requests/storage/get_service.rb +1 -1
- data/lib/fog/aws/requests/storage/list_parts.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket.rb +0 -4
- data/lib/fog/aws/requests/storage/put_bucket_lifecycle.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_notification.rb +1 -1
- data/lib/fog/aws/requests/storage/put_object.rb +1 -1
- data/lib/fog/aws/requests/storage/put_object_tagging.rb +42 -0
- data/lib/fog/aws/requests/storage/shared_mock_methods.rb +2 -1
- data/lib/fog/aws/requests/storage/sync_clock.rb +9 -1
- data/lib/fog/aws/requests/storage/upload_part_copy.rb +119 -0
- data/lib/fog/aws/requests/sts/assume_role_with_web_identity.rb +7 -6
- data/lib/fog/aws/ses.rb +20 -17
- data/lib/fog/aws/signaturev4.rb +1 -1
- data/lib/fog/aws/simpledb.rb +1 -1
- data/lib/fog/aws/sns.rb +1 -1
- data/lib/fog/aws/sqs.rb +1 -1
- data/lib/fog/aws/storage.rb +78 -13
- data/lib/fog/aws/support.rb +1 -1
- data/lib/fog/aws/version.rb +1 -1
- data/lib/fog/aws.rb +11 -2
- metadata +49 -294
- data/.gitignore +0 -16
- data/.travis.yml +0 -53
- data/Gemfile +0 -14
- data/Rakefile +0 -14
- data/gemfiles/Gemfile-edge +0 -14
- data/gemfiles/Gemfile-ruby-2.0 +0 -7
- data/stale.yml +0 -17
- data/tests/credentials_tests.rb +0 -87
- data/tests/helper.rb +0 -29
- data/tests/helpers/collection_helper.rb +0 -90
- data/tests/helpers/compute/flavors_helper.rb +0 -28
- data/tests/helpers/compute/server_helper.rb +0 -23
- data/tests/helpers/compute/servers_helper.rb +0 -8
- data/tests/helpers/dns_helper.rb +0 -56
- data/tests/helpers/formats_helper.rb +0 -100
- data/tests/helpers/formats_helper_tests.rb +0 -107
- data/tests/helpers/mock_helper.rb +0 -109
- data/tests/helpers/model_helper.rb +0 -30
- data/tests/helpers/responds_to_helper.rb +0 -11
- data/tests/helpers/schema_validator_tests.rb +0 -104
- data/tests/helpers/succeeds_helper.rb +0 -9
- data/tests/lorem.txt +0 -1
- data/tests/models/auto_scaling/activities_tests.rb +0 -6
- data/tests/models/auto_scaling/configuration_test.rb +0 -13
- data/tests/models/auto_scaling/configurations_tests.rb +0 -11
- data/tests/models/auto_scaling/groups_test.rb +0 -27
- data/tests/models/auto_scaling/helper.rb +0 -0
- data/tests/models/auto_scaling/instance_tests.rb +0 -15
- data/tests/models/auto_scaling/instances_tests.rb +0 -6
- data/tests/models/beanstalk/application_tests.rb +0 -69
- data/tests/models/beanstalk/applications_tests.rb +0 -7
- data/tests/models/beanstalk/environment_tests.rb +0 -131
- data/tests/models/beanstalk/environments_tests.rb +0 -34
- data/tests/models/beanstalk/template_tests.rb +0 -47
- data/tests/models/beanstalk/templates_tests.rb +0 -62
- data/tests/models/beanstalk/version_tests.rb +0 -66
- data/tests/models/beanstalk/versions_tests.rb +0 -60
- data/tests/models/cdn/distribution_tests.rb +0 -15
- data/tests/models/cdn/distributions_tests.rb +0 -15
- data/tests/models/cdn/invalidation_tests.rb +0 -31
- data/tests/models/cdn/invalidations_tests.rb +0 -14
- data/tests/models/cdn/streaming_distribution_tests.rb +0 -15
- data/tests/models/cdn/streaming_distributions_tests.rb +0 -15
- data/tests/models/cloud_watch/alarm_data_tests.rb +0 -42
- data/tests/models/cloud_watch/alarm_history_tests.rb +0 -22
- data/tests/models/cloud_watch/metric_statistics_tests.rb +0 -51
- data/tests/models/cloud_watch/metrics_tests.rb +0 -32
- data/tests/models/compute/address_tests.rb +0 -43
- data/tests/models/compute/addresses_tests.rb +0 -5
- data/tests/models/compute/dhcp_option_tests.rb +0 -3
- data/tests/models/compute/dhcp_options_tests.rb +0 -3
- data/tests/models/compute/internet_gateway_tests.rb +0 -3
- data/tests/models/compute/internet_gateways_tests.rb +0 -3
- data/tests/models/compute/key_pair_tests.rb +0 -26
- data/tests/models/compute/key_pairs_tests.rb +0 -5
- data/tests/models/compute/network_acl_tests.rb +0 -109
- data/tests/models/compute/network_acls_tests.rb +0 -20
- data/tests/models/compute/network_interfaces_test.rb +0 -12
- data/tests/models/compute/security_group_tests.rb +0 -98
- data/tests/models/compute/security_groups_tests.rb +0 -5
- data/tests/models/compute/server_tests.rb +0 -94
- data/tests/models/compute/snapshot_tests.rb +0 -10
- data/tests/models/compute/snapshots_tests.rb +0 -10
- data/tests/models/compute/subnet_tests.rb +0 -13
- data/tests/models/compute/subnets_tests.rb +0 -5
- data/tests/models/compute/volume_tests.rb +0 -65
- data/tests/models/compute/volumes_tests.rb +0 -5
- data/tests/models/compute/vpc_tests.rb +0 -26
- data/tests/models/compute/vpcs_tests.rb +0 -19
- data/tests/models/data_pipeline/pipeline_tests.rb +0 -8
- data/tests/models/data_pipeline/pipelines_tests.rb +0 -8
- data/tests/models/dns/record_tests.rb +0 -33
- data/tests/models/dns/records_tests.rb +0 -41
- data/tests/models/dns/zone_tests.rb +0 -4
- data/tests/models/dns/zones_tests.rb +0 -4
- data/tests/models/efs/file_system_tests.rb +0 -12
- data/tests/models/efs/mount_target_tests.rb +0 -45
- data/tests/models/efs/mount_targets_tests.rb +0 -30
- data/tests/models/elasticache/cluster_tests.rb +0 -30
- data/tests/models/elasticache/parameter_groups_tests.rb +0 -15
- data/tests/models/elasticache/security_groups_tests.rb +0 -52
- data/tests/models/elasticache/subnet_groups_tests.rb +0 -43
- data/tests/models/elb/model_tests.rb +0 -360
- data/tests/models/elb/tagging_tests.rb +0 -15
- data/tests/models/glacier/model_tests.rb +0 -47
- data/tests/models/iam/access_keys_tests.rb +0 -53
- data/tests/models/iam/groups_tests.rb +0 -59
- data/tests/models/iam/instance_profile_tests.rb +0 -18
- data/tests/models/iam/managed_policies_tests.rb +0 -89
- data/tests/models/iam/policies_tests.rb +0 -57
- data/tests/models/iam/roles_tests.rb +0 -71
- data/tests/models/iam/users_tests.rb +0 -119
- data/tests/models/rds/cluster_tests.rb +0 -54
- data/tests/models/rds/clusters_tests.rb +0 -5
- data/tests/models/rds/event_subscription_tests.rb +0 -9
- data/tests/models/rds/event_subscriptions_tests.rb +0 -6
- data/tests/models/rds/helper.rb +0 -25
- data/tests/models/rds/instance_option_tests.rb +0 -14
- data/tests/models/rds/parameter_group_tests.rb +0 -24
- data/tests/models/rds/parameter_groups_tests.rb +0 -8
- data/tests/models/rds/security_group_tests.rb +0 -77
- data/tests/models/rds/security_groups_tests.rb +0 -5
- data/tests/models/rds/server_tests.rb +0 -131
- data/tests/models/rds/servers_tests.rb +0 -24
- data/tests/models/rds/snapshot_tests.rb +0 -12
- data/tests/models/rds/snapshots_tests.rb +0 -12
- data/tests/models/rds/tagging_tests.rb +0 -20
- data/tests/models/sns/topic_tests.rb +0 -15
- data/tests/models/sns/topics_tests.rb +0 -6
- data/tests/models/storage/directory_tests.rb +0 -91
- data/tests/models/storage/file_tests.rb +0 -129
- data/tests/models/storage/files_tests.rb +0 -58
- data/tests/models/storage/url_tests.rb +0 -25
- data/tests/models/storage/version_tests.rb +0 -52
- data/tests/models/storage/versions_tests.rb +0 -51
- data/tests/models/support/trusted_advisor_tests.rb +0 -25
- data/tests/parsers/compute/describe_images_tests.rb +0 -33
- data/tests/parsers/elb/describe_load_balancers.rb +0 -65
- data/tests/requests/auto_scaling/auto_scaling_tests.rb +0 -111
- data/tests/requests/auto_scaling/describe_types_tests.rb +0 -102
- data/tests/requests/auto_scaling/helper.rb +0 -229
- data/tests/requests/auto_scaling/model_tests.rb +0 -235
- data/tests/requests/auto_scaling/notification_configuration_tests.rb +0 -124
- data/tests/requests/auto_scaling/tag_tests.rb +0 -63
- data/tests/requests/beanstalk/application_tests.rb +0 -140
- data/tests/requests/beanstalk/solution_stack_tests.rb +0 -22
- data/tests/requests/cdn/cdn_tests.rb +0 -252
- data/tests/requests/cloud_formation/stack_tests.rb +0 -167
- data/tests/requests/cloud_watch/get_metric_statistics_tests.rb +0 -28
- data/tests/requests/cloud_watch/list_metrics_test.rb +0 -64
- data/tests/requests/cloud_watch/put_metric_data_tests.rb +0 -36
- data/tests/requests/compute/address_tests.rb +0 -144
- data/tests/requests/compute/assign_private_ip_tests.rb +0 -55
- data/tests/requests/compute/availability_zone_tests.rb +0 -25
- data/tests/requests/compute/client_tests.rb +0 -25
- data/tests/requests/compute/dhcp_options_tests.rb +0 -39
- data/tests/requests/compute/helper.rb +0 -27
- data/tests/requests/compute/image_tests.rb +0 -169
- data/tests/requests/compute/instance_attrib_tests.rb +0 -168
- data/tests/requests/compute/instance_tests.rb +0 -338
- data/tests/requests/compute/internet_gateway_tests.rb +0 -49
- data/tests/requests/compute/key_pair_tests.rb +0 -67
- data/tests/requests/compute/network_acl_tests.rb +0 -112
- data/tests/requests/compute/network_interface_tests.rb +0 -239
- data/tests/requests/compute/placement_group_tests.rb +0 -48
- data/tests/requests/compute/region_tests.rb +0 -52
- data/tests/requests/compute/route_tests.rb +0 -341
- data/tests/requests/compute/security_group_tests.rb +0 -446
- data/tests/requests/compute/snapshot_tests.rb +0 -77
- data/tests/requests/compute/spot_datafeed_subscription_tests.rb +0 -47
- data/tests/requests/compute/spot_instance_tests.rb +0 -55
- data/tests/requests/compute/spot_price_history_tests.rb +0 -23
- data/tests/requests/compute/subnet_tests.rb +0 -87
- data/tests/requests/compute/tag_tests.rb +0 -101
- data/tests/requests/compute/volume_tests.rb +0 -263
- data/tests/requests/compute/vpc_tests.rb +0 -216
- data/tests/requests/data_pipeline/helper.rb +0 -78
- data/tests/requests/data_pipeline/pipeline_tests.rb +0 -80
- data/tests/requests/dns/change_resource_record_sets_tests.rb +0 -34
- data/tests/requests/dns/dns_tests.rb +0 -240
- data/tests/requests/dns/health_check_tests.rb +0 -159
- data/tests/requests/dns/helper.rb +0 -21
- data/tests/requests/dynamodb/item_tests.rb +0 -137
- data/tests/requests/dynamodb/table_tests.rb +0 -99
- data/tests/requests/ecs/cluster_tests.rb +0 -112
- data/tests/requests/ecs/container_instance_tests.rb +0 -119
- data/tests/requests/ecs/helper.rb +0 -276
- data/tests/requests/ecs/sample_task_definition1.json +0 -56
- data/tests/requests/ecs/service_tests.rb +0 -132
- data/tests/requests/ecs/task_definitions_tests.rb +0 -97
- data/tests/requests/ecs/task_tests.rb +0 -145
- data/tests/requests/efs/file_system_tests.rb +0 -152
- data/tests/requests/efs/helper.rb +0 -44
- data/tests/requests/elasticache/cache_cluster_tests.rb +0 -137
- data/tests/requests/elasticache/describe_events.rb +0 -17
- data/tests/requests/elasticache/describe_reserved_cache_nodes.rb +0 -17
- data/tests/requests/elasticache/helper.rb +0 -103
- data/tests/requests/elasticache/parameter_group_tests.rb +0 -105
- data/tests/requests/elasticache/security_group_tests.rb +0 -108
- data/tests/requests/elasticache/subnet_group_tests.rb +0 -52
- data/tests/requests/elb/helper.rb +0 -91
- data/tests/requests/elb/listener_tests.rb +0 -68
- data/tests/requests/elb/load_balancer_tests.rb +0 -89
- data/tests/requests/elb/policy_tests.rb +0 -132
- data/tests/requests/emr/helper.rb +0 -167
- data/tests/requests/emr/instance_group_tests.rb +0 -106
- data/tests/requests/emr/job_flow_tests.rb +0 -88
- data/tests/requests/federation/get_signin_token_tests.rb +0 -11
- data/tests/requests/glacier/archive_tests.rb +0 -13
- data/tests/requests/glacier/multipart_upload_tests.rb +0 -29
- data/tests/requests/glacier/tree_hash_tests.rb +0 -62
- data/tests/requests/glacier/vault_tests.rb +0 -35
- data/tests/requests/iam/access_key_tests.rb +0 -53
- data/tests/requests/iam/account_policy_tests.rb +0 -20
- data/tests/requests/iam/account_tests.rb +0 -34
- data/tests/requests/iam/group_policy_tests.rb +0 -48
- data/tests/requests/iam/group_tests.rb +0 -44
- data/tests/requests/iam/helper.rb +0 -154
- data/tests/requests/iam/instance_profile_tests.rb +0 -44
- data/tests/requests/iam/login_profile_tests.rb +0 -62
- data/tests/requests/iam/managed_policy_tests.rb +0 -110
- data/tests/requests/iam/mfa_tests.rb +0 -23
- data/tests/requests/iam/role_tests.rb +0 -156
- data/tests/requests/iam/server_certificate_tests.rb +0 -130
- data/tests/requests/iam/user_policy_tests.rb +0 -45
- data/tests/requests/iam/user_tests.rb +0 -78
- data/tests/requests/iam/versioned_managed_policy_tests.rb +0 -105
- data/tests/requests/kinesis/helper.rb +0 -111
- data/tests/requests/kinesis/stream_tests.rb +0 -169
- data/tests/requests/kms/helper.rb +0 -27
- data/tests/requests/kms/key_tests.rb +0 -23
- data/tests/requests/lambda/function_sample_1.js +0 -9
- data/tests/requests/lambda/function_sample_2.js +0 -9
- data/tests/requests/lambda/function_tests.rb +0 -460
- data/tests/requests/lambda/helper.rb +0 -81
- data/tests/requests/rds/cluster_snapshot_tests.rb +0 -43
- data/tests/requests/rds/cluster_tests.rb +0 -37
- data/tests/requests/rds/db_engine_versions.rb +0 -7
- data/tests/requests/rds/db_snapshot_tests.rb +0 -62
- data/tests/requests/rds/describe_events.rb +0 -16
- data/tests/requests/rds/event_subscription_tests.rb +0 -30
- data/tests/requests/rds/helper.rb +0 -406
- data/tests/requests/rds/instance_option_tests.rb +0 -27
- data/tests/requests/rds/instance_tests.rb +0 -149
- data/tests/requests/rds/log_file_tests.rb +0 -19
- data/tests/requests/rds/parameter_group_tests.rb +0 -62
- data/tests/requests/rds/parameter_request_tests.rb +0 -32
- data/tests/requests/rds/security_group_tests.rb +0 -101
- data/tests/requests/rds/subnet_groups_tests.rb +0 -52
- data/tests/requests/rds/tagging_tests.rb +0 -78
- data/tests/requests/redshift/cluster_parameter_group_tests.rb +0 -76
- data/tests/requests/redshift/cluster_security_group_tests.rb +0 -42
- data/tests/requests/redshift/cluster_snapshot_tests.rb +0 -73
- data/tests/requests/redshift/cluster_tests.rb +0 -80
- data/tests/requests/ses/helper.rb +0 -9
- data/tests/requests/ses/verified_domain_identity_tests.rb +0 -16
- data/tests/requests/ses/verified_email_address_tests.rb +0 -27
- data/tests/requests/simpledb/attributes_tests.rb +0 -86
- data/tests/requests/simpledb/domain_tests.rb +0 -51
- data/tests/requests/simpledb/helper.rb +0 -10
- data/tests/requests/sns/helper.rb +0 -9
- data/tests/requests/sns/subscription_tests.rb +0 -86
- data/tests/requests/sns/topic_tests.rb +0 -53
- data/tests/requests/sqs/helper.rb +0 -9
- data/tests/requests/sqs/message_tests.rb +0 -51
- data/tests/requests/sqs/queue_tests.rb +0 -50
- data/tests/requests/storage/acl_utils_tests.rb +0 -209
- data/tests/requests/storage/bucket_tests.rb +0 -416
- data/tests/requests/storage/cors_utils_tests.rb +0 -108
- data/tests/requests/storage/delete_multiple_objects_tests.rb +0 -12
- data/tests/requests/storage/multipart_upload_tests.rb +0 -121
- data/tests/requests/storage/object_tests.rb +0 -262
- data/tests/requests/storage/versioning_tests.rb +0 -262
- data/tests/requests/sts/assume_role_tests.rb +0 -19
- data/tests/requests/sts/assume_role_with_saml_tests.rb +0 -18
- data/tests/requests/sts/assume_role_with_web_identity_tests.rb +0 -28
- data/tests/requests/sts/get_federation_token_tests.rb +0 -20
- data/tests/requests/sts/session_token_tests.rb +0 -16
- data/tests/requests/support/helper.rb +0 -43
- data/tests/requests/support/trusted_advisor_check_tests.rb +0 -16
- data/tests/signaturev4_tests.rb +0 -106
- data/tests/signed_params_tests.rb +0 -17
- data/tests/storage_tests.rb +0 -7
@@ -11,11 +11,12 @@ module Fog
|
|
11
11
|
# * response<~Excon::Response>:
|
12
12
|
# * body<~Hash>:
|
13
13
|
def remove_tags_from_resource(rds_id, keys)
|
14
|
+
resource_name = "arn:aws:rds:#{@region}:#{owner_id}:db:#{rds_id}"
|
15
|
+
%w[us-gov-west-1 us-gov-east-1].include?(@region) ? resource_name.insert(7, '-us-gov') : resource_name
|
14
16
|
request(
|
15
|
-
{ 'Action'
|
16
|
-
'ResourceName'
|
17
|
-
:parser
|
18
|
-
}.merge(Fog::AWS.indexed_param('TagKeys.member.%d', keys))
|
17
|
+
{ 'Action' => 'RemoveTagsFromResource',
|
18
|
+
'ResourceName' => resource_name,
|
19
|
+
:parser => Fog::Parsers::AWS::RDS::Base.new }.merge(Fog::AWS.indexed_param('TagKeys.member.%d', keys))
|
19
20
|
)
|
20
21
|
end
|
21
22
|
end
|
@@ -23,15 +24,15 @@ module Fog
|
|
23
24
|
class Mock
|
24
25
|
def remove_tags_from_resource(rds_id, keys)
|
25
26
|
response = Excon::Response.new
|
26
|
-
if server =
|
27
|
-
keys.each {|key|
|
27
|
+
if server = data[:servers][rds_id]
|
28
|
+
keys.each { |key| data[:tags][rds_id].delete key }
|
28
29
|
response.status = 200
|
29
30
|
response.body = {
|
30
|
-
|
31
|
+
'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id }
|
31
32
|
}
|
32
33
|
response
|
33
34
|
else
|
34
|
-
raise Fog::AWS::RDS::NotFound
|
35
|
+
raise Fog::AWS::RDS::NotFound, "DBInstance #{rds_id} not found"
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
@@ -9,7 +9,7 @@ module Fog
|
|
9
9
|
# ==== Parameters
|
10
10
|
# * RawMessage <~String> - The message to be sent.
|
11
11
|
# * Options <~Hash>
|
12
|
-
# * Source <~String> - The sender's email address. Takes
|
12
|
+
# * Source <~String> - The sender's email address. Takes precedence over Return-Path if specified in RawMessage
|
13
13
|
# * Destinations <~Array> - All destinations for this email.
|
14
14
|
#
|
15
15
|
# ==== Returns
|
@@ -8,7 +8,7 @@ module Fog
|
|
8
8
|
#
|
9
9
|
# ==== Parameters
|
10
10
|
# * queue_url<~String> - Url of queue for message to update
|
11
|
-
# * receipt_handle<~String> - Token from previous
|
11
|
+
# * receipt_handle<~String> - Token from previous receive message
|
12
12
|
# * visibility_timeout<~Integer> - New visibility timeout in 0..43200
|
13
13
|
#
|
14
14
|
# ==== See Also
|
@@ -8,7 +8,7 @@ module Fog
|
|
8
8
|
#
|
9
9
|
# ==== Parameters
|
10
10
|
# * queue_url<~String> - Url of queue to delete message from
|
11
|
-
# * receipt_handle<~String> - Token from previous
|
11
|
+
# * receipt_handle<~String> - Token from previous receive message
|
12
12
|
#
|
13
13
|
# ==== See Also
|
14
14
|
# http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryDeleteMessage.html
|
@@ -17,7 +17,7 @@ module Fog
|
|
17
17
|
# @option options [Time] x-amz-copy_source-if-modified_since Copies object it it has been modified since this time
|
18
18
|
# @option options [String] x-amz-copy_source-if-none-match Copies object if its etag does not match this value
|
19
19
|
# @option options [Time] x-amz-copy_source-if-unmodified-since Copies object it it has not been modified since this time
|
20
|
-
# @option options [String] x-amz-storage-class Default is 'STANDARD', set to 'REDUCED_REDUNDANCY' for non-critical,
|
20
|
+
# @option options [String] x-amz-storage-class Default is 'STANDARD', set to 'REDUCED_REDUNDANCY' for non-critical, reproducible data
|
21
21
|
#
|
22
22
|
#
|
23
23
|
# @return [Excon::Response]
|
@@ -34,6 +34,7 @@ module Fog
|
|
34
34
|
:headers => headers,
|
35
35
|
:bucket_name => target_bucket_name,
|
36
36
|
:object_name => target_object_name,
|
37
|
+
:idempotent => true,
|
37
38
|
:method => 'PUT',
|
38
39
|
:parser => Fog::Parsers::AWS::Storage::CopyObject.new,
|
39
40
|
})
|
@@ -36,13 +36,20 @@ module Fog
|
|
36
36
|
data << "<Quiet>true</Quiet>" if headers.delete(:quiet)
|
37
37
|
version_ids = headers.delete('versionId')
|
38
38
|
object_names.each do |object_name|
|
39
|
-
data << "<Object>"
|
40
|
-
data << "<Key>#{CGI.escapeHTML(object_name)}</Key>"
|
41
39
|
object_version = version_ids.nil? ? nil : version_ids[object_name]
|
42
40
|
if object_version
|
43
|
-
|
41
|
+
object_version = object_version.is_a?(String) ? [object_version] : object_version
|
42
|
+
object_version.each do |version_id|
|
43
|
+
data << "<Object>"
|
44
|
+
data << "<Key>#{CGI.escapeHTML(object_name)}</Key>"
|
45
|
+
data << "<VersionId>#{CGI.escapeHTML(version_id)}</VersionId>"
|
46
|
+
data << "</Object>"
|
47
|
+
end
|
48
|
+
else
|
49
|
+
data << "<Object>"
|
50
|
+
data << "<Key>#{CGI.escapeHTML(object_name)}</Key>"
|
51
|
+
data << "</Object>"
|
44
52
|
end
|
45
|
-
data << "</Object>"
|
46
53
|
end
|
47
54
|
data << "</Delete>"
|
48
55
|
|
@@ -72,10 +79,13 @@ module Fog
|
|
72
79
|
response.body = { 'DeleteResult' => [] }
|
73
80
|
version_ids = headers.delete('versionId')
|
74
81
|
object_names.each do |object_name|
|
75
|
-
object_version = version_ids.nil? ? nil : version_ids[object_name]
|
76
|
-
|
77
|
-
|
78
|
-
|
82
|
+
object_version = version_ids.nil? ? [nil] : version_ids[object_name]
|
83
|
+
object_version = object_version.is_a?(String) ? [object_version] : object_version
|
84
|
+
object_version.each do |version_id|
|
85
|
+
response.body['DeleteResult'] << delete_object_helper(bucket,
|
86
|
+
object_name,
|
87
|
+
version_id)
|
88
|
+
end
|
79
89
|
end
|
80
90
|
else
|
81
91
|
response.status = 404
|
@@ -9,7 +9,7 @@ module Fog
|
|
9
9
|
# @param bucket_name [String] name of bucket to list object keys from
|
10
10
|
# @param options [Hash] config arguments for list. Defaults to {}.
|
11
11
|
# @option options delimiter [String] causes keys with the same string between the prefix
|
12
|
-
# value and the first
|
12
|
+
# value and the first occurrence of delimiter to be rolled up
|
13
13
|
# @option options marker [String] limits object keys to only those that appear
|
14
14
|
# lexicographically after its value.
|
15
15
|
# @option options max-keys [Integer] limits number of object keys returned
|
@@ -17,7 +17,7 @@ module Fog
|
|
17
17
|
#
|
18
18
|
# @return [Excon::Response] response:
|
19
19
|
# * body [Hash]:
|
20
|
-
# *
|
20
|
+
# * Delimiter [String] - Delimiter specified for query
|
21
21
|
# * IsTruncated [Boolean] - Whether or not the listing is truncated
|
22
22
|
# * Marker [String]- Marker specified for query
|
23
23
|
# * MaxKeys [Integer] - Maximum number of keys specified for query
|
@@ -8,7 +8,7 @@ module Fog
|
|
8
8
|
#
|
9
9
|
# @param bucket_name [String] name of bucket to list object keys from
|
10
10
|
# @param options [Hash] config arguments for list
|
11
|
-
# @option options delimiter [String] causes keys with the same string between the prefix value and the first
|
11
|
+
# @option options delimiter [String] causes keys with the same string between the prefix value and the first occurrence of delimiter to be rolled up
|
12
12
|
# @option options key-marker [String] limits object keys to only those that appear lexicographically after its value.
|
13
13
|
# @option options max-keys [Integer] limits number of object keys returned
|
14
14
|
# @option options prefix [String] limits object keys to those beginning with its value.
|
@@ -16,7 +16,7 @@ module Fog
|
|
16
16
|
#
|
17
17
|
# @return [Excon::Response] response:
|
18
18
|
# * body [Hash]:
|
19
|
-
# *
|
19
|
+
# * Delimiter [String] - Delimiter specified for query
|
20
20
|
# * KeyMarker [String] - Key marker specified for query
|
21
21
|
# * MaxKeys [Integer] - Maximum number of keys specified for query
|
22
22
|
# * Name [String] - Name of the bucket
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class Storage
|
4
|
+
class Real
|
5
|
+
require 'fog/aws/parsers/storage/get_object_tagging'
|
6
|
+
|
7
|
+
# Get tags for an S3 object
|
8
|
+
#
|
9
|
+
# @param bucket_name [String] Name of bucket to read from
|
10
|
+
# @param object_name [String] Name of object to get tags for
|
11
|
+
#
|
12
|
+
# @return [Excon::Response] response:
|
13
|
+
# * body [Hash]:
|
14
|
+
# * ObjectTagging [Hash]:
|
15
|
+
# * Key [String] - tag key
|
16
|
+
# * Value [String] - tag value
|
17
|
+
# @see https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html
|
18
|
+
|
19
|
+
def get_object_tagging(bucket_name, object_name)
|
20
|
+
unless bucket_name
|
21
|
+
raise ArgumentError.new('bucket_name is required')
|
22
|
+
end
|
23
|
+
unless object_name
|
24
|
+
raise ArgumentError.new('object_name is required')
|
25
|
+
end
|
26
|
+
|
27
|
+
request({
|
28
|
+
:expects => 200,
|
29
|
+
:headers => {},
|
30
|
+
:bucket_name => bucket_name,
|
31
|
+
:object_name => object_name,
|
32
|
+
:idempotent => true,
|
33
|
+
:method => 'GET',
|
34
|
+
:parser => Fog::Parsers::AWS::Storage::GetObjectTagging.new,
|
35
|
+
:query => {'tagging' => nil}
|
36
|
+
})
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -21,7 +21,7 @@ module Fog
|
|
21
21
|
# * ID [String] Id of upload initiator
|
22
22
|
# * IsTruncated [Boolean] Whether or not the listing is truncated
|
23
23
|
# * Key [String] Key where multipart upload was initiated
|
24
|
-
# * MaxParts [String] maximum number of replies
|
24
|
+
# * MaxParts [String] maximum number of replies allowed in response
|
25
25
|
# * NextPartNumberMarker [String] last item in list, for further pagination
|
26
26
|
# * Part [Array]:
|
27
27
|
# * ETag [String] ETag of part
|
@@ -61,10 +61,6 @@ DATA
|
|
61
61
|
end
|
62
62
|
if !self.data[:buckets][bucket_name]
|
63
63
|
self.data[:buckets][bucket_name] = bucket
|
64
|
-
elsif self.region != 'us-east-1'
|
65
|
-
response.status = 409
|
66
|
-
Fog::Logger.warning "Your region '#{self.region}' does not match the default region 'us-east-1'"
|
67
|
-
raise(Excon::Errors.status_error({:expects => 201}, response))
|
68
64
|
end
|
69
65
|
response
|
70
66
|
end
|
@@ -47,7 +47,7 @@ module Fog
|
|
47
47
|
if rule['NoncurrentVersionExpiration']['NoncurrentDays']
|
48
48
|
NoncurrentVersionExpiration { NoncurrentDays rule['NoncurrentVersionExpiration']['NoncurrentDays'] }
|
49
49
|
elsif rule['NoncurrentVersionExpiration']['Date']
|
50
|
-
|
50
|
+
NoncurrentVersionExpiration {
|
51
51
|
if Date rule['NoncurrentVersionExpiration']['Date'].is_a?(Time)
|
52
52
|
rule['NoncurrentVersionExpiration']['Date'].utc.iso8601
|
53
53
|
else
|
@@ -5,7 +5,7 @@ module Fog
|
|
5
5
|
# Change notification configuration for an S3 bucket
|
6
6
|
#
|
7
7
|
# @param bucket_name [String] name of bucket to set notification configuration for
|
8
|
-
# *
|
8
|
+
# * notifications [Hash]:
|
9
9
|
# * Topics [Array] SNS topic configurations for the notification
|
10
10
|
# * ID [String] Unique identifier for the configuration
|
11
11
|
# * Topic [String] Amazon SNS topic ARN to which Amazon S3 will publish a message when it detects events of specified type
|
@@ -16,7 +16,7 @@ module Fog
|
|
16
16
|
# @option options Content-Type [String] Standard MIME type describing contents (defaults to MIME::Types.of.first)
|
17
17
|
# @option options Expires [String] Cache expiry
|
18
18
|
# @option options x-amz-acl [String] Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
|
19
|
-
# @option options x-amz-storage-class [String] Default is 'STANDARD', set to 'REDUCED_REDUNDANCY' for non-critical,
|
19
|
+
# @option options x-amz-storage-class [String] Default is 'STANDARD', set to 'REDUCED_REDUNDANCY' for non-critical, reproducible data
|
20
20
|
# @option options x-amz-meta-#{name} Headers to be returned with object, note total size of request without body must be less than 8 KB. Each name, value pair must conform to US-ASCII.
|
21
21
|
# @option options x-amz-server-side-encryption [String] Sets HTTP header for server-side encryption. Set to 'AES256' for SSE-S3 and SSE-C. Set to 'aws:kms' for SSE-KMS
|
22
22
|
# @option options x-amz-server-side-encryption-customer-algorithm [String] Algorithm to use to when encrypting the object for SSE-C.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class Storage
|
4
|
+
class Real
|
5
|
+
# Change tag set for an S3 object
|
6
|
+
#
|
7
|
+
# @param bucket_name [String] Name of bucket to modify object in
|
8
|
+
# @param object_name [String] Name of object to modify
|
9
|
+
#
|
10
|
+
# @param tags [Hash]:
|
11
|
+
# * Key [String]: tag key
|
12
|
+
# * Value [String]: tag value
|
13
|
+
#
|
14
|
+
# @see https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html
|
15
|
+
|
16
|
+
def put_object_tagging(bucket_name, object_name, tags)
|
17
|
+
tagging = tags.map do |k,v|
|
18
|
+
"<Tag><Key>#{k}</Key><Value>#{v}</Value></Tag>"
|
19
|
+
end.join("\n")
|
20
|
+
data =
|
21
|
+
<<-DATA
|
22
|
+
<Tagging xmlns="http://doc.s3.amazonaws.com/2006-03-01" >
|
23
|
+
<TagSet>
|
24
|
+
#{tagging}
|
25
|
+
</TagSet>
|
26
|
+
</Tagging>
|
27
|
+
DATA
|
28
|
+
|
29
|
+
request({
|
30
|
+
:body => data,
|
31
|
+
:expects => 200,
|
32
|
+
:headers => {'Content-MD5' => Base64.encode64(OpenSSL::Digest::MD5.digest(data)).chomp!, 'Content-Type' => 'application/xml'},
|
33
|
+
:bucket_name => bucket_name,
|
34
|
+
:object_name => object_name,
|
35
|
+
:method => 'PUT',
|
36
|
+
:query => {'tagging' => nil}
|
37
|
+
})
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
module SharedMockMethods
|
5
5
|
def define_mock_acl(bucket_name, object_name, options)
|
6
6
|
acl = options['x-amz-acl'] || 'private'
|
7
|
-
if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
|
7
|
+
if !['private', 'public-read', 'public-read-write', 'authenticated-read', 'bucket-owner-read', 'bucket-owner-full-control'].include?(acl)
|
8
8
|
raise Excon::Errors::BadRequest.new('invalid x-amz-acl')
|
9
9
|
else
|
10
10
|
self.data[:acls][:object][bucket_name] ||= {}
|
@@ -15,6 +15,7 @@ module Fog
|
|
15
15
|
def parse_mock_data(data)
|
16
16
|
data = Fog::Storage.parse_data(data)
|
17
17
|
unless data[:body].is_a?(String)
|
18
|
+
data[:body].rewind if data[:body].eof?
|
18
19
|
data[:body] = data[:body].read
|
19
20
|
end
|
20
21
|
data
|
@@ -6,12 +6,20 @@ module Fog
|
|
6
6
|
#
|
7
7
|
def sync_clock
|
8
8
|
response = begin
|
9
|
-
|
9
|
+
Excon.get(sync_clock_url)
|
10
10
|
rescue Excon::Errors::HTTPStatusError => error
|
11
11
|
error.response
|
12
12
|
end
|
13
13
|
Fog::Time.now = Time.parse(response.headers['Date'])
|
14
14
|
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def sync_clock_url
|
19
|
+
host = @acceleration ? region_to_host(@region) : @host
|
20
|
+
|
21
|
+
"#{@scheme}://#{host}:#{@port}"
|
22
|
+
end
|
15
23
|
end # Real
|
16
24
|
|
17
25
|
class Mock # :nodoc:all
|
@@ -0,0 +1,119 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class Storage
|
4
|
+
# From https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
|
5
|
+
ALLOWED_UPLOAD_PART_OPTIONS = %i(
|
6
|
+
x-amz-copy-source
|
7
|
+
x-amz-copy-source-if-match
|
8
|
+
x-amz-copy-source-if-modified-since
|
9
|
+
x-amz-copy-source-if-none-match
|
10
|
+
x-amz-copy-source-if-unmodified-since
|
11
|
+
x-amz-copy-source-range
|
12
|
+
x-amz-copy-source-server-side-encryption-customer-algorithm
|
13
|
+
x-amz-copy-source-server-side-encryption-customer-key
|
14
|
+
x-amz-copy-source-server-side-encryption-customer-key-MD5
|
15
|
+
x-amz-expected-bucket-owner
|
16
|
+
x-amz-request-payer
|
17
|
+
x-amz-server-side-encryption-customer-algorithm
|
18
|
+
x-amz-server-side-encryption-customer-key
|
19
|
+
x-amz-server-side-encryption-customer-key-MD5
|
20
|
+
x-amz-source-expected-bucket-owner
|
21
|
+
).freeze
|
22
|
+
|
23
|
+
class Real
|
24
|
+
require 'fog/aws/parsers/storage/upload_part_copy_object'
|
25
|
+
|
26
|
+
# Upload a part for a multipart copy
|
27
|
+
#
|
28
|
+
# @param target_bucket_name [String] Name of bucket to create copy in
|
29
|
+
# @param target_object_name [String] Name for new copy of object
|
30
|
+
# @param upload_id [String] Id of upload to add part to
|
31
|
+
# @param part_number [String] Index of part in upload
|
32
|
+
# @param options [Hash]:
|
33
|
+
# @option options [String] x-amz-metadata-directive Specifies whether to copy metadata from source or replace with data in request. Must be in ['COPY', 'REPLACE']
|
34
|
+
# @option options [String] x-amz-copy_source-if-match Copies object if its etag matches this value
|
35
|
+
# @option options [Time] x-amz-copy_source-if-modified_since Copies object it it has been modified since this time
|
36
|
+
# @option options [String] x-amz-copy_source-if-none-match Copies object if its etag does not match this value
|
37
|
+
# @option options [Time] x-amz-copy_source-if-unmodified-since Copies object it it has not been modified since this time
|
38
|
+
# @option options [Time] x-amz-copy-source-range Specifies the range of bytes to copy from the source object
|
39
|
+
#
|
40
|
+
# @return [Excon::Response]
|
41
|
+
# * body [Hash]:
|
42
|
+
# * ETag [String] - etag of new object
|
43
|
+
# * LastModified [Time] - date object was last modified
|
44
|
+
#
|
45
|
+
# @see https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
|
46
|
+
#
|
47
|
+
def upload_part_copy(target_bucket_name, target_object_name, upload_id, part_number, options = {})
|
48
|
+
headers = options
|
49
|
+
request({
|
50
|
+
:expects => 200,
|
51
|
+
:idempotent => true,
|
52
|
+
:headers => headers,
|
53
|
+
:bucket_name => target_bucket_name,
|
54
|
+
:object_name => target_object_name,
|
55
|
+
:method => 'PUT',
|
56
|
+
:query => {'uploadId' => upload_id, 'partNumber' => part_number},
|
57
|
+
:parser => Fog::Parsers::AWS::Storage::UploadPartCopyObject.new,
|
58
|
+
})
|
59
|
+
end
|
60
|
+
end # Real
|
61
|
+
|
62
|
+
class Mock # :nodoc:all
|
63
|
+
require 'fog/aws/requests/storage/shared_mock_methods'
|
64
|
+
include Fog::AWS::Storage::SharedMockMethods
|
65
|
+
|
66
|
+
def upload_part_copy(target_bucket_name, target_object_name, upload_id, part_number, options = {})
|
67
|
+
validate_options!(options)
|
68
|
+
|
69
|
+
copy_source = options['x-amz-copy-source']
|
70
|
+
copy_range = options['x-amz-copy-source-range']
|
71
|
+
|
72
|
+
raise 'No x-amz-copy-source header provided' unless copy_source
|
73
|
+
raise 'No x-amz-copy-source-range header provided' unless copy_range
|
74
|
+
|
75
|
+
source_bucket_name, source_object_name = copy_source.split('/', 2)
|
76
|
+
verify_mock_bucket_exists(source_bucket_name)
|
77
|
+
|
78
|
+
source_bucket = self.data[:buckets][source_bucket_name]
|
79
|
+
source_object = source_bucket && source_bucket[:objects][source_object_name] && source_bucket[:objects][source_object_name].first
|
80
|
+
upload_info = get_upload_info(target_bucket_name, upload_id)
|
81
|
+
|
82
|
+
response = Excon::Response.new
|
83
|
+
|
84
|
+
if source_object
|
85
|
+
start_pos, end_pos = byte_range(copy_range, source_object[:body].length)
|
86
|
+
upload_info[:parts][part_number] = source_object[:body][start_pos..end_pos]
|
87
|
+
|
88
|
+
response.status = 200
|
89
|
+
response.body = {
|
90
|
+
# just use the part number as the ETag, for simplicity
|
91
|
+
'ETag' => part_number.to_i,
|
92
|
+
'LastModified' => Time.parse(source_object['Last-Modified'])
|
93
|
+
}
|
94
|
+
response
|
95
|
+
else
|
96
|
+
response.status = 404
|
97
|
+
raise(Excon::Errors.status_error({:expects => 200}, response))
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def byte_range(range, size)
|
102
|
+
matches = range.match(/bytes=(\d*)-(\d*)/)
|
103
|
+
|
104
|
+
return nil unless matches
|
105
|
+
|
106
|
+
end_pos = [matches[2].to_i, size].min
|
107
|
+
|
108
|
+
[matches[1].to_i, end_pos]
|
109
|
+
end
|
110
|
+
|
111
|
+
def validate_options!(options)
|
112
|
+
options.keys.each do |key|
|
113
|
+
raise "Invalid UploadPart option: #{key}" unless ::Fog::AWS::Storage::ALLOWED_UPLOAD_PART_OPTIONS.include?(key.to_sym)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end # Mock
|
117
|
+
end # Storage
|
118
|
+
end # AWS
|
119
|
+
end # Fog
|
@@ -6,12 +6,13 @@ module Fog
|
|
6
6
|
|
7
7
|
def assume_role_with_web_identity(role_arn, web_identity_token, role_session_name, options={})
|
8
8
|
request_unsigned(
|
9
|
-
'Action'
|
10
|
-
'RoleArn'
|
11
|
-
'RoleSessionName'
|
12
|
-
'
|
13
|
-
|
14
|
-
:
|
9
|
+
'Action' => 'AssumeRoleWithWebIdentity',
|
10
|
+
'RoleArn' => role_arn,
|
11
|
+
'RoleSessionName' => role_session_name,
|
12
|
+
'WebIdentityToken' => web_identity_token,
|
13
|
+
'DurationSeconds' => options[:duration] || 3600,
|
14
|
+
:idempotent => true,
|
15
|
+
:parser => Fog::Parsers::AWS::STS::AssumeRoleWithWebIdentity.new
|
15
16
|
)
|
16
17
|
end
|
17
18
|
end
|
data/lib/fog/aws/ses.rb
CHANGED
@@ -7,7 +7,7 @@ module Fog
|
|
7
7
|
class MessageRejected < Fog::Errors::Error; end
|
8
8
|
|
9
9
|
requires :aws_access_key_id, :aws_secret_access_key
|
10
|
-
recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
|
10
|
+
recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
|
11
11
|
|
12
12
|
request_path 'fog/aws/requests/ses'
|
13
13
|
request :delete_verified_email_address
|
@@ -48,18 +48,21 @@ module Fog
|
|
48
48
|
def initialize(options={})
|
49
49
|
|
50
50
|
@use_iam_profile = options[:use_iam_profile]
|
51
|
-
setup_credentials(options)
|
52
51
|
|
53
52
|
@instrumentor = options[:instrumentor]
|
54
53
|
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.ses'
|
55
54
|
@connection_options = options[:connection_options] || {}
|
56
55
|
options[:region] ||= 'us-east-1'
|
56
|
+
@region = options[:region]
|
57
|
+
|
57
58
|
@host = options[:host] || "email.#{options[:region]}.amazonaws.com"
|
58
59
|
@path = options[:path] || '/'
|
59
60
|
@persistent = options[:persistent] || false
|
60
61
|
@port = options[:port] || 443
|
61
62
|
@scheme = options[:scheme] || 'https'
|
62
63
|
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
|
64
|
+
|
65
|
+
setup_credentials(options)
|
63
66
|
end
|
64
67
|
|
65
68
|
def reload
|
@@ -74,7 +77,7 @@ module Fog
|
|
74
77
|
@aws_session_token = options[:aws_session_token]
|
75
78
|
@aws_credentials_expire_at = options[:aws_credentials_expire_at]
|
76
79
|
|
77
|
-
@
|
80
|
+
@signer = Fog::AWS::SignatureV4.new(@aws_access_key_id, @aws_secret_access_key, @region, 'ses')
|
78
81
|
end
|
79
82
|
|
80
83
|
def request(params)
|
@@ -87,20 +90,20 @@ module Fog
|
|
87
90
|
'Content-Type' => 'application/x-www-form-urlencoded',
|
88
91
|
'Date' => Fog::Time.now.to_date_header,
|
89
92
|
}
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
93
|
+
|
94
|
+
body, headers = AWS.signed_params_v4(
|
95
|
+
params,
|
96
|
+
{ 'Content-Type' => 'application/x-www-form-urlencoded' },
|
97
|
+
{
|
98
|
+
:method => 'POST',
|
99
|
+
:aws_session_token => @aws_session_token,
|
100
|
+
:signer => @signer,
|
101
|
+
:host => @host,
|
102
|
+
:path => @path,
|
103
|
+
:port => @port,
|
104
|
+
:version => '2010-12-01'
|
105
|
+
}
|
106
|
+
)
|
104
107
|
|
105
108
|
if @instrumentor
|
106
109
|
@instrumentor.instrument("#{@instrumentor_name}.request", params) do
|
data/lib/fog/aws/signaturev4.rb
CHANGED
data/lib/fog/aws/simpledb.rb
CHANGED
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
5
5
|
|
6
6
|
requires :aws_access_key_id, :aws_secret_access_key
|
7
|
-
recognizes :host, :nil_string, :path, :port, :scheme, :persistent, :region, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
|
7
|
+
recognizes :host, :nil_string, :path, :port, :scheme, :persistent, :region, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
|
8
8
|
|
9
9
|
request_path 'fog/aws/requests/simpledb'
|
10
10
|
request :batch_put_attributes
|
data/lib/fog/aws/sns.rb
CHANGED
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
5
5
|
|
6
6
|
requires :aws_access_key_id, :aws_secret_access_key
|
7
|
-
recognizes :host, :path, :port, :scheme, :persistent, :region, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
|
7
|
+
recognizes :host, :path, :port, :scheme, :persistent, :region, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
|
8
8
|
|
9
9
|
request_path 'fog/aws/requests/sns'
|
10
10
|
request :add_permission
|
data/lib/fog/aws/sqs.rb
CHANGED
@@ -4,7 +4,7 @@ module Fog
|
|
4
4
|
extend Fog::AWS::CredentialFetcher::ServiceMethods
|
5
5
|
|
6
6
|
requires :aws_access_key_id, :aws_secret_access_key
|
7
|
-
recognizes :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
|
7
|
+
recognizes :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
|
8
8
|
|
9
9
|
request_path 'fog/aws/requests/sqs'
|
10
10
|
request :change_message_visibility
|