blob: 4120bdb8878df270e763692834c77aa76fb4ea37 [file] [log] [blame]
Matteo Scandolo7629cc42017-03-13 14:12:15 -07001interface Id3Element {
2 d3Class?: string;
3 d3Id?: string;
4}
5
Matteo Scandoloa62adbc2017-03-02 15:37:34 -08006export interface IXosServiceModel {
7 id: number;
Matteo Scandolo75171782017-03-08 14:17:01 -08008 d3Id?: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -08009 backend_status: string;
10 kind: string;
11 name: string;
Matteo Scandolo7629cc42017-03-13 14:12:15 -070012 class_names: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080013 service_specific_attributes: string; // this is json stringified
14}
15
Matteo Scandolo7629cc42017-03-13 14:12:15 -070016export interface IXosTenantModel extends Id3Element {
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080017 id: number;
Matteo Scandolo75171782017-03-08 14:17:01 -080018 d3Id?: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080019 backend_status: string;
20 kind: string;
21
22 // source
23 provider_service_id: number;
24
25 // destination
26 subscriber_service_id: number;
27 subscriber_tenant_id: number;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080028 subscriber_root_id: number;
29 subscriber_network_id: number;
30
Matteo Scandolo75171782017-03-08 14:17:01 -080031 subscriber_user_id: number;
32
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080033 // extra informations
34 service_specific_id: string;
35 service_specific_attribute: string;
36 connect_method: string;
37
38 // reverse of subscriber tenants
39 subscribed_tenants_ids: number[];
40}
41
Matteo Scandolo968e7f22017-03-03 11:49:18 -080042export interface IXosCoarseGraphData {
43 services: IXosServiceModel[];
Matteo Scandolod4878532017-03-20 17:39:55 -070044 servicedependencys: any[];
Matteo Scandolo968e7f22017-03-03 11:49:18 -080045}
46
Matteo Scandolo75171782017-03-08 14:17:01 -080047export interface IXosFineGrainedGraphData extends IXosCoarseGraphData {
Matteo Scandolod4878532017-03-20 17:39:55 -070048 tenants: IXosTenantModel[];
49 subscribers: any[];
50 networks: any[];
Matteo Scandolo75171782017-03-08 14:17:01 -080051}
52
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080053export interface IXosServiceGraphNodeBadge {
54 type: 'info'|'success'|'warning'|'danger';
55 text: string;
56}
57
Matteo Scandolo7629cc42017-03-13 14:12:15 -070058export interface IXosServiceGraphNode extends Id3Element {
Matteo Scandolo75171782017-03-08 14:17:01 -080059 id: number | string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080060 label: string;
Matteo Scandolo968e7f22017-03-03 11:49:18 -080061 x?: number;
62 y?: number;
63 px?: number;
64 py?: number;
Max Chu2bfddde2017-06-29 13:41:52 -070065 width?: number;
66 height?: number;
Matteo Scandolo7629cc42017-03-13 14:12:15 -070067 fixed?: boolean;
68 badge?: IXosServiceGraphNodeBadge; // TODO implement badges
Matteo Scandolo968e7f22017-03-03 11:49:18 -080069 model: IXosServiceModel;
Matteo Scandolo75171782017-03-08 14:17:01 -080070 type: 'service' | 'tenant' | 'network' | 'subscriber';
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080071}
72
Matteo Scandolo7629cc42017-03-13 14:12:15 -070073export interface IXosServiceGraphLink extends Id3Element {
Matteo Scandolo0e8a8422017-03-25 14:55:40 -070074 id: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080075 source: number;
76 target: number;
Matteo Scandolo968e7f22017-03-03 11:49:18 -080077 model: IXosTenantModel;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080078}
79
80export interface IXosServiceGraph {
81 nodes: IXosServiceGraphNode[];
82 links: IXosServiceGraphLink[];
83}