Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 1 | import { |
| 2 | Level1Model, Level1ModelProperties, |
| 3 | Level1ModelResponseInterface |
| 4 | } from "./nodeModel"; |
| 5 | import {VfcInstanceGroupMap} from "./vfcInstanceGroupMap"; |
| 6 | |
| 7 | |
| 8 | export interface NetworkProperties extends Level1ModelProperties{ |
| 9 | ecomp_generated_naming: string; |
| 10 | network_role: string; |
| 11 | } |
| 12 | |
| 13 | export interface NetworkModelResponseInterface extends Level1ModelResponseInterface{ |
| 14 | properties: NetworkProperties; |
| 15 | } |
| 16 | |
| 17 | export class NetworkModel extends Level1Model{ |
| 18 | |
| 19 | roles: string[] = []; |
| 20 | properties: NetworkProperties; |
| 21 | |
| 22 | constructor(networkJson?: NetworkModelResponseInterface){ |
| 23 | super(networkJson); |
| 24 | if(networkJson && networkJson.properties){ |
| 25 | this.properties = networkJson.properties; |
| 26 | // expecting network_role to be a comma-saparated list |
| 27 | this.roles = networkJson.properties.network_role ? networkJson.properties.network_role.split(',') : []; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | |
| 32 | } |