Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yang_models]: Update extension yang and types yang with new yang ext… #6861

Merged
merged 20 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d9efbf2
[yang_models]: Update extension yang and types yang with new yang ext…
maheshwari-mayank Feb 23, 2021
43c8510
[yang_models]:Update revision-date in import statement
maheshwari-mayank Feb 24, 2021
76e9a18
[yang-model]: Removed operations container from types yang.
maheshwari-mayank Feb 25, 2021
5cdfcdf
[yang_models]:Removed revision-date from import statement of sonic-ty…
maheshwari-mayank Feb 26, 2021
90fe5de
{yang_models]: Updated SONiC YANG extensions as per guidelines.
maheshwari-mayank Mar 2, 2021
9f814e3
[yang_models]: Updated extensions and types yang models as per review…
maheshwari-mayank Mar 17, 2021
bda2a63
Merge branch 'master' into extension-yang
maheshwari-mayank Apr 7, 2021
7fc7614
[yang_models] Removed extensions key-delim, key-pattern and map-leaf.
maheshwari-mayank May 3, 2021
65b59d7
Merge branch 'master' into extension-yang
maheshwari-mayank May 3, 2021
be95a38
[yang_models] Resolved Conflicts
maheshwari-mayank May 4, 2021
22c53a4
[yang_models] Resolved conflicts
maheshwari-mayank May 4, 2021
70c1e40
[yang_models] Updated sonic extensions yang.
maheshwari-mayank May 28, 2021
66f303e
Merge branch 'master' into extension-yang
maheshwari-mayank May 28, 2021
19f5a43
Merge branch 'master' into extension-yang
maheshwari-mayank Oct 29, 2021
23817df
Reverting changes in sonic-acl.yang to merge properly.
maheshwari-mayank Nov 12, 2021
48e0b9c
Merge branch 'master' of https://github.com/Azure/sonic-buildimage in…
maheshwari-mayank Nov 12, 2021
d5215c1
Merge branch 'Azure-master' into extension-yang
maheshwari-mayank Nov 12, 2021
fc438bd
Removed CVL specific yang extensions.
maheshwari-mayank Nov 12, 2021
c04d17b
Added CVL specific extensions to jinja template and moved extension y…
maheshwari-mayank Nov 17, 2021
3c310ab
[YANG] Added CVL specific type and moved sonic-types to j2 template.
maheshwari-mayank Nov 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module sonic-breakout_cfg {

import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}

description "BREAKOUT_CFG YANG Module for SONiC OS";
Expand Down
1 change: 0 additions & 1 deletion src/sonic-yang-models/yang-models/sonic-crm.yang
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module sonic-crm {

import sonic-types {
prefix stypes;
revision-date 2019-07-01;
}

description "CRM YANG Module for SONiC OS";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module sonic-device_metadata {

import sonic-types {
prefix stypes;
revision-date 2019-07-01;
maheshwari-mayank marked this conversation as resolved.
Show resolved Hide resolved
}

description "DEVICE_METADATA YANG Module for SONiC OS";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module sonic-device_neighbor {

import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}

import sonic-port {
Expand Down
13 changes: 0 additions & 13 deletions src/sonic-yang-models/yang-models/sonic-extension.yang

This file was deleted.

2 changes: 0 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-interface.yang
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ module sonic-interface {

import sonic-types {
prefix stypes;
revision-date 2019-07-01;
}

import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}

import sonic-port {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ module sonic-loopback-interface {

import sonic-types {
prefix stypes;
revision-date 2019-07-01;
}

import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}

import sonic-vrf {
Expand Down
2 changes: 0 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ module sonic-port{

import sonic-types {
prefix stypes;
revision-date 2019-07-01;
}

import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}

description "PORT yang Module for SONiC OS";
Expand Down
4 changes: 1 addition & 3 deletions src/sonic-yang-models/yang-models/sonic-portchannel.yang
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ module sonic-portchannel {

import sonic-types {
prefix stypes;
revision-date 2019-07-01;
}

import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}

import sonic-port {
Expand Down Expand Up @@ -138,7 +136,7 @@ module sonic-portchannel {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
}

leaf port {
/* key elements are mandatory by default */
type leafref {
Expand Down
2 changes: 0 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-vlan.yang
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ module sonic-vlan {

import sonic-types {
prefix stypes;
revision-date 2019-07-01;
}

import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}

import sonic-port {
Expand Down
41 changes: 41 additions & 0 deletions src/sonic-yang-models/yang-templates/sonic-extension.yang.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module sonic-extension {

yang-version 1.1;

namespace "http://github.com/Azure/sonic-extension";
prefix sonic-extension;

description "Extension yang Module for SONiC OS";

revision 2019-07-01 {
description "First Revision";
}

/* For complete guide of using these extensions in SONiC yangs, refer
SONiC yang guidelines at
https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md */

extension db-name {
description "DB name, e.g. APPL_DB, CONFIG_DB";
argument "value";
}

{% if yang_model_type == "cvl" %}
extension custom-validation-cvl {
description "Extension for registering cvl based custom validation handler.";
argument "handler";
}

extension dependent-on {
description
"Extension to define dependency on other table. During CREATE/UPDATE,
the action will be performed first on the Parent table and then on the
Dependent table. In DELETE operation, the Dependent table will be
deleted first and then the Parent table. This extension can be defined
only under List nodes. Table name should always be suffixed with '_LIST'
as modeled in yang. e.g. - dependent-on STP_LIST";
argument "value";
}
{% else %}
{% endif %}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,42 @@ module sonic-types {
}
}

typedef oper-status {
type enumeration {
enum unknown;
enum up;
enum down;
}
description "Operational status of an entity such as Port, MCLAG etc";
}

typedef mode-status {
type enumeration {
enum enable;
enum disable;
}
description
"This type can be used where toggle functionality required.
For ex. IPv6-link-local-only, Dhcp-replay-link-select, SNMP traps etc";
}

typedef dhcp-relay-policy-action {
type enumeration {
enum discard;
enum append;
enum replace;
}
description "DHCP relay policy action value";
}

typedef percentage {
type uint8 {
range "0..100";
}
description
"Integer indicating a percentage value";
}

typedef tpid_type {
type string {
pattern "0x8100|0x9100|0x9200|0x88a8|0x88A8";
Expand Down Expand Up @@ -185,4 +221,27 @@ module sonic-types {
enum transit;
}
}



/* Required for CVL */
{% if yang_model_type == "cvl" %}
container operation {
description
"This definition is used internally by CVL and
is not exposed in NBI. Leaf 'operation' allows
evaluation of must expression for
CREATE/UPDATE/DELETE operation.";

leaf operation {
type enumeration {
enum NOP;
enum CREATE;
enum UPDATE;
enum DELETE;
}
}
}
{% else %}
{% endif %}
}