blob: 3c1894b510b057e4e3edfb51021b9cba93988f56 [file] [log] [blame]
Sean Condon0c577f62018-11-18 22:40:05 +00001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the 'License');
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an 'AS IS' BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/**
17 * Enum of the topo2CurrentRegion node type from SubRegion below
18 */
19import {LocationType} from '../../backgroundsvg/backgroundsvg.component';
20import {Device, Host, SubRegion} from './node';
21import {RegionLink} from './link';
22
23export enum NodeType {
24 REGION = 'region',
25 DEVICE = 'device',
26 HOST = 'host',
27}
28
29/**
30 * Enum of the topo2CurrentRegion layerOrder from Region below
31 */
32export enum LayerType {
33 LAYER_OPTICAL = 'opt',
34 LAYER_PACKET = 'pkt',
35 LAYER_DEFAULT = 'def'
36}
37
38/**
39 * model of the topo2CurrentRegion location from SubRegion below
40 */
41export interface Location {
42 locType: LocationType;
43 latOrY: number;
44 longOrX: number;
45}
46
47/**
48 * model of the topo2CurrentRegion props from SubRegion below
49 */
50export interface RegionProps {
51 latitude: number;
52 longitude: number;
53 name: string;
54 peerLocations: string;
55}
56
57/**
58 * model of the topo2CurrentRegion WebSocket response
59 *
60 * The Devices are in a 2D array - 1st order is layer type, 2nd order is
61 * devices in that layer
62 */
63export interface Region {
64 note?: string;
65 id: string;
66 devices: Device[][];
67 hosts: Host[][];
68 links: RegionLink[];
69 layerOrder: LayerType[];
70 peerLocations?: Location[];
71 subregions: SubRegion[];
72}
73
74/**
75 * model of the topo2PeerRegions WebSocket response
76 */
77export interface Peer {
78 peers: SubRegion[];
79}
80