fog-google 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/fog/compute/google.rb +22 -0
- data/lib/fog/compute/google/models/global_address.rb +88 -0
- data/lib/fog/compute/google/models/global_addresses.rb +45 -0
- data/lib/fog/compute/google/models/ssl_certificate.rb +35 -0
- data/lib/fog/compute/google/models/ssl_certificates.rb +22 -0
- data/lib/fog/compute/google/models/target_http_proxy.rb +4 -4
- data/lib/fog/compute/google/models/target_https_proxies.rb +22 -0
- data/lib/fog/compute/google/models/target_https_proxy.rb +73 -0
- data/lib/fog/compute/google/requests/delete_global_address.rb +22 -0
- data/lib/fog/compute/google/requests/delete_ssl_certificate.rb +23 -0
- data/lib/fog/compute/google/requests/delete_target_https_proxy.rb +23 -0
- data/lib/fog/compute/google/requests/get_global_address.rb +22 -0
- data/lib/fog/compute/google/requests/get_ssl_certificate.rb +22 -0
- data/lib/fog/compute/google/requests/get_target_https_proxy.rb +23 -0
- data/lib/fog/compute/google/requests/insert_global_address.rb +24 -0
- data/lib/fog/compute/google/requests/insert_ssl_certificate.rb +29 -0
- data/lib/fog/compute/google/requests/insert_target_https_proxy.rb +24 -0
- data/lib/fog/compute/google/requests/list_ssl_certificates.rb +21 -0
- data/lib/fog/compute/google/requests/list_target_https_proxies.rb +22 -0
- data/lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb +27 -0
- data/lib/fog/google/version.rb +1 -1
- metadata +19 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 700ff2a01dca32bc1c4508a52cc1b579f1bb42ca
|
4
|
+
data.tar.gz: 4c469d31400a3a9fb0787de5fe25cd4ccda3db03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9669170e0b975040b8c44bd054fe51b30408c0fef952431635bd051fe63dc4f4916dc7d186fa4811c0f31b6d06dec2cf6e37e5e3dd6f1f30af87d1d361425a5f
|
7
|
+
data.tar.gz: efba4ba3ddffa5346f4d18eae18bcd491d69788dcc0cbd870d128e4e92132659d49e0845fc4735f922ca44ebfa97be25c3d40c123ccf42c707b3039130d6c901
|
data/.gitignore
CHANGED
data/lib/fog/compute/google.rb
CHANGED
@@ -40,6 +40,7 @@ module Fog
|
|
40
40
|
request :add_zone_view_resources
|
41
41
|
|
42
42
|
request :delete_address
|
43
|
+
request :delete_global_address
|
43
44
|
request :delete_backend_service
|
44
45
|
request :delete_disk
|
45
46
|
request :delete_firewall
|
@@ -58,13 +59,16 @@ module Fog
|
|
58
59
|
request :delete_snapshot
|
59
60
|
request :delete_subnetwork
|
60
61
|
request :delete_target_http_proxy
|
62
|
+
request :delete_target_https_proxy
|
61
63
|
request :delete_target_instance
|
62
64
|
request :delete_target_pool
|
63
65
|
request :delete_url_map
|
64
66
|
request :delete_zone_operation
|
65
67
|
request :delete_zone_view
|
68
|
+
request :delete_ssl_certificate
|
66
69
|
|
67
70
|
request :get_address
|
71
|
+
request :get_global_address
|
68
72
|
request :get_backend_service
|
69
73
|
request :get_backend_service_health
|
70
74
|
request :get_disk
|
@@ -89,6 +93,7 @@ module Fog
|
|
89
93
|
request :get_snapshot
|
90
94
|
request :get_subnetwork
|
91
95
|
request :get_target_http_proxy
|
96
|
+
request :get_target_https_proxy
|
92
97
|
request :get_target_instance
|
93
98
|
request :get_target_pool
|
94
99
|
request :get_target_pool_health
|
@@ -96,8 +101,10 @@ module Fog
|
|
96
101
|
request :get_zone
|
97
102
|
request :get_zone_operation
|
98
103
|
request :get_zone_view
|
104
|
+
request :get_ssl_certificate
|
99
105
|
|
100
106
|
request :insert_address
|
107
|
+
request :insert_global_address
|
101
108
|
request :insert_backend_service
|
102
109
|
request :insert_disk
|
103
110
|
request :insert_firewall
|
@@ -114,10 +121,12 @@ module Fog
|
|
114
121
|
request :insert_snapshot
|
115
122
|
request :insert_subnetwork
|
116
123
|
request :insert_target_http_proxy
|
124
|
+
request :insert_target_https_proxy
|
117
125
|
request :insert_target_instance
|
118
126
|
request :insert_target_pool
|
119
127
|
request :insert_url_map
|
120
128
|
request :insert_zone_view
|
129
|
+
request :insert_ssl_certificate
|
121
130
|
|
122
131
|
request :list_addresses
|
123
132
|
request :list_aggregated_addresses
|
@@ -150,6 +159,7 @@ module Fog
|
|
150
159
|
request :list_snapshots
|
151
160
|
request :list_subnetworks
|
152
161
|
request :list_target_http_proxies
|
162
|
+
request :list_target_https_proxies
|
153
163
|
request :list_target_instances
|
154
164
|
request :list_target_pools
|
155
165
|
request :list_url_maps
|
@@ -157,6 +167,7 @@ module Fog
|
|
157
167
|
request :list_zone_view_resources
|
158
168
|
request :list_zone_views
|
159
169
|
request :list_zones
|
170
|
+
request :list_ssl_certificates
|
160
171
|
|
161
172
|
request :remove_instance_group_instances
|
162
173
|
request :remove_target_pool_health_checks
|
@@ -170,6 +181,8 @@ module Fog
|
|
170
181
|
request :set_server_scheduling
|
171
182
|
request :set_tags
|
172
183
|
request :set_target_http_proxy_url_map
|
184
|
+
request :set_target_https_proxy_url_map
|
185
|
+
|
173
186
|
|
174
187
|
request :attach_disk
|
175
188
|
request :detach_disk
|
@@ -198,6 +211,9 @@ module Fog
|
|
198
211
|
model :address
|
199
212
|
collection :addresses
|
200
213
|
|
214
|
+
model :global_address
|
215
|
+
collection :global_addresses
|
216
|
+
|
201
217
|
model :operation
|
202
218
|
collection :operations
|
203
219
|
|
@@ -237,6 +253,9 @@ module Fog
|
|
237
253
|
model :target_http_proxy
|
238
254
|
collection :target_http_proxies
|
239
255
|
|
256
|
+
model :target_https_proxy
|
257
|
+
collection :target_https_proxies
|
258
|
+
|
240
259
|
model :url_map
|
241
260
|
collection :url_maps
|
242
261
|
|
@@ -254,6 +273,9 @@ module Fog
|
|
254
273
|
|
255
274
|
model :subnetwork
|
256
275
|
collection :subnetworks
|
276
|
+
|
277
|
+
model :ssl_certificate
|
278
|
+
collection :ssl_certificates
|
257
279
|
end
|
258
280
|
end
|
259
281
|
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
##
|
5
|
+
# Represents an Address resource
|
6
|
+
#
|
7
|
+
# @see https://developers.google.com/compute/docs/reference/latest/addresses
|
8
|
+
class GlobalAddress < Fog::Model
|
9
|
+
identity :name
|
10
|
+
|
11
|
+
attribute :kind
|
12
|
+
attribute :id
|
13
|
+
attribute :address
|
14
|
+
attribute :creation_timestamp, :aliases => "creationTimestamp"
|
15
|
+
attribute :description
|
16
|
+
attribute :self_link, :aliases => "selfLink"
|
17
|
+
attribute :status
|
18
|
+
attribute :users
|
19
|
+
|
20
|
+
IN_USE_STATE = "IN_USE".freeze
|
21
|
+
RESERVED_STATE = "RESERVED".freeze
|
22
|
+
|
23
|
+
def server
|
24
|
+
return nil if !in_use? || users.nil? || users.empty?
|
25
|
+
|
26
|
+
service.servers.get(users.first.split("/")[-1])
|
27
|
+
end
|
28
|
+
|
29
|
+
def server=(server)
|
30
|
+
requires :identity
|
31
|
+
server ? associate(server) : disassociate
|
32
|
+
end
|
33
|
+
|
34
|
+
def save
|
35
|
+
requires :identity
|
36
|
+
|
37
|
+
data = service.insert_global_address(identity, attributes)
|
38
|
+
operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"], nil)
|
39
|
+
operation.wait_for { !pending? }
|
40
|
+
reload
|
41
|
+
end
|
42
|
+
|
43
|
+
def destroy(async = true)
|
44
|
+
requires :identity
|
45
|
+
|
46
|
+
data = service.delete_global_address(identity)
|
47
|
+
operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"], nil)
|
48
|
+
operation.wait_for { ready? } unless async
|
49
|
+
operation
|
50
|
+
end
|
51
|
+
|
52
|
+
def reload
|
53
|
+
requires :identity
|
54
|
+
|
55
|
+
data = collection.get(identity)
|
56
|
+
merge_attributes(data.attributes)
|
57
|
+
self
|
58
|
+
end
|
59
|
+
|
60
|
+
def in_use?
|
61
|
+
status == IN_USE_STATE
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def associate(server)
|
67
|
+
nic = server.network_interfaces.first["name"]
|
68
|
+
data = service.add_server_access_config(server.name, server.zone_name, nic, :address => address)
|
69
|
+
Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"], data.body["zone"])
|
70
|
+
end
|
71
|
+
|
72
|
+
def disassociate
|
73
|
+
return nil if !in_use? || users.nil? || users.empty?
|
74
|
+
|
75
|
+
# An address can only be associated with one server at a time
|
76
|
+
server = service.servers.get(users.first.split("/")[-1])
|
77
|
+
nic = server.network_interfaces.first["name"]
|
78
|
+
unless server.network_interfaces.first["accessConfigs"].nil? || server.network_interfaces.first["accessConfigs"].empty?
|
79
|
+
access_config = server.network_interfaces.first["accessConfigs"].first["name"]
|
80
|
+
data = service.delete_server_access_config(server.name, server.zone_name, nic,
|
81
|
+
:access_config => access_config)
|
82
|
+
Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"], data.body["zone"])
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class GlobalAddresses < Fog::Collection
|
5
|
+
model Fog::Compute::Google::GlobalAddress
|
6
|
+
|
7
|
+
def all(_filters = {})
|
8
|
+
data = []
|
9
|
+
service.list_aggregated_addresses.body["items"].each_value do |region|
|
10
|
+
data.concat(region["addresses"]) if region["addresses"]
|
11
|
+
end
|
12
|
+
load(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(identity)
|
16
|
+
if address = service.get_global_address(identity).body
|
17
|
+
new(address)
|
18
|
+
end
|
19
|
+
rescue Fog::Errors::NotFound
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def get_by_ip_address(ip_address)
|
24
|
+
addresses = service.list_aggregated_addresses(:filter => "address eq .*#{ip_address}").body["items"]
|
25
|
+
address = addresses.each_value.select { |region| region.key?("addresses") }
|
26
|
+
|
27
|
+
return nil if address.empty?
|
28
|
+
new(address.first["addresses"].first)
|
29
|
+
end
|
30
|
+
|
31
|
+
def get_by_name(ip_name)
|
32
|
+
names = service.list_aggregated_addresses(:filter => "name eq .*#{ip_name}").body["items"]
|
33
|
+
name = names.each_value.select { |region| region.key?("addresses") }
|
34
|
+
|
35
|
+
return nil if name.empty?
|
36
|
+
new(name.first["addresses"].first)
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_by_ip_address_or_name(ip_address_or_name)
|
40
|
+
get_by_ip_address(ip_address_or_name) || get_by_name(ip_address_or_name)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
##
|
5
|
+
# Represents a Subnetwork resource
|
6
|
+
#
|
7
|
+
# @see https://cloud.google.com/compute/docs/reference/latest/sslCertificates
|
8
|
+
class SslCertificate < Fog::Model
|
9
|
+
identity :name
|
10
|
+
attribute :id
|
11
|
+
attribute :creation_timestamp, :aliases => "creationTimestamp"
|
12
|
+
attribute :description
|
13
|
+
attribute :self_link, :aliases => "selfLink"
|
14
|
+
attribute :certificate
|
15
|
+
attribute :private_key, :aliases => "privateKey"
|
16
|
+
|
17
|
+
def save
|
18
|
+
requires :identity, :certificate, :private_key
|
19
|
+
data = service.insert_ssl_certificate(identity, certificate, private_key, attributes)
|
20
|
+
operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"], nil)
|
21
|
+
operation.wait_for { !pending? }
|
22
|
+
reload
|
23
|
+
end
|
24
|
+
|
25
|
+
def destroy(async = true)
|
26
|
+
requires :identity
|
27
|
+
data = service.delete_ssl_certificate(identity)
|
28
|
+
operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"], nil)
|
29
|
+
operation.wait_for { ready? } unless async
|
30
|
+
operation
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class SslCertificates < Fog::Collection
|
5
|
+
model Fog::Compute::Google::SslCertificate
|
6
|
+
|
7
|
+
def get(certificate_name)
|
8
|
+
if certificate = service.get_ssl_certificate(certificate_name).body
|
9
|
+
new(certificate)
|
10
|
+
end
|
11
|
+
rescue Fog::Errors::NotFound
|
12
|
+
nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def all(_filters = {})
|
16
|
+
data = service.list_ssl_certificates.body["items"] || []
|
17
|
+
load(data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -16,7 +16,7 @@ module Fog
|
|
16
16
|
|
17
17
|
options = {
|
18
18
|
"description" => description,
|
19
|
-
"urlMap"
|
19
|
+
"urlMap" => url_map
|
20
20
|
}
|
21
21
|
|
22
22
|
data = service.insert_target_http_proxy(name, options).body
|
@@ -38,8 +38,8 @@ module Fog
|
|
38
38
|
operation
|
39
39
|
end
|
40
40
|
|
41
|
-
def set_url_map(
|
42
|
-
|
41
|
+
def set_url_map(url_map)
|
42
|
+
service.set_target_http_proxy_url_map(self, url_map)
|
43
43
|
reload
|
44
44
|
end
|
45
45
|
|
@@ -64,7 +64,7 @@ module Fog
|
|
64
64
|
self
|
65
65
|
end
|
66
66
|
|
67
|
-
RUNNING_STATE = "READY"
|
67
|
+
RUNNING_STATE = "READY".freeze
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class TargetHttpsProxies < Fog::Collection
|
5
|
+
model Fog::Compute::Google::TargetHttpsProxy
|
6
|
+
|
7
|
+
def all(_filters = {})
|
8
|
+
data = service.list_target_https_proxies.body["items"] || []
|
9
|
+
load(data)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(identity)
|
13
|
+
if target_https_proxy = service.get_target_https_proxy(identity).body
|
14
|
+
new(target_https_proxy)
|
15
|
+
end
|
16
|
+
rescue Fog::Errors::NotFound
|
17
|
+
nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class TargetHttpsProxy < Fog::Model
|
5
|
+
identity :name
|
6
|
+
|
7
|
+
attribute :kind, :aliases => "kind"
|
8
|
+
attribute :self_link, :aliases => "selfLink"
|
9
|
+
attribute :id, :aliases => "id"
|
10
|
+
attribute :creation_timestamp, :aliases => "creationTimestamp"
|
11
|
+
attribute :description, :aliases => "description"
|
12
|
+
attribute :url_map, :aliases => "urlMap"
|
13
|
+
attribute :ssl_certificates, :aliases => "sslCertificates"
|
14
|
+
|
15
|
+
def save
|
16
|
+
requires :name
|
17
|
+
|
18
|
+
options = {
|
19
|
+
"description" => description,
|
20
|
+
"urlMap" => url_map,
|
21
|
+
"sslCertificates" => ssl_certificates
|
22
|
+
}
|
23
|
+
|
24
|
+
data = service.insert_target_https_proxy(name, options).body
|
25
|
+
operation = Fog::Compute::Google::Operations.new(:service => service).get(data["name"])
|
26
|
+
operation.wait_for { !pending? }
|
27
|
+
reload
|
28
|
+
end
|
29
|
+
|
30
|
+
def destroy(async = true)
|
31
|
+
requires :name
|
32
|
+
operation = service.delete_target_https_proxy(name)
|
33
|
+
unless async
|
34
|
+
# wait until "DONE" to ensure the operation doesn't fail, raises
|
35
|
+
# exception on error
|
36
|
+
Fog.wait_for do
|
37
|
+
operation.body["status"] == "DONE"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
operation
|
41
|
+
end
|
42
|
+
|
43
|
+
def set_url_map(url_map)
|
44
|
+
service.set_target_https_proxy_url_map(self, url_map)
|
45
|
+
reload
|
46
|
+
end
|
47
|
+
|
48
|
+
def ready?
|
49
|
+
service.get_target_https_proxy(name)
|
50
|
+
true
|
51
|
+
rescue Fog::Errors::NotFound
|
52
|
+
false
|
53
|
+
end
|
54
|
+
|
55
|
+
def reload
|
56
|
+
requires :name
|
57
|
+
|
58
|
+
return unless data = begin
|
59
|
+
collection.get(name)
|
60
|
+
rescue Excon::Errors::SocketError
|
61
|
+
nil
|
62
|
+
end
|
63
|
+
|
64
|
+
new_attributes = data.attributes
|
65
|
+
merge_attributes(new_attributes)
|
66
|
+
self
|
67
|
+
end
|
68
|
+
|
69
|
+
RUNNING_STATE = "READY".freeze
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def delete_global_address(_address_name)
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def delete_global_address(address_name)
|
12
|
+
api_method = @compute.global_addresses.delete
|
13
|
+
parameters = {
|
14
|
+
"project" => @project,
|
15
|
+
"address" => address_name,
|
16
|
+
}
|
17
|
+
request(api_method, parameters)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def delete_ssl_certificate(_certificate_name)
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def delete_ssl_certificate(certificate_name)
|
12
|
+
api_method = @compute.ssl_certificates.delete
|
13
|
+
parameters = {
|
14
|
+
"project" => @project,
|
15
|
+
"sslCertificate" => certificate_name
|
16
|
+
}
|
17
|
+
|
18
|
+
request(api_method, parameters)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def delete_target_https_proxy(_name)
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def delete_target_https_proxy(name)
|
12
|
+
api_method = @compute.target_https_proxies.delete
|
13
|
+
parameters = {
|
14
|
+
"project" => @project,
|
15
|
+
"targetHttpsProxy" => name
|
16
|
+
}
|
17
|
+
|
18
|
+
request(api_method, parameters)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def get_global_address(_address_name)
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def get_global_address(address_name)
|
12
|
+
api_method = @compute.global_addresses.get
|
13
|
+
parameters = {
|
14
|
+
"project" => @project,
|
15
|
+
"address" => address_name
|
16
|
+
}
|
17
|
+
request(api_method, parameters)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def get_ssl_certificate(_certificate_name)
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def get_ssl_certificate(certificate_name)
|
12
|
+
api_method = @compute.ssl_certificates.get
|
13
|
+
parameters = {
|
14
|
+
"project" => @project,
|
15
|
+
"sslCertificate" => certificate_name
|
16
|
+
}
|
17
|
+
request(api_method, parameters)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def get_target_https_proxy(_name)
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def get_target_https_proxy(name)
|
12
|
+
api_method = @compute.target_https_proxies.get
|
13
|
+
parameters = {
|
14
|
+
"project" => @project,
|
15
|
+
"targetHttpsProxy" => name
|
16
|
+
}
|
17
|
+
|
18
|
+
request(api_method, parameters)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def insert_global_address(_address_name, _options = {})
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def insert_global_address(address_name, options = {})
|
12
|
+
api_method = @compute.global_addresses.insert
|
13
|
+
parameters = {
|
14
|
+
"project" => @project
|
15
|
+
}
|
16
|
+
body_object = { "name" => address_name }
|
17
|
+
body_object["description"] = options[:description] if options[:description]
|
18
|
+
|
19
|
+
request(api_method, parameters, body_object)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def insert_ssl_certificate(_certificate_name, _certificate, _private_key, _options = {})
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def insert_ssl_certificate(certificate_name, certificate, private_key, options = {})
|
12
|
+
api_method = @compute.ssl_certificates.insert
|
13
|
+
parameters = {
|
14
|
+
"project" => @project
|
15
|
+
}
|
16
|
+
body_object = {
|
17
|
+
"certificate" => certificate,
|
18
|
+
"name" => certificate_name,
|
19
|
+
"privateKey" => private_key
|
20
|
+
}
|
21
|
+
|
22
|
+
body_object["description"] = options[:description] if options[:description]
|
23
|
+
|
24
|
+
request(api_method, parameters, body_object)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def insert_target_https_proxy(_name, _options = {})
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def insert_target_https_proxy(name, opts = {})
|
12
|
+
api_method = @compute.target_https_proxies.insert
|
13
|
+
parameters = {
|
14
|
+
"project" => @project
|
15
|
+
}
|
16
|
+
body_object = { "name" => name }
|
17
|
+
body_object.merge!(opts)
|
18
|
+
|
19
|
+
request(api_method, parameters, body_object)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def list_ssl_certificates
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def list_ssl_certificates
|
12
|
+
api_method = @compute.ssl_certificates.list
|
13
|
+
parameters = {
|
14
|
+
"project" => @project
|
15
|
+
}
|
16
|
+
request(api_method, parameters)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def list_target_https_proxies
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def list_target_https_proxies
|
12
|
+
api_method = @compute.target_https_proxies.list
|
13
|
+
parameters = {
|
14
|
+
"project" => @project
|
15
|
+
}
|
16
|
+
|
17
|
+
request(api_method, parameters)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Google
|
4
|
+
class Mock
|
5
|
+
def set_target_https_proxy_url_map(_target_https_proxy, _url_map)
|
6
|
+
Fog::Mock.not_implemented
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class Real
|
11
|
+
def set_target_https_proxy_url_map(target_https_proxy, url_map)
|
12
|
+
api_method = @compute.target_https_proxies.set_url_map
|
13
|
+
parameters = {
|
14
|
+
"project" => @project,
|
15
|
+
"targetHttpsProxy" => target_https_proxy.name
|
16
|
+
}
|
17
|
+
url_map = url_map.self_link unless url_map.class == String
|
18
|
+
body = {
|
19
|
+
"urlMap" => url_map
|
20
|
+
}
|
21
|
+
|
22
|
+
request(api_method, parameters, body)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/fog/google/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-google
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Welch
|
@@ -263,6 +263,8 @@ files:
|
|
263
263
|
- lib/fog/compute/google/models/flavors.rb
|
264
264
|
- lib/fog/compute/google/models/forwarding_rule.rb
|
265
265
|
- lib/fog/compute/google/models/forwarding_rules.rb
|
266
|
+
- lib/fog/compute/google/models/global_address.rb
|
267
|
+
- lib/fog/compute/google/models/global_addresses.rb
|
266
268
|
- lib/fog/compute/google/models/global_forwarding_rule.rb
|
267
269
|
- lib/fog/compute/google/models/global_forwarding_rules.rb
|
268
270
|
- lib/fog/compute/google/models/http_health_check.rb
|
@@ -287,10 +289,14 @@ files:
|
|
287
289
|
- lib/fog/compute/google/models/servers.rb
|
288
290
|
- lib/fog/compute/google/models/snapshot.rb
|
289
291
|
- lib/fog/compute/google/models/snapshots.rb
|
292
|
+
- lib/fog/compute/google/models/ssl_certificate.rb
|
293
|
+
- lib/fog/compute/google/models/ssl_certificates.rb
|
290
294
|
- lib/fog/compute/google/models/subnetwork.rb
|
291
295
|
- lib/fog/compute/google/models/subnetworks.rb
|
292
296
|
- lib/fog/compute/google/models/target_http_proxies.rb
|
293
297
|
- lib/fog/compute/google/models/target_http_proxy.rb
|
298
|
+
- lib/fog/compute/google/models/target_https_proxies.rb
|
299
|
+
- lib/fog/compute/google/models/target_https_proxy.rb
|
294
300
|
- lib/fog/compute/google/models/target_instance.rb
|
295
301
|
- lib/fog/compute/google/models/target_instances.rb
|
296
302
|
- lib/fog/compute/google/models/target_pool.rb
|
@@ -315,6 +321,7 @@ files:
|
|
315
321
|
- lib/fog/compute/google/requests/delete_disk.rb
|
316
322
|
- lib/fog/compute/google/requests/delete_firewall.rb
|
317
323
|
- lib/fog/compute/google/requests/delete_forwarding_rule.rb
|
324
|
+
- lib/fog/compute/google/requests/delete_global_address.rb
|
318
325
|
- lib/fog/compute/google/requests/delete_global_forwarding_rule.rb
|
319
326
|
- lib/fog/compute/google/requests/delete_global_operation.rb
|
320
327
|
- lib/fog/compute/google/requests/delete_http_health_check.rb
|
@@ -327,8 +334,10 @@ files:
|
|
327
334
|
- lib/fog/compute/google/requests/delete_server.rb
|
328
335
|
- lib/fog/compute/google/requests/delete_server_access_config.rb
|
329
336
|
- lib/fog/compute/google/requests/delete_snapshot.rb
|
337
|
+
- lib/fog/compute/google/requests/delete_ssl_certificate.rb
|
330
338
|
- lib/fog/compute/google/requests/delete_subnetwork.rb
|
331
339
|
- lib/fog/compute/google/requests/delete_target_http_proxy.rb
|
340
|
+
- lib/fog/compute/google/requests/delete_target_https_proxy.rb
|
332
341
|
- lib/fog/compute/google/requests/delete_target_instance.rb
|
333
342
|
- lib/fog/compute/google/requests/delete_target_pool.rb
|
334
343
|
- lib/fog/compute/google/requests/delete_url_map.rb
|
@@ -343,6 +352,7 @@ files:
|
|
343
352
|
- lib/fog/compute/google/requests/get_disk_type.rb
|
344
353
|
- lib/fog/compute/google/requests/get_firewall.rb
|
345
354
|
- lib/fog/compute/google/requests/get_forwarding_rule.rb
|
355
|
+
- lib/fog/compute/google/requests/get_global_address.rb
|
346
356
|
- lib/fog/compute/google/requests/get_global_forwarding_rule.rb
|
347
357
|
- lib/fog/compute/google/requests/get_global_operation.rb
|
348
358
|
- lib/fog/compute/google/requests/get_http_health_check.rb
|
@@ -359,8 +369,10 @@ files:
|
|
359
369
|
- lib/fog/compute/google/requests/get_server.rb
|
360
370
|
- lib/fog/compute/google/requests/get_server_serial_port_output.rb
|
361
371
|
- lib/fog/compute/google/requests/get_snapshot.rb
|
372
|
+
- lib/fog/compute/google/requests/get_ssl_certificate.rb
|
362
373
|
- lib/fog/compute/google/requests/get_subnetwork.rb
|
363
374
|
- lib/fog/compute/google/requests/get_target_http_proxy.rb
|
375
|
+
- lib/fog/compute/google/requests/get_target_https_proxy.rb
|
364
376
|
- lib/fog/compute/google/requests/get_target_instance.rb
|
365
377
|
- lib/fog/compute/google/requests/get_target_pool.rb
|
366
378
|
- lib/fog/compute/google/requests/get_target_pool_health.rb
|
@@ -373,6 +385,7 @@ files:
|
|
373
385
|
- lib/fog/compute/google/requests/insert_disk.rb
|
374
386
|
- lib/fog/compute/google/requests/insert_firewall.rb
|
375
387
|
- lib/fog/compute/google/requests/insert_forwarding_rule.rb
|
388
|
+
- lib/fog/compute/google/requests/insert_global_address.rb
|
376
389
|
- lib/fog/compute/google/requests/insert_global_forwarding_rule.rb
|
377
390
|
- lib/fog/compute/google/requests/insert_http_health_check.rb
|
378
391
|
- lib/fog/compute/google/requests/insert_image.rb
|
@@ -382,8 +395,10 @@ files:
|
|
382
395
|
- lib/fog/compute/google/requests/insert_route.rb
|
383
396
|
- lib/fog/compute/google/requests/insert_server.rb
|
384
397
|
- lib/fog/compute/google/requests/insert_snapshot.rb
|
398
|
+
- lib/fog/compute/google/requests/insert_ssl_certificate.rb
|
385
399
|
- lib/fog/compute/google/requests/insert_subnetwork.rb
|
386
400
|
- lib/fog/compute/google/requests/insert_target_http_proxy.rb
|
401
|
+
- lib/fog/compute/google/requests/insert_target_https_proxy.rb
|
387
402
|
- lib/fog/compute/google/requests/insert_target_instance.rb
|
388
403
|
- lib/fog/compute/google/requests/insert_target_pool.rb
|
389
404
|
- lib/fog/compute/google/requests/insert_url_map.rb
|
@@ -417,8 +432,10 @@ files:
|
|
417
432
|
- lib/fog/compute/google/requests/list_routes.rb
|
418
433
|
- lib/fog/compute/google/requests/list_servers.rb
|
419
434
|
- lib/fog/compute/google/requests/list_snapshots.rb
|
435
|
+
- lib/fog/compute/google/requests/list_ssl_certificates.rb
|
420
436
|
- lib/fog/compute/google/requests/list_subnetworks.rb
|
421
437
|
- lib/fog/compute/google/requests/list_target_http_proxies.rb
|
438
|
+
- lib/fog/compute/google/requests/list_target_https_proxies.rb
|
422
439
|
- lib/fog/compute/google/requests/list_target_instances.rb
|
423
440
|
- lib/fog/compute/google/requests/list_target_pools.rb
|
424
441
|
- lib/fog/compute/google/requests/list_url_maps.rb
|
@@ -439,6 +456,7 @@ files:
|
|
439
456
|
- lib/fog/compute/google/requests/set_server_scheduling.rb
|
440
457
|
- lib/fog/compute/google/requests/set_tags.rb
|
441
458
|
- lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb
|
459
|
+
- lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb
|
442
460
|
- lib/fog/compute/google/requests/start_server.rb
|
443
461
|
- lib/fog/compute/google/requests/stop_server.rb
|
444
462
|
- lib/fog/compute/google/requests/update_firewall.rb
|