Khen Nursimulu | f8abbc9 | 2016-11-04 19:56:45 -0400 | [diff] [blame] | 1 | module xos-slice { |
| 2 | namespace "urn:ietf:params:xml:ns:yang:xos-slice"; |
| 3 | prefix xslice; |
| 4 | yang-version 1.1; |
| 5 | |
| 6 | import ietf-yang-types { prefix yang; } |
| 7 | import ietf-inet-types { prefix inet; } |
| 8 | import xos-controller { prefix xos; } |
| 9 | import xos-types { prefix xtype; } |
| 10 | import opnfv-infrastructure { prefix nfvi; } |
| 11 | |
| 12 | organization |
| 13 | "Open Networking Lab (XOS) / Corenova Technologies, Inc."; |
| 14 | |
| 15 | contact |
| 16 | "Larry Peterson <llp@onlab.us> |
| 17 | Peter K. Lee <peter@corenova.com>"; |
| 18 | |
| 19 | description |
| 20 | "This module contains a collection of Slice and related models for XOS. |
| 21 | |
| 22 | Copyright (c) 2016 ON.LAB and the persons identified as authors of |
| 23 | the code. All rights reserved. |
| 24 | |
| 25 | Redistribution and use in source and binary forms, with or without |
| 26 | modification, is permitted pursuant to, and subject to the license |
| 27 | terms of the Apache License, Version 2.0 which accompanies this |
| 28 | distribution, and is available at |
| 29 | (http://www.apache.org/licenses/LICENSE-2.0)."; |
| 30 | |
| 31 | revision 2016-09-13 { |
| 32 | description "Initial revision."; |
| 33 | } |
| 34 | |
| 35 | grouping slice { |
| 36 | description |
| 37 | "A slice is a logically centralized container for network and compute resources"; |
| 38 | |
| 39 | uses xos:provider { |
| 40 | refine "name" { description "Name of the slice"; } |
| 41 | } |
| 42 | leaf slice-url { |
| 43 | description "A URL describing the purpose of this slice"; |
| 44 | type inet:uri; |
| 45 | // blank true; |
| 46 | } |
| 47 | leaf-list instances { |
| 48 | type leafref { |
| 49 | path "/nfvi:controller/compute/server/id"; |
| 50 | } |
| 51 | } |
| 52 | leaf-list networks { |
| 53 | type leafref { |
| 54 | path "/nfvi:controller/fabric/network/id"; |
| 55 | } |
| 56 | } |
| 57 | container policy { |
| 58 | leaf max-instances { |
| 59 | description "The maximum number of VMs that this slice is allowed to allocate"; |
| 60 | type uint16; |
| 61 | } |
| 62 | leaf default-flavor { |
| 63 | type leafref { |
| 64 | path "/nfvi:controller/compute/flavor/id"; |
| 65 | } |
| 66 | } |
| 67 | leaf default-image { |
| 68 | type leafref { |
| 69 | path "/nfvi:controller/compute/image/id"; |
| 70 | } |
| 71 | } |
| 72 | leaf default-node { |
| 73 | type leafref { |
| 74 | path "/nfvi:controller/compute/host/id"; |
| 75 | } |
| 76 | } |
| 77 | leaf mount-data-sets { |
| 78 | type string { |
| 79 | length 0..256; |
| 80 | } |
| 81 | default "GenBank"; |
| 82 | } |
| 83 | leaf default-isolation { |
| 84 | type xtype:isolation; |
| 85 | } |
| 86 | } |
| 87 | leaf network { |
| 88 | description |
| 89 | "The network that the slice uses to connect to other slices and to the Internet."; |
| 90 | type enumeration { |
| 91 | enum none; |
| 92 | enum host; |
| 93 | enum bridged; |
| 94 | enum noauto; |
| 95 | } |
| 96 | default none; |
| 97 | } |
| 98 | leaf-list ports { |
| 99 | description |
| 100 | "The ports to be exposed for other slices to connect to"; |
| 101 | type uint16; |
| 102 | } |
| 103 | leaf creator { |
| 104 | type leafref { |
| 105 | path "/xos:core/user/id"; |
| 106 | } |
| 107 | } |
| 108 | leaf-list tags { |
| 109 | type string; |
| 110 | } |
| 111 | // below are deprecated and should not be used |
| 112 | leaf service { |
| 113 | description "The service that runs in this slice"; |
| 114 | status deprecated; |
| 115 | } |
| 116 | // TOOD: need to better understand relationship between Service and Slice |
| 117 | action scale { |
| 118 | description "Adjust scale for slice(s)"; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | /* |
| 123 | * Augmentations to XOS core and NFVI modules |
| 124 | */ |
| 125 | augment "/xos:core" { |
| 126 | list slice { |
| 127 | key id; |
| 128 | uses xslice:slice; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | augment "/nfvi:controller/nfvi:compute/nfvi:server" { |
| 133 | leaf slice { |
| 134 | // do we need this circular reference? |
| 135 | } |
| 136 | leaf deployment { |
| 137 | type leafref { |
| 138 | path "/xos:core/deployment/id"; |
| 139 | } |
| 140 | } |
| 141 | leaf isolation { |
| 142 | type xtype:isolation; |
| 143 | } |
| 144 | leaf-list volumes { |
| 145 | type string; // should be leafref |
| 146 | } |
| 147 | // leaf parent { |
| 148 | // type xtype:parent; |
| 149 | // } |
| 150 | container synchronizer { |
| 151 | if-feature synchronizer; |
| 152 | leaf instance-id { |
| 153 | type string; |
| 154 | } |
| 155 | leaf instance-uuid { |
| 156 | type string; |
| 157 | } |
| 158 | leaf instance-name { |
| 159 | type string; |
| 160 | } |
| 161 | leaf ip { |
| 162 | type inet:ip-address; |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | augment "/nfvi:controller/nfvi:compute/nfvi:image" { |
| 167 | leaf template { |
| 168 | type leafref { |
| 169 | path "/xos:core/template/id"; |
| 170 | } |
| 171 | } |
| 172 | leaf-list deployments { |
| 173 | type leafref { |
| 174 | path "/xos:core/deployment/id"; |
| 175 | } |
| 176 | } |
| 177 | container synchronizer { |
| 178 | if-feature xos:synchronizer; |
| 179 | leaf glance-image-id { |
| 180 | type string; |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | augment "/nfvi:controller/nfvi:fabric/nfvi:network" { |
| 185 | leaf autoconnect { |
| 186 | type boolean; |
| 187 | default true; |
| 188 | } |
| 189 | leaf-list labels { |
| 190 | type string; |
| 191 | } |
| 192 | container policy { |
| 193 | leaf guaranteed-bandwidth { |
| 194 | type uint32; |
| 195 | } |
| 196 | leaf permit-all-slices { |
| 197 | type boolean; |
| 198 | default true; |
| 199 | } |
| 200 | container parameters { |
| 201 | list topology { |
| 202 | key name; |
| 203 | uses xos:parameter; |
| 204 | } |
| 205 | list controller { |
| 206 | key name; |
| 207 | uses xos:parameter; |
| 208 | } |
| 209 | list network { |
| 210 | key name; |
| 211 | uses xos:parameter; |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | container synchronizer { |
| 216 | if-feature synchronizer; |
| 217 | leaf network-id { |
| 218 | type string; |
| 219 | } |
| 220 | leaf router-id { |
| 221 | type string; |
| 222 | } |
| 223 | leaf subnet-id { |
| 224 | type string; |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | augment "/nfvi:controller/nfvi:fabric/nfvi:network/nfvi:subnet/nfvi:port" { |
| 229 | leaf instance { |
| 230 | type instance-identifier; |
| 231 | } |
| 232 | leaf xos-created { |
| 233 | type boolean; |
| 234 | status deprecated; |
| 235 | } |
| 236 | container synchronizer { |
| 237 | if-feature xos:synchronizer; |
| 238 | leaf ip { |
| 239 | type inet:ip-address; |
| 240 | } |
| 241 | leaf port-id { |
| 242 | type yang:uuid; |
| 243 | } |
| 244 | leaf mac { |
| 245 | type yang:mac-address; |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | augment "/nfvi:controller/nfvi:fabric/nfvi:network/nfvi:subnet/nfvi:dhcp/nfvi:pool" { |
| 250 | leaf gateway-ip { |
| 251 | type inet:ip-address; |
| 252 | } |
| 253 | leaf gateway-mac { |
| 254 | type yang:mac-address; |
| 255 | } |
| 256 | leaf cidr { |
| 257 | type string; |
| 258 | } |
| 259 | leaf inuse { |
| 260 | type boolean; |
| 261 | } |
| 262 | } |
| 263 | } |