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 model] add Restapi yang file #12287

Merged
merged 2 commits into from
Oct 11, 2022
Merged

Conversation

prsunny
Copy link
Contributor

@prsunny prsunny commented Oct 5, 2022

Why I did it

Add yang model for Restapi

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@prsunny prsunny requested a review from qiluo-msft as a code owner October 5, 2022 22:39
@qiluo-msft qiluo-msft requested a review from ganglyu October 5, 2022 22:42
@qiluo-msft qiluo-msft added the YANG YANG model related changes label Oct 5, 2022
@prsunny prsunny linked an issue Oct 5, 2022 that may be closed by this pull request
leaf server_crt {
type string {
pattern '(/[a-zA-Z0-9_-]+)*/([a-zA-Z0-9_-]+).crt';
}
Copy link
Contributor

@ganglyu ganglyu Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to limit the suffix as crt? Can we use xxx.cer or xxx.cert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think for restapi, it is currently fixed to crt. We may not need to provide an extension support

Copy link
Member

@praveen-li praveen-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, barring minor issues in Tests. Plz fix them.

{
"RESTAPI_TABLE_WITH_INCORRECT_CERT": {
"desc": "TABLE_WITH_INCORRECT_CERT failure.",
"eStrKey": "Pattern"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"eStr": ["server_crt"]

This way, Libyang error will be matched against only server_crt field.

"eStrKey": "Pattern"
},
"RESTAPI_TABLE_WITH_VALID_CONFIG": {
"desc": "TABLE WITH VALID CONFIG."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"RESTAPI TABLE WITH VALID CONFIG."

Desc is helpful in case of test failures. Thx

@prsunny prsunny requested a review from lguohan as a code owner October 7, 2022 20:25
@prsunny prsunny merged commit e176512 into sonic-net:master Oct 11, 2022
@prsunny prsunny deleted the restapi_yang branch October 11, 2022 17:53
saiarcot895 added a commit that referenced this pull request Oct 12, 2022
lguohan pushed a commit that referenced this pull request Oct 12, 2022
This is causing a build failure for all builds. The PR build was incorrectly marked as passing due to a different build issue.

libyang[0]: Regular expression "(/[a-zA-Z0-9_-.]+)*/([a-zA-Z0-9_-.]+)./[a-z]{3}" is not valid (".]+)*/([a-zA-Z0-9_-.]+)./[a-z]{3})$": range out of order in character class).
libyang[0]: Module "sonic-restapi" parsing failed.
ERROR:YANG-TEST: Exception >Module "sonic-restapi" parsing failed.< in /sonic/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py:114
ERROR:YANG-TEST: Exception >Module "sonic-restapi" parsing failed.< in /sonic/src/sonic-yang-models/tests/yang_model_test

This reverts commit e176512.
prsunny added a commit that referenced this pull request Oct 12, 2022
@prsunny prsunny restored the restapi_yang branch October 12, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YANG YANG model related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[yang] Need Yang for RESTAPI table
4 participants