fog-google 1.6.0 → 1.7.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 +5 -5
- data/.codecov.yml +2 -0
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +51 -0
- data/CONTRIBUTING.md +85 -17
- data/CONTRIBUTORS.md +6 -4
- data/Gemfile +6 -0
- data/MIGRATING.md +1 -11
- data/README.md +15 -4
- data/ci/credentials.yml.template +2 -0
- data/ci/docker-image/Dockerfile +1 -3
- data/ci/pipeline.yml +117 -12
- data/ci/tasks/run-int.sh +3 -2
- data/ci/tasks/run-int.yml +1 -1
- data/examples/create_instance.rb +40 -25
- data/examples/get_list_images.rb +1 -1
- data/examples/load-balance.rb +1 -1
- data/examples/metadata.rb +1 -1
- data/examples/network.rb +1 -1
- data/fog-google.gemspec +8 -6
- data/lib/fog/compute/google/models/address.rb +1 -1
- data/lib/fog/compute/google/models/backend_service.rb +1 -1
- data/lib/fog/compute/google/models/disk.rb +2 -2
- data/lib/fog/compute/google/models/firewall.rb +23 -3
- data/lib/fog/compute/google/models/forwarding_rule.rb +1 -1
- data/lib/fog/compute/google/models/global_address.rb +1 -1
- data/lib/fog/compute/google/models/global_forwarding_rule.rb +1 -1
- data/lib/fog/compute/google/models/http_health_check.rb +2 -2
- data/lib/fog/compute/google/models/image.rb +1 -1
- data/lib/fog/compute/google/models/instance_group_manager.rb +1 -1
- data/lib/fog/compute/google/models/instance_template.rb +1 -1
- data/lib/fog/compute/google/models/route.rb +1 -1
- data/lib/fog/compute/google/models/server.rb +59 -5
- data/lib/fog/compute/google/models/servers.rb +1 -1
- data/lib/fog/compute/google/models/ssl_certificate.rb +1 -1
- data/lib/fog/compute/google/models/subnetwork.rb +1 -1
- data/lib/fog/compute/google/models/target_http_proxy.rb +1 -1
- data/lib/fog/compute/google/models/target_https_proxy.rb +14 -1
- data/lib/fog/compute/google/models/target_instance.rb +1 -1
- data/lib/fog/compute/google/models/target_pool.rb +1 -1
- data/lib/fog/compute/google/models/url_map.rb +1 -1
- data/lib/fog/compute/google/requests/insert_server.rb +1 -1
- data/lib/fog/dns/google/models/record.rb +1 -1
- data/lib/fog/google/models/sql/instance.rb +1 -1
- data/lib/fog/google/models/sql/user.rb +1 -1
- data/lib/fog/google/version.rb +1 -1
- data/lib/fog/storage/google_json.rb +4 -1
- data/lib/fog/storage/google_json/mock.rb +3 -0
- data/lib/fog/storage/google_json/models/file.rb +2 -2
- data/lib/fog/storage/google_json/models/files.rb +2 -2
- data/lib/fog/storage/google_json/real.rb +3 -0
- data/lib/fog/storage/google_json/requests/get_object_http_url.rb +6 -7
- data/lib/fog/storage/google_json/requests/get_object_https_url.rb +6 -7
- data/lib/fog/storage/google_json/requests/get_object_url.rb +4 -4
- data/lib/fog/storage/google_json/utils.rb +7 -1
- data/lib/fog/storage/google_xml/models/file.rb +2 -2
- data/lib/fog/storage/google_xml/models/files.rb +4 -4
- data/lib/fog/storage/google_xml/requests/get_object_http_url.rb +8 -7
- data/lib/fog/storage/google_xml/requests/get_object_https_url.rb +7 -7
- data/lib/fog/storage/google_xml/requests/get_object_url.rb +5 -4
- data/lib/fog/storage/google_xml/utils.rb +7 -1
- data/tasks/test.rake +45 -23
- data/test/helpers/integration_test_helper.rb +67 -0
- data/test/helpers/test_helper.rb +14 -10
- data/test/integration/compute/core_compute/test_coverage.rb +6 -0
- data/test/integration/compute/{test_disk_types.rb → core_compute/test_disk_types.rb} +0 -0
- data/test/integration/compute/{disks/test_compute_disk_models.rb → core_compute/test_disks.rb} +0 -0
- data/test/integration/compute/{test_images.rb → core_compute/test_images.rb} +0 -0
- data/test/integration/compute/core_compute/test_machine_types.rb +42 -0
- data/test/integration/compute/core_compute/test_operations.rb +27 -0
- data/test/integration/compute/core_compute/test_projects.rb +19 -0
- data/test/integration/compute/{test_regions.rb → core_compute/test_regions.rb} +0 -0
- data/test/integration/compute/core_compute/test_servers.rb +109 -0
- data/test/integration/compute/{test_snapshots.rb → core_compute/test_snapshots.rb} +0 -0
- data/test/integration/compute/core_compute/test_zones.rb +35 -0
- data/test/integration/compute/core_networking/test_addresses.rb +84 -0
- data/test/integration/compute/core_networking/test_coverage.rb +6 -0
- data/test/integration/compute/core_networking/test_firewalls.rb +11 -0
- data/test/integration/compute/core_networking/test_networks.rb +41 -0
- data/test/integration/compute/core_networking/test_routes.rb +26 -0
- data/test/integration/compute/core_networking/test_subnetworks.rb +11 -0
- data/test/integration/compute/instance_groups/test_coverage.rb +6 -0
- data/test/integration/compute/{test_instance_group_managers.rb → instance_groups/test_instance_group_managers.rb} +0 -0
- data/test/integration/compute/instance_groups/test_instance_groups.rb +11 -0
- data/test/integration/compute/{test_instance_templates.rb → instance_groups/test_instance_templates.rb} +0 -0
- data/test/integration/compute/{test_backend_services.rb → loadbalancing/test_backend_services.rb} +0 -0
- data/test/integration/compute/loadbalancing/test_coverage.rb +6 -0
- data/test/integration/compute/{test_forwarding_rules.rb → loadbalancing/test_forwarding_rules.rb} +0 -0
- data/test/integration/compute/loadbalancing/test_global_addresses.rb +11 -0
- data/test/integration/compute/{test_global_forwarding_rules.rb → loadbalancing/test_global_forwarding_rules.rb} +0 -0
- data/test/integration/compute/{test_http_health_checks.rb → loadbalancing/test_http_health_checks.rb} +0 -0
- data/test/integration/compute/loadbalancing/test_ssl_certificates.rb +11 -0
- data/test/integration/compute/{test_target_http_proxies.rb → loadbalancing/test_target_http_proxies.rb} +0 -0
- data/test/integration/compute/loadbalancing/test_target_https_proxies.rb +11 -0
- data/test/integration/compute/{test_target_instances.rb → loadbalancing/test_target_instances.rb} +0 -0
- data/test/integration/compute/loadbalancing/test_target_pools.rb +55 -0
- data/test/integration/compute/{test_url_maps.rb → loadbalancing/test_url_maps.rb} +0 -0
- data/test/integration/factories/addresses_factory.rb +16 -0
- data/test/integration/factories/collection_factory.rb +24 -3
- data/test/integration/factories/disks_factory.rb +1 -0
- data/test/integration/factories/firewalls_factory.rb +13 -0
- data/test/integration/factories/global_addresses_factory.rb +15 -0
- data/test/integration/factories/instance_groups_factory.rb +16 -0
- data/test/integration/factories/instance_template_factory.rb +1 -0
- data/test/integration/factories/networks_factory.rb +16 -0
- data/test/integration/factories/ssl_certificates_factory.rb +13 -0
- data/test/integration/factories/subnetworks_factory.rb +22 -0
- data/test/integration/factories/target_https_proxies_factory.rb +26 -0
- data/test/integration/factories/target_pools_factory.rb +2 -2
- data/test/integration/monitoring/test_coverage.rb +6 -0
- data/test/integration/monitoring/test_timeseries.rb +1 -1
- data/test/integration/pubsub/test_coverage.rb +6 -0
- data/test/integration/sql/{test_common_flags.rb → sqlv1/test_common_flags.rb} +0 -0
- data/test/integration/sql/{test_common_tiers.rb → sqlv1/test_common_tiers.rb} +0 -0
- data/test/integration/sql/sqlv1/test_coverage.rb +6 -0
- data/test/integration/sql/{test_v1_certs.rb → sqlv1/test_v1_certs.rb} +0 -0
- data/test/integration/sql/{test_v1_instances.rb → sqlv1/test_v1_instances.rb} +0 -0
- data/test/integration/sql/{test_v1_users.rb → sqlv1/test_v1_users.rb} +0 -0
- data/test/integration/sql/sqlv2/test_coverage.rb +6 -0
- data/test/integration/sql/{test_v2_instances.rb → sqlv2/test_v2_instances.rb} +0 -0
- data/test/integration/storage/test_coverage.rb +6 -0
- data/test/unit/storage/test_json_requests.rb +45 -0
- data/test/unit/storage/test_xml_requests.rb +20 -0
- metadata +115 -92
- data/test/integration/compute/addresses/addresses_shared.rb +0 -59
- data/test/integration/compute/addresses/test_compute_address_models.rb +0 -105
- data/test/integration/compute/addresses/test_compute_address_requests.rb +0 -52
- data/test/integration/compute/disks/test_compute_disk_requests.rb +0 -92
- data/test/integration/compute/test_compute_addresses_collection.rb +0 -75
- data/test/integration/compute/test_compute_networks_collection.rb +0 -69
- data/test/integration/compute/test_servers.rb +0 -54
- data/test/integration/compute/test_target_pools.rb +0 -38
|
@@ -26,7 +26,7 @@ module Fog
|
|
|
26
26
|
data = service.insert_subnetwork(identity, region, network, ip_cidr_range, attributes)
|
|
27
27
|
operation = Fog::Compute::Google::Operations.new(:service => service)
|
|
28
28
|
.get(data.name, nil, data.region)
|
|
29
|
-
operation.wait_for {
|
|
29
|
+
operation.wait_for { ready? }
|
|
30
30
|
reload
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -10,11 +10,24 @@ module Fog
|
|
|
10
10
|
attribute :kind, :aliases => "kind"
|
|
11
11
|
attribute :self_link, :aliases => "selfLink"
|
|
12
12
|
attribute :url_map, :aliases => "urlMap"
|
|
13
|
+
# Array of SSL Certificates
|
|
14
|
+
# @example
|
|
15
|
+
#
|
|
16
|
+
# [cert_one.self_link', cert_two.self_link]
|
|
17
|
+
#
|
|
18
|
+
# , where 'cert_one' and 'cert_two' are instances of
|
|
19
|
+
# Fog::Compute::Google::SslCertificate
|
|
20
|
+
#
|
|
21
|
+
# @return [Array<String>]
|
|
13
22
|
attribute :ssl_certificates, :aliases => "sslCertificates"
|
|
14
23
|
|
|
15
24
|
def save
|
|
16
25
|
requires :identity, :url_map, :ssl_certificates
|
|
17
26
|
|
|
27
|
+
unless ssl_certificates.is_a?(Array)
|
|
28
|
+
raise Fog::Errors::Error.new("ssl_certificates attribute must be an array")
|
|
29
|
+
end
|
|
30
|
+
|
|
18
31
|
data = service.insert_target_https_proxy(
|
|
19
32
|
identity,
|
|
20
33
|
:description => description,
|
|
@@ -23,7 +36,7 @@ module Fog
|
|
|
23
36
|
)
|
|
24
37
|
operation = Fog::Compute::Google::Operations.new(:service => service)
|
|
25
38
|
.get(data.name)
|
|
26
|
-
operation.wait_for {
|
|
39
|
+
operation.wait_for { ready? }
|
|
27
40
|
reload
|
|
28
41
|
end
|
|
29
42
|
|
|
@@ -26,7 +26,7 @@ module Fog
|
|
|
26
26
|
data = service.insert_target_instance(identity, zone, options)
|
|
27
27
|
operation = Fog::Compute::Google::Operations.new(:service => service)
|
|
28
28
|
.get(data.name, data.zone)
|
|
29
|
-
operation.wait_for {
|
|
29
|
+
operation.wait_for { ready? }
|
|
30
30
|
reload
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -318,7 +318,7 @@ module Fog
|
|
|
318
318
|
|
|
319
319
|
data = service.update_instance(identity, settings_version, tier, settings)
|
|
320
320
|
operation = Fog::Google::SQL::Operations.new(:service => service).get(data.name)
|
|
321
|
-
operation.wait_for {
|
|
321
|
+
operation.wait_for { ready? }
|
|
322
322
|
reload
|
|
323
323
|
end
|
|
324
324
|
|
data/lib/fog/google/version.rb
CHANGED
|
@@ -16,7 +16,10 @@ module Fog
|
|
|
16
16
|
:google_key_location,
|
|
17
17
|
:google_key_string,
|
|
18
18
|
:google_json_key_location,
|
|
19
|
-
:google_json_key_string
|
|
19
|
+
:google_json_key_string,
|
|
20
|
+
:open_timeout_sec,
|
|
21
|
+
:read_timeout_sec,
|
|
22
|
+
:send_timeout_sec
|
|
20
23
|
)
|
|
21
24
|
|
|
22
25
|
# https://cloud.google.com/storage/docs/json_api/v1/
|
|
@@ -5,8 +5,11 @@ module Fog
|
|
|
5
5
|
include Utils
|
|
6
6
|
include Fog::Google::Shared
|
|
7
7
|
|
|
8
|
+
MockClient = Struct.new(:issuer)
|
|
9
|
+
|
|
8
10
|
def initialize(options = {})
|
|
9
11
|
shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, GOOGLE_STORAGE_JSON_BASE_URL)
|
|
12
|
+
@client = MockClient.new('test')
|
|
10
13
|
end
|
|
11
14
|
|
|
12
15
|
def signature(_params)
|
|
@@ -112,9 +112,9 @@ module Fog
|
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
# params[:expires] : Eg: Time.now to integer value.
|
|
115
|
-
def url(expires)
|
|
115
|
+
def url(expires, options = {})
|
|
116
116
|
requires :key
|
|
117
|
-
collection.get_https_url(key, expires)
|
|
117
|
+
collection.get_https_url(key, expires, options)
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
private
|
|
@@ -40,9 +40,9 @@ module Fog
|
|
|
40
40
|
nil
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
def get_https_url(key, expires)
|
|
43
|
+
def get_https_url(key, expires, options = {})
|
|
44
44
|
requires :directory
|
|
45
|
-
service.get_object_https_url(directory.key, key, expires)
|
|
45
|
+
service.get_object_https_url(directory.key, key, expires, options)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def metadata(key, options = {})
|
|
@@ -15,6 +15,9 @@ module Fog
|
|
|
15
15
|
|
|
16
16
|
@client = initialize_google_client(options)
|
|
17
17
|
@storage_json = ::Google::Apis::StorageV1::StorageService.new
|
|
18
|
+
@storage_json.client_options.open_timeout_sec = options[:open_timeout_sec] if options[:open_timeout_sec]
|
|
19
|
+
@storage_json.client_options.read_timeout_sec = options[:read_timeout_sec] if options[:read_timeout_sec]
|
|
20
|
+
@storage_json.client_options.send_timeout_sec = options[:send_timeout_sec] if options[:send_timeout_sec]
|
|
18
21
|
end
|
|
19
22
|
|
|
20
23
|
def signature(params)
|
|
@@ -2,15 +2,14 @@ module Fog
|
|
|
2
2
|
module Storage
|
|
3
3
|
class GoogleJSON
|
|
4
4
|
module GetObjectHttpUrl
|
|
5
|
-
def get_object_http_url(bucket_name, object_name, expires)
|
|
5
|
+
def get_object_http_url(bucket_name, object_name, expires, options = {})
|
|
6
6
|
raise ArgumentError.new("bucket_name is required") unless bucket_name
|
|
7
7
|
raise ArgumentError.new("object_name is required") unless object_name
|
|
8
|
-
http_url({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, expires)
|
|
8
|
+
http_url(options.merge(:headers => {},
|
|
9
|
+
:host => @host,
|
|
10
|
+
:method => "GET",
|
|
11
|
+
:path => "#{bucket_name}/#{object_name}"),
|
|
12
|
+
expires)
|
|
14
13
|
end
|
|
15
14
|
end
|
|
16
15
|
|
|
@@ -2,16 +2,15 @@ module Fog
|
|
|
2
2
|
module Storage
|
|
3
3
|
class GoogleJSON
|
|
4
4
|
module GetObjectHttpsUrl
|
|
5
|
-
def get_object_https_url(bucket_name, object_name, expires)
|
|
5
|
+
def get_object_https_url(bucket_name, object_name, expires, options = {})
|
|
6
6
|
raise ArgumentError.new("bucket_name is required") unless bucket_name
|
|
7
7
|
raise ArgumentError.new("object_name is required") unless object_name
|
|
8
8
|
|
|
9
|
-
https_url({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, expires)
|
|
9
|
+
https_url(options.merge(:headers => {},
|
|
10
|
+
:host => @host,
|
|
11
|
+
:method => "GET",
|
|
12
|
+
:path => "#{bucket_name}/#{object_name}"),
|
|
13
|
+
expires)
|
|
15
14
|
end
|
|
16
15
|
end
|
|
17
16
|
|
|
@@ -4,16 +4,16 @@ module Fog
|
|
|
4
4
|
class Real
|
|
5
5
|
# Get an expiring object url from GCS
|
|
6
6
|
# Deprecated, redirects to get_object_https_url.rb
|
|
7
|
-
def get_object_url(bucket_name, object_name, expires)
|
|
7
|
+
def get_object_url(bucket_name, object_name, expires, options = {})
|
|
8
8
|
Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
|
|
9
|
-
get_object_https_url(bucket_name, object_name, expires)
|
|
9
|
+
get_object_https_url(bucket_name, object_name, expires, options)
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
class Mock # :nodoc:all
|
|
14
|
-
def get_object_url(bucket_name, object_name, expires)
|
|
14
|
+
def get_object_url(bucket_name, object_name, expires, options = {})
|
|
15
15
|
Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
|
|
16
|
-
get_object_https_url(bucket_name, object_name, expires)
|
|
16
|
+
get_object_https_url(bucket_name, object_name, expires, options)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -20,7 +20,13 @@ module Fog
|
|
|
20
20
|
def host_path_query(params, expires)
|
|
21
21
|
params[:headers]["Date"] = expires.to_i
|
|
22
22
|
params[:path] = URI.encode(params[:path]).gsub("%2F", "/")
|
|
23
|
-
query = [
|
|
23
|
+
query = []
|
|
24
|
+
|
|
25
|
+
if params[:query]
|
|
26
|
+
filtered = params[:query].reject { |k, v| k.nil? || v.nil? }
|
|
27
|
+
query = filtered.map { |k, v| [k.to_s, Fog::Google.escape(v)].join("=") }
|
|
28
|
+
end
|
|
29
|
+
|
|
24
30
|
query << "GoogleAccessId=#{@client.issuer}"
|
|
25
31
|
query << "Signature=#{CGI.escape(signature(params))}"
|
|
26
32
|
query << "Expires=#{params[:headers]['Date']}"
|
|
@@ -66,14 +66,14 @@ module Fog
|
|
|
66
66
|
nil
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
def get_http_url(key, expires)
|
|
69
|
+
def get_http_url(key, expires, options = {})
|
|
70
70
|
requires :directory
|
|
71
|
-
service.get_object_http_url(directory.key, key, expires)
|
|
71
|
+
service.get_object_http_url(directory.key, key, expires, options)
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
def get_https_url(key, expires)
|
|
74
|
+
def get_https_url(key, expires, options = {})
|
|
75
75
|
requires :directory
|
|
76
|
-
service.get_object_https_url(directory.key, key, expires)
|
|
76
|
+
service.get_object_https_url(directory.key, key, expires, options)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
def head(key, options = {})
|
|
@@ -2,15 +2,16 @@ module Fog
|
|
|
2
2
|
module Storage
|
|
3
3
|
class GoogleXML
|
|
4
4
|
module GetObjectHttpUrl
|
|
5
|
-
def get_object_http_url(bucket_name, object_name, expires)
|
|
5
|
+
def get_object_http_url(bucket_name, object_name, expires, options = {})
|
|
6
6
|
raise ArgumentError.new("bucket_name is required") unless bucket_name
|
|
7
7
|
raise ArgumentError.new("object_name is required") unless object_name
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
|
|
9
|
+
https_url(options.merge(:headers => {},
|
|
10
|
+
:host => @host,
|
|
11
|
+
:method => "GET",
|
|
12
|
+
:path => "#{bucket_name}/#{object_name}"),
|
|
13
|
+
expires)
|
|
14
|
+
http_url(url_options, expires)
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
|
|
@@ -2,15 +2,15 @@ module Fog
|
|
|
2
2
|
module Storage
|
|
3
3
|
class GoogleXML
|
|
4
4
|
module GetObjectHttpsUrl
|
|
5
|
-
def get_object_https_url(bucket_name, object_name, expires)
|
|
5
|
+
def get_object_https_url(bucket_name, object_name, expires, options)
|
|
6
6
|
raise ArgumentError.new("bucket_name is required") unless bucket_name
|
|
7
7
|
raise ArgumentError.new("object_name is required") unless object_name
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
|
|
9
|
+
https_url(options.merge(:headers => {},
|
|
10
|
+
:host => @host,
|
|
11
|
+
:method => "GET",
|
|
12
|
+
:path => "#{bucket_name}/#{object_name}"),
|
|
13
|
+
expires)
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -8,21 +8,22 @@ module Fog
|
|
|
8
8
|
# * bucket_name<~String> - Name of bucket containing object
|
|
9
9
|
# * object_name<~String> - Name of object to get expiring url for
|
|
10
10
|
# * expires<~Time> - An expiry time for this url
|
|
11
|
+
# * options<~Hash> - A list of key-value pairs to send as query strings
|
|
11
12
|
#
|
|
12
13
|
# ==== Returns
|
|
13
14
|
# * response<~Excon::Response>:
|
|
14
15
|
# * body<~String> - url for object
|
|
15
16
|
|
|
16
|
-
def get_object_url(bucket_name, object_name, expires)
|
|
17
|
+
def get_object_url(bucket_name, object_name, expires, options = {})
|
|
17
18
|
Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})")
|
|
18
|
-
get_object_https_url(bucket_name, object_name, expires)
|
|
19
|
+
get_object_https_url(bucket_name, object_name, expires, options)
|
|
19
20
|
end
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
class Mock # :nodoc:all
|
|
23
|
-
def get_object_url(bucket_name, object_name, expires)
|
|
24
|
+
def get_object_url(bucket_name, object_name, expires, options = {})
|
|
24
25
|
Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(1..1).first})")
|
|
25
|
-
get_object_https_url(bucket_name, object_name, expires)
|
|
26
|
+
get_object_https_url(bucket_name, object_name, expires, options)
|
|
26
27
|
end
|
|
27
28
|
end
|
|
28
29
|
end
|
|
@@ -31,7 +31,13 @@ module Fog
|
|
|
31
31
|
def host_path_query(params, expires)
|
|
32
32
|
params[:headers]["Date"] = expires.to_i
|
|
33
33
|
params[:path] = Fog::Google.escape(params[:path]).gsub("%2F", "/")
|
|
34
|
-
query = [
|
|
34
|
+
query = []
|
|
35
|
+
|
|
36
|
+
if params[:query]
|
|
37
|
+
filtered = params[:query].reject { |k, v| k.nil? || v.nil? }
|
|
38
|
+
query = filtered.map { |k, v| [k.to_s, Fog::Google.escape(v)].join("=") }
|
|
39
|
+
end
|
|
40
|
+
|
|
35
41
|
query << "GoogleAccessId=#{@google_storage_access_key_id}"
|
|
36
42
|
query << "Signature=#{CGI.escape(signature(params))}"
|
|
37
43
|
query << "Expires=#{params[:headers]['Date']}"
|
data/tasks/test.rake
CHANGED
|
@@ -17,28 +17,40 @@ namespace :test do
|
|
|
17
17
|
multitask :parallel => ["test:compute",
|
|
18
18
|
"test:monitoring",
|
|
19
19
|
"test:pubsub",
|
|
20
|
-
"test:
|
|
21
|
-
"test:sqlv2",
|
|
20
|
+
"test:sql",
|
|
22
21
|
"test:storage"]
|
|
23
22
|
|
|
24
23
|
Rake::TestTask.new do |t|
|
|
25
24
|
t.name = "unit"
|
|
26
25
|
t.description = "Run Unit tests"
|
|
27
26
|
t.libs << "test"
|
|
28
|
-
t.pattern = FileList[
|
|
27
|
+
t.pattern = FileList["test/unit/**/test_*.rb"]
|
|
29
28
|
t.warning = false
|
|
30
29
|
t.verbose = true
|
|
31
30
|
end
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
# This autogenerates rake tasks based on test folder structures
|
|
33
|
+
# This is done to simplify running many test suites in parallel
|
|
34
|
+
COMPUTE_TEST_TASKS = []
|
|
35
|
+
Dir.glob("test/integration/compute/**").each do |task|
|
|
36
|
+
suite_collection = task.gsub(/test\/integration\/compute\//, "")
|
|
37
|
+
component_name = task.gsub(/test\/integration\//, "").split("/").first
|
|
38
|
+
Rake::TestTask.new(:"#{component_name}-#{suite_collection}") do |t|
|
|
39
|
+
t.libs << "test"
|
|
40
|
+
t.description = "Autotask - run #{component_name} integration tests - #{suite_collection}"
|
|
41
|
+
t.pattern = FileList["test/integration/#{component_name}/#{suite_collection}/test_*.rb"]
|
|
42
|
+
t.warning = false
|
|
43
|
+
t.verbose = true
|
|
44
|
+
end
|
|
45
|
+
COMPUTE_TEST_TASKS << "#{component_name}-#{suite_collection}"
|
|
40
46
|
end
|
|
41
47
|
|
|
48
|
+
desc "Run Compute API tests"
|
|
49
|
+
task :compute => COMPUTE_TEST_TASKS
|
|
50
|
+
|
|
51
|
+
desc "Run Compute API tests in parallel"
|
|
52
|
+
multitask :compute_parallel => COMPUTE_TEST_TASKS
|
|
53
|
+
|
|
42
54
|
Rake::TestTask.new do |t|
|
|
43
55
|
t.name = "monitoring"
|
|
44
56
|
t.description = "Run Monitoring API tests"
|
|
@@ -57,23 +69,33 @@ namespace :test do
|
|
|
57
69
|
t.verbose = true
|
|
58
70
|
end
|
|
59
71
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
# This autogenerates rake tasks based on test folder structures
|
|
73
|
+
# This is done to simplify running many test suites in parallel
|
|
74
|
+
SQL_TEST_TASKS = []
|
|
75
|
+
Dir.glob("test/integration/sql/**").each do |task|
|
|
76
|
+
suite_collection = task.gsub(/test\/integration\/sql\//, "")
|
|
77
|
+
component_name = task.gsub(/test\/integration\//, "").split("/").first
|
|
78
|
+
Rake::TestTask.new(:"#{component_name}-#{suite_collection}") do |t|
|
|
79
|
+
t.libs << "test"
|
|
80
|
+
t.description = "Autotask - run #{component_name} integration tests - #{suite_collection}"
|
|
81
|
+
t.pattern = FileList["test/integration/#{component_name}/#{suite_collection}/test_*.rb"]
|
|
82
|
+
t.warning = false
|
|
83
|
+
t.verbose = true
|
|
84
|
+
end
|
|
85
|
+
SQL_TEST_TASKS << "#{component_name}-#{suite_collection}"
|
|
70
86
|
end
|
|
71
87
|
|
|
88
|
+
desc "Run SQL API tests"
|
|
89
|
+
task :compute => SQL_TEST_TASKS
|
|
90
|
+
|
|
91
|
+
desc "Run SQL API tests in parallel"
|
|
92
|
+
multitask :compute_parallel => SQL_TEST_TASKS
|
|
93
|
+
|
|
72
94
|
Rake::TestTask.new do |t|
|
|
73
|
-
t.name = "
|
|
74
|
-
t.description = "Run
|
|
95
|
+
t.name = "sql"
|
|
96
|
+
t.description = "Run SQL API tests"
|
|
75
97
|
t.libs << "test"
|
|
76
|
-
t.pattern = FileList["test/integration/sql/
|
|
98
|
+
t.pattern = FileList["test/integration/sql/test_*.rb"]
|
|
77
99
|
t.warning = false
|
|
78
100
|
t.verbose = true
|
|
79
101
|
end
|