blob: c7642bb839d1adacdf89c07e48ddcccad3632567 [file] [log] [blame]
Matteo Scandolo48d890f2015-12-14 17:36:09 -08001'use strict';
2(function () {
3
4 const meters = [
5 // service_1
6 // - slice_1
7 // - resource_1
8 // service_2
9 // - slice_2
10 // - resource_2
11 // - resource_3
12 // - slice_3
13 // - resource_4
14 {
15 service: 'service_1',
16 slice: 'slice_1',
17 resource_name: 'resource_1',
18 resource_id: 'resource_id_1',
19 name: 'instance_1',
20 unit: 'instance'
21 },
22 {
23 service: 'service_2',
24 slice: 'slice_2',
25 resource_name: 'resource_2',
26 resource_id: 'resource_id_2',
27 name: 'instance_2',
28 unit: 'instance'
29 },
30 {
31 service: 'service_2',
32 slice: 'slice_2',
33 resource_name: 'resource_3',
34 resource_id: 'resource_id_3',
35 name: 'instance_2',
36 unit: 'instance'
37 },
38 {
39 service: 'service_2',
40 slice: 'slice_3',
41 resource_name: 'resource_4',
42 resource_id: 'resource_id_4',
43 name: 'instance_3',
44 unit: 'instance'
45 }
46 ];
47
48 const samples = [
49 {
50 meter: 'cpu',
51 resource_name: 'fakeName',
Matteo Scandolod9e1c412015-12-15 14:37:27 -080052 project_id: 'fakeTenant',
Matteo Scandolo48d890f2015-12-14 17:36:09 -080053 timestamp: '2015-12-15T00:34:08',
54 volume: 110
55 },
56 {
57 meter: 'cpu',
58 resource_name: 'fakeName',
Matteo Scandolod9e1c412015-12-15 14:37:27 -080059 project_id: 'fakeTenant',
Matteo Scandolo48d890f2015-12-14 17:36:09 -080060 timestamp: '2015-12-15T00:44:08',
61 volume: 120
62 },
63 {
64 meter: 'cpu',
65 resource_name: 'anotherName',
Matteo Scandolod9e1c412015-12-15 14:37:27 -080066 project_id: 'anotherTenant',
Matteo Scandolo48d890f2015-12-14 17:36:09 -080067 timestamp: '2015-12-15T00:24:08',
68 volume: 210
69 },
70 {
71 meter: 'cpu',
72 resource_name: 'anotherName',
Matteo Scandolod9e1c412015-12-15 14:37:27 -080073 project_id: 'anotherTenant',
Matteo Scandolo48d890f2015-12-14 17:36:09 -080074 timestamp: '2015-12-15T00:34:08',
75 volume: 220
76 },
77 {
78 meter: 'cpu',
79 resource_name: 'anotherName',
Matteo Scandolod9e1c412015-12-15 14:37:27 -080080 project_id: 'anotherTenant',
Matteo Scandolo48d890f2015-12-14 17:36:09 -080081 timestamp: '2015-12-15T00:44:08',
82 volume: 230
83 },
84 {
85 meter: 'cpu',
86 resource_name: 'thirdName',
Matteo Scandolod9e1c412015-12-15 14:37:27 -080087 project_id: 'thirdTenant',
Matteo Scandolo48d890f2015-12-14 17:36:09 -080088 timestamp: '2015-12-15T00:44:08',
89 volume: 310
90 }
91 ];
92
93 angular.module('xos.ceilometerDashboard')
94 .run(($httpBackend) => {
95 $httpBackend.whenGET(/metersamples/).respond(samples);
96 $httpBackend.whenGET(/meters/).respond(meters);
97 });
98})();