blob: e08bc78644a2129b7714c35713e32a71428b5fbc [file] [log] [blame]
Matteo Scandoloa62adbc2017-03-02 15:37:34 -08001export interface IXosServiceModel {
2 id: number;
Matteo Scandolo75171782017-03-08 14:17:01 -08003 d3Id?: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -08004 backend_status: string;
5 kind: string;
6 name: string;
7 service_specific_attributes: string; // this is json stringified
8}
9
10export interface IXosTenantModel {
11 id: number;
Matteo Scandolo75171782017-03-08 14:17:01 -080012 d3Id?: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080013 backend_status: string;
14 kind: string;
15
16 // source
17 provider_service_id: number;
18
19 // destination
20 subscriber_service_id: number;
21 subscriber_tenant_id: number;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080022 subscriber_root_id: number;
23 subscriber_network_id: number;
24
Matteo Scandolo75171782017-03-08 14:17:01 -080025 subscriber_user_id: number;
26
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080027 // extra informations
28 service_specific_id: string;
29 service_specific_attribute: string;
30 connect_method: string;
31
32 // reverse of subscriber tenants
33 subscribed_tenants_ids: number[];
34}
35
Matteo Scandolo968e7f22017-03-03 11:49:18 -080036export interface IXosCoarseGraphData {
37 services: IXosServiceModel[];
38 tenants: IXosTenantModel[];
39}
40
Matteo Scandolo75171782017-03-08 14:17:01 -080041export interface IXosFineGrainedGraphData extends IXosCoarseGraphData {
42 subscribers: IXosServiceModel[];
43 networks: IXosTenantModel[];
44}
45
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080046export interface IXosServiceGraphNodeBadge {
47 type: 'info'|'success'|'warning'|'danger';
48 text: string;
49}
50
51export interface IXosServiceGraphNode {
Matteo Scandolo75171782017-03-08 14:17:01 -080052 id: number | string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080053 label: string;
Matteo Scandolo968e7f22017-03-03 11:49:18 -080054 x?: number;
55 y?: number;
56 px?: number;
57 py?: number;
58 badge?: IXosServiceGraphNodeBadge;
59 model: IXosServiceModel;
Matteo Scandolo75171782017-03-08 14:17:01 -080060 type: 'service' | 'tenant' | 'network' | 'subscriber';
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080061}
62
63export interface IXosServiceGraphLink {
Matteo Scandolo75171782017-03-08 14:17:01 -080064 id: number | string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080065 source: number;
66 target: number;
Matteo Scandolo968e7f22017-03-03 11:49:18 -080067 model: IXosTenantModel;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080068}
69
70export interface IXosServiceGraph {
71 nodes: IXosServiceGraphNode[];
72 links: IXosServiceGraphLink[];
73}