background_operation.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.BackgroundOperation = DS.Model.extend({
  20. operationName:DS.attr('string'),
  21. events: DS.hasMany('App.BackgroundOperationEvent'),
  22. cluster:DS.belongsTo('App.Cluster'),
  23. host:DS.belongsTo('App.Host'),
  24. operationLog: DS.attr('string')
  25. });
  26. App.BackgroundOperation.FIXTURES = [
  27. {
  28. id:1,
  29. operation_name:'Decommissioning host1',
  30. operation_log:'Decommissioning log',
  31. events:[1,2],
  32. cluster_id:1,
  33. host_id:1
  34. },
  35. {
  36. id:2,
  37. operation_name:'Starting DataNode on host4',
  38. operation_log:'Starting DataNode log',
  39. events:[3],
  40. cluster_id:1,
  41. host_id:1
  42. }
  43. ];
  44. App.BackgroundOperationEvent = DS.Model.extend({
  45. eventName:DS.attr('string'),
  46. operation:DS.belongsTo('App.BackgroundOperation'),
  47. eventDate: DS.attr('string')
  48. });
  49. App.BackgroundOperationEvent.FIXTURES = [
  50. {
  51. id:1,
  52. event_name:'Some intermediate operation',
  53. operation_id:1,
  54. event_date:'4 min ago'
  55. },
  56. {
  57. id:2,
  58. event_name:'Operation started',
  59. operation_id:1,
  60. event_date:'5 min ago'
  61. },
  62. {
  63. id:3,
  64. event_name:'Operation started',
  65. operation_id:2,
  66. event_date:'5 min ago'
  67. }
  68. ];