blob: 86ed3d830015bbb2bbb322fedb48b4a60f99bc66 [file] [log] [blame]
Matteo Scandolo48d890f2015-12-14 17:36:09 -08001'use strict';
2(function () {
3
4 const meters = [
Matteo Scandolo48d890f2015-12-14 17:36:09 -08005 {
Matteo Scandoloc0128562016-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 Scandolo48d890f2015-12-14 17:36:09 -080010 },
11 {
Matteo Scandoloc0128562016-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 Scandolo48d890f2015-12-14 17:36:09 -080016 },
17 {
Matteo Scandoloc0128562016-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 Scandolo48d890f2015-12-14 17:36:09 -080022 }
23 ];
24
25 const samples = [
26 {
27 meter: 'cpu',
28 resource_name: 'fakeName',
Matteo Scandolod9e1c412015-12-15 14:37:27 -080029 project_id: 'fakeTenant',
Matteo Scandolo48d890f2015-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 Scandolod9e1c412015-12-15 14:37:27 -080036 project_id: 'fakeTenant',
Matteo Scandolo48d890f2015-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 Scandolod9e1c412015-12-15 14:37:27 -080043 project_id: 'anotherTenant',
Matteo Scandolo48d890f2015-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 Scandolod9e1c412015-12-15 14:37:27 -080050 project_id: 'anotherTenant',
Matteo Scandolo48d890f2015-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 Scandolod9e1c412015-12-15 14:37:27 -080057 project_id: 'anotherTenant',
Matteo Scandolo48d890f2015-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 Scandolod9e1c412015-12-15 14:37:27 -080064 project_id: 'thirdTenant',
Matteo Scandolo48d890f2015-12-14 17:36:09 -080065 timestamp: '2015-12-15T00:44:08',
66 volume: 310
67 }
68 ];
69
Matteo Scandoloc0128562016-02-08 14:17:42 -080070 const mapping = [
71 {
72 service: 'service-a',
73 slice: [
74 {
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',
86 slice: [
87 {
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 Scandolo48d890f2015-12-14 17:36:09 -080099 angular.module('xos.ceilometerDashboard')
100 .run(($httpBackend) => {
101 $httpBackend.whenGET(/metersamples/).respond(samples);
Matteo Scandoloc0128562016-02-08 14:17:42 -0800102 $httpBackend.whenGET(/xos-slice-service-mapping/).respond(mapping);
Matteo Scandolo48d890f2015-12-14 17:36:09 -0800103 $httpBackend.whenGET(/meters/).respond(meters);
104 });
105})();