summaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-platform-port.yang
blob: 2039a8e00b4e5403df5208c700693875ea30d0c6 (plain)
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
module openconfig-platform-port {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/platform/port";

  prefix "oc-port";

  // import some basic types
  import openconfig-platform { prefix oc-platform; }
  import openconfig-interfaces { prefix oc-if; }
  import openconfig-if-ethernet { prefix oc-eth; }
  import openconfig-extensions { prefix oc-ext; }


  // meta
  organization "OpenConfig working group";

  contact
    "OpenConfig working group
    www.openconfig.net";

  description
    "This module defines data related to PORT components in the openconfig-platform model";

  oc-ext:openconfig-version "0.3.0";

  revision "2018-01-20" {
    description
      "Added augmentation for interface-to-port reference";
    reference "0.3.0";
  }

  revision "2017-11-17" {
    description
      "Corrected augmentation path for port data";
    reference "0.2.0";
  }

  revision "2016-10-24" {
    description
      "Initial revision";
    reference "0.1.0";
  }

  // extension statements

  // feature statements

  // identity statements

  // typedef statements

  // grouping statements

  grouping port-breakout-config {
    description
      "Configuration data for the port breakout mode";

    leaf num-channels {
      type uint8;
      description
        "Sets the number of channels to 'breakout' on a port
        capable of channelization";
    }

    leaf channel-speed {
      type identityref {
        base oc-eth:ETHERNET_SPEED;
      }
      description
        "Sets the channel speed on each channel -- the
        supported values are defined by the
        ETHERNET_SPEED identity";
    }
  }

  grouping port-breakout-state {
    description
      "Operational state data for the port breakout mode ";
  }

  grouping port-breakout-top {
    description
      "Top-level grouping for port breakout data";

    container breakout-mode {
      description
        "Top-level container for port breakout data";

      container config {
        description
          "Configuration data for port breakout";

        uses port-breakout-config;
      }

      container state {

        config false;

        description
          "Operational state data for port breakout";

        uses port-breakout-config;
        uses port-breakout-state;
      }
    }
  }

  // data definition statements

  // augment statements

  augment "/oc-platform:components/oc-platform:component/" +
    "oc-platform:port" {
    description
      "Adding port breakout data to physical platform data";

    uses port-breakout-top {
      when "./state/type = 'PORT'" {
        description
          "This data is valid only for PORT components";
      }
    }
  }

  augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
    description
      "Adds a reference from the base interface to the corresponding
      port component in the device inventory.";

    leaf hardware-port {
      type leafref {
        path "/oc-platform:components/oc-platform:component/" +
          "oc-platform:name";
      }
      description
        "For non-channelized interfaces, references the hardware port
        corresponding to the base interface.";
    }
  }

  // rpc statements

  // notification statements

}