add_controller.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  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.AddHostController = Em.Controller.extend({
  20. name: 'addHostController',
  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('addHost');
  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('addHost', 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. isStep8: function () {
  110. return this.get('currentStep') == 8;
  111. }.property('currentStep'),
  112. isStep9: function () {
  113. return this.get('currentStep') == 9;
  114. }.property('currentStep'),
  115. isStep10: function () {
  116. return this.get('currentStep') == 10;
  117. }.property('currentStep'),
  118. gotoStep: function (step) {
  119. if (this.get('isStepDisabled').findProperty('step', step).get('value') === false) {
  120. App.router.send('gotoStep' + step);
  121. }
  122. },
  123. gotoStep1: function () {
  124. this.gotoStep(1);
  125. },
  126. gotoStep2: function () {
  127. this.gotoStep(2);
  128. },
  129. gotoStep3: function () {
  130. this.gotoStep(3);
  131. },
  132. gotoStep4: function () {
  133. this.gotoStep(4);
  134. },
  135. gotoStep5: function () {
  136. this.gotoStep(5);
  137. },
  138. gotoStep6: function () {
  139. this.gotoStep(6);
  140. },
  141. gotoStep7: function () {
  142. this.gotoStep(7);
  143. },
  144. gotoStep8: function () {
  145. this.gotoStep(8);
  146. },
  147. gotoStep9: function () {
  148. this.gotoStep(9);
  149. },
  150. gotoStep10: function () {
  151. this.gotoStep(10);
  152. },
  153. /**
  154. * Load clusterInfo(step1) to model
  155. */
  156. loadClusterInfo: function(){
  157. var cStatus = App.db.getClusterStatus() || {status: "", isCompleted: false};
  158. var cluster = {
  159. name: App.db.getClusterName() || "",
  160. status: cStatus.status,
  161. isCompleted: cStatus.isCompleted
  162. };
  163. this.set('content.cluster', cluster);
  164. console.log("AddHostController:loadClusterInfo: loaded data ", cluster);
  165. },
  166. /**
  167. * Save all info about claster to model
  168. * @param stepController Step1WizardController
  169. */
  170. saveClusterInfo: function (stepController) {
  171. var cluster = stepController.get('content.cluster');
  172. var clusterStatus = {
  173. status: cluster.status,
  174. isCompleted: cluster.isCompleted
  175. }
  176. App.db.setClusterName(cluster.name);
  177. App.db.setClusterStatus(clusterStatus);
  178. console.log("AddHostController:saveClusterInfo: saved data ", cluster);
  179. //probably next line is extra work - need to check it
  180. this.set('content.cluster', cluster);
  181. },
  182. /**
  183. * save status of the cluster. This is called from step8 and step9 to persist install and start requestId
  184. * @param clusterStatus object with status, isCompleted, requestId, isInstallError and isStartError field.
  185. */
  186. saveClusterStatus: function (clusterStatus) {
  187. this.set('content.cluster', clusterStatus);
  188. App.db.setClusterStatus(clusterStatus);
  189. },
  190. /**
  191. * Temporary function for wizardStep9, before back-end integration
  192. */
  193. setInfoForStep9: function () {
  194. var hostInfo = App.db.getHosts();
  195. for (var index in hostInfo) {
  196. hostInfo[index].status = "pending";
  197. hostInfo[index].message = 'Waiting';
  198. hostInfo[index].progress = '0';
  199. }
  200. App.db.setHosts(hostInfo);
  201. },
  202. /**
  203. * Load all data for <code>Specify Host(install step2)</code> step
  204. * Data Example:
  205. * {
  206. * hostNames: '',
  207. * manualInstall: false,
  208. * sshKey: '',
  209. * passphrase: '',
  210. * confirmPassphrase: '',
  211. * localRepo: false,
  212. * localRepoPath: ''
  213. * }
  214. */
  215. loadInstallOptions: function () {
  216. if (!this.content.hosts) {
  217. this.content.hosts = Em.Object.create();
  218. }
  219. //TODO : rewire it as model. or not :)
  220. var hostsInfo = Em.Object.create();
  221. hostsInfo.hostNames = App.db.getAllHostNames() || ''; //empty string if undefined
  222. //TODO : should we check installType for add host wizard????
  223. var installType = App.db.getInstallType();
  224. //false if installType not equals 'manual'
  225. hostsInfo.manualInstall = installType && installType.installType === 'manual' || false;
  226. var softRepo = App.db.getSoftRepo();
  227. if (softRepo && softRepo.repoType === 'local') {
  228. hostsInfo.localRepo = true;
  229. hostsInfo.localRepopath = softRepo.repoPath;
  230. } else {
  231. hostsInfo.localRepo = false;
  232. hostsInfo.localRepoPath = '';
  233. }
  234. hostsInfo.sshKey = 'random';
  235. hostsInfo.passphrase = '';
  236. hostsInfo.confirmPassphrase = '';
  237. this.set('content.hosts', hostsInfo);
  238. console.log("AddHostController:loadHosts: loaded data ", hostsInfo);
  239. },
  240. /**
  241. * Save data, which user filled, to main controller
  242. * @param stepController App.WizardStep2Controller
  243. */
  244. saveHosts: function (stepController) {
  245. //TODO: put data to content.hosts and only then save it)
  246. //App.db.setBootStatus(false);
  247. App.db.setAllHostNames(stepController.get('hostNames'));
  248. App.db.setHosts(stepController.getHostInfo());
  249. if (stepController.get('manualInstall') === false) {
  250. App.db.setInstallType({installType: 'ambari' });
  251. } else {
  252. App.db.setInstallType({installType: 'manual' });
  253. }
  254. if (stepController.get('localRepo') === false) {
  255. App.db.setSoftRepo({ 'repoType': 'remote', 'repoPath': null});
  256. } else {
  257. App.db.setSoftRepo({ 'repoType': 'local', 'repoPath': stepController.get('localRepoPath') });
  258. }
  259. },
  260. /**
  261. * Return hosts, which were add at <code>Specify Host(step2)</code> step
  262. * @paramm isNew whether return all hosts or only new ones
  263. */
  264. getHostList: function (isNew) {
  265. var hosts = [];
  266. var hostArray = App.db.getHosts()
  267. console.log('in addHostController.getHostList: host names is ', hostArray);
  268. for (var i in hostArray) {
  269. var hostInfo = App.HostInfo.create({
  270. name: hostArray[i].name,
  271. bootStatus: hostArray[i].bootStatus
  272. });
  273. hosts.pushObject(hostInfo);
  274. }
  275. console.log('TRACE: pushing ' + hosts);
  276. return hosts;
  277. },
  278. /**
  279. * Remove host from model. Used at <code>Confirm hosts(step2)</code> step
  280. * @param hosts Array of hosts, which we want to delete
  281. */
  282. removeHosts: function (hosts) {
  283. //todo Replace this code with real logic
  284. App.db.removeHosts(hosts);
  285. },
  286. /**
  287. * Save data, which user filled, to main controller
  288. * @param stepController App.WizardStep3Controller
  289. */
  290. saveConfirmedHosts: function (stepController) {
  291. var hostInfo = {};
  292. stepController.get('content.hostsInfo').forEach(function (_host) {
  293. hostInfo[_host.name] = {
  294. name: _host.name,
  295. cpu: _host.cpu,
  296. memory: _host.memory,
  297. bootStatus: _host.bootStatus
  298. };
  299. });
  300. console.log('addHostController:saveConfirmedHosts: save hosts ', hostInfo);
  301. App.db.setHosts(hostInfo);
  302. this.set('content.hostsInfo', hostInfo);
  303. },
  304. /**
  305. * Load confirmed hosts.
  306. * Will be used at <code>Assign Masters(step5)</code> step
  307. */
  308. loadConfirmedHosts: function(){
  309. this.set('content.hostsInfo', App.db.getHosts());
  310. },
  311. /**
  312. * Save data after installation to main controller
  313. * @param stepController App.WizardStep9Controller
  314. */
  315. saveInstalledHosts: function (stepController) {
  316. var hosts = stepController.get('hosts');
  317. var hostInfo = App.db.getHosts();
  318. for (var index in hostInfo) {
  319. hostInfo[index].status = "pending";
  320. var host = hosts.findProperty('name', hostInfo[index].name);
  321. if (host) {
  322. hostInfo[index].status = host.status;
  323. hostInfo[index].message = host.message;
  324. hostInfo[index].progress = host.progress;
  325. }
  326. }
  327. App.db.setHosts(hostInfo);
  328. console.log('addHostController:saveInstalledHosts: save hosts ', hostInfo);
  329. },
  330. /**
  331. * Remove all data for hosts
  332. */
  333. clearHosts: function () {
  334. var hosts = this.get('content').get('hosts');
  335. if (hosts) {
  336. hosts.hostNames = '';
  337. hosts.manualInstall = false;
  338. hosts.localRepo = '';
  339. hosts.localRepopath = '';
  340. hosts.sshKey = '';
  341. hosts.passphrase = '';
  342. hosts.confirmPassphrase = '';
  343. }
  344. },
  345. /**
  346. * Load services data. Will be used at <code>Select services(step4)</code> step
  347. */
  348. loadServices: function () {
  349. var servicesInfo = App.db.getService();
  350. servicesInfo.forEach(function (item, index) {
  351. servicesInfo[index] = Em.Object.create(item);
  352. });
  353. this.set('content.services', servicesInfo);
  354. console.log('addHostController.loadServices: loaded data ', servicesInfo);
  355. console.log('selected services ', servicesInfo.filterProperty('isSelected', true).mapProperty('serviceName'));
  356. },
  357. /**
  358. * Save data to model
  359. * @param stepController App.WizardStep4Controller
  360. */
  361. saveServices: function (stepController) {
  362. var serviceNames = [];
  363. // we can also do it without stepController since all data,
  364. // changed at page, automatically changes in model(this.content.services)
  365. App.db.setService(stepController.get('content'));
  366. stepController.filterProperty('isSelected', true).forEach(function (item) {
  367. serviceNames.push(item.serviceName);
  368. });
  369. App.db.setSelectedServiceNames(serviceNames);
  370. console.log('addHostController.saveServices: saved data ', serviceNames);
  371. },
  372. /**
  373. * Save Master Component Hosts data to Main Controller
  374. * @param stepController App.WizardStep5Controller
  375. */
  376. saveMasterComponentHosts: function (stepController) {
  377. var obj = stepController.get('selectedServicesMasters');
  378. var masterComponentHosts = [];
  379. obj.forEach(function (_component) {
  380. masterComponentHosts.push({
  381. display_name: _component.display_name,
  382. component: _component.component_name,
  383. hostName: _component.selectedHost
  384. });
  385. });
  386. console.log("AddHostController.saveComponentHosts: saved hosts ", masterComponentHosts);
  387. App.db.setMasterComponentHosts(masterComponentHosts);
  388. this.set('content.masterComponentHosts', masterComponentHosts);
  389. var hosts = masterComponentHosts.mapProperty('hostName').uniq();
  390. var hostsMasterServicesMapping = [];
  391. hosts.forEach(function (_host) {
  392. var componentsOnHost = masterComponentHosts.filterProperty('hostName', _host).mapProperty('component');
  393. hostsMasterServicesMapping.push({
  394. hostname: _host,
  395. components: componentsOnHost
  396. });
  397. }, this);
  398. console.log("AddHostController.setHostToMasterComponent: saved hosts ", hostsMasterServicesMapping);
  399. App.db.setHostToMasterComponent(hostsMasterServicesMapping);
  400. this.set('content.hostToMasterComponent', hostsMasterServicesMapping);
  401. },
  402. /**
  403. * Load master component hosts data for using in required step controllers
  404. */
  405. loadMasterComponentHosts: function () {
  406. var masterComponentHosts = App.db.getMasterComponentHosts();
  407. this.set("content.masterComponentHosts", masterComponentHosts);
  408. console.log("AddHostController.loadMasterComponentHosts: loaded hosts ", masterComponentHosts);
  409. var hostsMasterServicesMapping = App.db.getHostToMasterComponent();
  410. this.set("content.hostToMasterComponent", hostsMasterServicesMapping);
  411. console.log("AddHostController.loadHostToMasterComponent: loaded hosts ", hostsMasterServicesMapping);
  412. },
  413. /**
  414. * Save slaveHostComponents to main controller
  415. * @param stepController
  416. */
  417. saveSlaveComponentHosts: function (stepController) {
  418. var hosts = stepController.get('hosts');
  419. var isMrSelected = stepController.get('isMrSelected');
  420. var isHbSelected = stepController.get('isHbSelected');
  421. App.db.setHostSlaveComponents(hosts);
  422. this.set('content.hostSlaveComponents', hosts);
  423. var dataNodeHosts = [];
  424. var taskTrackerHosts = [];
  425. var regionServerHosts = [];
  426. var clientHosts = [];
  427. hosts.forEach(function (host) {
  428. if (host.get('isDataNode')) {
  429. dataNodeHosts.push({
  430. hostname: host.hostname,
  431. group: 'Default'
  432. });
  433. }
  434. if (isMrSelected && host.get('isTaskTracker')) {
  435. taskTrackerHosts.push({
  436. hostname: host.hostname,
  437. group: 'Default'
  438. });
  439. }
  440. if (isHbSelected && host.get('isRegionServer')) {
  441. regionServerHosts.push({
  442. hostname: host.hostname,
  443. group: 'Default'
  444. });
  445. }
  446. if (host.get('isClient')) {
  447. clientHosts.pushObject({
  448. hostname: host.hostname,
  449. group: 'Default'
  450. });
  451. }
  452. }, this);
  453. var slaveComponentHosts = [];
  454. slaveComponentHosts.push({
  455. componentName: 'DATANODE',
  456. displayName: 'DataNode',
  457. hosts: dataNodeHosts
  458. });
  459. if (isMrSelected) {
  460. slaveComponentHosts.push({
  461. componentName: 'TASKTRACKER',
  462. displayName: 'TaskTracker',
  463. hosts: taskTrackerHosts
  464. });
  465. }
  466. if (isHbSelected) {
  467. slaveComponentHosts.push({
  468. componentName: 'HBASE_REGIONSERVER',
  469. displayName: 'RegionServer',
  470. hosts: regionServerHosts
  471. });
  472. }
  473. slaveComponentHosts.pushObject({
  474. componentName: 'CLIENT',
  475. displayName: 'client',
  476. hosts: clientHosts
  477. });
  478. App.db.setSlaveComponentHosts(slaveComponentHosts);
  479. this.set('content.slaveComponentHosts', slaveComponentHosts);
  480. },
  481. /**
  482. * Load master component hosts data for using in required step controllers
  483. */
  484. loadSlaveComponentHosts: function () {
  485. var slaveComponentHosts = App.db.getSlaveComponentHosts();
  486. this.set("content.slaveComponentHosts", slaveComponentHosts);
  487. console.log("AddHostController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
  488. var hostSlaveComponents = App.db.getHostSlaveComponents();
  489. this.set('content.hostSlaveComponents', hostSlaveComponents);
  490. console.log("AddHostController.loadSlaveComponentHosts: loaded hosts ", hostSlaveComponents);
  491. },
  492. /**
  493. * Save config properties
  494. * @param stepController Step7WizardController
  495. */
  496. saveServiceConfigProperties: function (stepController) {
  497. var serviceConfigProperties = [];
  498. stepController.get('stepConfigs').forEach(function (_content) {
  499. _content.get('configs').forEach(function (_configProperties) {
  500. var configProperty = {
  501. name: _configProperties.get('name'),
  502. value: _configProperties.get('value')
  503. };
  504. serviceConfigProperties.push(configProperty);
  505. }, this);
  506. }, this);
  507. App.db.setServiceConfigProperties(serviceConfigProperties);
  508. this.set('content.serviceConfigProperties', serviceConfigProperties);
  509. },
  510. /**
  511. * Load serviceConfigProperties to model
  512. */
  513. loadServiceConfigProperties: function () {
  514. var serviceConfigProperties = App.db.getServiceConfigProperties();
  515. this.set('content.serviceConfigProperties', serviceConfigProperties);
  516. console.log("AddHostController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
  517. },
  518. /**
  519. * Load information about hosts with clients components
  520. */
  521. loadClients: function(){
  522. var clients = App.db.getClientsForSelectedServices();
  523. this.set('content.clients', clients);
  524. console.log("AddHostController.loadClients: loaded list ", clients);
  525. },
  526. /**
  527. * Generate clients list for selected services and save it to model
  528. * @param stepController step4WizardController
  529. */
  530. saveClients: function(stepController){
  531. var clients = [];
  532. var serviceComponents = require('data/service_components');
  533. stepController.get('content').filterProperty('isSelected',true).forEach(function (_service) {
  534. var client = serviceComponents.filterProperty('service_name', _service.serviceName).findProperty('isClient', true);
  535. if (client) {
  536. clients.pushObject({
  537. component_name: client.component_name,
  538. display_name: client.display_name
  539. });
  540. }
  541. }, this);
  542. App.db.setClientsForSelectedServices(clients);
  543. this.set('content.clients', clients);
  544. console.log("AddHostController.saveClients: saved list ", clients);
  545. },
  546. /**
  547. * Load HostToMasterComponent array
  548. */
  549. loadHostToMasterComponent: function(){
  550. var list = App.db.getHostToMasterComponent();
  551. this.set('content.hostToMasterComponent', list);
  552. console.log("AddHostController.loadHostToMasterComponent: loaded list ", list);
  553. },
  554. /**
  555. * Load data for all steps until <code>current step</code>
  556. */
  557. loadAllPriorSteps: function () {
  558. var step = this.get('currentStep');
  559. switch (step) {
  560. case '8':
  561. case '7':
  562. case '6':
  563. this.loadServiceConfigProperties();
  564. case '5':
  565. this.loadClients();
  566. case '4':
  567. this.loadMasterComponentHosts();
  568. this.loadSlaveComponentHosts();
  569. this.loadHostToMasterComponent();
  570. this.loadConfirmedHosts();
  571. case '3':
  572. this.loadClients();
  573. this.loadServices();
  574. case '2':
  575. this.loadConfirmedHosts();
  576. case '1':
  577. this.loadInstallOptions();
  578. case '0':
  579. this.loadClusterInfo();
  580. }
  581. },
  582. /**
  583. * Generate clients list for selected services and save it to model
  584. * @param stepController step8WizardController or step9WizardController
  585. */
  586. installServices: function () {
  587. var self = this;
  588. var clusterName = this.get('content.cluster.name');
  589. var url = '/api/clusters/' + clusterName + '/services?state=INIT';
  590. var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
  591. $.ajax({
  592. type: 'PUT',
  593. url: url,
  594. data: data,
  595. async: false,
  596. dataType: 'text',
  597. timeout: 5000,
  598. success: function (data) {
  599. var jsonData = jQuery.parseJSON(data);
  600. console.log("TRACE: STep8 -> In success function for the installService call");
  601. console.log("TRACE: STep8 -> value of the url is: " + url);
  602. if (jsonData) {
  603. var requestId = jsonData.href.match(/.*\/(.*)$/)[1];
  604. console.log('requestId is: ' + requestId);
  605. var clusterStatus = {
  606. status: 'PENDING',
  607. requestId: requestId,
  608. isInstallError: false,
  609. isCompleted: false
  610. };
  611. self.saveClusterStatus(clusterStatus);
  612. } else {
  613. console.log('ERROR: Error occurred in parsing JSON data');
  614. }
  615. },
  616. error: function (request, ajaxOptions, error) {
  617. console.log("TRACE: STep8 -> In error function for the installService call");
  618. console.log("TRACE: STep8 -> value of the url is: " + url);
  619. console.log("TRACE: STep8 -> error code status is: " + request.status);
  620. console.log('Step8: Error message is: ' + request.responseText);
  621. var clusterStatus = {
  622. status: 'PENDING',
  623. isInstallError: true,
  624. isCompleted: false
  625. };
  626. self.saveClusterStatus(clusterStatus);
  627. },
  628. statusCode: require('data/statusCodes')
  629. });
  630. },
  631. /**
  632. * Remove all loaded data.
  633. * Created as copy for App.router.clearAllSteps
  634. */
  635. clearAllSteps: function () {
  636. this.clearHosts();
  637. //todo it)
  638. }
  639. });