foreman_datacenter 1.16.12 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/foreman_datacenter/modal.js +9 -22
- data/app/assets/stylesheets/foreman_datacenter/datacenter.css +0 -3
- data/app/assets/stylesheets/foreman_datacenter/device_roles.css +0 -32
- data/app/controllers/api/v2/foreman_datacenter/console_port_templates_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/console_ports_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/console_server_port_templates_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/console_server_ports_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/device_bay_templates_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/device_bays_controller.rb +25 -24
- data/app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb +27 -27
- data/app/controllers/api/v2/foreman_datacenter/device_interfaces_controller.rb +2 -1
- data/app/controllers/api/v2/foreman_datacenter/device_modules_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/device_roles_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/device_types_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/devices_controller.rb +2 -1
- data/app/controllers/api/v2/foreman_datacenter/interface_templates_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/management_devices_controller.rb +1 -1
- data/app/controllers/api/v2/foreman_datacenter/manufacturers_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/platforms_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/power_outlet_templates_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/power_outlets_controller.rb +2 -1
- data/app/controllers/api/v2/foreman_datacenter/power_port_templates_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/power_ports_controller.rb +1 -0
- data/app/controllers/api/v2/foreman_datacenter/rack_groups_controller.rb +24 -23
- data/app/controllers/api/v2/foreman_datacenter/racks_controller.rb +1 -6
- data/app/controllers/api/v2/foreman_datacenter/sites_controller.rb +32 -25
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/comment.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/console_port.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/console_port_template.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/console_server_port.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/console_server_port_template.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/device_bay.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/device_bay_template.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/device_interface.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/device_interface_connection.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/device_module.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/device_role.rb +1 -1
- data/app/controllers/concerns/foreman_datacenter/controller/parameters/device_type.rb +1 -1
- data/app/controllers/foreman_datacenter/application_controller.rb +0 -2
- data/app/controllers/foreman_datacenter/console_ports_controller.rb +4 -2
- data/app/controllers/foreman_datacenter/console_server_ports_controller.rb +10 -5
- data/app/controllers/foreman_datacenter/device_bays_controller.rb +10 -5
- data/app/controllers/foreman_datacenter/device_interface_connections_controller.rb +4 -7
- data/app/controllers/foreman_datacenter/device_interfaces_controller.rb +6 -3
- data/app/controllers/foreman_datacenter/device_modules_controller.rb +7 -3
- data/app/controllers/foreman_datacenter/device_types_controller.rb +2 -1
- data/app/controllers/foreman_datacenter/devices_controller.rb +25 -8
- data/app/controllers/foreman_datacenter/management_devices_controller.rb +6 -3
- data/app/controllers/foreman_datacenter/power_outlets_controller.rb +10 -5
- data/app/controllers/foreman_datacenter/power_ports_controller.rb +10 -5
- data/app/controllers/foreman_datacenter/rack_groups_controller.rb +1 -6
- data/app/controllers/foreman_datacenter/sites_controller.rb +1 -7
- data/app/models/foreman_datacenter/device.rb +0 -1
- data/app/models/foreman_datacenter/device_interface_connection.rb +2 -2
- data/app/models/foreman_datacenter/site.rb +0 -1
- data/app/views/foreman_datacenter/comments/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/comments/new.html.erb +2 -0
- data/app/views/foreman_datacenter/common/404.html.erb +2 -0
- data/app/views/foreman_datacenter/console_port_templates/new.html.erb +2 -0
- data/app/views/foreman_datacenter/console_ports/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/console_ports/index.html.erb +5 -27
- data/app/views/foreman_datacenter/console_ports/new.html.erb +2 -0
- data/app/views/foreman_datacenter/console_ports/new_connection.html.erb +2 -0
- data/app/views/foreman_datacenter/console_ports/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/console_server_port_templates/new.html.erb +2 -0
- data/app/views/foreman_datacenter/console_server_ports/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/console_server_ports/new.html.erb +2 -0
- data/app/views/foreman_datacenter/console_server_ports/new_connection.html.erb +2 -0
- data/app/views/foreman_datacenter/device_bay_templates/new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_bays/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/device_bays/new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_bays/populate_new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_interface_connections/index.html.erb +3 -23
- data/app/views/foreman_datacenter/device_interface_connections/new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_interface_connections/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/device_interfaces/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/device_interfaces/new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_modules/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/device_modules/new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_roles/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/device_roles/index.html.erb +1 -1
- data/app/views/foreman_datacenter/device_roles/new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_roles/show.html.erb +3 -1
- data/app/views/foreman_datacenter/device_roles/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/device_types/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/device_types/index.html.erb +1 -1
- data/app/views/foreman_datacenter/device_types/new.html.erb +2 -0
- data/app/views/foreman_datacenter/device_types/show.html.erb +3 -1
- data/app/views/foreman_datacenter/device_types/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/devices/_interface.html.erb +3 -17
- data/app/views/foreman_datacenter/devices/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/devices/index.html.erb +1 -1
- data/app/views/foreman_datacenter/devices/inventory.html.erb +2 -0
- data/app/views/foreman_datacenter/devices/new.html.erb +2 -0
- data/app/views/foreman_datacenter/devices/show.html.erb +3 -4
- data/app/views/foreman_datacenter/devices/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/interface_templates/new.html.erb +2 -0
- data/app/views/foreman_datacenter/management_devices/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/management_devices/new.html.erb +2 -0
- data/app/views/foreman_datacenter/manufacturers/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/manufacturers/index.html.erb +1 -1
- data/app/views/foreman_datacenter/manufacturers/new.html.erb +2 -0
- data/app/views/foreman_datacenter/manufacturers/show.html.erb +3 -1
- data/app/views/foreman_datacenter/manufacturers/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/platforms/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/platforms/index.html.erb +1 -1
- data/app/views/foreman_datacenter/platforms/new.html.erb +2 -0
- data/app/views/foreman_datacenter/platforms/show.html.erb +10 -8
- data/app/views/foreman_datacenter/platforms/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/power_outlet_templates/new.html.erb +2 -0
- data/app/views/foreman_datacenter/power_outlets/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/power_outlets/new.html.erb +2 -0
- data/app/views/foreman_datacenter/power_outlets/new_connection.html.erb +2 -0
- data/app/views/foreman_datacenter/power_port_templates/new.html.erb +2 -0
- data/app/views/foreman_datacenter/power_ports/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/power_ports/new.html.erb +2 -0
- data/app/views/foreman_datacenter/power_ports/new_connection.html.erb +2 -0
- data/app/views/foreman_datacenter/power_ports/welcome.html.erb +2 -0
- data/app/views/foreman_datacenter/rack_groups/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/rack_groups/move.html.erb +2 -0
- data/app/views/foreman_datacenter/rack_groups/new.html.erb +2 -0
- data/app/views/foreman_datacenter/rack_groups/show.html.erb +3 -4
- data/app/views/foreman_datacenter/racks/_device_position.html.erb +3 -21
- data/app/views/foreman_datacenter/racks/_unpositioned_devices.html.erb +1 -1
- data/app/views/foreman_datacenter/racks/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/racks/move.html.erb +2 -0
- data/app/views/foreman_datacenter/racks/new.html.erb +2 -0
- data/app/views/foreman_datacenter/racks/show.html.erb +4 -0
- data/app/views/foreman_datacenter/shared/_aa.html.erb +1 -0
- data/app/views/foreman_datacenter/sites/edit.html.erb +2 -0
- data/app/views/foreman_datacenter/sites/move.html.erb +2 -0
- data/app/views/foreman_datacenter/sites/new.html.erb +2 -0
- data/app/views/foreman_datacenter/sites/show.html.erb +3 -4
- data/config/routes.rb +0 -2
- data/db/migrate/20180725201545_add_location_id_and_organization_id_columns_to_devices.rb +1 -1
- data/lib/foreman_datacenter/engine.rb +2 -2
- data/lib/foreman_datacenter/version.rb +1 -1
- metadata +4 -8
- data/app/assets/stylesheets/foreman_datacenter/horizontal-scroll.css +0 -9
- data/app/controllers/concerns/foreman_datacenter/controller/racks.rb +0 -10
- data/app/views/foreman_datacenter/rack_groups/racks.html.erb +0 -16
- data/app/views/foreman_datacenter/racks/_dp.html.erb +0 -46
- data/app/views/foreman_datacenter/sites/racks.html.erb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b107cc41f1cd6e3e03d3eaa9c742dc6d437e206c50c4d5389a1e73251b9e8852
|
4
|
+
data.tar.gz: 2e0eb385586087cecd25ec166f12d7f45bd19a2cc4e9e761436a94ed0b50f00c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2948be60ff1b973fc6bc6d0bc72d108129478b47c082a12bc572957f905554db7e91f7f0b136b74b06da30e8f1f45757bdb7f2a1ad2bba7b199517dc4da693
|
7
|
+
data.tar.gz: 6efebfbac69d6ce1da94419d068573b5b31e1846d94a3d5b8a910f86b8cfc77482098c1ea0c722470de5b5fd1c896e1c68743f6f6d15aa41031dab5ae7257a92
|
@@ -8,10 +8,9 @@ $(window).click(function(event) {
|
|
8
8
|
var pathname = window.location.pathname; // Returns path only
|
9
9
|
var str = "/" + object_id;
|
10
10
|
var patt = new RegExp(str);
|
11
|
-
|
11
|
+
console.log(object_type);
|
12
12
|
if (object_type == 'device') {
|
13
|
-
|
14
|
-
var checkbox_label = ''
|
13
|
+
var checkbox_label = 'Delete associated host ONLY and keep current device as UNASSIGNED!'
|
15
14
|
} else {
|
16
15
|
var checkbox_label = 'Delete ' + object_type + ' ONLY'
|
17
16
|
}
|
@@ -19,19 +18,6 @@ $(window).click(function(event) {
|
|
19
18
|
if (!(patt.test(pathname))) {
|
20
19
|
pathname = pathname + str
|
21
20
|
}
|
22
|
-
var move = "<p></p>"
|
23
|
-
var checkbox = ""
|
24
|
-
var text = "You will permanently delete the"
|
25
|
-
text_ao = ""
|
26
|
-
if (object_type == "site" || object_type == "rack" || object_type == "rack_group") {
|
27
|
-
move = '<p>You also can move associated object to another <strong>' + object_type + '</strong> before you destroy it.</p> \
|
28
|
-
<a class="btn btn-block btn-primary modal-btn modal-btn-primary marginbottomsixteen" href="/datacenter/' + object_type + 's/' + object_id + '/move">Move associated objects</a>'
|
29
|
-
checkbox = '<input type="checkbox" name="object_only" id="object_only" value="true" checked="checked">'
|
30
|
-
text = "By unselecting checkbox you will permanently delete the"
|
31
|
-
text_ao = 'with \
|
32
|
-
<strong>ALL</strong> \
|
33
|
-
associated objects' + ao
|
34
|
-
}
|
35
21
|
|
36
22
|
var form = '<div id="myModal" class="modal"> \
|
37
23
|
<div class="modal-content"> \
|
@@ -45,19 +31,20 @@ $(window).click(function(event) {
|
|
45
31
|
<div class="modal-body"> \
|
46
32
|
<p>This action \
|
47
33
|
<strong>cannot</strong> \
|
48
|
-
be undone. \
|
49
|
-
' + text + ' \
|
34
|
+
be undone. By unselecting checkbox you will permanently delete the \
|
50
35
|
<strong>' + object_name + '</strong> \
|
51
|
-
|
36
|
+
with \
|
37
|
+
<strong>all</strong> \
|
38
|
+
associated objects' + ao + ' \
|
52
39
|
</p> \
|
53
40
|
<form class="modal-form nonpaddingbottom" action=' + pathname + ' accept-charset="UTF-8" method="post"> \
|
54
41
|
<input type="hidden" name="_method" value="delete"> \
|
55
|
-
<input type="
|
56
|
-
' + checkbox + ' \
|
42
|
+
<input type="checkbox" name="object_only" id="object_only" value="true" checked="checked"> \
|
57
43
|
<label>' + checkbox_label + '</label> \
|
58
44
|
<input type="submit" name="commit" value="I understand the consequences, delete this ' + object_type + '" class="btn btn-block btn-danger modal-btn modal-btn-danger"> \
|
59
45
|
</form> \
|
60
|
-
'+
|
46
|
+
<p>You also can move associated object to another <strong>' + object_type + '</strong> before you destroy it.</p> \
|
47
|
+
<a class="btn btn-block btn-primary modal-btn modal-btn-primary marginbottomsixteen" href="/datacenter/' + object_type + 's/' + object_id + '/move">Move associated objects</a> \
|
61
48
|
</div> \
|
62
49
|
</div> \
|
63
50
|
</div>'
|
@@ -28,35 +28,3 @@ span.mediumgray {
|
|
28
28
|
span.darkgray {
|
29
29
|
background-color: #171515;
|
30
30
|
}
|
31
|
-
|
32
|
-
|
33
|
-
.teal {
|
34
|
-
background-color: #06a79f;
|
35
|
-
}
|
36
|
-
.green {
|
37
|
-
background-color: #89A54E;
|
38
|
-
}
|
39
|
-
.blue {
|
40
|
-
background-color: #3D96AE;
|
41
|
-
}
|
42
|
-
.purple {
|
43
|
-
background-color: #D882d8;
|
44
|
-
}
|
45
|
-
.yellow {
|
46
|
-
background-color: #ecec61;
|
47
|
-
}
|
48
|
-
.orange {
|
49
|
-
background-color: #f37676;
|
50
|
-
}
|
51
|
-
.red {
|
52
|
-
background-color: #AA4643;
|
53
|
-
}
|
54
|
-
.lightgray {
|
55
|
-
background-color: gray;
|
56
|
-
}
|
57
|
-
.mediumgray {
|
58
|
-
background-color: #403e3e;
|
59
|
-
}
|
60
|
-
.darkgray {
|
61
|
-
background-color: #171515;
|
62
|
-
}
|
@@ -6,6 +6,7 @@ module Api
|
|
6
6
|
|
7
7
|
before_action :find_optional_nested_object
|
8
8
|
before_action :find_resource, :only => %w{destroy show}
|
9
|
+
add_scoped_search_description_for(::ForemanDatacenter::ConsolePortTemplate)
|
9
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/console_port_templates/", N_("List all ConsolePortTemplates")
|
@@ -7,6 +7,7 @@ module Api
|
|
7
7
|
before_action :find_resource, :only => %w{show update destroy connect connected planned disconnect}
|
8
8
|
|
9
9
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
|
+
add_scoped_search_description_for(::ForemanDatacenter::ConsolePort)
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/console_ports/", N_("List all ConsolePorts")
|
12
13
|
|
@@ -6,6 +6,7 @@ module Api
|
|
6
6
|
|
7
7
|
before_action :find_optional_nested_object
|
8
8
|
before_action :find_resource, :only => %w{destroy show}
|
9
|
+
add_scoped_search_description_for(::ForemanDatacenter::ConsoleServerPortTemplate)
|
9
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/console_server_port_templates/", N_("List all ConsoleServerPortTemplates")
|
@@ -5,6 +5,7 @@ module Api
|
|
5
5
|
include ::ForemanDatacenter::Controller::Parameters::ConsoleServerPort
|
6
6
|
|
7
7
|
before_action :find_resource, :only => %w{show update destroy connect connected planned disconnect}
|
8
|
+
add_scoped_search_description_for(::ForemanDatacenter::ConsoleServerPortTemplate)
|
8
9
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
9
10
|
|
10
11
|
api :GET, "/foreman_datacenter/console_server_ports/", N_("List all ConsoleServerPorts")
|
@@ -7,6 +7,7 @@ module Api
|
|
7
7
|
before_action :find_optional_nested_object
|
8
8
|
before_action :find_resource, :only => %w{destroy show}
|
9
9
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
|
+
add_scoped_search_description_for(::ForemanDatacenter::ConsolePortTemplate)
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/device_bay_templates/", N_("List all DeviceBayTemplate")
|
12
13
|
|
@@ -2,11 +2,12 @@ module Api
|
|
2
2
|
module V2
|
3
3
|
module ForemanDatacenter
|
4
4
|
class DeviceBaysController < ForemanDatacenter::BaseController
|
5
|
-
|
5
|
+
include ::ForemanDatacenter::Controller::Parameters::DeviceBay
|
6
6
|
|
7
7
|
before_action :find_optional_nested_object
|
8
8
|
before_action :find_resource, :only => %w{show update destroy populate depopulate}
|
9
9
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
|
+
add_scoped_search_description_for(::ForemanDatacenter::ConsolePortTemplate)
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/device_bays/", N_("List all DeviceBays")
|
12
13
|
|
@@ -20,35 +21,35 @@ module Api
|
|
20
21
|
def show
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
def_param_group :device_bay do
|
25
|
+
param :device_bay, Hash, :required => true, :action_aware => true do
|
26
|
+
param :name, String, :required => true
|
27
|
+
param :device_id, :number, :desc => N_("Device ID")
|
28
|
+
end
|
29
|
+
end
|
29
30
|
|
30
|
-
|
31
|
-
|
31
|
+
api :POST, "/foreman_datacenter/device_bays", N_("Create a DeviceBay")
|
32
|
+
param_group :device_bay, :as => :create
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
def create
|
35
|
+
@device_bay = ::ForemanDatacenter::DeviceBay.new(device_bay_params)
|
36
|
+
process_response @device_bay.save
|
37
|
+
end
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
api :PUT, "/foreman_datacenter/device_bays/:id/", N_("Update a DeviceBay")
|
40
|
+
param :id, :identifier, :required => true
|
41
|
+
param_group :device_bay
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
def update
|
44
|
+
process_response @device_bay.update(device_bay_params)
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
-
|
47
|
+
api :DELETE, "/foreman_datacenter/device_bays/:id/", N_("Delete a DeviceBay")
|
48
|
+
param :id, :identifier, :required => true
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
50
|
+
def destroy
|
51
|
+
process_response @device_bay.destroy
|
52
|
+
end
|
52
53
|
|
53
54
|
api :PATCH, "/foreman_datacenter/device_bays/:id/populate", N_("Populate")
|
54
55
|
param :id, :identifier, :required => true
|
@@ -2,7 +2,7 @@ module Api
|
|
2
2
|
module V2
|
3
3
|
module ForemanDatacenter
|
4
4
|
class DeviceInterfaceConnectionsController < ForemanDatacenter::BaseController
|
5
|
-
|
5
|
+
include ::ForemanDatacenter::Controller::Parameters::DeviceInterfaceConnection
|
6
6
|
|
7
7
|
before_action :find_resource, :only => %w{show update destroy connected planned}
|
8
8
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
@@ -19,46 +19,46 @@ module Api
|
|
19
19
|
def show
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
def_param_group :device_interface_connection do
|
23
|
+
param :device_interface_connection, Hash, :required => true, :action_aware => true do
|
24
|
+
param :name, String, :required => true
|
25
|
+
param :interface_a, :number, :desc => N_("Interface A")
|
26
|
+
param :interface_b, :number, :desc => N_("Interface B")
|
27
|
+
param :connection_status, :number, :desc => N_("Connectin status")
|
28
|
+
end
|
29
|
+
end
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
api :POST, "/foreman_datacenter/device_interfaces/:device_interface_id/device_interface_connections", N_("Create a DeviceInterfaceConnection")
|
32
|
+
param_group :device_interface_connection, :as => :create
|
33
33
|
|
34
|
-
|
34
|
+
def create
|
35
35
|
@device_interface_connection = ::ForemanDatacenter::DeviceInterfaceConnection.new(device_interface_connection_params.merge(interface_a: params[:device_interface_id]))
|
36
36
|
@device_interface_connection.first_interface = get_device_interface
|
37
|
-
|
38
|
-
|
37
|
+
@device_interface_connection.save
|
38
|
+
end
|
39
39
|
|
40
|
-
|
41
|
-
|
40
|
+
api :DELETE, "/foreman_datacenter/device_interface_connections/:id/", N_("Delete a DeviceInterfaceConnection")
|
41
|
+
param :id, :identifier, :required => true
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
def destroy
|
44
|
+
process_response @device_interface_connection.destroy
|
45
|
+
end
|
46
46
|
|
47
47
|
api :PATCH, "/foreman_datacenter/device_interface_connections/:id/planned", N_("Planned")
|
48
|
-
|
49
|
-
|
48
|
+
param :id, :identifier, :required => true
|
49
|
+
param_group :device_interface_connection
|
50
50
|
|
51
|
-
|
51
|
+
def planned
|
52
52
|
process_response @device_interface_connection.planned!
|
53
|
-
|
53
|
+
end
|
54
54
|
|
55
55
|
api :PATCH, "/foreman_datacenter/device_interface_connections/:id/connected", N_("Connected")
|
56
|
-
|
57
|
-
|
56
|
+
param :id, :identifier, :required => true
|
57
|
+
param_group :device_interface_connection
|
58
58
|
|
59
|
-
|
59
|
+
def connected
|
60
60
|
process_response @device_interface_connection.connected!
|
61
|
-
|
61
|
+
end
|
62
62
|
|
63
63
|
private
|
64
64
|
|
@@ -7,6 +7,7 @@ module Api
|
|
7
7
|
before_action :find_resource, :only => %w{show update destroy}
|
8
8
|
before_action :find_optional_nested_object
|
9
9
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
|
+
add_scoped_search_description_for(::ForemanDatacenter::DeviceInterface)
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/device_interfaces/", N_("List all DeviceInterfaces")
|
12
13
|
|
@@ -37,7 +38,7 @@ module Api
|
|
37
38
|
|
38
39
|
def create
|
39
40
|
@device_interface = ::ForemanDatacenter::DeviceInterface.new(device_interface_params)
|
40
|
-
|
41
|
+
@device_interface.save
|
41
42
|
end
|
42
43
|
|
43
44
|
api :PUT, "/foreman_datacenter/device_interfaces/:id/", N_("Update a DeviceInterface")
|
@@ -6,6 +6,7 @@ module Api
|
|
6
6
|
|
7
7
|
before_action :find_resource, :only => %w{show update destroy}
|
8
8
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
9
|
+
add_scoped_search_description_for(::ForemanDatacenter::ConsolePort)
|
9
10
|
|
10
11
|
api :GET, "/foreman_datacenter/device_modules/", N_("List all DeviceModules")
|
11
12
|
|
@@ -8,6 +8,7 @@ module Api
|
|
8
8
|
before_action :find_resource, :only => %w{show update destroy}
|
9
9
|
|
10
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
11
|
+
add_scoped_search_description_for(::ForemanDatacenter::DeviceRole)
|
11
12
|
|
12
13
|
api :GET, "/foreman_datacenter/device_roles/", N_("List all device_roles")
|
13
14
|
|
@@ -8,6 +8,7 @@ module Api
|
|
8
8
|
before_action :find_resource, :only => %w{show update destroy}
|
9
9
|
|
10
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
11
|
+
add_scoped_search_description_for(::ForemanDatacenter::DeviceType)
|
11
12
|
|
12
13
|
api :GET, "/foreman_datacenter/device_types/", N_("List all device_types")
|
13
14
|
|
@@ -8,6 +8,7 @@ module Api
|
|
8
8
|
before_action :find_resource, :only => %w{show update destroy destroy_interfaces sync_interfaces_with_host}
|
9
9
|
|
10
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
11
|
+
add_scoped_search_description_for(::ForemanDatacenter::Device)
|
11
12
|
|
12
13
|
api :GET, "/foreman_datacenter/devices/", N_("List all Devices")
|
13
14
|
|
@@ -46,7 +47,7 @@ module Api
|
|
46
47
|
param_group :device, :as => :create
|
47
48
|
|
48
49
|
def create
|
49
|
-
@device = ::ForemanDatacenter::Device.new(device_params.merge(
|
50
|
+
@device = ::ForemanDatacenter::Device.new(device_params.merge(hosy_id: params[:host_id]))
|
50
51
|
process_response @device.save
|
51
52
|
end
|
52
53
|
|
@@ -6,6 +6,7 @@ module Api
|
|
6
6
|
|
7
7
|
before_action :find_optional_nested_object
|
8
8
|
before_action :find_resource, :only => %w{destroy show}
|
9
|
+
add_scoped_search_description_for(::ForemanDatacenter::InterfaceTemplate)
|
9
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/interface_templates/", N_("List all InterfaceTemplates")
|
@@ -34,7 +34,7 @@ module Api
|
|
34
34
|
|
35
35
|
def create
|
36
36
|
@management_device = ::ForemanDatacenter::ManagementDevice.new(management_device_params)#.merge(device_id: params[]))
|
37
|
-
|
37
|
+
@management_device.save
|
38
38
|
end
|
39
39
|
|
40
40
|
api :PUT, "/foreman_datacenter/management_devices/:id/", N_("Update a management_device")
|
@@ -8,6 +8,7 @@ module Api
|
|
8
8
|
before_action :find_resource, :only => %w{show update destroy}
|
9
9
|
|
10
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
11
|
+
add_scoped_search_description_for(::ForemanDatacenter::Manufacturer)
|
11
12
|
|
12
13
|
api :GET, "/foreman_datacenter/manufacturers/", N_("List all manufacturers")
|
13
14
|
|
@@ -8,6 +8,7 @@ module Api
|
|
8
8
|
before_action :find_resource, :only => %w{show update destroy}
|
9
9
|
|
10
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
11
|
+
add_scoped_search_description_for(::ForemanDatacenter::Platform)
|
11
12
|
|
12
13
|
api :GET, "/foreman_datacenter/platforms/", N_("List all platforms")
|
13
14
|
|
@@ -6,6 +6,7 @@ module Api
|
|
6
6
|
|
7
7
|
before_action :find_optional_nested_object
|
8
8
|
before_action :find_resource, :only => %w{destroy show}
|
9
|
+
add_scoped_search_description_for(::ForemanDatacenter::PowerOutletTemplate)
|
9
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/power_outlet_templates/", N_("List all PowerOutletTemplates")
|
@@ -5,6 +5,7 @@ module Api
|
|
5
5
|
include ::ForemanDatacenter::Controller::Parameters::PowerOutlet
|
6
6
|
|
7
7
|
before_action :find_resource, :only => %w{show update destroy connect disconnect}
|
8
|
+
add_scoped_search_description_for(::ForemanDatacenter::PowerOutletTemplate)
|
8
9
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
9
10
|
|
10
11
|
api :GET, "/foreman_datacenter/power_outlets/", N_("List all PowerOutlets")
|
@@ -31,7 +32,7 @@ module Api
|
|
31
32
|
|
32
33
|
def create
|
33
34
|
@power_outlet = ::ForemanDatacenter::PowerOutlet.new(power_outlet_params)
|
34
|
-
|
35
|
+
@power_outlet.save
|
35
36
|
end
|
36
37
|
|
37
38
|
api :PUT, "/foreman_datacenter/power_outlets/:id/", N_("Update a PowerOutlet")
|
@@ -6,6 +6,7 @@ module Api
|
|
6
6
|
|
7
7
|
before_action :find_optional_nested_object
|
8
8
|
before_action :find_resource, :only => %w{destroy show}
|
9
|
+
add_scoped_search_description_for(::ForemanDatacenter::PowerPortTemplate)
|
9
10
|
param_group :search_and_pagination, ::Api::V2::BaseController
|
10
11
|
|
11
12
|
api :GET, "/foreman_datacenter/power_port_templates/", N_("List all PowerPortTemplates")
|