fog-oraclecloud 0.1.12 → 0.1.13
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/.gitignore +12 -10
- data/Gemfile +4 -4
- data/LICENSE +20 -20
- data/README.md +153 -153
- data/Rakefile +2 -2
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/fog-oracle.gemspec +32 -31
- data/lib/fog/oraclecloud.rb +29 -29
- data/lib/fog/oraclecloud/compute.rb +184 -184
- data/lib/fog/oraclecloud/database.rb +129 -129
- data/lib/fog/oraclecloud/java.rb +123 -115
- data/lib/fog/oraclecloud/models/compute/image.rb +43 -43
- data/lib/fog/oraclecloud/models/compute/image_list.rb +39 -39
- data/lib/fog/oraclecloud/models/compute/image_lists.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/images.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/instance.rb +74 -69
- data/lib/fog/oraclecloud/models/compute/instances.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/object_plan.rb +16 -16
- data/lib/fog/oraclecloud/models/compute/object_plans.rb +12 -12
- data/lib/fog/oraclecloud/models/compute/orchestration.rb +89 -89
- data/lib/fog/oraclecloud/models/compute/orchestrations.rb +20 -20
- data/lib/fog/oraclecloud/models/compute/security_application.rb +42 -42
- data/lib/fog/oraclecloud/models/compute/security_applications.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/security_list.rb +26 -26
- data/lib/fog/oraclecloud/models/compute/security_lists.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/security_rule.rb +41 -41
- data/lib/fog/oraclecloud/models/compute/security_rules.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/ssh_key.rb +37 -37
- data/lib/fog/oraclecloud/models/compute/ssh_keys.rb +22 -22
- data/lib/fog/oraclecloud/models/compute/volume.rb +47 -47
- data/lib/fog/oraclecloud/models/compute/volumes.rb +20 -20
- data/lib/fog/oraclecloud/models/database/backup.rb +37 -37
- data/lib/fog/oraclecloud/models/database/backups.rb +30 -30
- data/lib/fog/oraclecloud/models/database/instance.rb +331 -331
- data/lib/fog/oraclecloud/models/database/instances.rb +25 -25
- data/lib/fog/oraclecloud/models/database/patch.rb +34 -34
- data/lib/fog/oraclecloud/models/database/patches.rb +18 -18
- data/lib/fog/oraclecloud/models/database/recoveries.rb +26 -26
- data/lib/fog/oraclecloud/models/database/recovery.rb +43 -43
- data/lib/fog/oraclecloud/models/database/server.rb +28 -28
- data/lib/fog/oraclecloud/models/database/servers.rb +18 -18
- data/lib/fog/oraclecloud/models/database/snapshot.rb +60 -60
- data/lib/fog/oraclecloud/models/database/snapshots.rb +22 -22
- data/lib/fog/oraclecloud/models/java/database.rb +17 -17
- data/lib/fog/oraclecloud/models/java/databases.rb +17 -17
- data/lib/fog/oraclecloud/models/java/instance.rb +269 -265
- data/lib/fog/oraclecloud/models/java/instances.rb +23 -23
- data/lib/fog/oraclecloud/models/java/server.rb +62 -62
- data/lib/fog/oraclecloud/models/java/servers.rb +25 -25
- data/lib/fog/oraclecloud/models/soa/instance.rb +163 -163
- data/lib/fog/oraclecloud/models/soa/instances.rb +54 -54
- data/lib/fog/oraclecloud/models/storage/container.rb +33 -33
- data/lib/fog/oraclecloud/models/storage/containers.rb +24 -24
- data/lib/fog/oraclecloud/models/storage/object.rb +27 -27
- data/lib/fog/oraclecloud/models/storage/objects.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/create_image.rb +30 -30
- data/lib/fog/oraclecloud/requests/compute/create_image_list.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/create_instance.rb +53 -53
- data/lib/fog/oraclecloud/requests/compute/create_orchestration.rb +82 -82
- data/lib/fog/oraclecloud/requests/compute/create_security_application.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/create_security_rule.rb +29 -29
- data/lib/fog/oraclecloud/requests/compute/create_ssh_key.rb +46 -46
- data/lib/fog/oraclecloud/requests/compute/create_volume.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/delete_image.rb +19 -19
- data/lib/fog/oraclecloud/requests/compute/delete_image_list.rb +19 -19
- data/lib/fog/oraclecloud/requests/compute/delete_instance.rb +33 -33
- data/lib/fog/oraclecloud/requests/compute/delete_orchestration.rb +36 -36
- data/lib/fog/oraclecloud/requests/compute/delete_security_application.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/delete_security_rule.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/delete_ssh_key.rb +32 -32
- data/lib/fog/oraclecloud/requests/compute/get_image.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/get_image_list.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/get_instance.rb +45 -45
- data/lib/fog/oraclecloud/requests/compute/get_orchestration.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/get_security_application.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/get_security_rule.rb +20 -20
- data/lib/fog/oraclecloud/requests/compute/get_ssh_key.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/list_image_lists.rb +29 -29
- data/lib/fog/oraclecloud/requests/compute/list_images.rb +16 -16
- data/lib/fog/oraclecloud/requests/compute/list_instances.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/list_orchestrations.rb +28 -28
- data/lib/fog/oraclecloud/requests/compute/list_security_applications.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/list_security_lists.rb +16 -16
- data/lib/fog/oraclecloud/requests/compute/list_security_rules.rb +21 -21
- data/lib/fog/oraclecloud/requests/compute/list_ssh_keys.rb +29 -29
- data/lib/fog/oraclecloud/requests/compute/list_volumes.rb +16 -16
- data/lib/fog/oraclecloud/requests/compute/start_orchestration.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/stop_orchestration.rb +39 -39
- data/lib/fog/oraclecloud/requests/compute/update_image.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/update_image_list.rb +27 -27
- data/lib/fog/oraclecloud/requests/compute/update_orchestration.rb +80 -80
- data/lib/fog/oraclecloud/requests/compute/update_ssh_key.rb +49 -49
- data/lib/fog/oraclecloud/requests/database/backup_instance.rb +45 -45
- data/lib/fog/oraclecloud/requests/database/create_instance.rb +101 -101
- data/lib/fog/oraclecloud/requests/database/create_snapshot.rb +50 -50
- data/lib/fog/oraclecloud/requests/database/delete_instance.rb +26 -26
- data/lib/fog/oraclecloud/requests/database/delete_snapshot.rb +26 -26
- data/lib/fog/oraclecloud/requests/database/get_instance.rb +62 -62
- data/lib/fog/oraclecloud/requests/database/get_instance_from_job.rb +31 -31
- data/lib/fog/oraclecloud/requests/database/get_snapshot.rb +43 -43
- data/lib/fog/oraclecloud/requests/database/list_backups.rb +39 -39
- data/lib/fog/oraclecloud/requests/database/list_instances.rb +29 -29
- data/lib/fog/oraclecloud/requests/database/list_patches.rb +51 -51
- data/lib/fog/oraclecloud/requests/database/list_recoveries.rb +40 -40
- data/lib/fog/oraclecloud/requests/database/list_servers.rb +27 -27
- data/lib/fog/oraclecloud/requests/database/list_snapshots.rb +27 -27
- data/lib/fog/oraclecloud/requests/database/recover_instance.rb +83 -83
- data/lib/fog/oraclecloud/requests/database/scale_instance.rb +40 -40
- data/lib/fog/oraclecloud/requests/java/create_instance.rb +156 -87
- data/lib/fog/oraclecloud/requests/java/delete_instance.rb +37 -37
- data/lib/fog/oraclecloud/requests/java/get_instance.rb +43 -43
- data/lib/fog/oraclecloud/requests/java/get_server.rb +42 -42
- data/lib/fog/oraclecloud/requests/java/list_instances.rb +29 -29
- data/lib/fog/oraclecloud/requests/java/list_servers.rb +30 -30
- data/lib/fog/oraclecloud/requests/java/scale_a_node.rb +45 -45
- data/lib/fog/oraclecloud/requests/java/scale_in_a_cluster.rb +35 -35
- data/lib/fog/oraclecloud/requests/java/scale_out_a_cluster.rb +38 -38
- data/lib/fog/oraclecloud/requests/soa/create_instance.rb +71 -71
- data/lib/fog/oraclecloud/requests/soa/delete_instance.rb +35 -35
- data/lib/fog/oraclecloud/requests/soa/get_instance.rb +42 -42
- data/lib/fog/oraclecloud/requests/soa/get_job_status.rb +22 -22
- data/lib/fog/oraclecloud/requests/soa/list_instances.rb +29 -29
- data/lib/fog/oraclecloud/requests/storage/create_container.rb +41 -41
- data/lib/fog/oraclecloud/requests/storage/delete_container.rb +15 -15
- data/lib/fog/oraclecloud/requests/storage/get_container.rb +63 -63
- data/lib/fog/oraclecloud/requests/storage/list_containers.rb +27 -27
- data/lib/fog/oraclecloud/soa.rb +106 -106
- data/lib/fog/oraclecloud/storage.rb +98 -98
- data/lib/fog/oraclecloud/version.rb +5 -5
- data/tests/helper.rb +5 -3
- data/tests/helpers/mock_helper.rb +14 -14
- data/tests/requests/compute_tests.rb +9 -9
- data/tests/requests/database_tests.rb +241 -241
- data/tests/requests/instance_tests.rb +68 -61
- data/tests/requests/java_tests.rb +149 -109
- data/tests/requests/orchestrations_tests.rb +90 -90
- data/tests/requests/soa_tests.rb +151 -151
- data/tests/requests/ssh_keys_tests.rb +53 -53
- data/tests/requests/storage_tests.rb +54 -54
- metadata +17 -3
@@ -1,32 +1,32 @@
|
|
1
|
-
module Fog
|
2
|
-
module OracleCloud
|
3
|
-
class Database
|
4
|
-
class Real
|
5
|
-
|
6
|
-
def get_instance_from_job(job_id)
|
7
|
-
response = request(
|
8
|
-
:expects => 200,
|
9
|
-
:method => 'GET',
|
10
|
-
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/status/create/#{job_id}"
|
11
|
-
)
|
12
|
-
response
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class Mock
|
17
|
-
def get_instance_from_job(job_id)
|
18
|
-
response = Excon::Response.new
|
19
|
-
|
20
|
-
instance = self.data[:instances].select { |k, v| v['creation_job_id'] == job_id }
|
21
|
-
if instance
|
22
|
-
response.status = 200
|
23
|
-
response.body = instance
|
24
|
-
response
|
25
|
-
else
|
26
|
-
raise Fog::OracleCloud::Database::NotFound.new("Database #{job_id} does not exist");
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
1
|
+
module Fog
|
2
|
+
module OracleCloud
|
3
|
+
class Database
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def get_instance_from_job(job_id)
|
7
|
+
response = request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/status/create/#{job_id}"
|
11
|
+
)
|
12
|
+
response
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
def get_instance_from_job(job_id)
|
18
|
+
response = Excon::Response.new
|
19
|
+
|
20
|
+
instance = self.data[:instances].select { |k, v| v['creation_job_id'] == job_id }
|
21
|
+
if instance
|
22
|
+
response.status = 200
|
23
|
+
response.body = instance
|
24
|
+
response
|
25
|
+
else
|
26
|
+
raise Fog::OracleCloud::Database::NotFound.new("Database #{job_id} does not exist");
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
32
|
end
|
@@ -1,44 +1,44 @@
|
|
1
|
-
module Fog
|
2
|
-
module OracleCloud
|
3
|
-
class Database
|
4
|
-
class Real
|
5
|
-
|
6
|
-
def get_snapshot(db_name, snapshot_name)
|
7
|
-
response = request(
|
8
|
-
:expects => 200,
|
9
|
-
:method => 'GET',
|
10
|
-
:path => "/paas/api/v1.1/instancemgmt/#{@identity_domain}/services/dbaas/instances/#{db_name}/snapshots/#{snapshot_name}"
|
11
|
-
)
|
12
|
-
response
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class Mock
|
17
|
-
def get_snapshot(db_name, snapshot_name)
|
18
|
-
response = Excon::Response.new
|
19
|
-
|
20
|
-
if snapshot = self.data[:snapshots][db_name][snapshot_name]
|
21
|
-
case snapshot['status']
|
22
|
-
when 'Terminating'
|
23
|
-
if Time.now - self.data[:deleted_at][snapshot_name] >= Fog::Mock.delay
|
24
|
-
self.data[:deleted_at].delete(snapshot_name)
|
25
|
-
self.data[:snapshots][db_name].delete(snapshot_name)
|
26
|
-
end
|
27
|
-
when 'In Progress'
|
28
|
-
if Time.now - self.data[:created_at][snapshot_name] >= Fog::Mock.delay
|
29
|
-
self.data[:snapshots][db_name][snapshot_name]['status'] = 'Succeeded'
|
30
|
-
snapshot = self.data[:snapshots][db_name][snapshot_name]
|
31
|
-
self.data[:created_at].delete(snapshot_name)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
response.status = 200
|
35
|
-
response.body = snapshot
|
36
|
-
response
|
37
|
-
else
|
38
|
-
raise Fog::OracleCloud::Database::NotFound.new("Snapshot #{snapshot_name} for #{db_name} does not exist");
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
1
|
+
module Fog
|
2
|
+
module OracleCloud
|
3
|
+
class Database
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def get_snapshot(db_name, snapshot_name)
|
7
|
+
response = request(
|
8
|
+
:expects => 200,
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/paas/api/v1.1/instancemgmt/#{@identity_domain}/services/dbaas/instances/#{db_name}/snapshots/#{snapshot_name}"
|
11
|
+
)
|
12
|
+
response
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
def get_snapshot(db_name, snapshot_name)
|
18
|
+
response = Excon::Response.new
|
19
|
+
|
20
|
+
if snapshot = self.data[:snapshots][db_name][snapshot_name]
|
21
|
+
case snapshot['status']
|
22
|
+
when 'Terminating'
|
23
|
+
if Time.now - self.data[:deleted_at][snapshot_name] >= Fog::Mock.delay
|
24
|
+
self.data[:deleted_at].delete(snapshot_name)
|
25
|
+
self.data[:snapshots][db_name].delete(snapshot_name)
|
26
|
+
end
|
27
|
+
when 'In Progress'
|
28
|
+
if Time.now - self.data[:created_at][snapshot_name] >= Fog::Mock.delay
|
29
|
+
self.data[:snapshots][db_name][snapshot_name]['status'] = 'Succeeded'
|
30
|
+
snapshot = self.data[:snapshots][db_name][snapshot_name]
|
31
|
+
self.data[:created_at].delete(snapshot_name)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
response.status = 200
|
35
|
+
response.body = snapshot
|
36
|
+
response
|
37
|
+
else
|
38
|
+
raise Fog::OracleCloud::Database::NotFound.new("Snapshot #{snapshot_name} for #{db_name} does not exist");
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
44
|
end
|
@@ -1,39 +1,39 @@
|
|
1
|
-
module Fog
|
2
|
-
module OracleCloud
|
3
|
-
class Database
|
4
|
-
class Real
|
5
|
-
def list_backups(db_name)
|
6
|
-
response = request(
|
7
|
-
:expects => 200,
|
8
|
-
:method => 'GET',
|
9
|
-
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/#{db_name}/backups"
|
10
|
-
)
|
11
|
-
response
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class Mock
|
16
|
-
def list_backups(db_name)
|
17
|
-
response = Excon::Response.new
|
18
|
-
|
19
|
-
if !self.data[:backups][db_name] then self.data[:backups][db_name] = [] end
|
20
|
-
backups = self.data[:backups][db_name]
|
21
|
-
|
22
|
-
backups.each_with_index { |b, i|
|
23
|
-
if b['status'] = 'IN PROGRESS' then
|
24
|
-
if Time.now - self.data[:created_at][:backups][db_name][i] >= Fog::Mock.delay
|
25
|
-
self.data[:created_at][:backups][db_name].delete(i)
|
26
|
-
self.data[:backups][db_name][i]['status'] = 'COMPLETED'
|
27
|
-
b = self.data[:backups][db_name][i]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
}
|
31
|
-
response.body = {
|
32
|
-
'backupList' => backups
|
33
|
-
}
|
34
|
-
response
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
1
|
+
module Fog
|
2
|
+
module OracleCloud
|
3
|
+
class Database
|
4
|
+
class Real
|
5
|
+
def list_backups(db_name)
|
6
|
+
response = request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/#{db_name}/backups"
|
10
|
+
)
|
11
|
+
response
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def list_backups(db_name)
|
17
|
+
response = Excon::Response.new
|
18
|
+
|
19
|
+
if !self.data[:backups][db_name] then self.data[:backups][db_name] = [] end
|
20
|
+
backups = self.data[:backups][db_name]
|
21
|
+
|
22
|
+
backups.each_with_index { |b, i|
|
23
|
+
if b['status'] = 'IN PROGRESS' then
|
24
|
+
if Time.now - self.data[:created_at][:backups][db_name][i] >= Fog::Mock.delay
|
25
|
+
self.data[:created_at][:backups][db_name].delete(i)
|
26
|
+
self.data[:backups][db_name][i]['status'] = 'COMPLETED'
|
27
|
+
b = self.data[:backups][db_name][i]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
}
|
31
|
+
response.body = {
|
32
|
+
'backupList' => backups
|
33
|
+
}
|
34
|
+
response
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
module Fog
|
2
|
-
module OracleCloud
|
3
|
-
class Database
|
4
|
-
class Real
|
5
|
-
def list_instances
|
6
|
-
response = request(
|
7
|
-
:expects => 200,
|
8
|
-
:method => 'GET',
|
9
|
-
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}?outputLevel=verbose"
|
10
|
-
)
|
11
|
-
response
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class Mock
|
16
|
-
def list_instances
|
17
|
-
response = Excon::Response.new
|
18
|
-
|
19
|
-
instances = self.data[:instances].values
|
20
|
-
|
21
|
-
response.body = {
|
22
|
-
'services' => instances
|
23
|
-
}
|
24
|
-
response
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
1
|
+
module Fog
|
2
|
+
module OracleCloud
|
3
|
+
class Database
|
4
|
+
class Real
|
5
|
+
def list_instances
|
6
|
+
response = request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}?outputLevel=verbose"
|
10
|
+
)
|
11
|
+
response
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def list_instances
|
17
|
+
response = Excon::Response.new
|
18
|
+
|
19
|
+
instances = self.data[:instances].values
|
20
|
+
|
21
|
+
response.body = {
|
22
|
+
'services' => instances
|
23
|
+
}
|
24
|
+
response
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,51 +1,51 @@
|
|
1
|
-
module Fog
|
2
|
-
module OracleCloud
|
3
|
-
class Database
|
4
|
-
class Real
|
5
|
-
def list_patches(db_name)
|
6
|
-
response = request(
|
7
|
-
:expects => 200,
|
8
|
-
:method => 'GET',
|
9
|
-
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/#{db_name}/patches"
|
10
|
-
)
|
11
|
-
response
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class Mock
|
16
|
-
def list_patches(db_name)
|
17
|
-
response = Excon::Response.new
|
18
|
-
|
19
|
-
# Fake a patch
|
20
|
-
response.body = {
|
21
|
-
'availablePatches' => [{
|
22
|
-
"patchId"=>"23054246-SE",
|
23
|
-
"patchNumber"=>"Patch_12.1.0.2.160719_SE",
|
24
|
-
"patchCategory"=>"DB",
|
25
|
-
"patchSeverity"=>"Normal",
|
26
|
-
"includesConfigUpgrade"=>false,
|
27
|
-
"patchDescription"=>"DB 12.1.0.2.160719 Jul 2016 PSU Standard Edition image",
|
28
|
-
"patchReleaseUrl"=>"https://support.oracle.com/epmos/faces/PatchDetail?patchId=23054246",
|
29
|
-
"serviceType"=>"DBaaS",
|
30
|
-
"serviceVersion"=>"12.1.0.2",
|
31
|
-
"releaseDate"=>"2016-07-16T01:40:00.000+0000",
|
32
|
-
"entryDate"=>"2016-10-07T20:57:33.121+0000",
|
33
|
-
"entryUserId"=>"OCLOUD9_SM_PLATFORM_APPID",
|
34
|
-
"patchType"=>"PSU",
|
35
|
-
"requiresRestart"=> true,
|
36
|
-
"serviceTypeVersions"=>"ANY",
|
37
|
-
"isDeleted"=> false,
|
38
|
-
"isCustomerVisible"=> false,
|
39
|
-
"isAutoApply"=> false,
|
40
|
-
"induceDownTime"=> false,
|
41
|
-
"displayName"=>"12.1.0.2.160719",
|
42
|
-
"releaseVersion"=>"12.1.0.2.160719",
|
43
|
-
"serviceEditions"=>"SE",
|
44
|
-
}]
|
45
|
-
}
|
46
|
-
response
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
1
|
+
module Fog
|
2
|
+
module OracleCloud
|
3
|
+
class Database
|
4
|
+
class Real
|
5
|
+
def list_patches(db_name)
|
6
|
+
response = request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/#{db_name}/patches"
|
10
|
+
)
|
11
|
+
response
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def list_patches(db_name)
|
17
|
+
response = Excon::Response.new
|
18
|
+
|
19
|
+
# Fake a patch
|
20
|
+
response.body = {
|
21
|
+
'availablePatches' => [{
|
22
|
+
"patchId"=>"23054246-SE",
|
23
|
+
"patchNumber"=>"Patch_12.1.0.2.160719_SE",
|
24
|
+
"patchCategory"=>"DB",
|
25
|
+
"patchSeverity"=>"Normal",
|
26
|
+
"includesConfigUpgrade"=>false,
|
27
|
+
"patchDescription"=>"DB 12.1.0.2.160719 Jul 2016 PSU Standard Edition image",
|
28
|
+
"patchReleaseUrl"=>"https://support.oracle.com/epmos/faces/PatchDetail?patchId=23054246",
|
29
|
+
"serviceType"=>"DBaaS",
|
30
|
+
"serviceVersion"=>"12.1.0.2",
|
31
|
+
"releaseDate"=>"2016-07-16T01:40:00.000+0000",
|
32
|
+
"entryDate"=>"2016-10-07T20:57:33.121+0000",
|
33
|
+
"entryUserId"=>"OCLOUD9_SM_PLATFORM_APPID",
|
34
|
+
"patchType"=>"PSU",
|
35
|
+
"requiresRestart"=> true,
|
36
|
+
"serviceTypeVersions"=>"ANY",
|
37
|
+
"isDeleted"=> false,
|
38
|
+
"isCustomerVisible"=> false,
|
39
|
+
"isAutoApply"=> false,
|
40
|
+
"induceDownTime"=> false,
|
41
|
+
"displayName"=>"12.1.0.2.160719",
|
42
|
+
"releaseVersion"=>"12.1.0.2.160719",
|
43
|
+
"serviceEditions"=>"SE",
|
44
|
+
}]
|
45
|
+
}
|
46
|
+
response
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -1,40 +1,40 @@
|
|
1
|
-
module Fog
|
2
|
-
module OracleCloud
|
3
|
-
class Database
|
4
|
-
class Real
|
5
|
-
def list_recoveries(db_name)
|
6
|
-
response = request(
|
7
|
-
:expects => 200,
|
8
|
-
:method => 'GET',
|
9
|
-
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/#{db_name}/backups/recovery/history"
|
10
|
-
)
|
11
|
-
response
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class Mock
|
16
|
-
def list_recoveries(db_name)
|
17
|
-
response = Excon::Response.new
|
18
|
-
|
19
|
-
if !self.data[:recoveries][db_name] then self.data[:recoveries][db_name] = [] end
|
20
|
-
recoveries = self.data[:recoveries][db_name]
|
21
|
-
|
22
|
-
recoveries.each_with_index { |r, i|
|
23
|
-
if r['status'] = 'IN PROGRESS' then
|
24
|
-
if Time.now - self.data[:created_at][:recoveries][db_name][i] >= Fog::Mock.delay
|
25
|
-
self.data[:created_at][:recoveries][db_name].delete(i)
|
26
|
-
self.data[:recoveries][db_name][i]['status'] = 'COMPLETED'
|
27
|
-
self.data[:recoveries][db_name][i]['recoveryCompleteDate'] = Time.now.strftime('%d-%b-%Y %H:%M:%S UTC')
|
28
|
-
b = self.data[:backups][db_name][i]
|
29
|
-
end
|
30
|
-
end
|
31
|
-
}
|
32
|
-
response.body = {
|
33
|
-
'recoveryList' => recoveries
|
34
|
-
}
|
35
|
-
response
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
1
|
+
module Fog
|
2
|
+
module OracleCloud
|
3
|
+
class Database
|
4
|
+
class Real
|
5
|
+
def list_recoveries(db_name)
|
6
|
+
response = request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/#{db_name}/backups/recovery/history"
|
10
|
+
)
|
11
|
+
response
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def list_recoveries(db_name)
|
17
|
+
response = Excon::Response.new
|
18
|
+
|
19
|
+
if !self.data[:recoveries][db_name] then self.data[:recoveries][db_name] = [] end
|
20
|
+
recoveries = self.data[:recoveries][db_name]
|
21
|
+
|
22
|
+
recoveries.each_with_index { |r, i|
|
23
|
+
if r['status'] = 'IN PROGRESS' then
|
24
|
+
if Time.now - self.data[:created_at][:recoveries][db_name][i] >= Fog::Mock.delay
|
25
|
+
self.data[:created_at][:recoveries][db_name].delete(i)
|
26
|
+
self.data[:recoveries][db_name][i]['status'] = 'COMPLETED'
|
27
|
+
self.data[:recoveries][db_name][i]['recoveryCompleteDate'] = Time.now.strftime('%d-%b-%Y %H:%M:%S UTC')
|
28
|
+
b = self.data[:backups][db_name][i]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
}
|
32
|
+
response.body = {
|
33
|
+
'recoveryList' => recoveries
|
34
|
+
}
|
35
|
+
response
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|