Khen Nursimulu | f8abbc9 | 2016-11-04 19:56:45 -0400 | [diff] [blame] | 1 | module xos-types { |
| 2 | namespace "urn:ietf:params:xml:ns:yang:xos-types"; |
| 3 | prefix xtype; |
| 4 | yang-version 1.1; |
| 5 | |
| 6 | import ietf-yang-types { prefix yang; } |
| 7 | import ietf-inet-types { prefix inet; } |
| 8 | |
| 9 | organization |
| 10 | "Open Networking Lab (CORD) / Corenova Technologies"; |
| 11 | |
| 12 | contact |
| 13 | "Larry Peterson <llp@onlab.us> |
| 14 | Peter K. Lee <peter@corenova.com>"; |
| 15 | |
| 16 | description |
| 17 | "This module contains a collection of common models and types for XOS. |
| 18 | |
| 19 | Copyright (c) 2016 ON.LAB and the persons identified as authors of |
| 20 | the code. All rights reserved. |
| 21 | |
| 22 | Redistribution and use in source and binary forms, with or without |
| 23 | modification, is permitted pursuant to, and subject to the license |
| 24 | terms of the Apache License, Version 2.0 which accompanies this |
| 25 | distribution, and is available at |
| 26 | (http://www.apache.org/licenses/LICENSE-2.0)."; |
| 27 | |
| 28 | revision 2016-09-12 { |
| 29 | description "Initial revision."; |
| 30 | } |
| 31 | |
| 32 | /* |
| 33 | * Typedefs |
| 34 | */ |
| 35 | typedef unique-identifier { |
| 36 | description "defines valid formats for external reference id"; |
| 37 | type union { |
| 38 | type uint32 { range 1..max; } |
| 39 | type yang:uuid; |
| 40 | type inet:uri; |
| 41 | } |
| 42 | } |
| 43 | typedef flow-identifier { |
| 44 | description "defines valid format for identifying a flow"; |
| 45 | type yang:uuid; |
| 46 | } |
| 47 | typedef network-identifier { |
| 48 | description "defines valid format for identifying a network"; |
| 49 | type yang:uuid; |
| 50 | } |
| 51 | typedef mac-address { |
| 52 | description "defines valid format for mac-address"; |
| 53 | type yang:mac-address; |
| 54 | } |
| 55 | typedef bandwidth { |
| 56 | type uint32 { |
| 57 | range 1000000..max; // should be at least 1 Mbps? |
| 58 | } |
| 59 | units 'bps'; |
| 60 | } |
| 61 | typedef vlan { |
| 62 | type uint16 { range 0..4095; } |
| 63 | } |
| 64 | typedef isolation { |
| 65 | type enumeration { |
| 66 | enum vm { description 'Virtual Machine'; } |
| 67 | enum lxc { description 'Container'; } |
| 68 | enum hybrid { description 'Container in Virtual Machine'; } |
| 69 | } |
| 70 | default 'vm'; |
| 71 | } |
| 72 | typedef access-role { |
| 73 | type enumeration { |
| 74 | enum admin; |
| 75 | enum staff; |
| 76 | enum user; |
| 77 | } |
| 78 | default 'user'; |
| 79 | } |
| 80 | typedef certificate { |
| 81 | description |
| 82 | "Captures a security certificate, should be improved for better validation"; |
| 83 | type string { |
| 84 | length 0..1024; |
| 85 | } |
| 86 | } |
| 87 | } |