Skip to content
etsi-nfv-ns.yang 14.8 KiB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
submodule etsi-nfv-ns {
  belongs-to etsi-nfv {
    prefix nfv;
  }

  include etsi-nfv-common;

  description
    "Models for NS according to ETSI GS NFV-IFA 014.";

  revision 2017-01-20 {
    description
      "Initial revision
       Common data structure to support NSD
       according to:
       ETSI GS NFV-IFA 014 V2.1.1 (2016-10)";

    reference "ETSI GS NFV-IFA 014 V2.1.1 (2016-10)";
  }

  grouping security-parameters {
    container security {
      leaf signature {
        type string;
      }
      leaf algorithm {
        type string;
      }
      leaf certificate {
        type string;
      }
    }
  }

  grouping resource-handle {
    leaf vim-id {
      type string;
    }
    leaf resrouce-provider-id {
      type string;
    }
    leaf resource-id {
      type string;
    }
  }

  grouping nsd {
    list nsd {
      key "id";
      leaf id {
        type string;
        description
          "Uniquely identifies an network service descriptor";
      }
      leaf designer {
        type string;
        description
          "Identifies the designer of the network service descriptor";
      }
      leaf version {
        type string;
        description
          "Identifies the version of the network service descriptor";
      }
      leaf name {
        type string;
        description
          "Provides the human readable name of the network service. descriptor";
      }
      leaf invariant-id {
        description
          "Identifies an network service descriptor in a version
          independent manner. This attribute is invariant across
          versions of the network service descriptor.";
        type string;
      }

      leaf-list nested-nsd {
        type leafref {
          path "../../nfv:nsd/nfv:id";
        }
        must ". != ../nfv:id";
      }

      list vnfd {
        key "vnfd";
        min-elements 1;
        description
          "This lists the VNFDs this network service
           descriptor consists of.";
        leaf vnfd {
          type leafref {
            path "/nfv/nfv:vnfd/nfv:id";
          }
        }
      }
      leaf-list pnfd {
        type string;
      }
      list service-access-point-descriptor {
        key "id";
        min-elements 1;
        description
          "A service access point serves as the network
           service's external connection point";
        leaf id {
          type string;
        }

        leaf address-assignment {
          description
            "Specify whether the SAP address
             assignment is under the responsibility of
             management and orchestration functions
             or not. If it is set to True, management and
             orchestration functions are responsible for
             assigning addresses to the access points
             instantiated from this SAPD";
          type empty;
        }
        leaf description {
          type string;
        }
        leaf layer-protocol {
          type identityref {
            base layer-protocol;
          }
        }
        leaf role {
          type cp-role;
        }
        leaf virtual-link-desc {
          type leafref {
            path "../../nfv:virtual-link-desc/nfv:id";
          }
          description
            "Can optionally connect this service-access-point to an virtual-link. If not set,
             it's assumed a VNFD's connection-points references this
             service-access-point.";
        }
        /*
          associatedCpdId:
          Deliberatly not according to standard, see
          vnf-profile -> sapd-connectivity
        */
      }
      list virtual-link-desc {
        key "id";
        description
          "The virtual-link-desc information element provides general information
           enabling the instantiation of virtual links.";
        leaf id {
          type string;
        }
        leaf provider {
          description
            "Defines the organization generating the VLD.  ";
          type string;
        }
        leaf version {
          mandatory true;
          type string;
        }
        uses connectivity-type;

        list deployment-flavor {
          key "id";
          leaf id {
            type string;
          }

          container qos {
            leaf latency {
              mandatory true;
              description
                "Specifies the maximum latency in ms.";
              type uint32;
              units "ms";
            }

            leaf packet-delay-variation {
              mandatory true;
              description
                "Specifies the maximum jitter in ms.";
              type uint32;
              units "ms";
            }

            leaf packet-loss-ratio {
              description
                "Specifies the maximum packet loss ratio.";
              type decimal64 {
                fraction-digits "2";
                range "0..1.00";
              }
            }
            leaf priority {
              description
                "Specifies the priority level in case of
                 congestion on the underlying physical links.";
              type uint32;
            }
          }
          leaf service-availability-level {
            reference "ETSI GS NFV-REL 001 [i.5]";
            type enumeration {
              enum "level-1";
              enum "level-2";
              enum "level-3";
            }
          }
        }

        leaf test-access {
          type enumeration {
            enum none;
            enum passive-monitoring;
            enum active;
          }
        }

        leaf description {
          type string;
        }
        uses security-parameters;
      }
      // vnffgd skipped since not fully specified by the spec
      list monitored-info {
        key "id";
        leaf id {
          type string;
        }

        choice source {
          // We have no way of refererencing a VNF MP today
          container ns-monitoring-parameter {
            uses monitoring-parameter;
          }
          container vnf-indicator {
            leaf vnfd {
              type leafref {
                path "/nfv:nfv/nfv:vnfd/nfv:id";
              }
            }
            leaf indicator {
              type leafref {
                path "deref(../nfv:vnfd)/../nfv:indicator/nfv:id";
              }
            }
          }
        }
      }
      leaf-list autoscale-rule {
        type string;
      }
      list lifecycle-management-script {
        key "event";
        leaf event {
          type string;
        }
        leaf script {
          type string;
        }
      }
      list deployment-flavor {
        min-elements 1;
        must "nfv:default-instantiation-level or count(nfv:instantiation-level) = 1";
        key "id";
        description
          "The NsDf information element specifies the properties of a variant of an NS.";

        leaf id {
          type string;
        }

        leaf flavor-key {
          type leafref {
            path "../../nfv:monitored-info/nfv:id";
          }
        }

        list vnf-profile {
          must "nfv:min-number-of-instances<=nfv:max-number-of-instances";
          must "count(../../nfv:vnfd[vnfd=current()/nfv:vnfd])=1" {
            error-message "VNFDs in the profile has to be listed as a dependency of the network service descriptor.";
          }
          key "id";

          leaf id {
            type string;
          }

          leaf vnfd {
            mandatory true;
            type leafref {
              path "/nfv:nfv/nfv:vnfd/nfv:id";
            }
          }

          leaf flavor {
            mandatory true;
            type leafref {
              path "deref(../nfv:vnfd)/../nfv:deployment-flavor/nfv:id";
            }
          }

          leaf instantiation-level {
            mandatory true;
            type leafref {
              path "deref(../nfv:flavor)/../nfv:instantiation-level/nfv:id";
            }
          }

          leaf min-number-of-instances {
            type uint16;
            mandatory true;
          }
          leaf max-number-of-instances {
            type uint16;
            mandatory true;
          }

          uses local-affinity-or-anti-affinity-rule;
          list affinity-or-anti-affinity-group {
            key "id";

            leaf id {
              type leafref {
                path "../../../nfv:affinity-or-anti-affinity-group/nfv:id";
              }
            }
          }

          list virtual-link-connectivity {
            key "virtual-link-profile cp";

            leaf virtual-link-profile {
              type leafref {
                path "../../../nfv:virtual-link-profile/nfv:virtual-link-desc";
              }
            }

            leaf cp {
              type leafref {
                path "deref(../../nfv:vnfd)/../nfv:ext-cpd/nfv:id";
              }
            }
          }

          // Not according to standard
          list sapd-connectivity {
            key "sapd cp";

            leaf sapd {
              type leafref {
                path "../../../../nfv:service-access-point-descriptor/nfv:id";
              }
            }

            leaf cp {
              type leafref {
                path "deref(../../nfv:vnfd)/../nfv:ext-cpd/nfv:id";
              }
            }
          }
        }

        list pnf-profile {
          key "pnfd";
          leaf pnfd {
            type leafref {
              path "../../../nfv:pnfd";
            }
          }
          // no virtual-link-connectivity as we don't have PNFD modelled.
        }

        list virtual-link-profile {
          key "virtual-link-desc";
          leaf virtual-link-desc {
            mandatory true;
            type leafref {
              path "../../../nfv:virtual-link-desc/nfv:id";
            }
          }

          leaf flavor {
            mandatory true;
            type leafref {
              path "deref(../nfv:virtual-link-desc)/../nfv:deployment-flavor/nfv:id";
            }
          }

          uses local-affinity-or-anti-affinity-rule;
          list affinity-or-anti-affinity-group {
            key "id";

            leaf id {
              type leafref {
                path "../../../nfv:affinity-or-anti-affinity-group/nfv:id";
              }
            }
          }

          container max-bitrate-requirements {
            uses link-bitrate-requirements;
          }
          container min-bitrate-requirements {
            uses link-bitrate-requirements;
          }
        }

        list scaling-aspect {
          key "aspect";
          leaf aspect {
            type string;
          }
          leaf name {
            type string;
          }
          leaf description {
            type string;
          }
          leaf scaling-level {
            type leafref {
              path "../../nfv:instantiation-level/nfv:id";
            }
          }
        }

        list affinity-or-anti-affinity-group {
          key "id";

          leaf id {
            type string;
          }

          leaf affinity-type {
            mandatory true;
            type affinity-type;
          }

          leaf affinity-scope {
            mandatory true;
            type affinity-scope;
          }
        }

        list instantiation-level {
          min-elements 1;
          key "id";
          leaf id {
            type string;
          }

          leaf description {
            mandatory true;
            type string;
          }

          list vnf-to-level-mapping {
            key "vnf-profile";

            leaf vnf-profile {
              type leafref {
                path "../../../nfv:vnf-profile/nfv:id";
              }
            }

            leaf number-of-instances {
              mandatory true;
              type uint32;
            }
          }

          list vl-to-level-mapping {
            key "virtual-link-profile";

            leaf virtual-link-profile {
              type leafref {
                path "../../../nfv:virtual-link-profile/nfv:virtual-link-desc";
              }
            }

            uses link-bitrate-requirements;
          }

          must "(count(nfv:vnf-to-level-mapping) + count(nfv:vl-to-level-mapping)) > 0";

          list ns-to-level-mapping {
            key "ns-profile";
            leaf ns-profile {
              type leafref {
                path "../../../nfv:ns-profile/nfv:nsd";
              }
            }

            leaf number-of-instances {
              mandatory true;
              type uint32;
            }
          }
        }

        leaf default-instantiation-level {
          type leafref {
            path "../nfv:instantiation-level/nfv:id";
          }
        }

        list ns-profile {
          must "nfv:min-number-of-instances<=nfv:max-number-of-instances";
          key "nsd";
          leaf nsd {
            type leafref {
              path "../../../nfv:nested-nsd";
            }
          }
          leaf deployment-flavor {
            type leafref {
              path "/nfv:nfv/nfv:nsd[id=current()/../nfv:nsd]/nfv:deployment-flavor/nfv:id";
            }
          }
          leaf instantiation-level {
            type leafref {
              path "deref(../nfv:deployment-flavor)/../nfv:instantiation-level/nfv:id";
            }
          }
          leaf min-number-of-instances {
            type uint16;
            mandatory true;
          }
          leaf max-number-of-instances {
            type uint16;
            mandatory true;
          }
          uses local-affinity-or-anti-affinity-rule;
          list affinity-or-anti-affinity-group {
            key "id";

            leaf id {
              type leafref {
                path "../../../nfv:affinity-or-anti-affinity-group/nfv:id";
              }
            }
          }
        }

        list dependency {
          description
            "NFV Management and Orchestration functions shall instantiate
             VNFs from the VnfProfile and/or nested NSs from the NsProfile
             referenced in the primary attribute before instantiating VNFs
             from the VnfProfile and/or nested NSs from the NsProfile
             referenced in the secondary attribute.";
          key "id";
          leaf id {
            type string;
          }
          choice primary {
            leaf primary-vnf-profile {
              type leafref {
                path "../../nfv:vnf-profile/nfv:vnfd";
              }
            }
            leaf primary-ns-profile {
              type leafref {
                path "../../nfv:ns-profile/nfv:nsd";
              }
            }
          }
          choice secondary {
            leaf secondary-vnf-profile {
              type leafref {
                path "../../nfv:vnf-profile/nfv:vnfd";
              }
            }
            leaf secondary-ns-profile {
              type leafref {
                path "../../nfv:ns-profile/nfv:nsd";
              }
            }
          }
        }
      }
      uses security-parameters;
    }
  }
}