fog-oraclecloud 0.1.1

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.
Files changed (112) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +21 -0
  5. data/README.md +34 -0
  6. data/Rakefile +2 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +8 -0
  9. data/fog-oracle.gemspec +30 -0
  10. data/lib/fog/oraclecloud/compute.rb +146 -0
  11. data/lib/fog/oraclecloud/database.rb +114 -0
  12. data/lib/fog/oraclecloud/java.rb +114 -0
  13. data/lib/fog/oraclecloud/models/compute/image.rb +43 -0
  14. data/lib/fog/oraclecloud/models/compute/image_list.rb +42 -0
  15. data/lib/fog/oraclecloud/models/compute/image_lists.rb +22 -0
  16. data/lib/fog/oraclecloud/models/compute/images.rb +22 -0
  17. data/lib/fog/oraclecloud/models/compute/instance.rb +65 -0
  18. data/lib/fog/oraclecloud/models/compute/instances.rb +22 -0
  19. data/lib/fog/oraclecloud/models/compute/object_plan.rb +16 -0
  20. data/lib/fog/oraclecloud/models/compute/object_plans.rb +12 -0
  21. data/lib/fog/oraclecloud/models/compute/orchestration.rb +89 -0
  22. data/lib/fog/oraclecloud/models/compute/orchestrations.rb +20 -0
  23. data/lib/fog/oraclecloud/models/compute/security_application.rb +42 -0
  24. data/lib/fog/oraclecloud/models/compute/security_applications.rb +22 -0
  25. data/lib/fog/oraclecloud/models/compute/security_list.rb +26 -0
  26. data/lib/fog/oraclecloud/models/compute/security_lists.rb +22 -0
  27. data/lib/fog/oraclecloud/models/compute/security_rule.rb +41 -0
  28. data/lib/fog/oraclecloud/models/compute/security_rules.rb +22 -0
  29. data/lib/fog/oraclecloud/models/compute/ssh_key.rb +37 -0
  30. data/lib/fog/oraclecloud/models/compute/ssh_keys.rb +22 -0
  31. data/lib/fog/oraclecloud/models/compute/volume.rb +47 -0
  32. data/lib/fog/oraclecloud/models/compute/volumes.rb +20 -0
  33. data/lib/fog/oraclecloud/models/database/instance.rb +84 -0
  34. data/lib/fog/oraclecloud/models/database/instances.rb +26 -0
  35. data/lib/fog/oraclecloud/models/java/instance.rb +107 -0
  36. data/lib/fog/oraclecloud/models/java/instances.rb +27 -0
  37. data/lib/fog/oraclecloud/models/java/server.rb +26 -0
  38. data/lib/fog/oraclecloud/models/java/servers.rb +17 -0
  39. data/lib/fog/oraclecloud/models/soa/instance.rb +65 -0
  40. data/lib/fog/oraclecloud/models/soa/instances.rb +25 -0
  41. data/lib/fog/oraclecloud/models/storage/container.rb +34 -0
  42. data/lib/fog/oraclecloud/models/storage/containers.rb +24 -0
  43. data/lib/fog/oraclecloud/models/storage/object.rb +27 -0
  44. data/lib/fog/oraclecloud/models/storage/objects.rb +27 -0
  45. data/lib/fog/oraclecloud/requests/compute/create_image.rb +30 -0
  46. data/lib/fog/oraclecloud/requests/compute/create_image_list.rb +27 -0
  47. data/lib/fog/oraclecloud/requests/compute/create_instance.rb +32 -0
  48. data/lib/fog/oraclecloud/requests/compute/create_orchestration.rb +46 -0
  49. data/lib/fog/oraclecloud/requests/compute/create_security_application.rb +28 -0
  50. data/lib/fog/oraclecloud/requests/compute/create_security_rule.rb +29 -0
  51. data/lib/fog/oraclecloud/requests/compute/create_ssh_key.rb +27 -0
  52. data/lib/fog/oraclecloud/requests/compute/create_volume.rb +29 -0
  53. data/lib/fog/oraclecloud/requests/compute/delete_image.rb +19 -0
  54. data/lib/fog/oraclecloud/requests/compute/delete_image_list.rb +19 -0
  55. data/lib/fog/oraclecloud/requests/compute/delete_instance.rb +22 -0
  56. data/lib/fog/oraclecloud/requests/compute/delete_orchestration.rb +22 -0
  57. data/lib/fog/oraclecloud/requests/compute/delete_security_application.rb +20 -0
  58. data/lib/fog/oraclecloud/requests/compute/delete_security_rule.rb +20 -0
  59. data/lib/fog/oraclecloud/requests/compute/delete_ssh_key.rb +22 -0
  60. data/lib/fog/oraclecloud/requests/compute/get_image.rb +21 -0
  61. data/lib/fog/oraclecloud/requests/compute/get_image_list.rb +21 -0
  62. data/lib/fog/oraclecloud/requests/compute/get_instance.rb +24 -0
  63. data/lib/fog/oraclecloud/requests/compute/get_orchestration.rb +24 -0
  64. data/lib/fog/oraclecloud/requests/compute/get_security_application.rb +20 -0
  65. data/lib/fog/oraclecloud/requests/compute/get_security_rule.rb +20 -0
  66. data/lib/fog/oraclecloud/requests/compute/get_ssh_key.rb +24 -0
  67. data/lib/fog/oraclecloud/requests/compute/list_image_lists.rb +16 -0
  68. data/lib/fog/oraclecloud/requests/compute/list_images.rb +16 -0
  69. data/lib/fog/oraclecloud/requests/compute/list_instances.rb +16 -0
  70. data/lib/fog/oraclecloud/requests/compute/list_orchestrations.rb +16 -0
  71. data/lib/fog/oraclecloud/requests/compute/list_security_applications.rb +21 -0
  72. data/lib/fog/oraclecloud/requests/compute/list_security_lists.rb +16 -0
  73. data/lib/fog/oraclecloud/requests/compute/list_security_rules.rb +21 -0
  74. data/lib/fog/oraclecloud/requests/compute/list_ssh_keys.rb +16 -0
  75. data/lib/fog/oraclecloud/requests/compute/list_volumes.rb +16 -0
  76. data/lib/fog/oraclecloud/requests/compute/start_orchestration.rb +22 -0
  77. data/lib/fog/oraclecloud/requests/compute/stop_orchestration.rb +22 -0
  78. data/lib/fog/oraclecloud/requests/compute/update_image.rb +27 -0
  79. data/lib/fog/oraclecloud/requests/compute/update_image_list.rb +27 -0
  80. data/lib/fog/oraclecloud/requests/compute/update_orchestration.rb +49 -0
  81. data/lib/fog/oraclecloud/requests/compute/update_ssh_key.rb +29 -0
  82. data/lib/fog/oraclecloud/requests/database/create_instance.rb +46 -0
  83. data/lib/fog/oraclecloud/requests/database/delete_instance.rb +31 -0
  84. data/lib/fog/oraclecloud/requests/database/get_instance.rb +36 -0
  85. data/lib/fog/oraclecloud/requests/database/list_instances.rb +16 -0
  86. data/lib/fog/oraclecloud/requests/java/create_instance.rb +51 -0
  87. data/lib/fog/oraclecloud/requests/java/delete_instance.rb +42 -0
  88. data/lib/fog/oraclecloud/requests/java/get_instance.rb +37 -0
  89. data/lib/fog/oraclecloud/requests/java/get_server.rb +0 -0
  90. data/lib/fog/oraclecloud/requests/java/list_instances.rb +16 -0
  91. data/lib/fog/oraclecloud/requests/java/list_servers.rb +29 -0
  92. data/lib/fog/oraclecloud/requests/soa/create_instance.rb +47 -0
  93. data/lib/fog/oraclecloud/requests/soa/delete_instance.rb +40 -0
  94. data/lib/fog/oraclecloud/requests/soa/get_instance.rb +36 -0
  95. data/lib/fog/oraclecloud/requests/soa/list_instances.rb +16 -0
  96. data/lib/fog/oraclecloud/requests/storage/create_container.rb +21 -0
  97. data/lib/fog/oraclecloud/requests/storage/delete_container.rb +15 -0
  98. data/lib/fog/oraclecloud/requests/storage/get_container.rb +24 -0
  99. data/lib/fog/oraclecloud/requests/storage/list_containers.rb +16 -0
  100. data/lib/fog/oraclecloud/soa.rb +80 -0
  101. data/lib/fog/oraclecloud/storage.rb +80 -0
  102. data/lib/fog/oraclecloud/version.rb +5 -0
  103. data/lib/fog/oraclecloud.rb +29 -0
  104. data/tests/helper.rb +1 -0
  105. data/tests/requests/database_tests.rb +52 -0
  106. data/tests/requests/instance_tests.rb +54 -0
  107. data/tests/requests/java_tests.rb +52 -0
  108. data/tests/requests/orchestrations_tests.rb +86 -0
  109. data/tests/requests/soa_tests.rb +52 -0
  110. data/tests/requests/ssh_keys_tests.rb +49 -0
  111. data/tests/requests/storage_tests.rb +54 -0
  112. metadata +253 -0
@@ -0,0 +1,65 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class Instance < Fog::Model
7
+ identity :name
8
+
9
+ attribute :account
10
+ attribute :boot_order
11
+ attribute :disk_attach
12
+ attribute :domain
13
+ attribute :entry
14
+ attribute :error_reason
15
+ attribute :fingerprint
16
+ attribute :hostname
17
+ attribute :hypervisor
18
+ attribute :image_format
19
+ attribute :imagelist
20
+ attribute :ip
21
+ attribute :label
22
+ attribute :networking
23
+ attribute :placement_requirements
24
+ attribute :platform
25
+ attribute :priority
26
+ attribute :quota
27
+ attribute :quota_reservation
28
+ attribute :resolvers
29
+ attribute :reverse_dns
30
+ attribute :shape
31
+ attribute :site
32
+ attribute :sshkeys
33
+ attribute :start_time
34
+ attribute :state
35
+ attribute :storage_attachments
36
+ attribute :tags
37
+ attribute :uri
38
+ attribute :vcable_id
39
+ attribute :virtio
40
+ attribute :vnc
41
+
42
+ def ready?
43
+ state == 'running'
44
+ end
45
+
46
+ def save
47
+ #identity ? update : create
48
+ create
49
+ end
50
+
51
+ def create
52
+ requires :name, :shape, :imagelist, :label, :sshkeys
53
+
54
+ data = service.create_instance(name, shape, imagelist, label, sshkeys)
55
+ merge_attributes(data.body['instances'][0])
56
+ end
57
+
58
+ def destroy
59
+ requires :name
60
+ service.delete_instance(name)
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,22 @@
1
+ require 'fog/core/collection'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class Instances < Fog::Collection
7
+
8
+ model Fog::Compute::OracleCloud::Instance
9
+
10
+ def get(name)
11
+ data = service.get_instance(name).body
12
+ new(data)
13
+ end
14
+
15
+ def all
16
+ data = service.list_instances().body['result']
17
+ load(data)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,16 @@
1
+ module Fog
2
+ module Compute
3
+ class OracleCloud
4
+ class ObjectPlan < Fog::Model
5
+
6
+ attribute :label
7
+ attribute :obj_type
8
+ attribute :objects
9
+
10
+ def object_type
11
+ obj_type
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module Fog
2
+ module Compute
3
+ class OracleCloud
4
+ class ObjectPlans < Fog::Collection
5
+
6
+ model Fog::Compute::OracleCloud::ObjectPlan
7
+
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,89 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class Orchestration < Fog::Model
7
+ identity :uri
8
+
9
+ attribute :account
10
+ attribute :description
11
+ attribute :info
12
+ attribute :oplans
13
+ attribute :relationships
14
+ attribute :schedule
15
+ attribute :status
16
+ attribute :status_timestamp
17
+ attribute :user
18
+ attribute :name
19
+
20
+ def running?
21
+ status == 'running'
22
+ end
23
+
24
+ def ready?
25
+ status == 'ready'
26
+ end
27
+
28
+ def stopped?
29
+ status == 'stopped'
30
+ end
31
+
32
+ def save
33
+ identity ? update : create
34
+ end
35
+
36
+ def create
37
+ requires :name, :oplans
38
+ data = service.create_orchestration(name, oplans,
39
+ :schedule => schedule,
40
+ :account => account,
41
+ :description => description,
42
+ :relationships => relationships)
43
+ merge_attributes(data.body)
44
+ end
45
+
46
+ def update
47
+ requires :name, :oplans
48
+ data = service.update_orchestration(name, oplans,
49
+ :schedule => schedule,
50
+ :account => account,
51
+ :description => description,
52
+ :relationships => relationships)
53
+ merge_attributes(data.body)
54
+ end
55
+
56
+ def reload
57
+ requires :name
58
+
59
+ data = begin
60
+ collection.get(name)
61
+ rescue Excon::Errors::SocketError
62
+ nil
63
+ end
64
+
65
+ return unless data
66
+
67
+ new_attributes = data.attributes
68
+ merge_attributes(new_attributes)
69
+ self
70
+ end
71
+
72
+ def destroy
73
+ requires :name
74
+ service.delete_orchestration(name)
75
+ end
76
+
77
+ def start
78
+ requires :name
79
+ service.start_orchestration(name)
80
+ end
81
+
82
+ def stop
83
+ requires :name
84
+ service.stop_orchestration(name)
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,20 @@
1
+ module Fog
2
+ module Compute
3
+ class OracleCloud
4
+ class Orchestrations < Fog::Collection
5
+
6
+ model Fog::Compute::OracleCloud::Orchestration
7
+
8
+ def get(name)
9
+ data = service.get_orchestration(name).body
10
+ new(data)
11
+ end
12
+
13
+ def all
14
+ data = service.list_orchestrations().body['result']
15
+ load(data)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,42 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SecurityApplication < Fog::Model
7
+ identity :name
8
+
9
+ attribute :protocol
10
+ attribute :name
11
+ attribute :uri
12
+ attribute :icmptype
13
+ attribute :proxyuri
14
+ attribute :dport
15
+ attribute :icmpcode
16
+
17
+ # Only used in create
18
+ attribute :description
19
+
20
+ def save
21
+ #identity ? update : create
22
+ create
23
+ end
24
+
25
+ def create
26
+ requires :name, :protocol
27
+
28
+ data = service.create_security_application(name, protocol,
29
+ :dport => dport,
30
+ :icmptype => icmptype,
31
+ :icmpcode => icmpcode,
32
+ :description => description)
33
+ end
34
+
35
+ def destroy
36
+ requires :name
37
+ service.delete_security_application(name)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,22 @@
1
+ require 'fog/core/collection'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SecurityApplications < Fog::Collection
7
+
8
+ model Fog::Compute::OracleCloud::SecurityApplication
9
+
10
+ def all
11
+ data = service.list_security_applications().body['result']
12
+ load(data)
13
+ end
14
+
15
+ def get(name)
16
+ data = service.get_security_application(name).body
17
+ new(data)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SecurityList < Fog::Model
7
+ identity :name
8
+
9
+ attribute :account
10
+ attribute :name
11
+ attribute :uri
12
+ attribute :outbound_cidr_policy
13
+ attribute :proxyuri
14
+ attribute :policy
15
+
16
+ # Only used in create
17
+ attribute :description
18
+
19
+ def save
20
+ #identity ? update : create
21
+ create
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ require 'fog/core/collection'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SecurityLists < Fog::Collection
7
+
8
+ model Fog::Compute::OracleCloud::SecurityList
9
+
10
+ def all
11
+ data = service.list_security_lists().body['result']
12
+ load(data)
13
+ end
14
+
15
+ def get(name)
16
+ data = service.get_security_list(name).body
17
+ new(data)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,41 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SecurityRule < Fog::Model
7
+ identity :name
8
+
9
+ attribute :dst_list
10
+ attribute :name
11
+ attribute :src_list
12
+ attribute :uri
13
+ attribute :disabled
14
+ attribute :application
15
+ attribute :proxyuri
16
+ attribute :action
17
+
18
+ # Only used in create
19
+ attribute :description
20
+
21
+ def save
22
+ #identity ? update : create
23
+ create
24
+ end
25
+
26
+ def create
27
+ requires :name, :src_list, :dst_list, :application, :action
28
+
29
+ data = service.create_security_rule(name, src_list, dst_list, application, action,
30
+ :description => description,
31
+ :disabled => disabled)
32
+ end
33
+
34
+ def destroy
35
+ requires :name
36
+ service.delete_security_rule(name)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,22 @@
1
+ require 'fog/core/collection'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SecurityRules < Fog::Collection
7
+
8
+ model Fog::Compute::OracleCloud::SecurityRule
9
+
10
+ def all
11
+ data = service.list_security_rules().body['result']
12
+ load(data)
13
+ end
14
+
15
+ def get(name)
16
+ data = service.get_security_rule(name).body
17
+ new(data)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,37 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SshKey < Fog::Model
7
+ identity :uri
8
+
9
+ attribute :enabled
10
+ attribute :key
11
+ attribute :name
12
+
13
+ def save
14
+ identity ? update : create
15
+ end
16
+
17
+ def create
18
+ requires :enabled, :name, :key
19
+
20
+ data = service.create_ssh_key(name, enabled, key)
21
+ merge_attributes(data.body)
22
+ end
23
+
24
+ def update
25
+ requires :enabled, :name, :key, :uri
26
+ data = service.update_ssh_key(name, enabled, key)
27
+ merge_attributes(data.body)
28
+ end
29
+
30
+ def destroy
31
+ requires :name
32
+ service.delete_ssh_key(name)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,22 @@
1
+ require 'fog/core/collection'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class SshKeys < Fog::Collection
7
+
8
+ model Fog::Compute::OracleCloud::SshKey
9
+
10
+ def get(name)
11
+ data = service.get_ssh_key(name).body
12
+ new(data)
13
+ end
14
+
15
+ def all
16
+ data = service.list_ssh_keys().body['result']
17
+ load(data)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,47 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OracleCloud
6
+ class Volume < Fog::Model
7
+ identity :name
8
+
9
+ attribute :status
10
+ attribute :account
11
+ attribute :writecache
12
+ attribute :managed
13
+ attribute :description
14
+ attribute :tags
15
+ attribute :bootable
16
+ attribute :hypervisor
17
+ attribute :quota
18
+ attribute :uri
19
+ attribute :snapshot
20
+ attribute :status_detail
21
+ attribute :imagelist_entry
22
+ attribute :storage_pool
23
+ attribute :machineimage_name
24
+ attribute :status_timestamp
25
+ attribute :shared
26
+ attribute :imagelist
27
+ attribute :size
28
+
29
+ def save
30
+ #identity ? update : create
31
+ create
32
+ end
33
+
34
+ def create
35
+ requires :name, :size
36
+
37
+ data = service.create_volume(name, size)
38
+ end
39
+
40
+ def destroy
41
+ requires :name
42
+ service.delete_volume(name)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,20 @@
1
+ module Fog
2
+ module Compute
3
+ class OracleCloud
4
+ class Volumes < Fog::Collection
5
+
6
+ model Fog::Compute::OracleCloud::Volume
7
+
8
+ def all
9
+ data = service.list_volumes().body['result']
10
+ load(data)
11
+ end
12
+
13
+ def get(name)
14
+ data = service.get_volume(name).body
15
+ new(data)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,84 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module OracleCloud
5
+ class Database
6
+ class Instance < Fog::Model
7
+ identity :service_name
8
+
9
+ attribute :service_name, :aliases => 'display_name'
10
+ attribute :version
11
+ attribute :status
12
+ attribute :description
13
+ attribute :identity_domain
14
+ attribute :creation_time
15
+ attribute :last_modified_time
16
+ attribute :created_by
17
+ attribute :sm_plugin_version
18
+ attribute :service_uri
19
+ attribute :num_nodes
20
+ attribute :level
21
+ attribute :edition
22
+ attribute :shape
23
+ attribute :subscriptionType
24
+ attribute :creation_job_id
25
+ attribute :num_ip_reservations
26
+ attribute :backup_destination
27
+ attribute :cloud_storage_container
28
+ attribute :failover_database
29
+ attribute :rac_database
30
+ attribute :sid
31
+ attribute :pdbName
32
+ attribute :listenerPort
33
+ attribute :timezone
34
+ attribute :em_url
35
+ attribute :connect_descriptor
36
+ attribute :connect_descriptor_with_public_ip
37
+ attribute :apex_url
38
+ attribute :glassfish_url
39
+ attribute :dbaasmonitor_url
40
+ attribute :compute_site_name
41
+
42
+ # The following are only used to create an instance and are not returned in the list action
43
+ attribute :level
44
+ attribute :subscriptionType
45
+ attribute :vmPublicKey
46
+ attribute :parameters
47
+
48
+
49
+ def save
50
+ #identity ? update : create
51
+ create
52
+ end
53
+
54
+ def ready?
55
+ status == "Running"
56
+ end
57
+
58
+ def ip_address
59
+ # TODO: Replace with regex
60
+ content_url.sub('http://', '')
61
+ end
62
+
63
+ def destroy
64
+ requires :service_name
65
+ service.delete_instance(service_name).body
66
+ end
67
+
68
+ private
69
+
70
+ def create
71
+ requires :service_name, :edition, :vmPublicKey, :parameters
72
+ data = service.create_instance(service_name, edition, vmPublicKey, parameters,
73
+ :level => level,
74
+ :subscriptionType => subscriptionType,
75
+ :description => description,
76
+ :version => version,
77
+ :edition => edition,
78
+ :shape => shape)
79
+
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,26 @@
1
+ require 'fog/core/collection'
2
+
3
+ module Fog
4
+ module OracleCloud
5
+ class Database
6
+ class Instances < Fog::Collection
7
+
8
+ model Fog::OracleCloud::Database::Instance
9
+
10
+ def all
11
+ data = service.list_instances().body['services']
12
+ load(data)
13
+ end
14
+
15
+ def get(id)
16
+ begin
17
+ new(service.get_instance(id).body)
18
+ rescue Fog::OracleCloud::Database::NotFound
19
+ nil
20
+ end
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end