Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 1 | module xos-core { |
Peter K. Lee | 5539580 | 2016-07-15 18:25:40 -0700 | [diff] [blame] | 2 | namespace "urn:onlab:xos:core"; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 3 | prefix xos; |
| 4 | yang-version 1.1; |
| 5 | |
| 6 | organization |
| 7 | "Open Networking Lab (XOS) / Corenova Technologies"; |
| 8 | |
| 9 | contact |
| 10 | "Larry Peterson <llp@onlab.us> |
| 11 | Peter K. Lee <peter@corenova.com>"; |
| 12 | |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 13 | description |
| 14 | "This module contains a collection of core models for XOS. |
| 15 | |
| 16 | Copyright (c) 2016 ON.LAB and the persons identified as authors of |
| 17 | the code. All rights reserved. |
| 18 | |
| 19 | Redistribution and use in source and binary forms, with or without |
| 20 | modification, is permitted pursuant to, and subject to the license |
| 21 | terms of the Apache License, Version 2.0 which accompanies this |
| 22 | distribution, and is available at |
| 23 | (http://www.apache.org/licenses/LICENSE-2.0)."; |
| 24 | |
| 25 | revision 2016-07-14 { |
| 26 | description "Initial revision."; |
| 27 | } |
| 28 | |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 29 | import ietf-yang-types { prefix yang; } |
Peter K. Lee | 5539580 | 2016-07-15 18:25:40 -0700 | [diff] [blame] | 30 | import ietf-inet-types { prefix inet; } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 31 | |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 32 | feature synchronizer { |
| 33 | description |
| 34 | "Enables configuration synchronization to the distributed store."; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | identity kind; |
| 38 | identity generic { base kind; } |
| 39 | identity subscriber { base kind; } |
| 40 | |
| 41 | typedef unique-identifier { |
| 42 | description "defines valid formats for external reference id"; |
| 43 | type union { |
Peter K. Lee | 4302f47 | 2016-07-28 03:51:39 -0700 | [diff] [blame] | 44 | type uint32 { range 1..max; } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 45 | type yang:uuid; |
| 46 | type inet:uri; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 47 | } |
| 48 | } |
| 49 | |
Peter K. Lee | cb2eb92 | 2016-09-01 18:02:31 -0700 | [diff] [blame^] | 50 | grouping service-attribute { |
| 51 | leaf name { type string { length 0..128; } } |
| 52 | leaf value { type string; } |
| 53 | // don't need pointer back to service |
| 54 | } |
| 55 | |
| 56 | grouping xos-base { |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 57 | leaf id { |
| 58 | type unique-identifier; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 59 | mandatory true; |
| 60 | } |
| 61 | leaf kind { |
| 62 | type identityref { |
| 63 | base kind; |
| 64 | } |
| 65 | default generic; |
| 66 | } |
| 67 | leaf name { |
| 68 | type string { |
| 69 | length 0..255; |
| 70 | } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 71 | } |
Peter K. Lee | cb2eb92 | 2016-09-01 18:02:31 -0700 | [diff] [blame^] | 72 | // NOTE: this used to be service-specific-attribute |
| 73 | //leaf service-specific-attribute { type string; } |
| 74 | list attribute { uses service-attribute; } |
| 75 | // TODO: service-specific-id should be one of the attributes above? |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 76 | leaf service-specific-id { |
| 77 | type unique-identifier; |
| 78 | mandatory true; |
| 79 | } |
Peter K. Lee | cb2eb92 | 2016-09-01 18:02:31 -0700 | [diff] [blame^] | 80 | } |
| 81 | |
| 82 | grouping tenant-root { |
| 83 | uses xos-base { |
| 84 | refine 'name' { |
| 85 | description "Specify name of the TenantRoot"; |
| 86 | } |
| 87 | } |
| 88 | description |
| 89 | "A Tenant Root is one of the things that can sit at the root of a chain |
| 90 | of tenancy. This object represents a node."; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 91 | |
Peter K. Lee | af777da | 2016-08-17 04:33:00 -0700 | [diff] [blame] | 92 | list subscribed-tenant { |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 93 | config false; |
| 94 | // not exactly clear how this is populated |
| 95 | } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | grouping subscriber { |
| 99 | uses tenant-root { |
| 100 | refine kind { default subscriber; } |
| 101 | } |
| 102 | // seems we should have interesting attributes specific to subscriber? |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 103 | } |
Peter K. Lee | cb2eb92 | 2016-09-01 18:02:31 -0700 | [diff] [blame^] | 104 | |
| 105 | grouping provider { |
| 106 | uses tenant-root { |
| 107 | refine kind { default provider; } |
| 108 | } |
| 109 | // seems we should have interesting attributes specific to provider? |
| 110 | } |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 111 | |
Peter K. Lee | cb2eb92 | 2016-09-01 18:02:31 -0700 | [diff] [blame^] | 112 | grouping service { |
| 113 | uses xos-base { |
| 114 | refine 'name' { |
| 115 | description "Name of the Service"; |
| 116 | } |
| 117 | } |
| 118 | leaf description { |
| 119 | type string { |
| 120 | length 0..254; |
| 121 | } |
| 122 | description "Description of the Service"; |
| 123 | } |
| 124 | leaf version { |
| 125 | type string { length 0..30; } |
| 126 | description "Version of Service Definition"; |
| 127 | } |
| 128 | |
| 129 | leaf enabled { type boolean; default true; } |
| 130 | leaf published { type boolean; default true; } |
| 131 | |
| 132 | container external-assets { |
| 133 | leaf view { type inet:uri; } |
| 134 | leaf icon { type inet:uri; } |
| 135 | } |
| 136 | |
| 137 | list keypair { |
| 138 | description "collection of public/private key pair(s)"; |
| 139 | leaf public { type string { length 0..1024; } } |
| 140 | leaf private { type string { length 0..1024; } } |
| 141 | } |
| 142 | |
| 143 | // TOOD: need to better understand relationship between Service and Slice |
| 144 | action scale { |
| 145 | description "Adjust scale for slice(s)"; |
| 146 | } |
| 147 | |
| 148 | // TODO: need to better understand relationship between Service and VTN |
| 149 | } |
| 150 | |
| 151 | grouping tenancy { |
| 152 | uses xos-base; |
| 153 | |
| 154 | choice provider { |
| 155 | description "only one type of provider node is valid."; |
| 156 | case service { leaf provider-service { type instance-identifier; } } |
| 157 | } |
| 158 | |
| 159 | choice subscriber { |
| 160 | description "only one type of subscriber node is valid."; |
| 161 | case service { leaf subscriber-service { type instance-identifier; } } |
| 162 | case tenant { leaf subscriber-tenant { type instance-identifier; } } |
| 163 | case user { leaf subscriber-user { type instance-identifier; } } |
| 164 | case root { leaf subscriber-root { type instance-identifier; } } |
| 165 | case network { leaf subscriber-network { type instance-identifier; } } |
| 166 | } |
| 167 | |
| 168 | leaf connect-method { |
| 169 | //when "../kind == 'static-tenant'"; |
| 170 | |
| 171 | type enumeration { |
| 172 | enum public { description "Public"; } |
| 173 | enum private { description "Private"; } |
| 174 | enum private-unidirectional { description "Private Uni-directional"; } |
| 175 | enum na { description "Not Applicable"; } |
| 176 | } |
| 177 | default na; |
| 178 | } |
| 179 | |
| 180 | // TODO: should be able to deal with TenantWithContainer here |
| 181 | |
| 182 | } |
| 183 | |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 184 | /*** main configuration tree for XOS ***/ |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 185 | |
| 186 | container api { |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 187 | description |
| 188 | "The primary configuration interaction endpoint"; |
| 189 | |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 190 | container service { |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 191 | description |
| 192 | "placeholder endpoint for services to augment"; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 193 | } |
| 194 | container tenant { |
Peter K. Lee | f4d38d3 | 2016-07-23 02:47:38 -0700 | [diff] [blame] | 195 | description |
| 196 | "placeholder endpoint for tenants to augment"; |
Peter K. Lee | 2bade4d | 2016-07-14 16:19:56 -0700 | [diff] [blame] | 197 | } |
| 198 | } |
| 199 | |
| 200 | } |