blob: af55c546ec2fa5d271a1f5ab96b346fe95bb3f68 [file] [log] [blame]
Matteo Scandolofb46ae62017-08-08 09:10:50 -07001
2/*
3 * Copyright 2017-present Open Networking Foundation
4
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
Matteo Scandolo7629cc42017-03-13 14:12:15 -070019interface Id3Element {
20 d3Class?: string;
21 d3Id?: string;
22}
23
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080024export interface IXosServiceModel {
25 id: number;
Matteo Scandolo75171782017-03-08 14:17:01 -080026 d3Id?: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080027 backend_status: string;
28 kind: string;
29 name: string;
Matteo Scandolo7629cc42017-03-13 14:12:15 -070030 class_names: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080031 service_specific_attributes: string; // this is json stringified
32}
33
Matteo Scandolo7629cc42017-03-13 14:12:15 -070034export interface IXosTenantModel extends Id3Element {
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080035 id: number;
Matteo Scandolo75171782017-03-08 14:17:01 -080036 d3Id?: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080037 backend_status: string;
38 kind: string;
39
40 // source
41 provider_service_id: number;
42
43 // destination
44 subscriber_service_id: number;
45 subscriber_tenant_id: number;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080046 subscriber_root_id: number;
47 subscriber_network_id: number;
48
Matteo Scandolo75171782017-03-08 14:17:01 -080049 subscriber_user_id: number;
50
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080051 // extra informations
52 service_specific_id: string;
53 service_specific_attribute: string;
54 connect_method: string;
55
56 // reverse of subscriber tenants
57 subscribed_tenants_ids: number[];
58}
59
Matteo Scandolo968e7f22017-03-03 11:49:18 -080060export interface IXosCoarseGraphData {
61 services: IXosServiceModel[];
Matteo Scandolo72181592017-07-25 14:49:40 -070062 servicedependencies: any[];
Matteo Scandolo968e7f22017-03-03 11:49:18 -080063}
64
Matteo Scandolo72181592017-07-25 14:49:40 -070065// TODO outdated, remove
Matteo Scandolo75171782017-03-08 14:17:01 -080066export interface IXosFineGrainedGraphData extends IXosCoarseGraphData {
Matteo Scandolod4878532017-03-20 17:39:55 -070067 tenants: IXosTenantModel[];
68 subscribers: any[];
69 networks: any[];
Matteo Scandolo75171782017-03-08 14:17:01 -080070}
71
Matteo Scandolo72181592017-07-25 14:49:40 -070072export interface IXosServiceInstanceGraphData {
73 serviceGraph: IXosServiceGraph;
74 serviceInstances: any[];
75 serviceInstanceLinks: any[];
76 networks: any[];
77}
78
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080079export interface IXosServiceGraphNodeBadge {
80 type: 'info'|'success'|'warning'|'danger';
81 text: string;
82}
83
Matteo Scandolo7629cc42017-03-13 14:12:15 -070084export interface IXosServiceGraphNode extends Id3Element {
Matteo Scandolo75171782017-03-08 14:17:01 -080085 id: number | string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080086 label: string;
Matteo Scandolo968e7f22017-03-03 11:49:18 -080087 x?: number;
88 y?: number;
89 px?: number;
90 py?: number;
Max Chu2bfddde2017-06-29 13:41:52 -070091 width?: number;
92 height?: number;
Matteo Scandolo7629cc42017-03-13 14:12:15 -070093 fixed?: boolean;
94 badge?: IXosServiceGraphNodeBadge; // TODO implement badges
Matteo Scandolo968e7f22017-03-03 11:49:18 -080095 model: IXosServiceModel;
Matteo Scandolo75171782017-03-08 14:17:01 -080096 type: 'service' | 'tenant' | 'network' | 'subscriber';
Matteo Scandoloa62adbc2017-03-02 15:37:34 -080097}
98
Matteo Scandolo7629cc42017-03-13 14:12:15 -070099export interface IXosServiceGraphLink extends Id3Element {
Matteo Scandolo0e8a8422017-03-25 14:55:40 -0700100 id: string;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -0800101 source: number;
102 target: number;
Matteo Scandolo968e7f22017-03-03 11:49:18 -0800103 model: IXosTenantModel;
Matteo Scandoloa62adbc2017-03-02 15:37:34 -0800104}
105
106export interface IXosServiceGraph {
107 nodes: IXosServiceGraphNode[];
108 links: IXosServiceGraphLink[];
109}