Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: 2021 Open Networking Foundation |
| 2 | // |
| 3 | // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 4 | |
| 5 | module service-group { |
| 6 | namespace "http://opennetworking.org/aether/service-group"; |
| 7 | prefix sg; |
| 8 | |
| 9 | import service-policy { prefix serv; } |
| 10 | |
| 11 | organization "Open Networking Foundation."; |
| 12 | contact "Scott Baker"; |
| 13 | description "To generate JSON from this use command |
| 14 | pyang -f jtoxx test1.yang | python3 -m json.tool > test1.json |
| 15 | Copied from YangUIComponents project"; |
| 16 | |
| 17 | revision "2021-03-04" { |
| 18 | description "An Aether Service Group"; |
| 19 | reference "RFC 6087"; |
| 20 | } |
| 21 | |
| 22 | typedef service-group-id { |
| 23 | type string { |
| 24 | length 1..32; |
| 25 | } |
PUSHP RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 26 | description "The typede for service-group-id"; |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | typedef service-kind { |
| 30 | type string { |
| 31 | length 1..32; |
| 32 | pattern "default|on-demand"; |
| 33 | } |
PUSHP RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 34 | description "The typedef for service-kind"; |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | container service-group { |
| 38 | description "The top level container"; |
| 39 | |
| 40 | list service-group { |
| 41 | key "id"; |
| 42 | description |
| 43 | "List of service groups"; |
| 44 | |
| 45 | leaf id { |
| 46 | type service-group-id; |
| 47 | description "ID for this service group."; |
| 48 | } |
| 49 | |
| 50 | leaf display-name { |
| 51 | type string { |
| 52 | length 1..80; |
| 53 | } |
| 54 | description "display name to use in GUI or CLI"; |
| 55 | } |
| 56 | |
| 57 | list service-policies { |
| 58 | key "service-policy"; |
| 59 | leaf service-policy { |
| 60 | type leafref { |
| 61 | path "/serv:service-policy/serv:service-policy/serv:id"; |
| 62 | } |
| 63 | description |
| 64 | "Link to service policy"; |
| 65 | } |
PUSHP RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 66 | leaf kind { |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 67 | type service-kind; |
| 68 | default "default"; |
| 69 | description |
| 70 | "Type of service link"; |
| 71 | } |
PUSHP RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 72 | description "The container for service-policies"; |
| 73 | } |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 74 | |
| 75 | leaf description { |
| 76 | type string { |
| 77 | length 1..100; |
| 78 | } |
| 79 | description "description of this service group"; |
PUSHP RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 80 | } |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 81 | } |
PUSHP RAJ | ba2e32f | 2021-11-02 10:39:24 +0000 | [diff] [blame] | 82 | } |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 83 | } |