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.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +34 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fog-oracle.gemspec +30 -0
- data/lib/fog/oraclecloud/compute.rb +146 -0
- data/lib/fog/oraclecloud/database.rb +114 -0
- data/lib/fog/oraclecloud/java.rb +114 -0
- data/lib/fog/oraclecloud/models/compute/image.rb +43 -0
- data/lib/fog/oraclecloud/models/compute/image_list.rb +42 -0
- data/lib/fog/oraclecloud/models/compute/image_lists.rb +22 -0
- data/lib/fog/oraclecloud/models/compute/images.rb +22 -0
- data/lib/fog/oraclecloud/models/compute/instance.rb +65 -0
- data/lib/fog/oraclecloud/models/compute/instances.rb +22 -0
- data/lib/fog/oraclecloud/models/compute/object_plan.rb +16 -0
- data/lib/fog/oraclecloud/models/compute/object_plans.rb +12 -0
- data/lib/fog/oraclecloud/models/compute/orchestration.rb +89 -0
- data/lib/fog/oraclecloud/models/compute/orchestrations.rb +20 -0
- data/lib/fog/oraclecloud/models/compute/security_application.rb +42 -0
- data/lib/fog/oraclecloud/models/compute/security_applications.rb +22 -0
- data/lib/fog/oraclecloud/models/compute/security_list.rb +26 -0
- data/lib/fog/oraclecloud/models/compute/security_lists.rb +22 -0
- data/lib/fog/oraclecloud/models/compute/security_rule.rb +41 -0
- data/lib/fog/oraclecloud/models/compute/security_rules.rb +22 -0
- data/lib/fog/oraclecloud/models/compute/ssh_key.rb +37 -0
- data/lib/fog/oraclecloud/models/compute/ssh_keys.rb +22 -0
- data/lib/fog/oraclecloud/models/compute/volume.rb +47 -0
- data/lib/fog/oraclecloud/models/compute/volumes.rb +20 -0
- data/lib/fog/oraclecloud/models/database/instance.rb +84 -0
- data/lib/fog/oraclecloud/models/database/instances.rb +26 -0
- data/lib/fog/oraclecloud/models/java/instance.rb +107 -0
- data/lib/fog/oraclecloud/models/java/instances.rb +27 -0
- data/lib/fog/oraclecloud/models/java/server.rb +26 -0
- data/lib/fog/oraclecloud/models/java/servers.rb +17 -0
- data/lib/fog/oraclecloud/models/soa/instance.rb +65 -0
- data/lib/fog/oraclecloud/models/soa/instances.rb +25 -0
- data/lib/fog/oraclecloud/models/storage/container.rb +34 -0
- data/lib/fog/oraclecloud/models/storage/containers.rb +24 -0
- data/lib/fog/oraclecloud/models/storage/object.rb +27 -0
- data/lib/fog/oraclecloud/models/storage/objects.rb +27 -0
- data/lib/fog/oraclecloud/requests/compute/create_image.rb +30 -0
- data/lib/fog/oraclecloud/requests/compute/create_image_list.rb +27 -0
- data/lib/fog/oraclecloud/requests/compute/create_instance.rb +32 -0
- data/lib/fog/oraclecloud/requests/compute/create_orchestration.rb +46 -0
- data/lib/fog/oraclecloud/requests/compute/create_security_application.rb +28 -0
- data/lib/fog/oraclecloud/requests/compute/create_security_rule.rb +29 -0
- data/lib/fog/oraclecloud/requests/compute/create_ssh_key.rb +27 -0
- data/lib/fog/oraclecloud/requests/compute/create_volume.rb +29 -0
- data/lib/fog/oraclecloud/requests/compute/delete_image.rb +19 -0
- data/lib/fog/oraclecloud/requests/compute/delete_image_list.rb +19 -0
- data/lib/fog/oraclecloud/requests/compute/delete_instance.rb +22 -0
- data/lib/fog/oraclecloud/requests/compute/delete_orchestration.rb +22 -0
- data/lib/fog/oraclecloud/requests/compute/delete_security_application.rb +20 -0
- data/lib/fog/oraclecloud/requests/compute/delete_security_rule.rb +20 -0
- data/lib/fog/oraclecloud/requests/compute/delete_ssh_key.rb +22 -0
- data/lib/fog/oraclecloud/requests/compute/get_image.rb +21 -0
- data/lib/fog/oraclecloud/requests/compute/get_image_list.rb +21 -0
- data/lib/fog/oraclecloud/requests/compute/get_instance.rb +24 -0
- data/lib/fog/oraclecloud/requests/compute/get_orchestration.rb +24 -0
- data/lib/fog/oraclecloud/requests/compute/get_security_application.rb +20 -0
- data/lib/fog/oraclecloud/requests/compute/get_security_rule.rb +20 -0
- data/lib/fog/oraclecloud/requests/compute/get_ssh_key.rb +24 -0
- data/lib/fog/oraclecloud/requests/compute/list_image_lists.rb +16 -0
- data/lib/fog/oraclecloud/requests/compute/list_images.rb +16 -0
- data/lib/fog/oraclecloud/requests/compute/list_instances.rb +16 -0
- data/lib/fog/oraclecloud/requests/compute/list_orchestrations.rb +16 -0
- data/lib/fog/oraclecloud/requests/compute/list_security_applications.rb +21 -0
- data/lib/fog/oraclecloud/requests/compute/list_security_lists.rb +16 -0
- data/lib/fog/oraclecloud/requests/compute/list_security_rules.rb +21 -0
- data/lib/fog/oraclecloud/requests/compute/list_ssh_keys.rb +16 -0
- data/lib/fog/oraclecloud/requests/compute/list_volumes.rb +16 -0
- data/lib/fog/oraclecloud/requests/compute/start_orchestration.rb +22 -0
- data/lib/fog/oraclecloud/requests/compute/stop_orchestration.rb +22 -0
- data/lib/fog/oraclecloud/requests/compute/update_image.rb +27 -0
- data/lib/fog/oraclecloud/requests/compute/update_image_list.rb +27 -0
- data/lib/fog/oraclecloud/requests/compute/update_orchestration.rb +49 -0
- data/lib/fog/oraclecloud/requests/compute/update_ssh_key.rb +29 -0
- data/lib/fog/oraclecloud/requests/database/create_instance.rb +46 -0
- data/lib/fog/oraclecloud/requests/database/delete_instance.rb +31 -0
- data/lib/fog/oraclecloud/requests/database/get_instance.rb +36 -0
- data/lib/fog/oraclecloud/requests/database/list_instances.rb +16 -0
- data/lib/fog/oraclecloud/requests/java/create_instance.rb +51 -0
- data/lib/fog/oraclecloud/requests/java/delete_instance.rb +42 -0
- data/lib/fog/oraclecloud/requests/java/get_instance.rb +37 -0
- data/lib/fog/oraclecloud/requests/java/get_server.rb +0 -0
- data/lib/fog/oraclecloud/requests/java/list_instances.rb +16 -0
- data/lib/fog/oraclecloud/requests/java/list_servers.rb +29 -0
- data/lib/fog/oraclecloud/requests/soa/create_instance.rb +47 -0
- data/lib/fog/oraclecloud/requests/soa/delete_instance.rb +40 -0
- data/lib/fog/oraclecloud/requests/soa/get_instance.rb +36 -0
- data/lib/fog/oraclecloud/requests/soa/list_instances.rb +16 -0
- data/lib/fog/oraclecloud/requests/storage/create_container.rb +21 -0
- data/lib/fog/oraclecloud/requests/storage/delete_container.rb +15 -0
- data/lib/fog/oraclecloud/requests/storage/get_container.rb +24 -0
- data/lib/fog/oraclecloud/requests/storage/list_containers.rb +16 -0
- data/lib/fog/oraclecloud/soa.rb +80 -0
- data/lib/fog/oraclecloud/storage.rb +80 -0
- data/lib/fog/oraclecloud/version.rb +5 -0
- data/lib/fog/oraclecloud.rb +29 -0
- data/tests/helper.rb +1 -0
- data/tests/requests/database_tests.rb +52 -0
- data/tests/requests/instance_tests.rb +54 -0
- data/tests/requests/java_tests.rb +52 -0
- data/tests/requests/orchestrations_tests.rb +86 -0
- data/tests/requests/soa_tests.rb +52 -0
- data/tests/requests/ssh_keys_tests.rb +49 -0
- data/tests/requests/storage_tests.rb +54 -0
- metadata +253 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def delete_instance (name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
request(
|
|
11
|
+
:method => 'DELETE',
|
|
12
|
+
:expects => 204,
|
|
13
|
+
:path => "/instance#{name}",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def delete_orchestration (name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
request(
|
|
11
|
+
:method => 'DELETE',
|
|
12
|
+
:expects => 204,
|
|
13
|
+
:path => "/orchestration#{name}",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def delete_security_application(name)
|
|
6
|
+
# Just in case it's already set
|
|
7
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
|
8
|
+
request(
|
|
9
|
+
:method => 'DELETE',
|
|
10
|
+
:expects => 204,
|
|
11
|
+
:path => "/secapplication/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
12
|
+
:headers => {
|
|
13
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def delete_security_rule(name)
|
|
6
|
+
# Just in case it's already set
|
|
7
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
|
8
|
+
request(
|
|
9
|
+
:method => 'DELETE',
|
|
10
|
+
:expects => 204,
|
|
11
|
+
:path => "/secrule/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
12
|
+
:headers => {
|
|
13
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def delete_ssh_key (name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
request(
|
|
11
|
+
:method => 'DELETE',
|
|
12
|
+
:expects => 204,
|
|
13
|
+
:path => "/sshkey#{name}",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def get_image(name)
|
|
6
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
|
7
|
+
response = request(
|
|
8
|
+
:expects => 200,
|
|
9
|
+
:method => 'GET',
|
|
10
|
+
:path => "/machineimage/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
11
|
+
:headers => {
|
|
12
|
+
'Content-Type' => 'application/oracle-compute-v3+json',
|
|
13
|
+
'Accept' => 'application/oracle-compute-v3+json'
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
response
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def get_image_list(name)
|
|
6
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
|
7
|
+
response = request(
|
|
8
|
+
:expects => 200,
|
|
9
|
+
:method => 'GET',
|
|
10
|
+
:path => "/imagelist/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
11
|
+
:headers => {
|
|
12
|
+
'Content-Type' => 'application/oracle-compute-v3+json',
|
|
13
|
+
'Accept' => 'application/oracle-compute-v3+json'
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
response
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def get_instance(name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
response = request(
|
|
11
|
+
:expects => 200,
|
|
12
|
+
:method => 'GET',
|
|
13
|
+
:path => "/instance#{name}",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json',
|
|
16
|
+
'Accept' => 'application/oracle-compute-v3+json'
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
response
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def get_orchestration(name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
response = request(
|
|
11
|
+
:expects => 200,
|
|
12
|
+
:method => 'GET',
|
|
13
|
+
:path => "/orchestration#{name}",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json',
|
|
16
|
+
'Accept' => 'application/oracle-compute-v3+json'
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
response
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def get_security_application(name)
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/secapplication/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
10
|
+
:headers => {
|
|
11
|
+
'Content-Type' => 'application/oracle-compute-v3+json',
|
|
12
|
+
'Accept' => 'application/oracle-compute-v3+json'
|
|
13
|
+
}
|
|
14
|
+
)
|
|
15
|
+
response
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def get_security_rule(name)
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/secrule/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
10
|
+
:headers => {
|
|
11
|
+
'Content-Type' => 'application/oracle-compute-v3+json',
|
|
12
|
+
'Accept' => 'application/oracle-compute-v3+json'
|
|
13
|
+
}
|
|
14
|
+
)
|
|
15
|
+
response
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def get_ssh_key(name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
response = request(
|
|
11
|
+
:expects => 200,
|
|
12
|
+
:method => 'GET',
|
|
13
|
+
:path => "/sshkey#{name}",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json',
|
|
16
|
+
'Accept' => 'application/oracle-compute-v3+json'
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
response
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def list_image_lists
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/imagelist/Compute-#{@identity_domain}/#{@username}/"
|
|
10
|
+
)
|
|
11
|
+
response
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def list_images
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/machineimage/Compute-#{@identity_domain}/#{@username}/"
|
|
10
|
+
)
|
|
11
|
+
response
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def list_orchestrations
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/orchestration/Compute-#{@identity_domain}/"
|
|
10
|
+
)
|
|
11
|
+
response
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def list_security_applications
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/secapplication/Compute-#{@identity_domain}/#{@username}/"
|
|
10
|
+
)
|
|
11
|
+
response
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class Mock
|
|
16
|
+
def list_security_applications
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def list_security_lists
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/seclist/Compute-#{@identity_domain}/#{@username}/"
|
|
10
|
+
)
|
|
11
|
+
response
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def list_security_rules
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/secrule/Compute-#{@identity_domain}/#{@username}/"
|
|
10
|
+
)
|
|
11
|
+
response
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class Mock
|
|
16
|
+
def list_security_applications
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def list_volumes
|
|
6
|
+
response = request(
|
|
7
|
+
:expects => 200,
|
|
8
|
+
:method => 'GET',
|
|
9
|
+
:path => "/storage/volume/Compute-#{@identity_domain}/#{@username}/"
|
|
10
|
+
)
|
|
11
|
+
response
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def start_orchestration (name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
request(
|
|
11
|
+
:method => 'PUT',
|
|
12
|
+
:expects => 200,
|
|
13
|
+
:path => "/orchestration#{name}?action=start",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def stop_orchestration (name)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
request(
|
|
11
|
+
:method => 'PUT',
|
|
12
|
+
:expects => 200,
|
|
13
|
+
:path => "/orchestration#{name}?action=stop",
|
|
14
|
+
:headers => {
|
|
15
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def update_image (name, options={})
|
|
6
|
+
# Just in case it's already set
|
|
7
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
|
8
|
+
body_data = {
|
|
9
|
+
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
10
|
+
'description' => options[:description],
|
|
11
|
+
'default' => options[:default]
|
|
12
|
+
}
|
|
13
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
|
14
|
+
request(
|
|
15
|
+
:method => 'PUT',
|
|
16
|
+
:expects => 200,
|
|
17
|
+
:path => "/imagelist/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
18
|
+
:body => Fog::JSON.encode(body_data),
|
|
19
|
+
:headers => {
|
|
20
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def update_image_list (name, options={})
|
|
6
|
+
# Just in case it's already set
|
|
7
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
|
8
|
+
body_data = {
|
|
9
|
+
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
10
|
+
'description' => options[:description],
|
|
11
|
+
'default' => options[:default]
|
|
12
|
+
}
|
|
13
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
|
14
|
+
request(
|
|
15
|
+
:method => 'PUT',
|
|
16
|
+
:expects => 200,
|
|
17
|
+
:path => "/imagelist/Compute-#{@identity_domain}/#{@username}/#{name}",
|
|
18
|
+
:body => Fog::JSON.encode(body_data),
|
|
19
|
+
:headers => {
|
|
20
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def update_orchestration (name, oplans, options={})
|
|
6
|
+
|
|
7
|
+
# Clean up names in case they haven't provided the fully resolved names
|
|
8
|
+
if !name.start_with?("/Compute-") then
|
|
9
|
+
# They haven't provided a well formed name, add their name in
|
|
10
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
11
|
+
end
|
|
12
|
+
oplans.map do |oplan|
|
|
13
|
+
oplan['objects'].map do |object|
|
|
14
|
+
if oplan['obj_type'] == 'launchplan' then
|
|
15
|
+
object['instances'].map do |instance|
|
|
16
|
+
if !instance['name'].start_with?("/Compute-") then
|
|
17
|
+
instance['name'] = "/Compute-#{@identity_domain}/#{@username}/#{instance['name']}"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
else
|
|
21
|
+
if !object['name'].start_with?("/Compute-") then
|
|
22
|
+
object['name'] = "/Compute-#{@identity_domain}/#{@username}/#{object['name']}"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
body_data = {
|
|
28
|
+
'name' => name,
|
|
29
|
+
'oplans' => oplans,
|
|
30
|
+
'relationships' => options[:relationships],
|
|
31
|
+
'description' => options[:description],
|
|
32
|
+
'account' => options[:account],
|
|
33
|
+
'schedule' => options[:schedule]
|
|
34
|
+
}
|
|
35
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
|
36
|
+
request(
|
|
37
|
+
:method => 'PUT',
|
|
38
|
+
:expects => 200,
|
|
39
|
+
:path => "/orchestration#{name}",
|
|
40
|
+
:body => Fog::JSON.encode(body_data),
|
|
41
|
+
:headers => {
|
|
42
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class OracleCloud
|
|
4
|
+
class Real
|
|
5
|
+
def update_ssh_key (name, enabled, key)
|
|
6
|
+
if !name.start_with?("/Compute-") then
|
|
7
|
+
# They haven't provided a well formed name, add their name in
|
|
8
|
+
name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
|
|
9
|
+
end
|
|
10
|
+
body_data = {
|
|
11
|
+
'name' => name,
|
|
12
|
+
'enabled' => enabled,
|
|
13
|
+
'key' => key
|
|
14
|
+
}
|
|
15
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
|
16
|
+
request(
|
|
17
|
+
:method => 'PUT',
|
|
18
|
+
:expects => 200,
|
|
19
|
+
:path => "/sshkey#{name}",
|
|
20
|
+
:body => Fog::JSON.encode(body_data),
|
|
21
|
+
:headers => {
|
|
22
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module OracleCloud
|
|
3
|
+
class Database
|
|
4
|
+
class Real
|
|
5
|
+
|
|
6
|
+
def create_instance(service_name, edition, vmPublicKey, parameters, options={})
|
|
7
|
+
body_data = {
|
|
8
|
+
'serviceName' => service_name,
|
|
9
|
+
'version' => options[:version],
|
|
10
|
+
'level' => options[:level],
|
|
11
|
+
'edition' => edition,
|
|
12
|
+
'subscriptionType' => options[:subscriptionType],
|
|
13
|
+
'description' => options[:description],
|
|
14
|
+
'shape' => options[:shape],
|
|
15
|
+
'vmPublicKeyText' => vmPublicKey,
|
|
16
|
+
'parameters' => parameters
|
|
17
|
+
}
|
|
18
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
|
19
|
+
|
|
20
|
+
request(
|
|
21
|
+
:method => 'POST',
|
|
22
|
+
:expects => 202,
|
|
23
|
+
:path => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}",
|
|
24
|
+
:body => Fog::JSON.encode(body_data),
|
|
25
|
+
#:headers => {
|
|
26
|
+
# 'Content-Type'=>'application/vnd.com.oracle.oracloud.provisioning.Service+json'
|
|
27
|
+
#}
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class Mock
|
|
34
|
+
def create_instance(service_name, edition, vmPublicKey, parameters, options={})
|
|
35
|
+
response = Excon::Response.new
|
|
36
|
+
|
|
37
|
+
instance = Fog::OracleCloud::Mock.create_database_instance(service_name)
|
|
38
|
+
self.data[:instances][service_name] = instance
|
|
39
|
+
|
|
40
|
+
response.status = 202
|
|
41
|
+
response
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|