foreman_rh_cloud 8.0.47 → 8.0.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +23 -0
- data/app/controllers/foreman_inventory_upload/missing_hosts_controller.rb +22 -0
- data/app/models/insights_missing_host.rb +2 -0
- data/config/package-lock.json.plugin +3701 -16609
- data/config/routes.rb +3 -0
- data/db/migrate/20230515140211_add_missing_hosts_table.foreman_rh_cloud.rb +1 -1
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +1 -1
- data/lib/foreman_rh_cloud/engine.rb +3 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +2 -6
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +25 -9
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +28 -5
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +1 -1
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5aaa9176ddc41ce5b0d3877b0f84d4da1e7646095d9552c0b4e2c268d6cff2b
|
4
|
+
data.tar.gz: 323a006184c5e0f989ef81ac8a010a2e493eb8cd69dc35b93ecb30a2e807dcec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4758b21705294f7bc5628878fbcf101e081f7a662426fb50501ad9909b09d7c33959ec316e3b790f248587a0ba85933782c5822c70fe9ec434ab57f070b0b0ca
|
7
|
+
data.tar.gz: e67bebbc9e8d478fa32778037d1fd4172b8633ff0c845bda2fa554c9e51cc74f94eca21ded5b9c7826a0622aa2842908e5abf70f1ffe2472fdecb6c6cf2f7d11
|
@@ -28,6 +28,29 @@ module Api
|
|
28
28
|
}, status: :ok
|
29
29
|
end
|
30
30
|
|
31
|
+
api :GET, "/organizations/:organization_id/rh_cloud/missing_hosts", N_("Grab hosts that are missing in RH Cloud")
|
32
|
+
param :organization_id, Integer, required: true, desc: N_("Set the current organization context for the request")
|
33
|
+
def get_hosts
|
34
|
+
organization_id = params[:organization_id]
|
35
|
+
payload = InsightsMissingHosts.where(organization_id: organization_id)
|
36
|
+
|
37
|
+
render :json => payload
|
38
|
+
end
|
39
|
+
|
40
|
+
api :POST, "/organizations/:organization_id/rh_cloud/missing_hosts", N_("Grab hosts that are missing in RH Cloud")
|
41
|
+
param :organization_id, Integer, required: true, desc: N_("Set the current organization context for the request")
|
42
|
+
param :search_term, String, required: true, desc: N_("Scoped search string for host removal")
|
43
|
+
def remove_hosts
|
44
|
+
organization_id = params[:organization_id]
|
45
|
+
search_term = params[:search_term]
|
46
|
+
|
47
|
+
task = ForemanTasks.async_task(ForemanInventoryUpload::Async::RemoveInsightsHostsJob, search_term, organization_id)
|
48
|
+
|
49
|
+
render json: {
|
50
|
+
task: task,
|
51
|
+
}, status: :ok
|
52
|
+
end
|
53
|
+
|
31
54
|
api :POST, "/organizations/:organization_id/rh_cloud/inventory_sync", N_("Start inventory synchronization")
|
32
55
|
param :organization_id, Integer, required: true, desc: N_("Set the current organization context for the request")
|
33
56
|
def sync_inventory_status
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module ForemanInventoryUpload
|
2
|
+
class MissingHostsController < ::ApplicationController
|
3
|
+
def index
|
4
|
+
organizations = Organization.current || User.current.my_organizations
|
5
|
+
organization_id = organizations.pluck(:id)
|
6
|
+
payload = InsightsMissingHosts.where(organization_id: organization_id)
|
7
|
+
|
8
|
+
render :json => payload
|
9
|
+
end
|
10
|
+
|
11
|
+
def remove_hosts
|
12
|
+
organization_id = params[:organization_id]
|
13
|
+
search_term = params[:search_term]
|
14
|
+
|
15
|
+
task = ForemanTasks.async_task(ForemanInventoryUpload::Async::RemoveInsightsHostsJob, search_term, organization_id)
|
16
|
+
|
17
|
+
render json: {
|
18
|
+
task: task,
|
19
|
+
}, status: :ok
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|