Matteo Scandolo | fb46ae6 | 2017-08-08 09:10:50 -0700 | [diff] [blame] | 1 | |
| 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 Scandolo | 7629cc4 | 2017-03-13 14:12:15 -0700 | [diff] [blame] | 19 | interface Id3Element { |
| 20 | d3Class?: string; |
| 21 | d3Id?: string; |
| 22 | } |
| 23 | |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 24 | export interface IXosServiceModel { |
| 25 | id: number; |
Matteo Scandolo | 7517178 | 2017-03-08 14:17:01 -0800 | [diff] [blame] | 26 | d3Id?: string; |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 27 | backend_status: string; |
| 28 | kind: string; |
| 29 | name: string; |
Matteo Scandolo | 7629cc4 | 2017-03-13 14:12:15 -0700 | [diff] [blame] | 30 | class_names: string; |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 31 | service_specific_attributes: string; // this is json stringified |
| 32 | } |
| 33 | |
Matteo Scandolo | 7629cc4 | 2017-03-13 14:12:15 -0700 | [diff] [blame] | 34 | export interface IXosTenantModel extends Id3Element { |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 35 | id: number; |
Matteo Scandolo | 7517178 | 2017-03-08 14:17:01 -0800 | [diff] [blame] | 36 | d3Id?: string; |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 37 | 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 Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 46 | subscriber_root_id: number; |
| 47 | subscriber_network_id: number; |
| 48 | |
Matteo Scandolo | 7517178 | 2017-03-08 14:17:01 -0800 | [diff] [blame] | 49 | subscriber_user_id: number; |
| 50 | |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 51 | // 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 Scandolo | 968e7f2 | 2017-03-03 11:49:18 -0800 | [diff] [blame] | 60 | export interface IXosCoarseGraphData { |
| 61 | services: IXosServiceModel[]; |
Matteo Scandolo | 7218159 | 2017-07-25 14:49:40 -0700 | [diff] [blame] | 62 | servicedependencies: any[]; |
Matteo Scandolo | 968e7f2 | 2017-03-03 11:49:18 -0800 | [diff] [blame] | 63 | } |
| 64 | |
Matteo Scandolo | 7218159 | 2017-07-25 14:49:40 -0700 | [diff] [blame] | 65 | // TODO outdated, remove |
Matteo Scandolo | 7517178 | 2017-03-08 14:17:01 -0800 | [diff] [blame] | 66 | export interface IXosFineGrainedGraphData extends IXosCoarseGraphData { |
Matteo Scandolo | d487853 | 2017-03-20 17:39:55 -0700 | [diff] [blame] | 67 | tenants: IXosTenantModel[]; |
| 68 | subscribers: any[]; |
| 69 | networks: any[]; |
Matteo Scandolo | 7517178 | 2017-03-08 14:17:01 -0800 | [diff] [blame] | 70 | } |
| 71 | |
Matteo Scandolo | 7218159 | 2017-07-25 14:49:40 -0700 | [diff] [blame] | 72 | export interface IXosServiceInstanceGraphData { |
| 73 | serviceGraph: IXosServiceGraph; |
| 74 | serviceInstances: any[]; |
| 75 | serviceInstanceLinks: any[]; |
| 76 | networks: any[]; |
| 77 | } |
| 78 | |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 79 | export interface IXosServiceGraphNodeBadge { |
| 80 | type: 'info'|'success'|'warning'|'danger'; |
| 81 | text: string; |
| 82 | } |
| 83 | |
Matteo Scandolo | 7629cc4 | 2017-03-13 14:12:15 -0700 | [diff] [blame] | 84 | export interface IXosServiceGraphNode extends Id3Element { |
Matteo Scandolo | 7517178 | 2017-03-08 14:17:01 -0800 | [diff] [blame] | 85 | id: number | string; |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 86 | label: string; |
Matteo Scandolo | 968e7f2 | 2017-03-03 11:49:18 -0800 | [diff] [blame] | 87 | x?: number; |
| 88 | y?: number; |
| 89 | px?: number; |
| 90 | py?: number; |
Max Chu | 2bfddde | 2017-06-29 13:41:52 -0700 | [diff] [blame] | 91 | width?: number; |
| 92 | height?: number; |
Matteo Scandolo | 7629cc4 | 2017-03-13 14:12:15 -0700 | [diff] [blame] | 93 | fixed?: boolean; |
| 94 | badge?: IXosServiceGraphNodeBadge; // TODO implement badges |
Matteo Scandolo | 968e7f2 | 2017-03-03 11:49:18 -0800 | [diff] [blame] | 95 | model: IXosServiceModel; |
Matteo Scandolo | 7517178 | 2017-03-08 14:17:01 -0800 | [diff] [blame] | 96 | type: 'service' | 'tenant' | 'network' | 'subscriber'; |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 97 | } |
| 98 | |
Matteo Scandolo | 7629cc4 | 2017-03-13 14:12:15 -0700 | [diff] [blame] | 99 | export interface IXosServiceGraphLink extends Id3Element { |
Matteo Scandolo | 0e8a842 | 2017-03-25 14:55:40 -0700 | [diff] [blame] | 100 | id: string; |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 101 | source: number; |
| 102 | target: number; |
Matteo Scandolo | 968e7f2 | 2017-03-03 11:49:18 -0800 | [diff] [blame] | 103 | model: IXosTenantModel; |
Matteo Scandolo | a62adbc | 2017-03-02 15:37:34 -0800 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | export interface IXosServiceGraph { |
| 107 | nodes: IXosServiceGraphNode[]; |
| 108 | links: IXosServiceGraphLink[]; |
| 109 | } |