netconfcentral logo

sd-onos-service-l3vpn@2015-10-14



  module sd-onos-service-l3vpn {

    yang-version 1;

    namespace "urn:onos:l3vpn";

    prefix l3vpn;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang-types;
    }
    import sd-onos-service-types {
      prefix service-types;
    }
    import sd-onos-common-types {
      prefix types;
    }

    organization "";

    contact "";

    revision "2015-10-14" {
      description "revised revision.";
    }


    container service {
      container l3vpn-cfg {
        list vpn-cfg {
          key "name";
          leaf name {
            type string;
            mandatory true;
            description "name of snc eline.";
          }

          leaf id {
            type uint32;
            mandatory true;
            description "ID of snc eline.";
          }

          leaf user-label {
            type string;
            description
              "user label of snc eline.";
          }

          leaf parent-ncd-id {
            type string;
            description "parent ncd id.";
          }

          leaf admin-status {
            type types:admin-status;
          }

          leaf operate-status {
            type types:operate-status;
          }

          leaf service-topology {
            type enumeration {
              enum "full-mesh" {
                value 1;
                description "full-mesh.";
              }
              enum "hub-spoke" {
                value 2;
                description "hub-spoke.";
              }
            }
            default "full-mesh";
            description
              "service topology type.";
          }

          container acess-information {
            list access-circuit {
              key "id";
              leaf id {
                type string;
                mandatory true;
                description "ac id.";
              }

              leaf name {
                type string;
                config false;
                description "ac name.";
              }

              leaf ne-id {
                type string;
                mandatory true;
                description "ne id.";
              }

              leaf ltp-id {
                type string;
                mandatory true;
                description "ltp id.";
              }

              leaf admin-status {
                type types:admin-status;
              }

              leaf operate-status {
                type types:operate-status;
              }

              container l2-access {
                description
                  "link layer access information of ac.";
                leaf access-type {
                  type enumeration {
                    enum "Port" {
                      value 0;
                      description "master.";
                    }
                    enum "Dot1Q" {
                      value 1;
                      description "Dot1Q.";
                    }
                    enum "QinQ" {
                      value 2;
                      description "QinQ.";
                    }
                  }
                  mandatory true;
                }

                leaf dot1q-vlan-bitmap {
                  type string;
                  mandatory true;
                  description
                    "Dot1Q Vlan Bitmap.";
                }

                leaf qinq-svlan-bitmap {
                  type string;
                  mandatory true;
                  description
                    "QinQ svlan Bitmap.";
                }

                leaf qinq-cvlan-bitmap {
                  type string;
                  mandatory true;
                  description
                    "QinQ cvlan Bitmap.";
                }

                leaf access-action {
                  type enumeration {
                    enum "Keep" {
                      value 0;
                      description "keep.";
                    }
                    enum "Push" {
                      value 1;
                      description "push.";
                    }
                    enum "Pop" {
                      value 2;
                      description "pop.";
                    }
                    enum "Swap" {
                      value 3;
                      description "swap.";
                    }
                  }
                  mandatory true;
                  description "access type.";
                }

                leaf action-vlan-id {
                  type int32 {
                    range "1..4094";
                  }
                  description
                    "action vlan id.";
                }
              }  // container l2-access

              leaf role {
                type enumeration {
                  enum "master" {
                    value 0;
                    description "master.";
                  }
                  enum "slave" {
                    value 1;
                    description "slave.";
                  }
                  enum "hub" {
                    value 2;
                    description "hub.";
                  }
                  enum "spoke" {
                    value 3;
                    description "spoke.";
                  }
                }
                default "master";
                description
                  "role of snc lsp.";
              }

              container qos-policy {
                container qos-if-cars {
                  list qos-if-car {
                    key "direction";
                    leaf direction {
                      type enumeration {
                        enum "inbound" {
                          value 0;
                          description
                            "inbound.";
                        }
                        enum "outbound" {
                          value 1;
                          description
                            "outbound.";
                        }
                      }
                      description
                        "qos for interface car";
                    }

                    leaf cir {
                      type int32;
                      description
                        "forward CIR. unit:Kbps";
                    }

                    leaf pir {
                      type int32;
                      description
                        "forward PIR. unit:Kbps";
                    }

                    leaf cbs {
                      type int32;
                      description
                        "forward CBS. unit:Kbps";
                    }

                    leaf pbs {
                      type int32;
                      description
                        "forward PBS. unit:Kbps";
                    }
                  }  // list qos-if-car
                }  // container qos-if-cars
              }  // container qos-policy

              container connection {
                description
                  "connection information of ac.";
                leaf ip-address {
                  type inet:ip-address;
                  description
                    "ip address of access circuit's
connectio.";
                }

                leaf mask-length {
                  type int32 {
                    range "1..32";
                  }
                  description
                    "mask length of ip address.";
                }

                leaf protocols {
                  type enumeration {
                    enum "static" {
                      value 0;
                      description "static.";
                    }
                    enum "ospf" {
                      value 1;
                      description "ospf.";
                    }
                    enum "isis" {
                      value 2;
                      description "bgp";
                    }
                    enum "bgp" {
                      value 3;
                      description "bgp";
                    }
                  }
                  description
                    "protocols between PE and CE.";
                }

                container static-routes {
                  list static-route {
                    key "ip-prefix mask-length";
                    leaf ip-prefix {
                      type inet:ipv4-address;
                    }

                    leaf mask-length {
                      type uint32 {
                        range "1..32";
                      }
                    }

                    leaf next-hop {
                      type inet:ipv4-address;
                    }

                    leaf preference {
                      type uint32 {
                        range "1..65535";
                      }
                    }
                  }  // list static-route
                }  // container static-routes
              }  // container connection
            }  // list access-circuit
          }  // container acess-information

          container protect-policy {
            description
              "L3VPN Service protect policy.";
            leaf protect-type {
              type enumeration {
                enum "unprotected" {
                  value 0;
                  description "unprotected.";
                }
                enum "protected" {
                  value 1;
                  description "protection.";
                }
              }
              default "unprotected";
              description "protection type";
            }

            leaf revertive-type {
              type enumeration {
                enum "no-revertive" {
                  value 0;
                  description "unprotected.";
                }
                enum "revertive" {
                  value 1;
                  description "protection.";
                }
              }
              description "revertive mode";
            }

            leaf wtr {
              type uint32;
              default "300";
              description "WTR.unit:s";
            }
          }  // container protect-policy

          container tunnel-service {
            description "tunnel service.";
            leaf signaling-type {
              type enumeration {
                enum "RSVP-TE" {
                  value 0;
                  description "RSVP-TE";
                }
                enum "LDP" {
                  value 1;
                  description "LDP";
                }
                enum "GRE" {
                  value 2;
                  description "GRE";
                }
                enum "SR-BE" {
                  value 3;
                  description "SR-BE";
                }
                enum "SR-TE" {
                  value 4;
                  description "SR-TE";
                }
              }
              default "RSVP-TE";
              description "signaling type.";
            }

            leaf tunnel-mode {
              type enumeration {
                enum "Nto1" {
                  value 0;
                  description
                    "multi service one tunnel";
                }
                enum "1to1" {
                  value 1;
                  description
                    "oner service one tunnel";
                }
              }
              default "Nto1";
              description
                "service to tunnel mode.";
            }

            container protect-policy {
              leaf protect-type {
                type enumeration {
                  enum "unprotected" {
                    value 0;
                    description
                      "unprotected.";
                  }
                  enum "protected" {
                    value 1;
                    description
                      "protection.";
                  }
                }
                default "unprotected";
                description
                  "protection type";
              }

              leaf revertive-type {
                type enumeration {
                  enum "no-revertive" {
                    value 0;
                    description
                      "unprotected.";
                  }
                  enum "revertive" {
                    value 1;
                    description
                      "protection.";
                  }
                }
                description "revertive mode";
              }

              leaf wtr {
                type uint32;
                default "300";
                description "WTR.unit:s";
              }
            }  // container protect-policy

            container oam-policy {
              leaf detect-type {
                type enumeration {
                  enum "undetect" {
                    value 0;
                    description
                      "unprotected.";
                  }
                  enum "APS" {
                    value 1;
                    description
                      "protection.";
                  }
                  enum "BFD" {
                    value 2;
                    description
                      "unprotected.";
                  }
                }
                description "detect type";
              }

              container bfd-detect-para {
                leaf ingress-discriminator {
                  type int32;
                  description
                    "ingress-discriminator";
                }

                leaf egress-discriminator {
                  type int32;
                  description
                    "egress-discriminator";
                }

                leaf tx-interval {
                  type int32;
                  description "tx-interval";
                }

                leaf rx-interval {
                  type int32;
                  description "rx-interval";
                }

                leaf detect-interval {
                  type int32;
                  description
                    "detect-interval";
                }
              }  // container bfd-detect-para
            }  // container oam-policy

            leaf latency {
              type int32;
              description
                "tunnel latency requirement.";
            }
          }  // container tunnel-service
        }  // list vpn-cfg
      }  // container l3vpn-cfg

      container service-paths {
        list service-path {
          key "service-id source-ne-id source-ac-id destination-ne-id destination-ac-id";
          leaf service-id {
            type string;
            description
              "l2vpn or l3vpn service id.";
          }

          leaf source-ne-id {
            type string;
            description "source ne id.";
          }

          leaf source-ac-id {
            type string;
            description "source ltp id.";
          }

          leaf destination-ne-id {
            type string;
            description "destination ne id.";
          }

          leaf destination-ac-id {
            type string;
            description
              "destination ltp id.";
          }

          container path-lists {
            list path-list {
              key "path-layer path-role";
              leaf path-layer {
                type enumeration {
                  enum "PW" {
                    value 0;
                    description "pw path.";
                  }
                  enum "BGP-LSP" {
                    value 1;
                    description
                      "BGP-LSP Path.";
                  }
                  enum "LSP" {
                    value 2;
                    description "LSP Path.";
                  }
                }
                description
                  "path type. 0 : PW, 1 : BGP-LSP,
2 : PW";
              }

              leaf path-role {
                type enumeration {
                  enum "Primary" {
                    value 0;
                    description
                      "master path.";
                  }
                  enum "Backup" {
                    value 1;
                    description
                      "backup path.";
                  }
                  enum "Active" {
                    value 2;
                    description
                      "active path.";
                  }
                }
                description
                  "path role.. 0 : master, 1 :
backup, 2 : Bypass.";
              }

              container paths {
                list path {
                  key "ne-id";
                  leaf ne-id {
                    type string;
                  }

                  leaf ingress-ltp-id {
                    type string;
                  }

                  leaf backward-peer-id {
                    type string;
                  }

                  leaf egress-ltp-id {
                    type string;
                  }

                  leaf forward-peer-id {
                    type string;
                  }
                }  // list path
              }  // container paths
            }  // list path-list
          }  // container path-lists
        }  // list service-path
      }  // container service-paths
    }  // container service

    rpc create-l3vpn-instance {
      input {
        container l3vpn-instance {
          leaf name {
            type string;
            mandatory true;
            description "name of snc eline.";
          }

          leaf id {
            type uint32;
            mandatory true;
            description "ID of snc eline.";
          }

          leaf user-label {
            type string;
            description
              "user label of snc eline.";
          }

          leaf parent-ncd-id {
            type string;
            description "parent ncd id.";
          }

          leaf admin-status {
            type types:admin-status;
          }

          leaf operate-status {
            type types:operate-status;
          }

          leaf service-topology {
            type enumeration {
              enum "full-mesh" {
                value 1;
                description "full-mesh.";
              }
              enum "hub-spoke" {
                value 2;
                description "hub-spoke.";
              }
            }
            default "full-mesh";
            description
              "service topology type.";
          }

          container acess-information {
            list access-circuit {
              key "id";
              leaf id {
                type string;
                mandatory true;
                description "ac id.";
              }

              leaf name {
                type string;
                config false;
                description "ac name.";
              }

              leaf ne-id {
                type string;
                mandatory true;
                description "ne id.";
              }

              leaf ltp-id {
                type string;
                mandatory true;
                description "ltp id.";
              }

              leaf admin-status {
                type types:admin-status;
              }

              leaf operate-status {
                type types:operate-status;
              }

              container l2-access {
                description
                  "link layer access information of ac.";
                leaf access-type {
                  type enumeration {
                    enum "Port" {
                      value 0;
                      description "master.";
                    }
                    enum "Dot1Q" {
                      value 1;
                      description "Dot1Q.";
                    }
                    enum "QinQ" {
                      value 2;
                      description "QinQ.";
                    }
                  }
                  mandatory true;
                }

                leaf dot1q-vlan-bitmap {
                  type string;
                  mandatory true;
                  description
                    "Dot1Q Vlan Bitmap.";
                }

                leaf qinq-svlan-bitmap {
                  type string;
                  mandatory true;
                  description
                    "QinQ svlan Bitmap.";
                }

                leaf qinq-cvlan-bitmap {
                  type string;
                  mandatory true;
                  description
                    "QinQ cvlan Bitmap.";
                }

                leaf access-action {
                  type enumeration {
                    enum "Keep" {
                      value 0;
                      description "keep.";
                    }
                    enum "Push" {
                      value 1;
                      description "push.";
                    }
                    enum "Pop" {
                      value 2;
                      description "pop.";
                    }
                    enum "Swap" {
                      value 3;
                      description "swap.";
                    }
                  }
                  mandatory true;
                  description "access type.";
                }

                leaf action-vlan-id {
                  type int32 {
                    range "1..4094";
                  }
                  description
                    "action vlan id.";
                }
              }  // container l2-access

              leaf role {
                type enumeration {
                  enum "master" {
                    value 0;
                    description "master.";
                  }
                  enum "slave" {
                    value 1;
                    description "slave.";
                  }
                  enum "hub" {
                    value 2;
                    description "hub.";
                  }
                  enum "spoke" {
                    value 3;
                    description "spoke.";
                  }
                }
                default "master";
                description
                  "role of snc lsp.";
              }

              container qos-policy {
                container qos-if-cars {
                  list qos-if-car {
                    key "direction";
                    leaf direction {
                      type enumeration {
                        enum "inbound" {
                          value 0;
                          description
                            "inbound.";
                        }
                        enum "outbound" {
                          value 1;
                          description
                            "outbound.";
                        }
                      }
                      description
                        "qos for interface car";
                    }

                    leaf cir {
                      type int32;
                      description
                        "forward CIR. unit:Kbps";
                    }

                    leaf pir {
                      type int32;
                      description
                        "forward PIR. unit:Kbps";
                    }

                    leaf cbs {
                      type int32;
                      description
                        "forward CBS. unit:Kbps";
                    }

                    leaf pbs {
                      type int32;
                      description
                        "forward PBS. unit:Kbps";
                    }
                  }  // list qos-if-car
                }  // container qos-if-cars
              }  // container qos-policy

              container connection {
                description
                  "connection information of ac.";
                leaf ip-address {
                  type inet:ip-address;
                  description
                    "ip address of access circuit's
connectio.";
                }

                leaf mask-length {
                  type int32 {
                    range "1..32";
                  }
                  description
                    "mask length of ip address.";
                }

                leaf protocols {
                  type enumeration {
                    enum "static" {
                      value 0;
                      description "static.";
                    }
                    enum "ospf" {
                      value 1;
                      description "ospf.";
                    }
                    enum "isis" {
                      value 2;
                      description "bgp";
                    }
                    enum "bgp" {
                      value 3;
                      description "bgp";
                    }
                  }
                  description
                    "protocols between PE and CE.";
                }

                container static-routes {
                  list static-route {
                    key "ip-prefix mask-length";
                    leaf ip-prefix {
                      type inet:ipv4-address;
                    }

                    leaf mask-length {
                      type uint32 {
                        range "1..32";
                      }
                    }

                    leaf next-hop {
                      type inet:ipv4-address;
                    }

                    leaf preference {
                      type uint32 {
                        range "1..65535";
                      }
                    }
                  }  // list static-route
                }  // container static-routes
              }  // container connection
            }  // list access-circuit
          }  // container acess-information

          container protect-policy {
            description
              "L3VPN Service protect policy.";
            leaf protect-type {
              type enumeration {
                enum "unprotected" {
                  value 0;
                  description "unprotected.";
                }
                enum "protected" {
                  value 1;
                  description "protection.";
                }
              }
              default "unprotected";
              description "protection type";
            }

            leaf revertive-type {
              type enumeration {
                enum "no-revertive" {
                  value 0;
                  description "unprotected.";
                }
                enum "revertive" {
                  value 1;
                  description "protection.";
                }
              }
              description "revertive mode";
            }

            leaf wtr {
              type uint32;
              default "300";
              description "WTR.unit:s";
            }
          }  // container protect-policy

          container tunnel-service {
            description "tunnel service.";
            leaf signaling-type {
              type enumeration {
                enum "RSVP-TE" {
                  value 0;
                  description "RSVP-TE";
                }
                enum "LDP" {
                  value 1;
                  description "LDP";
                }
                enum "GRE" {
                  value 2;
                  description "GRE";
                }
                enum "SR-BE" {
                  value 3;
                  description "SR-BE";
                }
                enum "SR-TE" {
                  value 4;
                  description "SR-TE";
                }
              }
              default "RSVP-TE";
              description "signaling type.";
            }

            leaf tunnel-mode {
              type enumeration {
                enum "Nto1" {
                  value 0;
                  description
                    "multi service one tunnel";
                }
                enum "1to1" {
                  value 1;
                  description
                    "oner service one tunnel";
                }
              }
              default "Nto1";
              description
                "service to tunnel mode.";
            }

            container protect-policy {
              leaf protect-type {
                type enumeration {
                  enum "unprotected" {
                    value 0;
                    description
                      "unprotected.";
                  }
                  enum "protected" {
                    value 1;
                    description
                      "protection.";
                  }
                }
                default "unprotected";
                description
                  "protection type";
              }

              leaf revertive-type {
                type enumeration {
                  enum "no-revertive" {
                    value 0;
                    description
                      "unprotected.";
                  }
                  enum "revertive" {
                    value 1;
                    description
                      "protection.";
                  }
                }
                description "revertive mode";
              }

              leaf wtr {
                type uint32;
                default "300";
                description "WTR.unit:s";
              }
            }  // container protect-policy

            container oam-policy {
              leaf detect-type {
                type enumeration {
                  enum "undetect" {
                    value 0;
                    description
                      "unprotected.";
                  }
                  enum "APS" {
                    value 1;
                    description
                      "protection.";
                  }
                  enum "BFD" {
                    value 2;
                    description
                      "unprotected.";
                  }
                }
                description "detect type";
              }

              container bfd-detect-para {
                leaf ingress-discriminator {
                  type int32;
                  description
                    "ingress-discriminator";
                }

                leaf egress-discriminator {
                  type int32;
                  description
                    "egress-discriminator";
                }

                leaf tx-interval {
                  type int32;
                  description "tx-interval";
                }

                leaf rx-interval {
                  type int32;
                  description "rx-interval";
                }

                leaf detect-interval {
                  type int32;
                  description
                    "detect-interval";
                }
              }  // container bfd-detect-para
            }  // container oam-policy

            leaf latency {
              type int32;
              description
                "tunnel latency requirement.";
            }
          }  // container tunnel-service
        }  // container l3vpn-instance
      }
    }  // rpc create-l3vpn-instance

    rpc delete-l3vpn-instance {
      input {
        leaf l3vpn-id {
          type string;
        }
      }
    }  // rpc delete-l3vpn-instance

    rpc close-l3vpn {
      input {
        leaf l3vpn-id {
          type string;
        }

        container ac-status {
          list acs {
            key "id";
            leaf id {
              type string;
            }

            leaf admin-status {
              type types:admin-status;
            }
          }  // list acs
        }  // container ac-status
      }
    }  // rpc close-l3vpn

    rpc modify-l3vpn-instance-basic {
      input {
        leaf l3vpn-id {
          type string;
        }

        leaf user-label {
          type string;
        }
      }
    }  // rpc modify-l3vpn-instance-basic

    rpc modify-l3vpn-instance-ac-qos {
      input {
        leaf l3vpn-id {
          type string;
        }

        container ac-qos {
          list acs {
            key "id";
            leaf id {
              type string;
            }

            container qos-policy {
              container qos-if-cars {
                list qos-if-car {
                  key "direction";
                  leaf direction {
                    type enumeration {
                      enum "inbound" {
                        value 0;
                        description
                          "inbound.";
                      }
                      enum "outbound" {
                        value 1;
                        description
                          "outbound.";
                      }
                    }
                    description
                      "qos for interface car";
                  }

                  leaf cir {
                    type int32;
                    description
                      "forward CIR. unit:Kbps";
                  }

                  leaf pir {
                    type int32;
                    description
                      "forward PIR. unit:Kbps";
                  }

                  leaf cbs {
                    type int32;
                    description
                      "forward CBS. unit:Kbps";
                  }

                  leaf pbs {
                    type int32;
                    description
                      "forward PBS. unit:Kbps";
                  }
                }  // list qos-if-car
              }  // container qos-if-cars
            }  // container qos-policy
          }  // list acs
        }  // container ac-qos
      }
    }  // rpc modify-l3vpn-instance-ac-qos

    rpc modify-l3vpn-instance-connection {
      input {
        leaf l3vpn-id {
          type string;
        }

        container ac-connection {
          list acs {
            leaf id {
              type string;
              description "ac id.";
            }

            container connection {
              description
                "CE to PE  connection.";
              leaf ip-address {
                type inet:ip-address;
                description
                  "ip address of access circuit's
connectio.";
              }

              leaf mask-length {
                type int32 {
                  range "1..32";
                }
                description
                  "mask length of ip address.";
              }

              leaf protocols {
                type enumeration {
                  enum "static" {
                    value 0;
                    description "static.";
                  }
                  enum "ospf" {
                    value 1;
                    description "ospf.";
                  }
                  enum "isis" {
                    value 2;
                    description "bgp";
                  }
                  enum "bgp" {
                    value 3;
                    description "bgp";
                  }
                }
                description
                  "protocols between PE and CE.";
              }

              container static-routes {
                list static-route {
                  key "ip-prefix mask-length";
                  leaf ip-prefix {
                    type inet:ipv4-address;
                  }

                  leaf mask-length {
                    type uint32 {
                      range "1..32";
                    }
                  }

                  leaf next-hop {
                    type inet:ipv4-address;
                  }

                  leaf preference {
                    type uint32 {
                      range "1..65535";
                    }
                  }
                }  // list static-route
              }  // container static-routes
            }  // container connection
          }  // list acs
        }  // container ac-connection
      }
    }  // rpc modify-l3vpn-instance-connection

    rpc inquire-l3vpn-instance-work-path {
      input {
        leaf service-id {
          type string;
        }

        leaf ingress-ne-id {
          type string;
        }

        leaf destination-ne-id {
          type string;
        }

        leaf ingress-ac-id {
          type string;
        }

        leaf destination-ac-id {
          type string;
        }

        leaf path-layer {
          type string;
        }

        leaf path-role {
          type string;
        }
      }

      output {
        container service-path {
          leaf service-id {
            type string;
          }

          leaf ingress-ne-id {
            type string;
          }

          leaf destination-ne-id {
            type string;
          }

          leaf ingress-ac-id {
            type string;
          }

          leaf destination-ac-id {
            type string;
          }

          leaf path-layer {
            type string;
          }

          leaf path-role {
            type string;
          }

          list path-list {
            key "ne-id";
            leaf ne-id {
              type string;
            }

            leaf ingress-ltp-id {
              type string;
            }

            leaf backward-peer-id {
              type string;
            }

            leaf egress-ltp-id {
              type string;
            }

            leaf forward-peer-id {
              type string;
            }
          }  // list path-list
        }  // container service-path
      }
    }  // rpc inquire-l3vpn-instance-work-path
  }  // module sd-onos-service-l3vpn