add_controller.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. App.AddServiceController = Em.Controller.extend({
  20. name: 'addServiceController',
  21. /**
  22. * All wizards data will be stored in this variable
  23. *
  24. * cluster - cluster name
  25. * hosts - hosts, ssh key, repo info, etc.
  26. * services - services list
  27. * hostsInfo - list of selected hosts
  28. * slaveComponentHosts, hostSlaveComponents - info about slave hosts
  29. * masterComponentHosts - info about master hosts
  30. * config??? - to be described later
  31. */
  32. content: Em.Object.create({
  33. cluster: null,
  34. hosts: null,
  35. services: null,
  36. hostsInfo: null,
  37. slaveComponentHosts: null,
  38. hostSlaveComponents: null,
  39. masterComponentHosts: null,
  40. hostToMasterComponent : null,
  41. serviceConfigProperties: null
  42. }),
  43. /**
  44. * Used for hiding back button in wizard
  45. */
  46. hideBackButton: true,
  47. isStepDisabled: [],
  48. totalSteps: 9,
  49. init: function () {
  50. this.isStepDisabled.pushObject(Ember.Object.create({
  51. step: 1,
  52. value: false
  53. }));
  54. for (var i = 2; i <= this.totalSteps; i++) {
  55. this.isStepDisabled.pushObject(Ember.Object.create({
  56. step: i,
  57. value: true
  58. }));
  59. }
  60. },
  61. setStepsEnable: function () {
  62. for (var i = 2; i <= this.totalSteps; i++) {
  63. var step = this.get('isStepDisabled').findProperty('step', i);
  64. if (i <= this.get('currentStep')) {
  65. step.set('value', false);
  66. } else {
  67. step.set('value', true);
  68. }
  69. }
  70. }.observes('currentStep'),
  71. /**
  72. * Return current step of Add Host Wizard
  73. */
  74. currentStep: function () {
  75. return App.get('router').getWizardCurrentStep('addService');
  76. }.property(),
  77. clusters: null,
  78. /**
  79. * Set current step to new value.
  80. * Method moved from App.router.setInstallerCurrentStep
  81. * @param currentStep
  82. * @param completed
  83. */
  84. setCurrentStep: function (currentStep, completed) {
  85. App.db.setWizardCurrentStep('addService', currentStep, completed);
  86. this.set('currentStep', currentStep);
  87. },
  88. isStep1: function () {
  89. return this.get('currentStep') == 1;
  90. }.property('currentStep'),
  91. isStep2: function () {
  92. return this.get('currentStep') == 2;
  93. }.property('currentStep'),
  94. isStep3: function () {
  95. return this.get('currentStep') == 3;
  96. }.property('currentStep'),
  97. isStep4: function () {
  98. return this.get('currentStep') == 4;
  99. }.property('currentStep'),
  100. isStep5: function () {
  101. return this.get('currentStep') == 5;
  102. }.property('currentStep'),
  103. isStep6: function () {
  104. return this.get('currentStep') == 6;
  105. }.property('currentStep'),
  106. isStep7: function () {
  107. return this.get('currentStep') == 7;
  108. }.property('currentStep'),
  109. gotoStep: function (step) {
  110. if (this.get('isStepDisabled').findProperty('step', step).get('value') === false) {
  111. App.router.send('gotoStep' + step);
  112. }
  113. },
  114. gotoStep1: function () {
  115. this.gotoStep(1);
  116. },
  117. gotoStep2: function () {
  118. this.gotoStep(2);
  119. },
  120. gotoStep3: function () {
  121. this.gotoStep(3);
  122. },
  123. gotoStep4: function () {
  124. this.gotoStep(4);
  125. },
  126. gotoStep5: function () {
  127. this.gotoStep(5);
  128. },
  129. gotoStep6: function () {
  130. this.gotoStep(6);
  131. },
  132. gotoStep7: function () {
  133. this.gotoStep(7);
  134. },
  135. /**
  136. * Load clusterInfo(step1) to model
  137. */
  138. loadClusterInfo: function(){
  139. var cStatus = App.db.getClusterStatus() || {status: "", isCompleted: false};
  140. var cluster = {
  141. name: App.db.getClusterName() || "",
  142. status: cStatus.status,
  143. isCompleted: cStatus.isCompleted
  144. };
  145. this.set('content.cluster', cluster);
  146. console.log("AddServiceController:loadClusterInfo: loaded data ", cluster);
  147. },
  148. /**
  149. * Save all info about claster to model
  150. * @param stepController Step1WizardController
  151. */
  152. saveClusterInfo: function (stepController) {
  153. var cluster = stepController.get('content.cluster');
  154. var clusterStatus = {
  155. status: cluster.status,
  156. isCompleted: cluster.isCompleted
  157. }
  158. App.db.setClusterName(cluster.name);
  159. App.db.setClusterStatus(clusterStatus);
  160. console.log("AddServiceController:saveClusterInfo: saved data ", cluster);
  161. //probably next line is extra work - need to check it
  162. this.set('content.cluster', cluster);
  163. },
  164. /**
  165. * save status of the cluster. This is called from step8 and step9 to persist install and start requestId
  166. * @param clusterStatus object with status, isCompleted, requestId, isInstallError and isStartError field.
  167. */
  168. saveClusterStatus: function (clusterStatus) {
  169. this.set('content.cluster', clusterStatus);
  170. App.db.setClusterStatus(clusterStatus);
  171. },
  172. /**
  173. * Temporary function for wizardStep9, before back-end integration
  174. */
  175. setInfoForStep9: function () {
  176. var hostInfo = App.db.getHosts();
  177. for (var index in hostInfo) {
  178. hostInfo[index].status = "pending";
  179. hostInfo[index].message = 'Information';
  180. hostInfo[index].progress = '0';
  181. }
  182. App.db.setHosts(hostInfo);
  183. },
  184. /**
  185. * Load all data for <code>Specify Host(install step2)</code> step
  186. * Data Example:
  187. * {
  188. * hostNames: '',
  189. * manualInstall: false,
  190. * sshKey: '',
  191. * passphrase: '',
  192. * confirmPassphrase: '',
  193. * localRepo: false,
  194. * localRepoPath: ''
  195. * }
  196. */
  197. loadInstallOptions: function () {
  198. if (!this.content.hosts) {
  199. this.content.hosts = Em.Object.create();
  200. }
  201. //TODO : rewire it as model. or not :)
  202. var hostsInfo = Em.Object.create();
  203. hostsInfo.hostNames = App.db.getAllHostNames() || ''; //empty string if undefined
  204. //TODO : should we check installType for add host wizard????
  205. var installType = App.db.getInstallType();
  206. //false if installType not equals 'manual'
  207. hostsInfo.manualInstall = installType && installType.installType === 'manual' || false;
  208. var softRepo = App.db.getSoftRepo();
  209. if (softRepo && softRepo.repoType === 'local') {
  210. hostsInfo.localRepo = true;
  211. hostsInfo.localRepopath = softRepo.repoPath;
  212. } else {
  213. hostsInfo.localRepo = false;
  214. hostsInfo.localRepoPath = '';
  215. }
  216. hostsInfo.sshKey = 'random';
  217. hostsInfo.passphrase = '';
  218. hostsInfo.confirmPassphrase = '';
  219. this.set('content.hosts', hostsInfo);
  220. console.log("AddServiceController:loadHosts: loaded data ", hostsInfo);
  221. },
  222. /**
  223. * Save data, which user filled, to main controller
  224. * @param stepController App.WizardStep2Controller
  225. */
  226. saveHosts: function (stepController) {
  227. //TODO: put data to content.hosts and only then save it)
  228. //App.db.setBootStatus(false);
  229. App.db.setAllHostNames(stepController.get('hostNames'));
  230. App.db.setHosts(stepController.getHostInfo());
  231. if (stepController.get('manualInstall') === false) {
  232. App.db.setInstallType({installType: 'ambari' });
  233. } else {
  234. App.db.setInstallType({installType: 'manual' });
  235. }
  236. if (stepController.get('localRepo') === false) {
  237. App.db.setSoftRepo({ 'repoType': 'remote', 'repoPath': null});
  238. } else {
  239. App.db.setSoftRepo({ 'repoType': 'local', 'repoPath': stepController.get('localRepoPath') });
  240. }
  241. },
  242. /**
  243. * Remove host from model. Used at <code>Confirm hosts(step2)</code> step
  244. * @param hosts Array of hosts, which we want to delete
  245. */
  246. removeHosts: function (hosts) {
  247. //todo Replace this code with real logic
  248. App.db.removeHosts(hosts);
  249. },
  250. /**
  251. * Save data, which user filled, to main controller
  252. * @param stepController App.WizardStep3Controller
  253. */
  254. saveConfirmedHosts: function (stepController) {
  255. var hostInfo = {};
  256. stepController.get('content').forEach(function (_host) {
  257. hostInfo[_host.name] = {
  258. name: _host.name,
  259. cpu: _host.cpu,
  260. memory: _host.memory,
  261. bootStatus: _host.bootStatus
  262. };
  263. });
  264. console.log('AddServiceController:saveConfirmedHosts: save hosts ', hostInfo);
  265. App.db.setHosts(hostInfo);
  266. this.set('content.hostsInfo', hostInfo);
  267. },
  268. /**
  269. * Load confirmed hosts.
  270. * Will be used at <code>Assign Masters(step5)</code> step
  271. */
  272. loadConfirmedHosts: function(){
  273. var hosts=App.db.getHosts();
  274. hosts = {
  275. "192.168.1.1":{"name":"192.168.1.1","cpu":"2","memory":"2","bootStatus":"pending"},
  276. "192.168.1.2":{"name":"192.168.1.2","cpu":"2","memory":"2","bootStatus":"success"},
  277. "192.168.1.3":{"name":"192.168.1.3","cpu":"2","memory":"2","bootStatus":"pending"},
  278. "192.168.1.4":{"name":"192.168.1.4","cpu":"2","memory":"2","bootStatus":"pending"},
  279. "192.168.1.5":{"name":"192.168.1.5","cpu":"2","memory":"2","bootStatus":"success"},
  280. "192.168.1.6":{"name":"192.168.1.6","cpu":"2","memory":"2","bootStatus":"pending"},
  281. "192.168.1.7":{"name":"192.168.1.7","cpu":"2","memory":"2","bootStatus":"success"},
  282. "192.168.1.8":{"name":"192.168.1.8","cpu":"2","memory":"2","bootStatus":"success"},
  283. "192.168.1.9":{"name":"192.168.1.9","cpu":"2","memory":"2","bootStatus":"success"},
  284. "192.168.1.10":{"name":"192.168.1.10","cpu":"2","memory":"2","bootStatus":"pending"},
  285. "192.168.1.11":{"name":"192.168.1.11","cpu":"2","memory":"2","bootStatus":"success"},
  286. "192.168.1.12":{"name":"192.168.1.12","cpu":"2","memory":"2","bootStatus":"pending"},
  287. "192.168.1.13":{"name":"192.168.1.13","cpu":"2","memory":"2","bootStatus":"success"}
  288. };
  289. this.set('content.hostsInfo', hosts);
  290. },
  291. /**
  292. * Save data after installation to main controller
  293. * @param stepController App.WizardStep9Controller
  294. */
  295. saveInstalledHosts: function (stepController) {
  296. var hosts = stepController.get('hosts');
  297. var hostInfo = App.db.getHosts();
  298. for (var index in hostInfo) {
  299. hostInfo[index].status = "pending";
  300. var host = hosts.findProperty('name', hostInfo[index].name);
  301. if (host) {
  302. hostInfo[index].status = host.status;
  303. hostInfo[index].message = host.message;
  304. hostInfo[index].progress = host.progress;
  305. }
  306. }
  307. App.db.setHosts(hostInfo);
  308. console.log('AddServiceController:saveInstalledHosts: save hosts ', hostInfo);
  309. },
  310. /**
  311. * Remove all data for hosts
  312. */
  313. clearHosts: function () {
  314. var hosts = this.get('content').get('hosts');
  315. if (hosts) {
  316. hosts.hostNames = '';
  317. hosts.manualInstall = false;
  318. hosts.localRepo = '';
  319. hosts.localRepopath = '';
  320. hosts.sshKey = '';
  321. hosts.passphrase = '';
  322. hosts.confirmPassphrase = '';
  323. }
  324. },
  325. /**
  326. * Load services data. Will be used at <code>Select services(step4)</code> step
  327. */
  328. loadServices: function () {
  329. var servicesInfo = App.db.getService();
  330. servicesInfo.forEach(function (item, index) {
  331. servicesInfo[index] = Em.Object.create(item);
  332. });
  333. this.set('content.services', servicesInfo);
  334. console.log('AddServiceController.loadServices: loaded data ', servicesInfo);
  335. console.log('selected services ', servicesInfo.filterProperty('isSelected', true).mapProperty('serviceName'));
  336. },
  337. /**
  338. * Save data to model
  339. * @param stepController App.WizardStep4Controller
  340. */
  341. saveServices: function (stepController) {
  342. var serviceNames = [];
  343. // we can also do it without stepController since all data,
  344. // changed at page, automatically changes in model(this.content.services)
  345. App.db.setService(stepController.get('content'));
  346. stepController.filterProperty('isSelected', true).forEach(function (item) {
  347. serviceNames.push(item.serviceName);
  348. });
  349. App.db.setSelectedServiceNames(serviceNames);
  350. console.log('AddServiceController.saveServices: saved data ', serviceNames);
  351. },
  352. /**
  353. * Save Master Component Hosts data to Main Controller
  354. * @param stepController App.WizardStep5Controller
  355. */
  356. saveMasterComponentHosts: function (stepController) {
  357. var obj = stepController.get('selectedServicesMasters');
  358. var masterComponentHosts = [];
  359. obj.forEach(function (_component) {
  360. masterComponentHosts.push({
  361. display_name: _component.display_name,
  362. component: _component.component_name,
  363. hostName: _component.selectedHost
  364. });
  365. });
  366. console.log("AddServiceController.saveComponentHosts: saved hosts ", masterComponentHosts);
  367. App.db.setMasterComponentHosts(masterComponentHosts);
  368. this.set('content.masterComponentHosts', masterComponentHosts);
  369. var hosts = masterComponentHosts.mapProperty('hostName').uniq();
  370. var hostsMasterServicesMapping = [];
  371. hosts.forEach(function (_host) {
  372. var componentsOnHost = masterComponentHosts.filterProperty('hostName', _host).mapProperty('component');
  373. hostsMasterServicesMapping.push({
  374. hostname: _host,
  375. components: componentsOnHost
  376. });
  377. }, this);
  378. console.log("AddServiceController.setHostToMasterComponent: saved hosts ", hostsMasterServicesMapping);
  379. App.db.setHostToMasterComponent(hostsMasterServicesMapping);
  380. this.set('content.hostToMasterComponent', hostsMasterServicesMapping);
  381. },
  382. /**
  383. * Load master component hosts data for using in required step controllers
  384. */
  385. loadMasterComponentHosts: function () {
  386. var masterComponentHosts = App.db.getMasterComponentHosts();
  387. this.set("content.masterComponentHosts", masterComponentHosts);
  388. console.log("AddServiceController.loadMasterComponentHosts: loaded hosts ", masterComponentHosts);
  389. var hostsMasterServicesMapping = App.db.getHostToMasterComponent();
  390. this.set("content.hostToMasterComponent", hostsMasterServicesMapping);
  391. console.log("AddServiceController.loadHostToMasterComponent: loaded hosts ", hostsMasterServicesMapping);
  392. },
  393. /**
  394. * Save slaveHostComponents to main controller
  395. * @param stepController
  396. */
  397. saveSlaveComponentHosts: function (stepController) {
  398. var hosts = stepController.get('hosts');
  399. var isMrSelected = stepController.get('isMrSelected');
  400. var isHbSelected = stepController.get('isHbSelected');
  401. App.db.setHostSlaveComponents(hosts);
  402. this.set('content.hostSlaveComponents', hosts);
  403. var dataNodeHosts = [];
  404. var taskTrackerHosts = [];
  405. var regionServerHosts = [];
  406. var clientHosts = [];
  407. hosts.forEach(function (host) {
  408. if (host.get('isDataNode')) {
  409. dataNodeHosts.push({
  410. hostname: host.hostname,
  411. group: 'Default'
  412. });
  413. }
  414. if (isMrSelected && host.get('isTaskTracker')) {
  415. taskTrackerHosts.push({
  416. hostname: host.hostname,
  417. group: 'Default'
  418. });
  419. }
  420. if (isHbSelected && host.get('isRegionServer')) {
  421. regionServerHosts.push({
  422. hostname: host.hostname,
  423. group: 'Default'
  424. });
  425. }
  426. if (host.get('isClient')) {
  427. clientHosts.pushObject({
  428. hostname: host.hostname,
  429. group: 'Default'
  430. });
  431. }
  432. }, this);
  433. var slaveComponentHosts = [];
  434. slaveComponentHosts.push({
  435. componentName: 'DATANODE',
  436. displayName: 'DataNode',
  437. hosts: dataNodeHosts
  438. });
  439. if (isMrSelected) {
  440. slaveComponentHosts.push({
  441. componentName: 'TASKTRACKER',
  442. displayName: 'TaskTracker',
  443. hosts: taskTrackerHosts
  444. });
  445. }
  446. if (isHbSelected) {
  447. slaveComponentHosts.push({
  448. componentName: 'HBASE_REGIONSERVER',
  449. displayName: 'RegionServer',
  450. hosts: regionServerHosts
  451. });
  452. }
  453. slaveComponentHosts.pushObject({
  454. componentName: 'CLIENT',
  455. displayName: 'client',
  456. hosts: clientHosts
  457. });
  458. App.db.setSlaveComponentHosts(slaveComponentHosts);
  459. this.set('content.slaveComponentHosts', slaveComponentHosts);
  460. },
  461. /**
  462. * Load master component hosts data for using in required step controllers
  463. */
  464. loadSlaveComponentHosts: function () {
  465. var slaveComponentHosts = App.db.getSlaveComponentHosts();
  466. this.set("content.slaveComponentHosts", slaveComponentHosts);
  467. console.log("AddServiceController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
  468. var hostSlaveComponents = App.db.getHostSlaveComponents();
  469. this.set('content.hostSlaveComponents', hostSlaveComponents);
  470. console.log("AddServiceController.loadSlaveComponentHosts: loaded hosts ", hostSlaveComponents);
  471. },
  472. /**
  473. * Save config properties
  474. * @param stepController Step7WizardController
  475. */
  476. saveServiceConfigProperties: function (stepController) {
  477. var serviceConfigProperties = [];
  478. stepController.get('stepConfigs').forEach(function (_content) {
  479. _content.get('configs').forEach(function (_configProperties) {
  480. var configProperty = {
  481. name: _configProperties.get('name'),
  482. value: _configProperties.get('value')
  483. };
  484. serviceConfigProperties.push(configProperty);
  485. }, this);
  486. }, this);
  487. App.db.setServiceConfigProperties(serviceConfigProperties);
  488. this.set('content.serviceConfigProperties', serviceConfigProperties);
  489. },
  490. /**
  491. * Load serviceConfigProperties to model
  492. */
  493. loadServiceConfigProperties: function () {
  494. var serviceConfigProperties = App.db.getServiceConfigProperties();
  495. this.set('content.serviceConfigProperties', serviceConfigProperties);
  496. console.log("AddServiceController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
  497. },
  498. /**
  499. * Load information about hosts with clients components
  500. */
  501. loadClients: function(){
  502. var clients = App.db.getClientsForSelectedServices();
  503. this.set('content.clients', clients);
  504. console.log("AddServiceController.loadClients: loaded list ", clients);
  505. },
  506. /**
  507. * Generate clients list for selected services and save it to model
  508. * @param stepController step4WizardController
  509. */
  510. saveClients: function(stepController){
  511. var clients = [];
  512. var serviceComponents = require('data/service_components');
  513. stepController.get('content').filterProperty('isSelected',true).forEach(function (_service) {
  514. var client = serviceComponents.filterProperty('service_name', _service.serviceName).findProperty('isClient', true);
  515. if (client) {
  516. clients.pushObject({
  517. component_name: client.component_name,
  518. display_name: client.display_name
  519. });
  520. }
  521. }, this);
  522. App.db.setClientsForSelectedServices(clients);
  523. this.set('content.clients', clients);
  524. console.log("AddServiceController.saveClients: saved list ", clients);
  525. },
  526. /**
  527. * Load HostToMasterComponent array
  528. */
  529. loadHostToMasterComponent: function(){
  530. var list = App.db.getHostToMasterComponent();
  531. this.set('content.hostToMasterComponent', list);
  532. console.log("AddServiceController.loadHostToMasterComponent: loaded list ", list);
  533. },
  534. /**
  535. * Load data for all steps until <code>current step</code>
  536. */
  537. loadAllPriorSteps: function () {
  538. var step = this.get('currentStep');
  539. switch (step) {
  540. case '6':
  541. case '5':
  542. this.loadClusterInfo();
  543. case '4':
  544. this.loadServiceConfigProperties();
  545. case '3':
  546. this.loadClients();
  547. case '2':
  548. this.loadMasterComponentHosts();
  549. this.loadSlaveComponentHosts();
  550. this.loadHostToMasterComponent();
  551. this.loadConfirmedHosts();
  552. case '1':
  553. this.loadServices();
  554. }
  555. },
  556. /**
  557. * Generate clients list for selected services and save it to model
  558. * @param stepController step8WizardController or step9WizardController
  559. */
  560. installServices: function () {
  561. var self = this;
  562. var clusterName = this.get('content.cluster.name');
  563. var url = '/api/clusters/' + clusterName + '/services?state=INIT';
  564. var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
  565. $.ajax({
  566. type: 'PUT',
  567. url: url,
  568. data: data,
  569. async: false,
  570. dataType: 'text',
  571. timeout: 5000,
  572. success: function (data) {
  573. var jsonData = jQuery.parseJSON(data);
  574. console.log("TRACE: STep8 -> In success function for the installService call");
  575. console.log("TRACE: STep8 -> value of the url is: " + url);
  576. if (jsonData) {
  577. var requestId = jsonData.href.match(/.*\/(.*)$/)[1];
  578. console.log('requestId is: ' + requestId);
  579. var clusterStatus = {
  580. status: 'PENDING',
  581. requestId: requestId,
  582. isInstallError: false,
  583. isCompleted: false
  584. };
  585. self.saveClusterStatus(clusterStatus);
  586. } else {
  587. console.log('ERROR: Error occurred in parsing JSON data');
  588. }
  589. },
  590. error: function (request, ajaxOptions, error) {
  591. console.log("TRACE: STep8 -> In error function for the installService call");
  592. console.log("TRACE: STep8 -> value of the url is: " + url);
  593. console.log("TRACE: STep8 -> error code status is: " + request.status);
  594. console.log('Step8: Error message is: ' + request.responseText);
  595. var clusterStatus = {
  596. status: 'PENDING',
  597. isInstallError: true,
  598. isCompleted: false
  599. };
  600. self.saveClusterStatus(clusterStatus);
  601. },
  602. statusCode: require('data/statusCodes')
  603. });
  604. },
  605. /**
  606. * Remove all loaded data.
  607. * Created as copy for App.router.clearAllSteps
  608. */
  609. clearAllSteps: function () {
  610. this.clearHosts();
  611. //todo it)
  612. }
  613. });