blob: 29080411bfd361f378e9b9c85e5b36d2bfa0bac1 [file] [log] [blame]
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -08001'use strict';
2(function () {
3
4 const meters = [
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -08005 {
Matteo Scandolo9db064f2016-02-08 14:17:42 -08006 service: 'service-a',
7 slice: 'slice-a-1',
8 name: 'network.outgoing.packets.rate',
9 resource_name: 'resource-1'
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080010 },
11 {
Matteo Scandolo9db064f2016-02-08 14:17:42 -080012 service: 'service-a',
13 slice: 'slice-a-1',
14 name: 'network.incoming.packets.rate',
15 resource_name: 'resource-1'
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080016 },
17 {
Matteo Scandolo9db064f2016-02-08 14:17:42 -080018 service: 'service-a',
19 slice: 'slice-a-1',
20 name: 'network.incoming.packets.rate',
21 resource_name: 'resource-2'
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080022 }
23 ];
24
25 const samples = [
26 {
27 meter: 'cpu',
28 resource_name: 'fakeName',
Matteo Scandolo8420f622016-03-24 11:38:50 -070029 resource_id: 'fakeTenant',
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080030 timestamp: '2015-12-15T00:34:08',
31 volume: 110
32 },
33 {
34 meter: 'cpu',
35 resource_name: 'fakeName',
Matteo Scandolo8420f622016-03-24 11:38:50 -070036 resource_id: 'fakeTenant',
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080037 timestamp: '2015-12-15T00:44:08',
38 volume: 120
39 },
40 {
41 meter: 'cpu',
42 resource_name: 'anotherName',
Matteo Scandolo8420f622016-03-24 11:38:50 -070043 resource_id: 'anotherTenant',
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080044 timestamp: '2015-12-15T00:24:08',
45 volume: 210
46 },
47 {
48 meter: 'cpu',
49 resource_name: 'anotherName',
Matteo Scandolo8420f622016-03-24 11:38:50 -070050 resource_id: 'anotherTenant',
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080051 timestamp: '2015-12-15T00:34:08',
52 volume: 220
53 },
54 {
55 meter: 'cpu',
56 resource_name: 'anotherName',
Matteo Scandolo8420f622016-03-24 11:38:50 -070057 resource_id: 'anotherTenant',
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080058 timestamp: '2015-12-15T00:44:08',
59 volume: 230
60 },
61 {
62 meter: 'cpu',
63 resource_name: 'thirdName',
Matteo Scandolo8420f622016-03-24 11:38:50 -070064 resource_id: 'thirdTenant',
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080065 timestamp: '2015-12-15T00:44:08',
66 volume: 310
67 }
68 ];
69
Matteo Scandolo9db064f2016-02-08 14:17:42 -080070 const mapping = [
71 {
72 service: 'service-a',
Matteo Scandolo8420f622016-03-24 11:38:50 -070073 slices: [
Matteo Scandolo9db064f2016-02-08 14:17:42 -080074 {
75 project_id: 'id-a-1',
76 slice: 'slice-a-1'
77 },
78 {
79 project_id: 'id-a-2',
80 slice: 'slice-a-2'
81 }
82 ]
83 },
84 {
85 service: 'service-b',
Matteo Scandolo8420f622016-03-24 11:38:50 -070086 slices: [
Matteo Scandolo9db064f2016-02-08 14:17:42 -080087 {
88 project_id: 'id-b-1',
89 slice: 'slice-b-1'
90 },
91 {
92 project_id: 'id-b-2',
93 slice: 'slice-b-2'
94 }
95 ]
96 }
97 ]
98
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -080099 angular.module('xos.ceilometerDashboard')
100 .run(($httpBackend) => {
101 $httpBackend.whenGET(/metersamples/).respond(samples);
Matteo Scandolo9db064f2016-02-08 14:17:42 -0800102 $httpBackend.whenGET(/xos-slice-service-mapping/).respond(mapping);
Matteo Scandolo1b9ffac2015-12-14 17:36:09 -0800103 $httpBackend.whenGET(/meters/).respond(meters);
104 });
105})();