aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-ap-manager.yang
blob: 6fb3f8f56a85d641f0da284e666fa764eef32fc6 (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
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
module openconfig-ap-manager {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/wifi/ap-manager";

  // Assign this module a prefix to be used by other modules, when imported.
  prefix "ap-manager";

  // Imports
  import openconfig-extensions { prefix oc-ext; }
  import openconfig-yang-types { prefix oc-yang; }
  import openconfig-inet-types { prefix oc-inet; }
  import openconfig-wifi-types { prefix oc-wifi; }

  // Meta
  organization "OpenConfig working group";

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

  description
    "This module defines the top level configuration and state data for a
    system which manages Access Points.";

  oc-ext:openconfig-version "0.1.0";

  revision "2018-02-14" {
    description
      "Initial version";
    reference "0.1.0";
  }

  grouping provision-aps-config {
    description
      "Assignment of hostname to an Access Point.";

    leaf mac {
      type oc-yang:mac-address;
      description
        "MAC address of the AP primary Ethernet interface. If AP
        has multiple Ethernet interfaces, this would be the MAC printed
        on the unit label and referenced within the management system.
        Vendors MUST reject attempts to configure this leaf.";
    }

    leaf hostname {
      type oc-inet:domain-name;
      description
        "Hostname of the Access Point.";
    }

    leaf country-code {
      type string {
        pattern '[A-Z]{2}';
      }
      description
        "Country code where the AP operates in ISO 3166-1 alpha-2
        format.";
    }
  }

  grouping controller-aps-system-state {
    description
      "Grouping for a Controller & AP system state data.";

    leaf mac {
      type oc-yang:mac-address;
      description
        "MAC address of the AP primary Ethernet interface. If AP
        has multiple Ethernet interfaces, this would be the MAC printed
        on the unit label and referenced within the management system.
        Vendors MUST reject attempts to configure this leaf.";
    }

    leaf hostname {
      type oc-inet:domain-name;
      description
        "Hostname of the Access Point.";
    }

    leaf opstate {
      type identityref {
        base oc-wifi:AP_STATE;
      }
      description
        "The current operational state of the AP.";
    }

    leaf uptime {
      type uint32;
      units seconds;
      description
        "Seconds this AP has been in the op-state of 'UP'.";
    }

    leaf enabled {
      type boolean;
      description
        "Wheather the AP is enabled or disabled.";
    }

    leaf serial {
      type string;
      description
        "Serial number of the Access Point.";
    }

    leaf model {
      type string;
      description
        "Model number of the Access Point.";
    }

    leaf ipv4 {
      type oc-inet:ipv4-address;
      description
        "The IPv4 address of the Access Point.";
    }

    leaf ipv6 {
      type oc-inet:ipv6-address;
      description
        "The IPv6 address of the Access Point.";
    }

    leaf power-source {
      type enumeration {
      enum AT {
        description "Powered using 802.3at.";
      }
      enum AF {
        description "Powered using 802.3af.";
      }
      enum PLUG {
        description "Powered using local source, not PoE.";
      }
    }
    description
      "Enumerate how the AP is being powered.";
    }
  }

  grouping provision-ap-top {
    description
      "Top-level grouping for assigning hostnames to APs.";

    container provision-aps {
      description
        "Top most container for assigning hostnames to APs.";

      list provision-ap {
        key "mac";
        description
          "List of MAC addresses that will have hostnames assigned.";

        leaf mac {
          type leafref {
            path "../config/mac";
          }
          description
          "Reference to the MAC address list key. This leaf is a reference
          only and not to be configured.";
        }

        container config {
          description
            "Config container for assigning hostnames to APs.";

          uses provision-aps-config;
        }

        container state {
          config false;
          description
            "State container for assigning hostnames to APs.";

          uses provision-aps-config;
        }
      }
    }
  }

  grouping joined-aps-top {
    description
      "Top-level grouping for APs assigned to controller(s).";

    container joined-aps {
      description
        "Top most container for joined-aps.";

      list joined-ap {
        key "hostname";
        config false;
        description
          "List of access points that have joined the controller.";

        leaf hostname {
          type leafref {
            path "../state/hostname";
          }
          description
          "Reference to the MAC address list key.";
        }

        container state {
          config false;
          description
            "State container for Joined APs.";

          uses controller-aps-system-state;
        }
      }
    }
  }
  uses provision-ap-top;
  uses joined-aps-top;
}