foreman_acd 0.4.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +84 -84
- data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +103 -11
- data/app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb +21 -3
- data/app/controllers/foreman_acd/api/v2/app_definitions_controller.rb +1 -0
- data/app/controllers/foreman_acd/api/v2/app_instances_controller.rb +9 -1
- data/app/controllers/foreman_acd/app_definitions_controller.rb +117 -15
- data/app/controllers/foreman_acd/app_instances_controller.rb +104 -30
- data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +1 -1
- data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +1 -1
- data/app/controllers/foreman_acd/concerns/app_instance_mixins.rb +36 -0
- data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +1 -1
- data/app/controllers/foreman_acd/remote_execution_controller.rb +36 -23
- data/app/controllers/ui_acd_controller.rb +46 -0
- data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +47 -0
- data/app/lib/actions/foreman_acd/run_configurator.rb +45 -0
- data/app/models/concerns/foreman_acd/host_managed_extensions.rb +39 -0
- data/app/models/foreman_acd/acd_provider.rb +36 -0
- data/app/models/foreman_acd/ansible_playbook.rb +32 -14
- data/app/models/foreman_acd/app_definition.rb +24 -1
- data/app/models/foreman_acd/app_instance.rb +85 -5
- data/app/models/foreman_acd/foreman_host.rb +31 -0
- data/app/models/foreman_acd/taxonomy_extensions.rb +17 -0
- data/app/services/foreman_acd/acd_proxy_proxy_selector.rb +17 -0
- data/app/services/foreman_acd/app_configurator.rb +64 -36
- data/app/services/foreman_acd/app_deployer.rb +83 -48
- data/app/services/foreman_acd/inventory_creator.rb +36 -25
- data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +50 -7
- data/app/views/foreman_acd/ansible_playbooks/edit.html.erb +9 -1
- data/app/views/foreman_acd/ansible_playbooks/index.html.erb +3 -3
- data/app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl +6 -0
- data/app/views/foreman_acd/api/v2/app_definitions/base.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/app_definitions/index.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/app_definitions/show.json.rabl +6 -0
- data/app/views/foreman_acd/api/v2/app_instances/base.json.rabl +3 -1
- data/app/views/foreman_acd/api/v2/app_instances/index.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/app_instances/show.json.rabl +2 -0
- data/app/views/foreman_acd/app_definitions/_form.html.erb +9 -1
- data/app/views/foreman_acd/app_definitions/edit.html.erb +10 -5
- data/app/views/foreman_acd/app_definitions/import.html.erb +20 -1
- data/app/views/foreman_acd/app_definitions/index.html.erb +5 -8
- data/app/views/foreman_acd/app_instances/_form.html.erb +4 -4
- data/app/views/foreman_acd/app_instances/edit.html.erb +10 -0
- data/app/views/foreman_acd/app_instances/index.html.erb +93 -14
- data/app/views/foreman_acd/app_instances/report.html.erb +12 -4
- data/app/views/templates/job/run_acd_ansible_playbook.erb +28 -15
- data/app/views/ui_acd/app_definition.json.rabl +1 -1
- data/app/views/ui_acd/host_report.json.rabl +4 -0
- data/app/views/ui_acd/report_data.json.rabl +10 -0
- data/app/views/ui_acd/validate_hostname.json.rabl +6 -0
- data/config/routes.rb +12 -3
- data/db/migrate/20200917120220_add_ansible_playbook_id.rb +1 -1
- data/db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb +3 -0
- data/db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb +3 -0
- data/db/migrate/20210112111548_add_organization_to_app_instance.rb +22 -0
- data/db/migrate/20210112113853_add_location_to_app_instance.rb +8 -0
- data/db/migrate/20210202141658_create_foreman_hosts.rb +24 -0
- data/db/migrate/20210204111306_remove_hosts_from_app_instances.rb +8 -0
- data/db/migrate/20210209091014_rename_acd_tables.rb +16 -0
- data/db/migrate/20210216083522_add_last_progress_report.rb +8 -0
- data/db/migrate/20210216091529_add_last_deploy_task.rb +8 -0
- data/db/migrate/20210316151145_add_git_commit_to_ansible_playbooks.rb +8 -0
- data/db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb +8 -0
- data/db/migrate/20210818125913_add_is_existing_host_to_foreman_host.rb +8 -0
- data/db/migrate/20210902110645_add_initial_configure_task.rb +8 -0
- data/db/seeds.d/62_acd_proxy_feature.rb +4 -0
- data/db/seeds.d/75-job_templates.rb +6 -1
- data/lib/foreman_acd/engine.rb +40 -3
- data/lib/foreman_acd/plugin.rb +60 -45
- data/lib/foreman_acd/version.rb +1 -1
- data/lib/foreman_acd.rb +30 -0
- data/lib/tasks/foreman_acd_tasks.rake +0 -12
- data/locale/en/foreman_acd.edit.po +326 -0
- data/locale/en/foreman_acd.po +232 -2
- data/{app/controllers/foreman_acd/api/v2/app_playbooks_controller.rb → locale/en/foreman_acd.po.time_stamp} +0 -0
- data/locale/foreman_acd.pot +343 -8
- data/package.json +8 -8
- data/test/controllers/ansible_playbooks_controller_test.rb +27 -0
- data/test/controllers/app_instances_controller_test.rb +8 -3
- data/test/controllers/ui_acd_controller_test.rb +22 -6
- data/test/factories/foreman_acd_factories.rb +18 -4
- data/test/models/acd_provider_test.rb +37 -0
- data/test/models/ansible_playbook_test.rb +11 -0
- data/test/models/app_definition_test.rb +1 -1
- data/test/models/app_instance_test.rb +2 -0
- data/test/models/concerns/host_extensions_test.rb +26 -0
- data/test/models/foreman_host_test.rb +12 -0
- data/webpack/__mocks__/foremanReact/API.js +2 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +3 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
- data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +2 -0
- data/webpack/__mocks__/foremanReact/components/ForemanModal.js +7 -0
- data/webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js +2 -0
- data/webpack/__mocks__/foremanReact/components/common/forms/TextInput.js +2 -0
- data/webpack/__mocks__/foremanReact/components/hosts/powerStatus.js +1 -0
- data/webpack/__snapshots__/helper.test.js.snap +14 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +55 -21
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +14 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +2 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +48 -1
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +4 -0
- data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionConfData_1.fixtures.js +288 -0
- data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +79 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +26 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +119 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +41 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +225 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +3033 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +299 -0
- data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +2 -1
- data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +41 -0
- data/webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap +121 -0
- data/webpack/components/ApplicationDefinition/index.js +8 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +214 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.scss +1 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +161 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +6 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +79 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +8 -0
- data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportConfData_1.fixtures.js +129 -0
- data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +29 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +20 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +43 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +29 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +62 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportReducer.test.js.snap +362 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +130 -0
- data/webpack/components/ApplicationDefinitionImport/index.js +32 -0
- data/webpack/components/ApplicationInstance/ApplicationInstance.js +153 -45
- data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +120 -6
- data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +5 -0
- data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +15 -0
- data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +77 -22
- data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +4 -0
- data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceConfData_1.fixtures.js +263 -0
- data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +80 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +24 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +131 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +44 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +299 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +2990 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +276 -0
- data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +1 -0
- data/webpack/components/ApplicationInstance/components/Service.js +1 -1
- data/webpack/components/ApplicationInstance/components/ServiceCounter.js +1 -1
- data/webpack/components/ApplicationInstance/helper.js +0 -0
- data/webpack/components/ApplicationInstance/index.js +8 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +128 -60
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.scss +17 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +40 -50
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +5 -4
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +19 -14
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +4 -1
- data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportData_1.fixtures.js +349 -0
- data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +20 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +47 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportReducer.test.js +41 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +26 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReport.test.js.snap +7 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +718 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +347 -0
- data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +1 -1
- data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +24 -0
- data/webpack/components/ApplicationInstanceReport/components/__tests__/__snapshots__/ReportViewer.test.js.snap +24 -0
- data/webpack/components/ApplicationInstanceReport/index.js +8 -3
- data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +104 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelection.scss +15 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +71 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +4 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionHelper.js +0 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +90 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -0
- data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +191 -0
- data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +203 -0
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +19 -0
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionReducer.test.js +59 -0
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +36 -0
- data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelection.test.js.snap +35 -0
- data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionReducer.test.js.snap +614 -0
- data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +27 -0
- data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +48 -0
- data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +35 -0
- data/webpack/components/ExistingHostSelection/components/__tests__/__snapshots__/ServiceSelector.test.js.snap +77 -0
- data/webpack/components/ExistingHostSelection/index.js +26 -0
- data/webpack/components/ParameterSelection/ParameterSelection.js +138 -15
- data/webpack/components/ParameterSelection/ParameterSelection.scss +7 -0
- data/webpack/components/ParameterSelection/ParameterSelectionActions.js +52 -9
- data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +3 -0
- data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +62 -25
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +1 -0
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +116 -84
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +10 -4
- data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +36 -46
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +33 -25
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +6 -6
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +84 -112
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +1488 -872
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +117 -79
- data/webpack/components/ParameterSelection/index.js +2 -1
- data/webpack/components/SyncGitRepo/SyncGitRepo.js +202 -0
- data/webpack/components/SyncGitRepo/SyncGitRepo.scss +1 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +123 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +8 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +80 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoSelectors.js +6 -0
- data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +7 -0
- data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +44 -0
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +27 -0
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoReducer.test.js +95 -0
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +32 -0
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +31 -0
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoReducer.test.js.snap +137 -0
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +13 -0
- data/webpack/components/SyncGitRepo/components/FormTextInput.js +42 -0
- data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +47 -0
- data/webpack/components/SyncGitRepo/index.js +28 -0
- data/webpack/components/common/DeleteTableEntry.js +18 -4
- data/webpack/components/common/EditTableEntry.js +50 -0
- data/webpack/components/common/ExtTextInput.js +43 -0
- data/webpack/components/common/LockTableEntry.js +60 -0
- data/webpack/components/common/__tests__/EditTableEntry.test.js +53 -0
- data/webpack/components/common/__tests__/LockTableEntry.test.js +35 -0
- data/webpack/components/common/__tests__/__snapshots__/DeleteTableEntry.test.js.snap +40 -2
- data/webpack/components/common/__tests__/__snapshots__/EditTableEntry.test.js.snap +81 -0
- data/webpack/components/common/__tests__/__snapshots__/LockTableEntry.test.js.snap +60 -0
- data/webpack/helper.js +20 -1
- data/webpack/helper.test.js +37 -0
- data/webpack/index.js +7 -0
- data/webpack/js-yaml.js +3874 -0
- data/webpack/reducer.js +16 -1
- metadata +182 -11
- data/app/views/foreman_acd/app_instances/deploy.html.erb +0 -19
- data/webpack/components/common/EasyHeaderFormatter.js +0 -18
- data/webpack/components/common/__tests__/__snapshots__/AddParameter.test.js.snap +0 -35
- data/webpack/components/common/__tests__/__snapshots__/DeleteParameter.test.js.snap +0 -41
@@ -11,76 +11,66 @@ import {
|
|
11
11
|
} from 'foremanReact/common/helpers';
|
12
12
|
|
13
13
|
import {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
APPLICATION_INSTANCE_REPORT_INIT,
|
15
|
+
APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST,
|
16
|
+
APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST,
|
17
|
+
APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS,
|
18
|
+
APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE,
|
18
19
|
} from './ApplicationInstanceReportConstants';
|
19
20
|
|
20
21
|
export const initApplicationInstanceReport = (
|
21
|
-
hosts,
|
22
|
+
hosts, deploymentState, initialConfigureState, initialConfigureJobUrl,
|
22
23
|
) => dispatch => {
|
23
24
|
const initialState = {};
|
24
25
|
|
25
26
|
initialState.hosts = hosts;
|
27
|
+
initialState.deploymentState = deploymentState;
|
28
|
+
initialState.initialConfigureState = initialConfigureState;
|
29
|
+
initialState.initialConfigureJobUrl = initialConfigureJobUrl;
|
30
|
+
|
31
|
+
// Decide if it should show only the initial Configure job state + URL or
|
32
|
+
// the URL to all configuration jobs
|
33
|
+
if (initialConfigureState == 'unconfigured') {
|
34
|
+
initialState.showInitialConfigureJob = true;
|
35
|
+
} else {
|
36
|
+
initialState.showInitialConfigureJob = false;
|
37
|
+
}
|
26
38
|
|
27
39
|
dispatch({
|
28
|
-
type:
|
40
|
+
type: APPLICATION_INSTANCE_REPORT_INIT,
|
29
41
|
payload: initialState,
|
30
42
|
});
|
31
43
|
};
|
32
44
|
|
33
|
-
const
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
};
|
38
|
-
return { type: msg, payload: { error } };
|
39
|
-
};
|
40
|
-
|
41
|
-
export const loadReport = (dispatch, getState, id, url, live, initial) => {
|
42
|
-
|
43
|
-
const reportState = getState().foremanAcd.applicationInstanceReport;
|
45
|
+
export const loadReportData = (
|
46
|
+
reportDataUrl,
|
47
|
+
appInstanceId,
|
48
|
+
) => dispatch => {
|
49
|
+
dispatch({ type: APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST });
|
44
50
|
|
45
|
-
|
46
|
-
|
47
|
-
setTimeout(() => {
|
48
|
-
loadReport(dispatch, getState, id, url, live, false);
|
49
|
-
}, 1600)
|
50
|
-
}
|
51
|
-
}
|
51
|
+
const baseUrl = reportDataUrl;
|
52
|
+
const realUrl = baseUrl.replace("__id__", appInstanceId);
|
52
53
|
|
53
54
|
return api
|
54
|
-
.get(
|
55
|
+
.get(realUrl, {}, {})
|
55
56
|
.then(({ data }) =>
|
56
57
|
dispatch({
|
57
|
-
type:
|
58
|
-
payload: data
|
58
|
+
type: APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS,
|
59
|
+
payload: { ...data }
|
59
60
|
})
|
60
61
|
)
|
61
|
-
.catch(error => dispatch(errorHandler(
|
62
|
+
.catch(error => dispatch(errorHandler(APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE, error)));
|
62
63
|
};
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
type: APPLICATION_INSTANCE_DEPLOY_LOAD_REPORT_REQUEST
|
71
|
-
});
|
72
|
-
|
73
|
-
return loadReport(dispatch, getState, id, url, true, true);
|
74
|
-
}
|
75
|
-
|
76
|
-
export const setActiveAndLoadLastReport = (
|
77
|
-
id,
|
78
|
-
url,
|
79
|
-
) => (dispatch, getState) => {
|
80
|
-
dispatch({
|
81
|
-
payload: { activeHostId: id },
|
82
|
-
type: APPLICATION_INSTANCE_DEPLOY_LOAD_REPORT_REQUEST
|
83
|
-
});
|
84
|
-
|
85
|
-
return loadReport(dispatch, getState, id, url, false, true);
|
65
|
+
const errorHandler = (msg, err) => {
|
66
|
+
const error = {
|
67
|
+
errorMsg: 'Failed to fetch data from server.',
|
68
|
+
statusText: err,
|
69
|
+
};
|
70
|
+
return { type: msg, payload: { error } };
|
86
71
|
};
|
72
|
+
|
73
|
+
export const setActiveHost = (id) => ({
|
74
|
+
type: APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST,
|
75
|
+
payload: { activeHostId: id },
|
76
|
+
});
|
@@ -1,4 +1,5 @@
|
|
1
|
-
export const
|
2
|
-
export const
|
3
|
-
export const
|
4
|
-
export const
|
1
|
+
export const APPLICATION_INSTANCE_REPORT_INIT = 'APPLICATION_INSTANCE_REPORT_INIT';
|
2
|
+
export const APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST = 'APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST';
|
3
|
+
export const APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST = 'APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST';
|
4
|
+
export const APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS = 'APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS';
|
5
|
+
export const APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE = 'APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE';
|
@@ -7,10 +7,11 @@ import {
|
|
7
7
|
} from 'lodash';
|
8
8
|
|
9
9
|
import {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
APPLICATION_INSTANCE_REPORT_INIT,
|
11
|
+
APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST,
|
12
|
+
APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST,
|
13
|
+
APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS,
|
14
|
+
APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE,
|
14
15
|
} from './ApplicationInstanceReportConstants';
|
15
16
|
|
16
17
|
export const initialState = Immutable({
|
@@ -22,27 +23,31 @@ const applicationInstanceReport = (state = initialState, action) => {
|
|
22
23
|
const { payload } = action;
|
23
24
|
|
24
25
|
switch (action.type) {
|
25
|
-
case
|
26
|
+
case APPLICATION_INSTANCE_REPORT_INIT: {
|
26
27
|
return state.merge(payload);
|
27
28
|
}
|
28
|
-
case
|
29
|
+
case APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST: {
|
29
30
|
return state.merge({
|
30
31
|
loading: true,
|
31
32
|
activeHostId: payload.activeHostId,
|
32
33
|
})
|
33
34
|
}
|
34
|
-
case
|
35
|
-
|
36
|
-
|
37
|
-
loading: false,
|
38
|
-
});
|
35
|
+
case APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST: {
|
36
|
+
// Nothing to do
|
37
|
+
return state;
|
39
38
|
}
|
40
|
-
case
|
39
|
+
case APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS: {
|
41
40
|
return state.merge({
|
42
|
-
|
43
|
-
|
41
|
+
deploymentState: payload.deploymentState,
|
42
|
+
initialConfigureState: payload.initialConfigureState,
|
43
|
+
initialConfigureJobUrl: payload.initialConfigureJobUrl,
|
44
|
+
hosts: payload.hosts,
|
44
45
|
});
|
45
46
|
}
|
47
|
+
case APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE: {
|
48
|
+
console.log("Error while loading report data: "+ payload.error);
|
49
|
+
return state.merge({ error: payload.error});
|
50
|
+
}
|
46
51
|
default: {
|
47
52
|
return state;
|
48
53
|
}
|
@@ -1,5 +1,8 @@
|
|
1
1
|
const applicationInstanceReport = state => state.foremanAcd.applicationInstanceReport;
|
2
2
|
|
3
3
|
export const selectHosts = state => applicationInstanceReport(state).hosts;
|
4
|
-
export const selectReport = state => applicationInstanceReport(state).report;
|
5
4
|
export const selectActiveHostId = state => applicationInstanceReport(state).activeHostId;
|
5
|
+
export const selectDeploymentState = state => applicationInstanceReport(state).deploymentState;
|
6
|
+
export const selectInitialConfigureState = state => applicationInstanceReport(state).initialConfigureState;
|
7
|
+
export const selectInitialConfigureJobUrl = state => applicationInstanceReport(state).initialConfigureJobUrl;
|
8
|
+
export const selectShowInitialConfigureJob = state => applicationInstanceReport(state).showInitialConfigureJob;
|
@@ -0,0 +1,349 @@
|
|
1
|
+
export const applicationInstanceReportData_1 = {
|
2
|
+
name: false,
|
3
|
+
error: {
|
4
|
+
errorMsg: '',
|
5
|
+
status: '',
|
6
|
+
statusText: ''
|
7
|
+
},
|
8
|
+
hosts: [
|
9
|
+
{
|
10
|
+
id: 8,
|
11
|
+
name: 'great-web-app-db-1',
|
12
|
+
build: false,
|
13
|
+
hostUrl: '/hosts/great-web-app-db-1.deploy3.dev.atix',
|
14
|
+
progress_report: [
|
15
|
+
{
|
16
|
+
id: 'Set up compute instance great-web-app-db-1.deploy3.dev.atix',
|
17
|
+
name: 'Set up compute instance great-web-app-db-1.deploy3.dev.atix',
|
18
|
+
timestamp: '2021-03-12T09:52:10.190Z',
|
19
|
+
status: 'completed',
|
20
|
+
priority: 3,
|
21
|
+
created: 1615542728.8466988
|
22
|
+
},
|
23
|
+
{
|
24
|
+
id: 'Query instance details for great-web-app-db-1.deploy3.dev.atix',
|
25
|
+
name: 'Query instance details for great-web-app-db-1.deploy3.dev.atix',
|
26
|
+
timestamp: '2021-03-12T09:52:10.385Z',
|
27
|
+
status: 'completed',
|
28
|
+
priority: 5,
|
29
|
+
created: 1615542728.8474095
|
30
|
+
},
|
31
|
+
{
|
32
|
+
id: 'dhcp_create_192.168.171.103',
|
33
|
+
name: 'Create DHCP Settings for great-web-app-db-1.deploy3.dev.atix',
|
34
|
+
timestamp: '2021-03-12T09:52:10.584Z',
|
35
|
+
status: 'completed',
|
36
|
+
priority: 10,
|
37
|
+
created: 1615542728.0081317
|
38
|
+
},
|
39
|
+
{
|
40
|
+
id: 'Create IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix',
|
41
|
+
name: 'Create IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix',
|
42
|
+
timestamp: '2021-03-12T09:52:10.679Z',
|
43
|
+
status: 'completed',
|
44
|
+
priority: 10,
|
45
|
+
created: 1615542728.04177
|
46
|
+
},
|
47
|
+
{
|
48
|
+
id: 'Create Reverse IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix',
|
49
|
+
name: 'Create Reverse IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix',
|
50
|
+
timestamp: '2021-03-12T09:52:10.798Z',
|
51
|
+
status: 'completed',
|
52
|
+
priority: 10,
|
53
|
+
created: 1615542728.0424814
|
54
|
+
},
|
55
|
+
{
|
56
|
+
id: 'Deploy TFTP PXELinux config for great-web-app-db-1.deploy3.dev.atix',
|
57
|
+
name: 'Deploy TFTP PXELinux config for great-web-app-db-1.deploy3.dev.atix',
|
58
|
+
timestamp: '2021-03-12T09:52:11.178Z',
|
59
|
+
status: 'completed',
|
60
|
+
priority: 20,
|
61
|
+
created: 1615542728.0881674
|
62
|
+
},
|
63
|
+
{
|
64
|
+
id: 'Deploy TFTP PXEGrub2 config for great-web-app-db-1.deploy3.dev.atix',
|
65
|
+
name: 'Deploy TFTP PXEGrub2 config for great-web-app-db-1.deploy3.dev.atix',
|
66
|
+
timestamp: '2021-03-12T09:52:11.615Z',
|
67
|
+
status: 'completed',
|
68
|
+
priority: 20,
|
69
|
+
created: 1615542728.0883749
|
70
|
+
},
|
71
|
+
{
|
72
|
+
id: 'Deploy TFTP PXEGrub config for great-web-app-db-1.deploy3.dev.atix',
|
73
|
+
name: 'Deploy TFTP PXEGrub config for great-web-app-db-1.deploy3.dev.atix',
|
74
|
+
timestamp: '2021-03-12T09:52:11.642Z',
|
75
|
+
status: 'completed',
|
76
|
+
priority: 20,
|
77
|
+
created: 1615542728.088634
|
78
|
+
},
|
79
|
+
{
|
80
|
+
id: 'Deploy TFTP iPXE config for great-web-app-db-1.deploy3.dev.atix',
|
81
|
+
name: 'Deploy TFTP iPXE config for great-web-app-db-1.deploy3.dev.atix',
|
82
|
+
timestamp: '2021-03-12T09:52:11.874Z',
|
83
|
+
status: 'completed',
|
84
|
+
priority: 20,
|
85
|
+
created: 1615542728.0888274
|
86
|
+
},
|
87
|
+
{
|
88
|
+
id: 'Fetch TFTP boot files for great-web-app-db-1.deploy3.dev.atix',
|
89
|
+
name: 'Fetch TFTP boot files for great-web-app-db-1.deploy3.dev.atix',
|
90
|
+
timestamp: '2021-03-12T09:52:11.981Z',
|
91
|
+
status: 'completed',
|
92
|
+
priority: 25,
|
93
|
+
created: 1615542728.0894718
|
94
|
+
},
|
95
|
+
{
|
96
|
+
id: 'Power up compute instance great-web-app-db-1.deploy3.dev.atix',
|
97
|
+
name: 'Power up compute instance great-web-app-db-1.deploy3.dev.atix',
|
98
|
+
timestamp: '2021-03-12T09:52:12.950Z',
|
99
|
+
status: 'completed',
|
100
|
+
priority: 1000,
|
101
|
+
created: 1615542728.8482428
|
102
|
+
},
|
103
|
+
{
|
104
|
+
id: 'Cleanup PuppetCA certificates for great-web-app-db-1.deploy3.dev.atix',
|
105
|
+
name: 'Cleanup PuppetCA certificates for great-web-app-db-1.deploy3.dev.atix',
|
106
|
+
timestamp: '2021-03-12T09:52:13.390Z',
|
107
|
+
status: 'completed',
|
108
|
+
priority: 51,
|
109
|
+
created: 1615542728.8508224
|
110
|
+
},
|
111
|
+
{
|
112
|
+
id: 'Enable PuppetCA autosigning for great-web-app-db-1.deploy3.dev.atix',
|
113
|
+
name: 'Enable PuppetCA autosigning for great-web-app-db-1.deploy3.dev.atix',
|
114
|
+
timestamp: '2021-03-12T09:52:13.442Z',
|
115
|
+
status: 'completed',
|
116
|
+
priority: 55,
|
117
|
+
created: 1615542728.8514216
|
118
|
+
}
|
119
|
+
],
|
120
|
+
powerStatusUrl: '/api/v2/hosts/great-web-app-db-1.deploy3.dev.atix/power'
|
121
|
+
},
|
122
|
+
{
|
123
|
+
id: 9,
|
124
|
+
name: 'great-web-app-web-1',
|
125
|
+
build: false,
|
126
|
+
hostUrl: '/hosts/great-web-app-web-1.deploy3.dev.atix',
|
127
|
+
progress_report: [
|
128
|
+
{
|
129
|
+
id: 'Set up compute instance great-web-app-web-1.deploy3.dev.atix',
|
130
|
+
name: 'Set up compute instance great-web-app-web-1.deploy3.dev.atix',
|
131
|
+
timestamp: '2021-03-12T09:52:14.825Z',
|
132
|
+
status: 'completed',
|
133
|
+
priority: 3,
|
134
|
+
created: 1615542733.824889
|
135
|
+
},
|
136
|
+
{
|
137
|
+
id: 'Query instance details for great-web-app-web-1.deploy3.dev.atix',
|
138
|
+
name: 'Query instance details for great-web-app-web-1.deploy3.dev.atix',
|
139
|
+
timestamp: '2021-03-12T09:52:15.007Z',
|
140
|
+
status: 'completed',
|
141
|
+
priority: 5,
|
142
|
+
created: 1615542733.825672
|
143
|
+
},
|
144
|
+
{
|
145
|
+
id: 'dhcp_create_192.168.171.104',
|
146
|
+
name: 'Create DHCP Settings for great-web-app-web-1.deploy3.dev.atix',
|
147
|
+
timestamp: '2021-03-12T09:52:15.181Z',
|
148
|
+
status: 'completed',
|
149
|
+
priority: 10,
|
150
|
+
created: 1615542733.5710943
|
151
|
+
},
|
152
|
+
{
|
153
|
+
id: 'Create IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix',
|
154
|
+
name: 'Create IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix',
|
155
|
+
timestamp: '2021-03-12T09:52:15.251Z',
|
156
|
+
status: 'completed',
|
157
|
+
priority: 10,
|
158
|
+
created: 1615542733.599793
|
159
|
+
},
|
160
|
+
{
|
161
|
+
id: 'Create Reverse IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix',
|
162
|
+
name: 'Create Reverse IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix',
|
163
|
+
timestamp: '2021-03-12T09:52:15.328Z',
|
164
|
+
status: 'completed',
|
165
|
+
priority: 10,
|
166
|
+
created: 1615542733.600369
|
167
|
+
},
|
168
|
+
{
|
169
|
+
id: 'Deploy TFTP PXELinux config for great-web-app-web-1.deploy3.dev.atix',
|
170
|
+
name: 'Deploy TFTP PXELinux config for great-web-app-web-1.deploy3.dev.atix',
|
171
|
+
timestamp: '2021-03-12T09:52:15.681Z',
|
172
|
+
status: 'completed',
|
173
|
+
priority: 20,
|
174
|
+
created: 1615542733.6356068
|
175
|
+
},
|
176
|
+
{
|
177
|
+
id: 'Deploy TFTP PXEGrub2 config for great-web-app-web-1.deploy3.dev.atix',
|
178
|
+
name: 'Deploy TFTP PXEGrub2 config for great-web-app-web-1.deploy3.dev.atix',
|
179
|
+
timestamp: '2021-03-12T09:52:16.152Z',
|
180
|
+
status: 'completed',
|
181
|
+
priority: 20,
|
182
|
+
created: 1615542733.635817
|
183
|
+
},
|
184
|
+
{
|
185
|
+
id: 'Deploy TFTP PXEGrub config for great-web-app-web-1.deploy3.dev.atix',
|
186
|
+
name: 'Deploy TFTP PXEGrub config for great-web-app-web-1.deploy3.dev.atix',
|
187
|
+
timestamp: '2021-03-12T09:52:16.183Z',
|
188
|
+
status: 'completed',
|
189
|
+
priority: 20,
|
190
|
+
created: 1615542733.6360064
|
191
|
+
},
|
192
|
+
{
|
193
|
+
id: 'Deploy TFTP iPXE config for great-web-app-web-1.deploy3.dev.atix',
|
194
|
+
name: 'Deploy TFTP iPXE config for great-web-app-web-1.deploy3.dev.atix',
|
195
|
+
timestamp: '2021-03-12T09:52:16.417Z',
|
196
|
+
status: 'completed',
|
197
|
+
priority: 20,
|
198
|
+
created: 1615542733.6362345
|
199
|
+
},
|
200
|
+
{
|
201
|
+
id: 'Fetch TFTP boot files for great-web-app-web-1.deploy3.dev.atix',
|
202
|
+
name: 'Fetch TFTP boot files for great-web-app-web-1.deploy3.dev.atix',
|
203
|
+
timestamp: '2021-03-12T09:52:16.523Z',
|
204
|
+
status: 'completed',
|
205
|
+
priority: 25,
|
206
|
+
created: 1615542733.6365006
|
207
|
+
},
|
208
|
+
{
|
209
|
+
id: 'Power up compute instance great-web-app-web-1.deploy3.dev.atix',
|
210
|
+
name: 'Power up compute instance great-web-app-web-1.deploy3.dev.atix',
|
211
|
+
timestamp: '2021-03-12T09:52:17.533Z',
|
212
|
+
status: 'completed',
|
213
|
+
priority: 1000,
|
214
|
+
created: 1615542733.8267431
|
215
|
+
},
|
216
|
+
{
|
217
|
+
id: 'Cleanup PuppetCA certificates for great-web-app-web-1.deploy3.dev.atix',
|
218
|
+
name: 'Cleanup PuppetCA certificates for great-web-app-web-1.deploy3.dev.atix',
|
219
|
+
timestamp: '2021-03-12T09:52:17.944Z',
|
220
|
+
status: 'completed',
|
221
|
+
priority: 51,
|
222
|
+
created: 1615542733.8292165
|
223
|
+
},
|
224
|
+
{
|
225
|
+
id: 'Enable PuppetCA autosigning for great-web-app-web-1.deploy3.dev.atix',
|
226
|
+
name: 'Enable PuppetCA autosigning for great-web-app-web-1.deploy3.dev.atix',
|
227
|
+
timestamp: '2021-03-12T09:52:17.995Z',
|
228
|
+
status: 'completed',
|
229
|
+
priority: 55,
|
230
|
+
created: 1615542733.8294067
|
231
|
+
}
|
232
|
+
],
|
233
|
+
powerStatusUrl: '/api/v2/hosts/great-web-app-web-1.deploy3.dev.atix/power'
|
234
|
+
},
|
235
|
+
{
|
236
|
+
id: 10,
|
237
|
+
name: 'great-web-app-web-2',
|
238
|
+
build: false,
|
239
|
+
hostUrl: '/hosts/great-web-app-web-2.deploy3.dev.atix',
|
240
|
+
progress_report: [
|
241
|
+
{
|
242
|
+
id: 'Set up compute instance great-web-app-web-2.deploy3.dev.atix',
|
243
|
+
name: 'Set up compute instance great-web-app-web-2.deploy3.dev.atix',
|
244
|
+
timestamp: '2021-03-12T09:52:19.221Z',
|
245
|
+
status: 'completed',
|
246
|
+
priority: 3,
|
247
|
+
created: 1615542738.3446305
|
248
|
+
},
|
249
|
+
{
|
250
|
+
id: 'Query instance details for great-web-app-web-2.deploy3.dev.atix',
|
251
|
+
name: 'Query instance details for great-web-app-web-2.deploy3.dev.atix',
|
252
|
+
timestamp: '2021-03-12T09:52:19.419Z',
|
253
|
+
status: 'completed',
|
254
|
+
priority: 5,
|
255
|
+
created: 1615542738.3449144
|
256
|
+
},
|
257
|
+
{
|
258
|
+
id: 'dhcp_create_192.168.171.105',
|
259
|
+
name: 'Create DHCP Settings for great-web-app-web-2.deploy3.dev.atix',
|
260
|
+
timestamp: '2021-03-12T09:52:19.668Z',
|
261
|
+
status: 'completed',
|
262
|
+
priority: 10,
|
263
|
+
created: 1615542738.1321318
|
264
|
+
},
|
265
|
+
{
|
266
|
+
id: 'Create IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix',
|
267
|
+
name: 'Create IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix',
|
268
|
+
timestamp: '2021-03-12T09:52:19.749Z',
|
269
|
+
status: 'completed',
|
270
|
+
priority: 10,
|
271
|
+
created: 1615542738.1576574
|
272
|
+
},
|
273
|
+
{
|
274
|
+
id: 'Create Reverse IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix',
|
275
|
+
name: 'Create Reverse IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix',
|
276
|
+
timestamp: '2021-03-12T09:52:19.859Z',
|
277
|
+
status: 'completed',
|
278
|
+
priority: 10,
|
279
|
+
created: 1615542738.1582346
|
280
|
+
},
|
281
|
+
{
|
282
|
+
id: 'Deploy TFTP PXELinux config for great-web-app-web-2.deploy3.dev.atix',
|
283
|
+
name: 'Deploy TFTP PXELinux config for great-web-app-web-2.deploy3.dev.atix',
|
284
|
+
timestamp: '2021-03-12T09:52:20.221Z',
|
285
|
+
status: 'completed',
|
286
|
+
priority: 20,
|
287
|
+
created: 1615542738.1885784
|
288
|
+
},
|
289
|
+
{
|
290
|
+
id: 'Deploy TFTP PXEGrub2 config for great-web-app-web-2.deploy3.dev.atix',
|
291
|
+
name: 'Deploy TFTP PXEGrub2 config for great-web-app-web-2.deploy3.dev.atix',
|
292
|
+
timestamp: '2021-03-12T09:52:20.604Z',
|
293
|
+
status: 'completed',
|
294
|
+
priority: 20,
|
295
|
+
created: 1615542738.1888642
|
296
|
+
},
|
297
|
+
{
|
298
|
+
id: 'Deploy TFTP PXEGrub config for great-web-app-web-2.deploy3.dev.atix',
|
299
|
+
name: 'Deploy TFTP PXEGrub config for great-web-app-web-2.deploy3.dev.atix',
|
300
|
+
timestamp: '2021-03-12T09:52:20.636Z',
|
301
|
+
status: 'completed',
|
302
|
+
priority: 20,
|
303
|
+
created: 1615542738.1890883
|
304
|
+
},
|
305
|
+
{
|
306
|
+
id: 'Deploy TFTP iPXE config for great-web-app-web-2.deploy3.dev.atix',
|
307
|
+
name: 'Deploy TFTP iPXE config for great-web-app-web-2.deploy3.dev.atix',
|
308
|
+
timestamp: '2021-03-12T09:52:20.895Z',
|
309
|
+
status: 'completed',
|
310
|
+
priority: 20,
|
311
|
+
created: 1615542738.1892834
|
312
|
+
},
|
313
|
+
{
|
314
|
+
id: 'Fetch TFTP boot files for great-web-app-web-2.deploy3.dev.atix',
|
315
|
+
name: 'Fetch TFTP boot files for great-web-app-web-2.deploy3.dev.atix',
|
316
|
+
timestamp: '2021-03-12T09:52:20.992Z',
|
317
|
+
status: 'completed',
|
318
|
+
priority: 25,
|
319
|
+
created: 1615542738.1898031
|
320
|
+
},
|
321
|
+
{
|
322
|
+
id: 'Power up compute instance great-web-app-web-2.deploy3.dev.atix',
|
323
|
+
name: 'Power up compute instance great-web-app-web-2.deploy3.dev.atix',
|
324
|
+
timestamp: '2021-03-12T09:52:21.864Z',
|
325
|
+
status: 'completed',
|
326
|
+
priority: 1000,
|
327
|
+
created: 1615542738.3453662
|
328
|
+
},
|
329
|
+
{
|
330
|
+
id: 'Cleanup PuppetCA certificates for great-web-app-web-2.deploy3.dev.atix',
|
331
|
+
name: 'Cleanup PuppetCA certificates for great-web-app-web-2.deploy3.dev.atix',
|
332
|
+
timestamp: '2021-03-12T09:52:22.316Z',
|
333
|
+
status: 'completed',
|
334
|
+
priority: 51,
|
335
|
+
created: 1615542738.34748
|
336
|
+
},
|
337
|
+
{
|
338
|
+
id: 'Enable PuppetCA autosigning for great-web-app-web-2.deploy3.dev.atix',
|
339
|
+
name: 'Enable PuppetCA autosigning for great-web-app-web-2.deploy3.dev.atix',
|
340
|
+
timestamp: '2021-03-12T09:52:22.368Z',
|
341
|
+
status: 'completed',
|
342
|
+
priority: 55,
|
343
|
+
created: 1615542738.3476808
|
344
|
+
}
|
345
|
+
],
|
346
|
+
powerStatusUrl: '/api/v2/hosts/great-web-app-web-2.deploy3.dev.atix/power'
|
347
|
+
}
|
348
|
+
]
|
349
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import Immutable from 'seamless-immutable';
|
2
|
+
import {
|
3
|
+
cloneDeep,
|
4
|
+
findIndex,
|
5
|
+
findLastIndex,
|
6
|
+
} from 'lodash';
|
7
|
+
|
8
|
+
import {
|
9
|
+
applicationInstanceReportData_1,
|
10
|
+
} from '../__fixtures__/applicationInstanceReportData_1.fixtures';
|
11
|
+
|
12
|
+
export const successState = Immutable(applicationInstanceReportData_1);
|
13
|
+
|
14
|
+
const ACTIVE_HOST_ID = 2;
|
15
|
+
|
16
|
+
// Payload Data
|
17
|
+
export const initApplicationInstanceReportPayload = applicationInstanceReportData_1;
|
18
|
+
export const setActiveHostPayload = {
|
19
|
+
activeHostId: ACTIVE_HOST_ID,
|
20
|
+
};
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import ApplicationInstanceReport from '../ApplicationInstanceReport';
|
4
|
+
|
5
|
+
const noop = () => {};
|
6
|
+
|
7
|
+
const hostData = [
|
8
|
+
{
|
9
|
+
"id": 8,
|
10
|
+
"name": "great-web-app-db-1",
|
11
|
+
"build": false,
|
12
|
+
"hostUrl": "/hosts/great-web-app-db-1.deploy3.dev.atix",
|
13
|
+
"progress_report": [],
|
14
|
+
"powerStatusUrl": "/api/v2/hosts/great-web-app-db-1.deploy3.dev.atix/power"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"id": 9,
|
18
|
+
"name": "great-web-app-web-1",
|
19
|
+
"build": false,
|
20
|
+
"hostUrl": "/hosts/great-web-app-web-1.deploy3.dev.atix",
|
21
|
+
"progress_report": [],
|
22
|
+
"powerStatusUrl": "/api/v2/hosts/great-web-app-web-1.deploy3.dev.atix/power"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"id": 10,
|
26
|
+
"name": "great-web-app-web-2",
|
27
|
+
"build": false,
|
28
|
+
"hostUrl": "/hosts/great-web-app-web-2.deploy3.dev.atix",
|
29
|
+
"progress_report": [],
|
30
|
+
"powerStatusUrl": "/api/v2/hosts/great-web-app-web-2.deploy3.dev.atix/power"
|
31
|
+
}
|
32
|
+
];
|
33
|
+
|
34
|
+
const fixtures = {
|
35
|
+
'should render application instance report': {
|
36
|
+
data: {
|
37
|
+
appInstanceName: "instance name",
|
38
|
+
deployTaskUrl: "deploy/task/url",
|
39
|
+
configureJobUrl: "configure/job/url",
|
40
|
+
hosts: hostData,
|
41
|
+
},
|
42
|
+
initApplicationInstanceReport: noop,
|
43
|
+
},
|
44
|
+
};
|
45
|
+
|
46
|
+
describe('ApplicationInstanceReport', () =>
|
47
|
+
testComponentSnapshotsWithFixtures(ApplicationInstanceReport, fixtures));
|
data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportReducer.test.js
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';
|
2
|
+
import reducer, { initialState } from '../ApplicationInstanceReportReducer';
|
3
|
+
|
4
|
+
import {
|
5
|
+
successState,
|
6
|
+
initApplicationInstanceReportPayload,
|
7
|
+
setActiveHostPayload,
|
8
|
+
} from '../__fixtures__/applicationInstanceReportReducer.fixtures';
|
9
|
+
|
10
|
+
import {
|
11
|
+
APPLICATION_INSTANCE_REPORT_INIT,
|
12
|
+
APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST,
|
13
|
+
} from '../ApplicationInstanceReportConstants';
|
14
|
+
|
15
|
+
const fixtures = {
|
16
|
+
'should return initial state': {
|
17
|
+
state: initialState,
|
18
|
+
action: {
|
19
|
+
type: undefined,
|
20
|
+
payload: {},
|
21
|
+
},
|
22
|
+
},
|
23
|
+
|
24
|
+
'should initialize component': {
|
25
|
+
state: initialState,
|
26
|
+
action: {
|
27
|
+
type: APPLICATION_INSTANCE_REPORT_INIT,
|
28
|
+
payload: initApplicationInstanceReportPayload,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
'should set active host': {
|
32
|
+
state: successState,
|
33
|
+
action: {
|
34
|
+
type: APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST,
|
35
|
+
payload: setActiveHostPayload,
|
36
|
+
},
|
37
|
+
},
|
38
|
+
};
|
39
|
+
|
40
|
+
describe('ApplicationInstanceReport', () =>
|
41
|
+
testReducerSnapshotWithFixtures(reducer, fixtures));
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import {
|
4
|
+
selectHosts,
|
5
|
+
selectActiveHostId,
|
6
|
+
} from '../ApplicationInstanceReportSelectors';
|
7
|
+
|
8
|
+
import {
|
9
|
+
applicationInstanceReportData_1,
|
10
|
+
} from '../__fixtures__/applicationInstanceReportData_1.fixtures';
|
11
|
+
|
12
|
+
const stateFactory = obj => ({
|
13
|
+
foremanAcd: {
|
14
|
+
applicationInstanceReport: obj,
|
15
|
+
},
|
16
|
+
});
|
17
|
+
|
18
|
+
const fixtures = {
|
19
|
+
'should return hosts from applicationInstanceReportData_1 fixtures': () =>
|
20
|
+
selectHosts(stateFactory(applicationInstanceReportData_1)),
|
21
|
+
'should return activeHostId from applicationInstanceReportData_1 fixtures': () =>
|
22
|
+
selectActiveHostId(stateFactory(applicationInstanceReportData_1)),
|
23
|
+
};
|
24
|
+
|
25
|
+
describe('ApplicationInstanceSelectors', () =>
|
26
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|