fog 1.35.0 → 1.36.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/.travis.yml +2 -0
- data/CHANGELOG.md +50 -0
- data/fog.gemspec +6 -6
- data/lib/fog/digitalocean/models/compute/server.rb +0 -1
- data/lib/fog/digitalocean/requests/compute_v2/create_ssh_key.rb +10 -8
- data/lib/fog/digitalocean/requests/compute_v2/delete_ssh_key.rb +5 -1
- data/lib/fog/digitalocean/requests/compute_v2/list_ssh_keys.rb +6 -1
- data/lib/fog/glesys/models/compute/server.rb +0 -1
- data/lib/fog/joyent/compute.rb +6 -1
- data/lib/fog/linode/compute.rb +3 -0
- data/lib/fog/linode/models/compute/data_center.rb +1 -0
- data/lib/fog/linode/models/compute/flavor.rb +3 -0
- data/lib/fog/linode/models/compute/flavors.rb +8 -1
- data/lib/fog/linode/models/compute/image.rb +2 -0
- data/lib/fog/linode/models/compute/images.rb +2 -1
- data/lib/fog/linode/models/compute/kernel.rb +3 -0
- data/lib/fog/linode/models/compute/kernels.rb +14 -8
- data/lib/fog/linode/models/compute/node_balancer_flavor.rb +13 -0
- data/lib/fog/linode/models/compute/node_balancer_flavors.rb +27 -0
- data/lib/fog/linode/requests/compute/avail_kernels.rb +17 -18
- data/lib/fog/linode/requests/compute/avail_linodeplans.rb +4 -2
- data/lib/fog/linode/requests/compute/avail_nodebalancers.rb +42 -0
- data/lib/fog/linode/requests/compute/avail_stackscripts.rb +6 -11
- data/lib/fog/openstack/core.rb +22 -21
- data/lib/fog/openstack/models/baremetal/nodes.rb +1 -1
- data/lib/fog/openstack/models/identity_v3/domain.rb +6 -0
- data/lib/fog/openstack/models/identity_v3/domains.rb +19 -4
- data/lib/fog/openstack/models/identity_v3/project.rb +10 -0
- data/lib/fog/openstack/models/identity_v3/projects.rb +16 -3
- data/lib/fog/openstack/models/identity_v3/tokens.rb +1 -0
- data/lib/fog/openstack/models/storage/file.rb +9 -0
- data/lib/fog/openstack/requests/baremetal/delete_node.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/create_node.rb +1 -1
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +8 -0
- data/lib/fog/vsphere/models/compute/network.rb +1 -0
- data/lib/fog/vsphere/models/compute/process.rb +18 -0
- data/lib/fog/vsphere/models/compute/server.rb +29 -0
- data/lib/fog/vsphere/models/compute/snapshot.rb +35 -0
- data/lib/fog/vsphere/models/compute/snapshots.rb +27 -0
- data/lib/fog/vsphere/requests/compute/create_vm.rb +65 -2
- data/lib/fog/vsphere/requests/compute/list_child_snapshots.rb +71 -0
- data/lib/fog/vsphere/requests/compute/list_networks.rb +5 -4
- data/lib/fog/vsphere/requests/compute/list_processes.rb +41 -0
- data/lib/fog/vsphere/requests/compute/list_vm_snapshots.rb +66 -0
- data/lib/fog/vsphere/requests/compute/revert_to_snapshot.rb +30 -0
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +2 -5
- data/lib/fog/vsphere/requests/compute/vm_take_snapshot.rb +37 -0
- data/lib/tasks/changelog_task.rb +1 -0
- data/spec/fog/openstack/identity_v3/authv3_a.yml +18 -18
- data/spec/fog/openstack/identity_v3/authv3_b.yml +18 -18
- data/spec/fog/openstack/identity_v3/authv3_c.yml +293 -55
- data/spec/fog/openstack/identity_v3/authv3_token.yml +89 -89
- data/spec/fog/openstack/identity_v3/authv3_unscoped.yml +325 -222
- data/spec/fog/openstack/identity_v3/authv3_unscoped_reauth.yml +587 -111
- data/spec/fog/openstack/identity_v3/common_setup.yml +30 -30
- data/spec/fog/openstack/identity_v3/idv3_credential.yml +17 -17
- data/spec/fog/openstack/identity_v3/idv3_credential_crud.yml +343 -106
- data/spec/fog/openstack/identity_v3/idv3_domain.yml +27 -122
- data/spec/fog/openstack/identity_v3/idv3_domain_crud.yml +75 -128
- data/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml +141 -141
- data/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml +326 -86
- data/spec/fog/openstack/identity_v3/idv3_endpoint.yml +221 -221
- data/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml +314 -314
- data/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml +191 -188
- data/spec/fog/openstack/identity_v3/idv3_policy.yml +23 -23
- data/spec/fog/openstack/identity_v3/idv3_policy_crud.yml +67 -67
- data/spec/fog/openstack/identity_v3/idv3_project.yml +267 -161
- data/spec/fog/openstack/identity_v3/idv3_project_crud.yml +70 -145
- data/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml +195 -243
- data/spec/fog/openstack/identity_v3/idv3_project_hier_crud_list.yml +203 -553
- data/spec/fog/openstack/identity_v3/idv3_role.yml +49 -49
- data/spec/fog/openstack/identity_v3/idv3_role_crud.yml +92 -92
- data/spec/fog/openstack/identity_v3/idv3_service.yml +61 -61
- data/spec/fog/openstack/identity_v3/idv3_services_crud.yml +111 -111
- data/spec/fog/openstack/identity_v3/idv3_token.yml +84 -84
- data/spec/fog/openstack/identity_v3/idv3_user_crud.yml +140 -125
- data/spec/fog/openstack/identity_v3/idv3_users.yml +98 -78
- data/spec/fog/openstack/network/common_setup.yml +84 -75
- data/spec/fog/openstack/network/subnets_crud.yml +75 -35
- data/spec/fog/openstack/shared_context.rb +5 -1
- data/tests/helper.rb +1 -0
- data/tests/linode/requests/compute/datacenter_tests.rb +2 -1
- data/tests/linode/requests/compute/kernel_tests.rb +2 -10
- data/tests/linode/requests/compute/linodeplans_tests.rb +10 -7
- data/tests/linode/requests/compute/nodebalancers_tests.rb +20 -0
- data/tests/openstack/models/storage/file_tests.rb +29 -0
- data/tests/rackspace/requests/load_balancers/node_tests.rb +7 -0
- data/tests/vsphere/models/compute/server_tests.rb +27 -1
- data/tests/vsphere/requests/compute/list_child_snapshots_tests.rb +10 -0
- data/tests/vsphere/requests/compute/list_vm_snapshots_tests.rb +10 -0
- data/tests/vsphere/requests/compute/revert_to_snapshot_tests.rb +15 -0
- data/tests/vsphere/requests/compute/vm_take_snapshot_tests.rb +19 -0
- metadata +41 -16
- data/spec/fog/openstack/identity_v3/authv3_project.yml +0 -98
|
@@ -56,8 +56,10 @@ module Fog
|
|
|
56
56
|
"DISK" => 20,
|
|
57
57
|
"CORES" => 1,
|
|
58
58
|
"AVAIL" => {
|
|
59
|
-
"
|
|
60
|
-
|
|
59
|
+
"2" => 500, "3" => 500, "4" => 500, "6" => 500, "7" => 500,
|
|
60
|
+
"8" => 500, "9" => 500, "10" => 500
|
|
61
|
+
},
|
|
62
|
+
"HOURLY" => 0.03
|
|
61
63
|
}
|
|
62
64
|
end
|
|
63
65
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Linode
|
|
4
|
+
class Real
|
|
5
|
+
# Get NodeBalancer pricing information.
|
|
6
|
+
#
|
|
7
|
+
# ==== Parameters
|
|
8
|
+
#
|
|
9
|
+
# ==== Returns
|
|
10
|
+
# * response<~Excon::Response>:
|
|
11
|
+
# * body<~Array>:
|
|
12
|
+
# * 'MONTHLY'<~Float> - Monthly price
|
|
13
|
+
# * 'HOURLY'<~Float>: - Hourly price
|
|
14
|
+
# * 'CONNECTIONS'<~Integer>: - Maximum concurrent connections
|
|
15
|
+
def avail_nodebalancers
|
|
16
|
+
request(
|
|
17
|
+
:expects => 200,
|
|
18
|
+
:method => 'GET',
|
|
19
|
+
:query => { :api_action => 'avail.nodebalancers' }
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class Mock
|
|
25
|
+
def avail_nodebalancers
|
|
26
|
+
response = Excon::Response.new
|
|
27
|
+
response.status = 200
|
|
28
|
+
response.body = {
|
|
29
|
+
"ERRORARRAY" => [],
|
|
30
|
+
"ACTION" => "avail.nodebalancers",
|
|
31
|
+
"DATA" => [{
|
|
32
|
+
"MONTHLY" => 20.0,
|
|
33
|
+
"HOURLY" => 0.03,
|
|
34
|
+
"CONNECTIONS" => 10000
|
|
35
|
+
}]
|
|
36
|
+
}
|
|
37
|
+
response
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -14,7 +14,7 @@ module Fog
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
class Mock
|
|
17
|
-
def avail_stackscripts(
|
|
17
|
+
def avail_stackscripts(options={})
|
|
18
18
|
response = Excon::Response.new
|
|
19
19
|
response.status = 200
|
|
20
20
|
|
|
@@ -22,17 +22,12 @@ module Fog
|
|
|
22
22
|
"ERRORARRAY" => [],
|
|
23
23
|
"ACTION" => "avail.stackscripts"
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
mock_stackscripts = []
|
|
30
|
-
10.times do
|
|
31
|
-
stackscript_id = rand(1..200)
|
|
32
|
-
mock_stackscripts << create_mock_stackscript(stackscript_id)
|
|
33
|
-
end
|
|
34
|
-
response.body = body.merge("DATA" => mock_stackscripts)
|
|
25
|
+
mock_stackscripts = []
|
|
26
|
+
10.times do
|
|
27
|
+
stackscript_id = rand(1..200)
|
|
28
|
+
mock_stackscripts << create_mock_stackscript(stackscript_id)
|
|
35
29
|
end
|
|
30
|
+
response.body = body.merge("DATA" => mock_stackscripts)
|
|
36
31
|
response
|
|
37
32
|
end
|
|
38
33
|
|
data/lib/fog/openstack/core.rb
CHANGED
|
@@ -154,17 +154,16 @@ module Fog
|
|
|
154
154
|
@port = @openstack_management_uri.port
|
|
155
155
|
@scheme = @openstack_management_uri.scheme
|
|
156
156
|
|
|
157
|
-
# Not all implementations have identity service in the catalog
|
|
158
|
-
if @openstack_identity_public_endpoint || @openstack_management_url
|
|
159
|
-
@identity_connection = Fog::Core::Connection.new(
|
|
160
|
-
@openstack_identity_public_endpoint || @openstack_management_url,
|
|
161
|
-
false, @connection_options)
|
|
162
|
-
end
|
|
163
|
-
|
|
164
157
|
true
|
|
165
158
|
end
|
|
166
159
|
end
|
|
167
160
|
|
|
161
|
+
@@token_cache = {}
|
|
162
|
+
|
|
163
|
+
def self.clear_token_cache
|
|
164
|
+
@@token_cache.clear
|
|
165
|
+
end
|
|
166
|
+
|
|
168
167
|
def self.authenticate(options, connection_options = {})
|
|
169
168
|
case options[:openstack_auth_uri].path
|
|
170
169
|
when /v1(\.\d+)?/
|
|
@@ -261,9 +260,9 @@ module Fog
|
|
|
261
260
|
raise Fog::Errors::NotFound, message
|
|
262
261
|
end
|
|
263
262
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
raise Fog::Errors::NotFound.new("Multiple regions available choose one of these '#{regions}'")
|
|
263
|
+
regions = service["endpoints"].map{ |e| e['region'] }.uniq
|
|
264
|
+
if regions.count > 1
|
|
265
|
+
raise Fog::Errors::NotFound.new("Multiple regions available choose one of these '#{regions.join(',')}'")
|
|
267
266
|
end
|
|
268
267
|
|
|
269
268
|
identity_service = get_service(body, identity_service_type) if identity_service_type
|
|
@@ -410,7 +409,7 @@ module Fog
|
|
|
410
409
|
auth_token = options[:openstack_auth_token] || options[:unscoped_token]
|
|
411
410
|
uri = options[:openstack_auth_uri]
|
|
412
411
|
|
|
413
|
-
|
|
412
|
+
@identity_connection = Fog::Core::Connection.new(uri.to_s, false, connection_options)
|
|
414
413
|
request_body = {:auth => Hash.new}
|
|
415
414
|
|
|
416
415
|
if auth_token
|
|
@@ -425,7 +424,7 @@ module Fog
|
|
|
425
424
|
end
|
|
426
425
|
request_body[:auth][:tenantName] = tenant_name if tenant_name
|
|
427
426
|
|
|
428
|
-
response =
|
|
427
|
+
response = @identity_connection.request({
|
|
429
428
|
:expects => [200, 204],
|
|
430
429
|
:headers => {'Content-Type' => 'application/json'},
|
|
431
430
|
:body => Fog::JSON.encode(request_body),
|
|
@@ -504,17 +503,19 @@ module Fog
|
|
|
504
503
|
end
|
|
505
504
|
request_body[:auth][:scope] = scope unless scope.empty?
|
|
506
505
|
|
|
507
|
-
|
|
506
|
+
path = (uri.path and not uri.path.empty?) ? uri.path : 'v3'
|
|
508
507
|
|
|
509
|
-
response =
|
|
510
|
-
:expects => [201],
|
|
511
|
-
:headers => {'Content-Type' => 'application/json'},
|
|
512
|
-
:body => Fog::JSON.encode(request_body),
|
|
513
|
-
:method => 'POST',
|
|
514
|
-
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
|
|
515
|
-
})
|
|
508
|
+
response, expires = @@token_cache[{body: request_body, path: path}]
|
|
516
509
|
|
|
517
|
-
|
|
510
|
+
unless response && expires > Time.now
|
|
511
|
+
response = connection.request({ :expects => [201],
|
|
512
|
+
:headers => {'Content-Type' => 'application/json'},
|
|
513
|
+
:body => Fog::JSON.encode(request_body),
|
|
514
|
+
:method => 'POST',
|
|
515
|
+
:path => path
|
|
516
|
+
})
|
|
517
|
+
@@token_cache[{body: request_body, path: path}] = response, Time.now + 30 # 30-second TTL, enough for most requests
|
|
518
|
+
end
|
|
518
519
|
|
|
519
520
|
[response.headers["X-Subject-Token"], Fog::JSON.decode(response.body)]
|
|
520
521
|
end
|
|
@@ -17,12 +17,14 @@ module Fog
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def destroy
|
|
20
|
+
@@cache.clear if @@cache
|
|
20
21
|
requires :id
|
|
21
22
|
service.delete_domain(self.id)
|
|
22
23
|
true
|
|
23
24
|
end
|
|
24
25
|
|
|
25
26
|
def update(attr = nil)
|
|
27
|
+
@@cache.clear if @@cache
|
|
26
28
|
requires :id, :name
|
|
27
29
|
merge_attributes(
|
|
28
30
|
service.update_domain(self.id, attr || attributes).body['domain'])
|
|
@@ -30,12 +32,16 @@ module Fog
|
|
|
30
32
|
end
|
|
31
33
|
|
|
32
34
|
def create
|
|
35
|
+
@@cache.clear if @@cache
|
|
33
36
|
requires :name
|
|
34
37
|
merge_attributes(
|
|
35
38
|
service.create_domain(attributes).body['domain'])
|
|
36
39
|
self
|
|
37
40
|
end
|
|
38
41
|
|
|
42
|
+
def self.use_cache(cache)
|
|
43
|
+
@@cache = cache
|
|
44
|
+
end
|
|
39
45
|
end
|
|
40
46
|
end
|
|
41
47
|
end
|
|
@@ -8,8 +8,20 @@ module Fog
|
|
|
8
8
|
class Domains < Fog::OpenStack::Collection
|
|
9
9
|
model Fog::Identity::OpenStack::V3::Domain
|
|
10
10
|
|
|
11
|
+
@@cache = {}
|
|
12
|
+
Fog::Identity::OpenStack::V3::Domain.use_cache(@@cache)
|
|
13
|
+
|
|
11
14
|
def all(options = {})
|
|
12
|
-
|
|
15
|
+
cached_domain, expires = @@cache[{token: service.auth_token, options: options}]
|
|
16
|
+
return cached_domain if cached_domain && expires > Time.now
|
|
17
|
+
domain_to_cache = load_response(service.list_domains(options), 'domains')
|
|
18
|
+
@@cache[{token: service.auth_token, options: options}] = domain_to_cache, Time.now + 30 # 30-second TTL
|
|
19
|
+
return domain_to_cache
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def create(attributes)
|
|
23
|
+
@@cache.clear if @@cache
|
|
24
|
+
super(attributes)
|
|
13
25
|
end
|
|
14
26
|
|
|
15
27
|
def auth_domains(options = {})
|
|
@@ -17,14 +29,17 @@ module Fog
|
|
|
17
29
|
end
|
|
18
30
|
|
|
19
31
|
def find_by_id(id)
|
|
20
|
-
cached_domain =
|
|
21
|
-
return cached_domain if cached_domain
|
|
32
|
+
cached_domain, expires = @@cache[{token: service.auth_token, id: id}]
|
|
33
|
+
return cached_domain if cached_domain && expires > Time.now
|
|
22
34
|
domain_hash = service.get_domain(id).body['domain']
|
|
23
|
-
Fog::Identity::OpenStack::V3::Domain.new(
|
|
35
|
+
domain_to_cache = Fog::Identity::OpenStack::V3::Domain.new(
|
|
24
36
|
domain_hash.merge(:service => service))
|
|
37
|
+
@@cache[{token: service.auth_token, id: id}] = domain_to_cache, Time.now + 30 # 30-second TTL
|
|
38
|
+
return domain_to_cache
|
|
25
39
|
end
|
|
26
40
|
|
|
27
41
|
def destroy(id)
|
|
42
|
+
@@cache.clear if @@cache
|
|
28
43
|
domain = self.find_by_id(id)
|
|
29
44
|
domain.destroy
|
|
30
45
|
end
|
|
@@ -21,12 +21,14 @@ module Fog
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def destroy
|
|
24
|
+
@@cache.clear if @@cache
|
|
24
25
|
requires :id
|
|
25
26
|
service.delete_project(self.id)
|
|
26
27
|
true
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
def update(attr = nil)
|
|
31
|
+
@@cache.clear if @@cache
|
|
30
32
|
requires :id
|
|
31
33
|
merge_attributes(
|
|
32
34
|
service.update_project(self.id, attr || attributes).body['project'])
|
|
@@ -34,6 +36,7 @@ module Fog
|
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
def create
|
|
39
|
+
@@cache.clear if @@cache
|
|
37
40
|
merge_attributes(
|
|
38
41
|
service.create_project(attributes).body['project'])
|
|
39
42
|
self
|
|
@@ -45,6 +48,7 @@ module Fog
|
|
|
45
48
|
end
|
|
46
49
|
|
|
47
50
|
def grant_role_to_user(role_id, user_id)
|
|
51
|
+
@@cache.clear if @@cache
|
|
48
52
|
requires :id
|
|
49
53
|
service.grant_project_user_role(self.id, user_id, role_id)
|
|
50
54
|
end
|
|
@@ -60,6 +64,7 @@ module Fog
|
|
|
60
64
|
end
|
|
61
65
|
|
|
62
66
|
def revoke_role_from_user(role_id, user_id)
|
|
67
|
+
@@cache.clear if @@cache
|
|
63
68
|
requires :id
|
|
64
69
|
service.revoke_project_user_role(self.id, user_id, role_id)
|
|
65
70
|
end
|
|
@@ -70,6 +75,7 @@ module Fog
|
|
|
70
75
|
end
|
|
71
76
|
|
|
72
77
|
def grant_role_to_group(role_id, group_id)
|
|
78
|
+
@@cache.clear if @@cache
|
|
73
79
|
requires :id
|
|
74
80
|
service.grant_project_group_role(self.id, group_id, role_id)
|
|
75
81
|
end
|
|
@@ -85,10 +91,14 @@ module Fog
|
|
|
85
91
|
end
|
|
86
92
|
|
|
87
93
|
def revoke_role_from_group(role_id, group_id)
|
|
94
|
+
@@cache.clear if @@cache
|
|
88
95
|
requires :id
|
|
89
96
|
service.revoke_project_group_role(self.id, group_id, role_id)
|
|
90
97
|
end
|
|
91
98
|
|
|
99
|
+
def self.use_cache(cache)
|
|
100
|
+
@@cache = cache
|
|
101
|
+
end
|
|
92
102
|
end
|
|
93
103
|
end
|
|
94
104
|
end
|
|
@@ -8,8 +8,20 @@ module Fog
|
|
|
8
8
|
class Projects < Fog::OpenStack::Collection
|
|
9
9
|
model Fog::Identity::OpenStack::V3::Project
|
|
10
10
|
|
|
11
|
+
@@cache = {}
|
|
12
|
+
Fog::Identity::OpenStack::V3::Project.use_cache(@@cache)
|
|
13
|
+
|
|
11
14
|
def all(options = {})
|
|
12
|
-
|
|
15
|
+
cached_project, expires = @@cache[{token: service.auth_token, options: options}]
|
|
16
|
+
return cached_project if cached_project && expires > Time.now
|
|
17
|
+
project_to_cache = load_response(service.list_projects(options), 'projects')
|
|
18
|
+
@@cache[{token: service.auth_token, options: options}] = project_to_cache, Time.now + 30 # 30-second TTL
|
|
19
|
+
return project_to_cache
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def create(attributes)
|
|
23
|
+
@@cache.clear if @@cache
|
|
24
|
+
super(attributes)
|
|
13
25
|
end
|
|
14
26
|
|
|
15
27
|
def auth_projects(options = {})
|
|
@@ -20,8 +32,8 @@ module Fog
|
|
|
20
32
|
if options.is_a? Symbol # Deal with a single option being passed on its own
|
|
21
33
|
options = [options]
|
|
22
34
|
end
|
|
23
|
-
cached_project =
|
|
24
|
-
return cached_project if cached_project
|
|
35
|
+
cached_project, expires = @@cache[{token: service.auth_token, id: id, options: options}]
|
|
36
|
+
return cached_project if cached_project && expires > Time.now
|
|
25
37
|
project_hash = service.get_project(id, options).body['project']
|
|
26
38
|
top_project = project_from_hash(project_hash, service)
|
|
27
39
|
if options.include? :subtree_as_list
|
|
@@ -30,6 +42,7 @@ module Fog
|
|
|
30
42
|
if options.include? :parents_as_list
|
|
31
43
|
top_project.parents.map! {|proj_hash| project_from_hash(proj_hash['project'], service)}
|
|
32
44
|
end
|
|
45
|
+
@@cache[{token: service.auth_token, id: id, options: options}] = top_project, Time.now + 30 # 30-second TTL
|
|
33
46
|
return top_project
|
|
34
47
|
end
|
|
35
48
|
|
|
@@ -26,6 +26,13 @@ module Fog
|
|
|
26
26
|
# @see http://docs.openstack.org/developer/swift/overview_expiring_objects.html
|
|
27
27
|
attribute :delete_after, :aliases => ['X-Delete-After']
|
|
28
28
|
|
|
29
|
+
# @!attribute [rw] content_encoding
|
|
30
|
+
# When you create an object or update its metadata, you can optionally set the Content-Encoding metadata.
|
|
31
|
+
# This metadata enables you to indicate that the object content is compressed without losing the identity of the
|
|
32
|
+
# underlying media type (Content-Type) of the file, such as a video.
|
|
33
|
+
# @see http://docs.openstack.org/developer/swift/api/use_content-encoding_metadata.html#use-content-encoding-metadata
|
|
34
|
+
attribute :content_encoding, :aliases => 'Content-Encoding'
|
|
35
|
+
|
|
29
36
|
def body
|
|
30
37
|
attributes[:body] ||= if last_modified
|
|
31
38
|
collection.get(identity).body
|
|
@@ -47,6 +54,7 @@ module Fog
|
|
|
47
54
|
options['Content-Type'] ||= content_type if content_type
|
|
48
55
|
options['Access-Control-Allow-Origin'] ||= access_control_allow_origin if access_control_allow_origin
|
|
49
56
|
options['Origin'] ||= origin if origin
|
|
57
|
+
options['Content-Encoding'] ||= content_encoding if content_encoding
|
|
50
58
|
service.copy_object(directory.key, key, target_directory_key, target_file_key, options)
|
|
51
59
|
target_directory = service.directories.new(:key => target_directory_key)
|
|
52
60
|
target_directory.files.get(target_file_key)
|
|
@@ -101,6 +109,7 @@ module Fog
|
|
|
101
109
|
options['Origin'] = origin if origin
|
|
102
110
|
options['X-Delete-At'] = delete_at if delete_at
|
|
103
111
|
options['X-Delete-After'] = delete_after if delete_after
|
|
112
|
+
options['Content-Encoding'] = content_encoding if content_encoding
|
|
104
113
|
options.merge!(metadata_to_headers)
|
|
105
114
|
|
|
106
115
|
data = service.put_object(directory.key, key, body, options)
|
data/lib/fog/version.rb
CHANGED
data/lib/fog/vsphere/compute.rb
CHANGED
|
@@ -22,6 +22,8 @@ module Fog
|
|
|
22
22
|
collection :interfacetypes
|
|
23
23
|
model :volume
|
|
24
24
|
collection :volumes
|
|
25
|
+
model :snapshot
|
|
26
|
+
collection :snapshots
|
|
25
27
|
model :template
|
|
26
28
|
collection :templates
|
|
27
29
|
model :cluster
|
|
@@ -39,6 +41,7 @@ module Fog
|
|
|
39
41
|
model :customfield
|
|
40
42
|
collection :customfields
|
|
41
43
|
model :scsicontroller
|
|
44
|
+
model :process
|
|
42
45
|
|
|
43
46
|
request_path 'fog/vsphere/requests/compute'
|
|
44
47
|
request :current_time
|
|
@@ -86,6 +89,11 @@ module Fog
|
|
|
86
89
|
request :list_customfields
|
|
87
90
|
request :get_vm_first_scsi_controller
|
|
88
91
|
request :set_vm_customvalue
|
|
92
|
+
request :vm_take_snapshot
|
|
93
|
+
request :list_vm_snapshots
|
|
94
|
+
request :list_child_snapshots
|
|
95
|
+
request :revert_to_snapshot
|
|
96
|
+
request :list_processes
|
|
89
97
|
|
|
90
98
|
module Shared
|
|
91
99
|
attr_reader :vsphere_is_vcenter
|