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,53 +1,53 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class OracleCloud
|
4
|
-
class Real
|
5
|
-
def create_instance (name, shape, imagelist, label, sshkeys)
|
6
|
-
# This will create an instance using a Launchplan. Consider using an orchestration plan for more control
|
7
|
-
# Just in case it's already set
|
8
|
-
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
9
|
-
body_data = {
|
10
|
-
'instances' => [{
|
11
|
-
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
12
|
-
'shape' => shape,
|
13
|
-
'imagelist' => imagelist,
|
14
|
-
'label' => label,
|
15
|
-
'sshkeys' => sshkeys
|
16
|
-
}]
|
17
|
-
}
|
18
|
-
body_data = body_data.reject {|key, value| value.nil?}
|
19
|
-
request(
|
20
|
-
:method => 'POST',
|
21
|
-
:expects => 201,
|
22
|
-
:path => "/launchplan/",
|
23
|
-
:body => Fog::JSON.encode(body_data),
|
24
|
-
:headers => {
|
25
|
-
'Content-Type' => 'application/oracle-compute-v3+json'
|
26
|
-
}
|
27
|
-
)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
class Mock
|
32
|
-
def create_instance (name, shape, imagelist, label, sshkeys)
|
33
|
-
response = Excon::Response.new
|
34
|
-
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
35
|
-
|
36
|
-
self.data[:instances][name] = {
|
37
|
-
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
38
|
-
'shape' => shape,
|
39
|
-
'imagelist' => imagelist,
|
40
|
-
'label' => label,
|
41
|
-
'sshkeys' => sshkeys,
|
42
|
-
'state' => 'running'
|
43
|
-
}
|
44
|
-
response.status = 201
|
45
|
-
response.body = {
|
46
|
-
'instances' => [self.data[:instances][name]]
|
47
|
-
}
|
48
|
-
response
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OracleCloud
|
4
|
+
class Real
|
5
|
+
def create_instance (name, shape, imagelist, label, sshkeys)
|
6
|
+
# This will create an instance using a Launchplan. Consider using an orchestration plan for more control
|
7
|
+
# Just in case it's already set
|
8
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
9
|
+
body_data = {
|
10
|
+
'instances' => [{
|
11
|
+
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
12
|
+
'shape' => shape,
|
13
|
+
'imagelist' => imagelist,
|
14
|
+
'label' => label,
|
15
|
+
'sshkeys' => sshkeys
|
16
|
+
}]
|
17
|
+
}
|
18
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
19
|
+
request(
|
20
|
+
:method => 'POST',
|
21
|
+
:expects => 201,
|
22
|
+
:path => "/launchplan/",
|
23
|
+
:body => Fog::JSON.encode(body_data),
|
24
|
+
:headers => {
|
25
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
26
|
+
}
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class Mock
|
32
|
+
def create_instance (name, shape, imagelist, label, sshkeys)
|
33
|
+
response = Excon::Response.new
|
34
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
35
|
+
|
36
|
+
self.data[:instances][name] = {
|
37
|
+
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
38
|
+
'shape' => shape,
|
39
|
+
'imagelist' => imagelist,
|
40
|
+
'label' => label,
|
41
|
+
'sshkeys' => sshkeys,
|
42
|
+
'state' => 'running'
|
43
|
+
}
|
44
|
+
response.status = 201
|
45
|
+
response.body = {
|
46
|
+
'instances' => [self.data[:instances][name]]
|
47
|
+
}
|
48
|
+
response
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -1,82 +1,82 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class OracleCloud
|
4
|
-
class Real
|
5
|
-
def create_orchestration (name, oplans, options={})
|
6
|
-
|
7
|
-
# Clean up names in case they haven't provided the fully resolved names
|
8
|
-
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
9
|
-
oplans.map do |oplan|
|
10
|
-
oplan['objects'].map do |object|
|
11
|
-
if oplan['obj_type'] == 'launchplan' then
|
12
|
-
object['instances'].map do |instance|
|
13
|
-
if !instance['name'].start_with?("/Compute-") then
|
14
|
-
instance['name'] = "/Compute-#{@identity_domain}/#{@username}/#{instance['name']}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
else
|
18
|
-
if !object['name'].start_with?("/Compute-") then
|
19
|
-
object['name'] = "/Compute-#{@identity_domain}/#{@username}/#{object['name']}"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
body_data = {
|
25
|
-
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
26
|
-
'oplans' => oplans,
|
27
|
-
'relationships' => options[:relationships],
|
28
|
-
'description' => options[:description],
|
29
|
-
'account' => options[:account],
|
30
|
-
'schedule' => options[:schedule]
|
31
|
-
}
|
32
|
-
body_data = body_data.reject {|key, value| value.nil?}
|
33
|
-
request(
|
34
|
-
:method => 'POST',
|
35
|
-
:expects => 201,
|
36
|
-
:path => "/orchestration/",
|
37
|
-
:body => Fog::JSON.encode(body_data),
|
38
|
-
:headers => {
|
39
|
-
'Content-Type' => 'application/oracle-compute-v3+json'
|
40
|
-
}
|
41
|
-
)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class Mock
|
46
|
-
def create_orchestration (name, oplans, options={})
|
47
|
-
response = Excon::Response.new
|
48
|
-
# Clean up names in case they haven't provided the fully resolved names
|
49
|
-
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
50
|
-
oplans.map do |oplan|
|
51
|
-
oplan['objects'].map do |object|
|
52
|
-
if oplan['obj_type'] == 'launchplan' then
|
53
|
-
object['instances'].map do |instance|
|
54
|
-
if !instance['name'].start_with?("/Compute-") then
|
55
|
-
instance['name'] = "/Compute-#{@identity_domain}/#{@username}/#{instance['name']}"
|
56
|
-
end
|
57
|
-
end
|
58
|
-
else
|
59
|
-
if !object['name'].start_with?("/Compute-") then
|
60
|
-
object['name'] = "/Compute-#{@identity_domain}/#{@username}/#{object['name']}"
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
self.data[:orchestrations][name] = {
|
66
|
-
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
67
|
-
'oplans' => oplans,
|
68
|
-
'relationships' => options[:relationships],
|
69
|
-
'description' => options[:description],
|
70
|
-
'account' => options[:account],
|
71
|
-
'schedule' => options[:schedule],
|
72
|
-
'status' => 'stopped',
|
73
|
-
'uri' => "#{@api_endpoint}orchestration/Compute-#{@identity_domain}/#{@username}/#{name}"
|
74
|
-
}
|
75
|
-
response.status = 201
|
76
|
-
response.body = self.data[:orchestrations][name]
|
77
|
-
response
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OracleCloud
|
4
|
+
class Real
|
5
|
+
def create_orchestration (name, oplans, options={})
|
6
|
+
|
7
|
+
# Clean up names in case they haven't provided the fully resolved names
|
8
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
9
|
+
oplans.map do |oplan|
|
10
|
+
oplan['objects'].map do |object|
|
11
|
+
if oplan['obj_type'] == 'launchplan' then
|
12
|
+
object['instances'].map do |instance|
|
13
|
+
if !instance['name'].start_with?("/Compute-") then
|
14
|
+
instance['name'] = "/Compute-#{@identity_domain}/#{@username}/#{instance['name']}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
else
|
18
|
+
if !object['name'].start_with?("/Compute-") then
|
19
|
+
object['name'] = "/Compute-#{@identity_domain}/#{@username}/#{object['name']}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
body_data = {
|
25
|
+
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
26
|
+
'oplans' => oplans,
|
27
|
+
'relationships' => options[:relationships],
|
28
|
+
'description' => options[:description],
|
29
|
+
'account' => options[:account],
|
30
|
+
'schedule' => options[:schedule]
|
31
|
+
}
|
32
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
33
|
+
request(
|
34
|
+
:method => 'POST',
|
35
|
+
:expects => 201,
|
36
|
+
:path => "/orchestration/",
|
37
|
+
:body => Fog::JSON.encode(body_data),
|
38
|
+
:headers => {
|
39
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
40
|
+
}
|
41
|
+
)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class Mock
|
46
|
+
def create_orchestration (name, oplans, options={})
|
47
|
+
response = Excon::Response.new
|
48
|
+
# Clean up names in case they haven't provided the fully resolved names
|
49
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
50
|
+
oplans.map do |oplan|
|
51
|
+
oplan['objects'].map do |object|
|
52
|
+
if oplan['obj_type'] == 'launchplan' then
|
53
|
+
object['instances'].map do |instance|
|
54
|
+
if !instance['name'].start_with?("/Compute-") then
|
55
|
+
instance['name'] = "/Compute-#{@identity_domain}/#{@username}/#{instance['name']}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
else
|
59
|
+
if !object['name'].start_with?("/Compute-") then
|
60
|
+
object['name'] = "/Compute-#{@identity_domain}/#{@username}/#{object['name']}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
self.data[:orchestrations][name] = {
|
66
|
+
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
67
|
+
'oplans' => oplans,
|
68
|
+
'relationships' => options[:relationships],
|
69
|
+
'description' => options[:description],
|
70
|
+
'account' => options[:account],
|
71
|
+
'schedule' => options[:schedule],
|
72
|
+
'status' => 'stopped',
|
73
|
+
'uri' => "#{@api_endpoint}orchestration/Compute-#{@identity_domain}/#{@username}/#{name}"
|
74
|
+
}
|
75
|
+
response.status = 201
|
76
|
+
response.body = self.data[:orchestrations][name]
|
77
|
+
response
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -1,28 +1,28 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class OracleCloud
|
4
|
-
class Real
|
5
|
-
def create_security_application(name, protocol, options={})
|
6
|
-
body_data = {
|
7
|
-
'name' => name,
|
8
|
-
'protocol' => protocol,
|
9
|
-
'dport' => options[:dport],
|
10
|
-
'icmptype' => options[:icmptype],
|
11
|
-
'icmpcode' => options[:icmpcode],
|
12
|
-
'description' => options[:description]
|
13
|
-
}
|
14
|
-
body_data = body_data.reject {|key, value| value.nil?}
|
15
|
-
request(
|
16
|
-
:method => 'POST',
|
17
|
-
:expects => 201,
|
18
|
-
:path => "/secapplication/",
|
19
|
-
:body => Fog::JSON.encode(body_data),
|
20
|
-
:headers => {
|
21
|
-
'Content-Type' => 'application/oracle-compute-v3+json'
|
22
|
-
}
|
23
|
-
)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OracleCloud
|
4
|
+
class Real
|
5
|
+
def create_security_application(name, protocol, options={})
|
6
|
+
body_data = {
|
7
|
+
'name' => name,
|
8
|
+
'protocol' => protocol,
|
9
|
+
'dport' => options[:dport],
|
10
|
+
'icmptype' => options[:icmptype],
|
11
|
+
'icmpcode' => options[:icmpcode],
|
12
|
+
'description' => options[:description]
|
13
|
+
}
|
14
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
15
|
+
request(
|
16
|
+
:method => 'POST',
|
17
|
+
:expects => 201,
|
18
|
+
:path => "/secapplication/",
|
19
|
+
:body => Fog::JSON.encode(body_data),
|
20
|
+
:headers => {
|
21
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
22
|
+
}
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class OracleCloud
|
4
|
-
class Real
|
5
|
-
def create_security_rule(name, src_list, dst_list, application, action, options={})
|
6
|
-
body_data = {
|
7
|
-
'name' => name,
|
8
|
-
'src_list' => src_list,
|
9
|
-
'dst_list' => dst_list,
|
10
|
-
'application' => application,
|
11
|
-
'action' => action,
|
12
|
-
'description' => options[:description],
|
13
|
-
'disabled' => options[:disabled]
|
14
|
-
}
|
15
|
-
body_data = body_data.reject {|key, value| value.nil?}
|
16
|
-
request(
|
17
|
-
:method => 'POST',
|
18
|
-
:expects => 201,
|
19
|
-
:path => "/secrule/",
|
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
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OracleCloud
|
4
|
+
class Real
|
5
|
+
def create_security_rule(name, src_list, dst_list, application, action, options={})
|
6
|
+
body_data = {
|
7
|
+
'name' => name,
|
8
|
+
'src_list' => src_list,
|
9
|
+
'dst_list' => dst_list,
|
10
|
+
'application' => application,
|
11
|
+
'action' => action,
|
12
|
+
'description' => options[:description],
|
13
|
+
'disabled' => options[:disabled]
|
14
|
+
}
|
15
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
16
|
+
request(
|
17
|
+
:method => 'POST',
|
18
|
+
:expects => 201,
|
19
|
+
:path => "/secrule/",
|
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
|
@@ -1,46 +1,46 @@
|
|
1
|
-
module Fog
|
2
|
-
module Compute
|
3
|
-
class OracleCloud
|
4
|
-
class Real
|
5
|
-
def create_ssh_key (name, enabled, key)
|
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
|
-
'enabled' => enabled,
|
11
|
-
'key' => key
|
12
|
-
}
|
13
|
-
body_data = body_data.reject {|key, value| value.nil?}
|
14
|
-
request(
|
15
|
-
:method => 'POST',
|
16
|
-
:expects => 201,
|
17
|
-
:path => "/sshkey/",
|
18
|
-
:body => Fog::JSON.encode(body_data),
|
19
|
-
:headers => {
|
20
|
-
'Content-Type' => 'application/oracle-compute-v3+json'
|
21
|
-
}
|
22
|
-
)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class Mock
|
27
|
-
def create_ssh_key (name, enabled, key)
|
28
|
-
response = Excon::Response.new
|
29
|
-
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
30
|
-
|
31
|
-
data = {
|
32
|
-
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
33
|
-
'enabled' => enabled,
|
34
|
-
'key' => key,
|
35
|
-
'uri' => "#{@api_endpoint}sshkey/#{name}"
|
36
|
-
}
|
37
|
-
self.data[:sshkeys][name] = data
|
38
|
-
|
39
|
-
response.status = 201
|
40
|
-
response.body = self.data[:sshkeys][name]
|
41
|
-
response
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class OracleCloud
|
4
|
+
class Real
|
5
|
+
def create_ssh_key (name, enabled, key)
|
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
|
+
'enabled' => enabled,
|
11
|
+
'key' => key
|
12
|
+
}
|
13
|
+
body_data = body_data.reject {|key, value| value.nil?}
|
14
|
+
request(
|
15
|
+
:method => 'POST',
|
16
|
+
:expects => 201,
|
17
|
+
:path => "/sshkey/",
|
18
|
+
:body => Fog::JSON.encode(body_data),
|
19
|
+
:headers => {
|
20
|
+
'Content-Type' => 'application/oracle-compute-v3+json'
|
21
|
+
}
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Mock
|
27
|
+
def create_ssh_key (name, enabled, key)
|
28
|
+
response = Excon::Response.new
|
29
|
+
name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
|
30
|
+
|
31
|
+
data = {
|
32
|
+
'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
|
33
|
+
'enabled' => enabled,
|
34
|
+
'key' => key,
|
35
|
+
'uri' => "#{@api_endpoint}sshkey/#{name}"
|
36
|
+
}
|
37
|
+
self.data[:sshkeys][name] = data
|
38
|
+
|
39
|
+
response.status = 201
|
40
|
+
response.body = self.data[:sshkeys][name]
|
41
|
+
response
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|