Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
wen587 committed Dec 20, 2023
1 parent 847f0e6 commit b31615d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions doc/mgmt/SONiC_YANG_Model_Guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ container PORTCHANNEL_INTERFACE {

### 18. In some cases it may be required to split an ABNF table into multiple YANG lists based on the data stored in the ABNF table. In this case it is crucial to ensure that the List keys are non-overlapping, unique, and unambiguous.

**Strategies for Ensuring Unique and Unambiguous Keys**: Utilize composite keys that have a different number of key elements to distinguish lists.
**Strategies for Ensuring Unique and Unambiguous Keys**: Utilize composite keys that have a different number of key elements to distinguish lists. Need to mention that different key names do not count as unambiguous model.

#### ABNF
```
Expand Down Expand Up @@ -551,7 +551,7 @@ container INTERFACE {
}
......
```
***In the example above if the config DB contains an INTERFACE table with single key element then it will be associted with the INTERFACE_LIST and if contains 2 key elements then it will be associated with INTERFACE_IPADDR_LIST***
In the example above if the config DB contains an INTERFACE table with single key element then it will be associted with the INTERFACE_LIST and if contains 2 key elements then it will be associated with INTERFACE_IPADDR_LIST

#### Example 2: Keys with same number of elements of same type (NOT Allowed case 1)

Expand All @@ -577,7 +577,7 @@ container NOT_SUPPORTED_INTERFACE {
......
```

***In the example above if the config DB contains an NOT_SUPPORTED_INTERFACE table with key Ethernet1 then it would match with both the list, this is an overlapping scenario***
In the example above if the config DB contains an NOT_SUPPORTED_INTERFACE table with key Ethernet1 then it would match with both the list, this is an overlapping scenario

#### Example 3: Keys with same number of elements of same type (NOT Allowed case 2)

Expand Down Expand Up @@ -623,11 +623,11 @@ container NOT_SUPPORTED_TELEMETRY_CLIENT {
}
......
```
***In the example above if the config DB contains an NOT_SUPPORTED_TELEMETRY_CLIENT table with key "DestinationGroup|HS", then it would correspond to the NOT_SUPPORTED_TELEMETRY_CLIENT_DS_LIST and NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST, this is an overlapping scenario***
In the example above if the config DB contains an NOT_SUPPORTED_TELEMETRY_CLIENT table with key "DestinationGroup|HS", then it would correspond to the NOT_SUPPORTED_TELEMETRY_CLIENT_DS_LIST and NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST, this is an overlapping scenario

#### Example 4: keys with same number of elements and different type(NOT Allowed case 1)
#### Example 4: keys with same number of elements and different type(NOT Allowed case 3)

***In the given example, if the configuration database has an NOT_SUPPORTED_TELEMETRY_CLIENT table with the key "1234", it would correspond to the NOT_SUPPORTED_TELEMETRY_CLIENT_DS_LIST and NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST, this is an overlapping scenario***
In the given example, if the configuration database has an NOT_SUPPORTED_TELEMETRY_CLIENT table with the key "1234", it would correspond to the NOT_SUPPORTED_TELEMETRY_CLIENT_DS_LIST and NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST, this is an overlapping scenario

```yang
......
Expand All @@ -647,9 +647,9 @@ container NOT_SUPPORTED_TELEMETRY_CLIENT {
}
list NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST { // Negative case
key "prefix";
key "id";
leaf prefix {
leaf id {
type int32;
}
Expand All @@ -662,9 +662,9 @@ container NOT_SUPPORTED_TELEMETRY_CLIENT {
......
```

#### Example 5: keys with same number of elements and different type(NOT Allowed case 2)
#### Example 5: keys with same number of elements and different type(NOT Allowed case 4)

***In the given example, if the configuration database has an NOT_SUPPORTED_TELEMETRY_CLIENT table with the key "1234|1234", it would correspond to the NOT_SUPPORTED_TELEMETRY_CLIENT_DS_LIST and NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST, this is an overlapping scenario***
In the given example, if the configuration database has an NOT_SUPPORTED_TELEMETRY_CLIENT table with the key "1234|1234", it would correspond to the NOT_SUPPORTED_TELEMETRY_CLIENT_DS_LIST and NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST, this is an overlapping scenario

```yang
......
Expand All @@ -686,9 +686,9 @@ container NOT_SUPPORTED_TELEMETRY_CLIENT {
}
list NOT_SUPPORTED_TELEMETRY_CLIENT_SUB_LIST { // Negative case
key "prefix name";
key "id name";
leaf prefix {
leaf id {
type int32;
}
Expand Down

0 comments on commit b31615d

Please sign in to comment.