From 7087763af4edae764d08196f410c19470a58db9a Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 12 Oct 2022 08:44:50 -0700 Subject: [PATCH] Revert "[Yang model] add Restapi yang file (#12287)" (#12374) 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 e1765121b2fa3a5481e80c7db15da597964ab30f. --- src/sonic-restapi | 2 +- src/sonic-yang-models/doc/Configuration.md | 13 ---- src/sonic-yang-models/setup.py | 1 - .../tests/files/sample_config_db.json | 8 --- .../tests/yang_model_tests/tests/restapi.json | 9 --- .../tests_config/restapi.json | 26 -------- .../yang-models/sonic-restapi.yang | 63 ------------------- 7 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json delete mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json delete mode 100644 src/sonic-yang-models/yang-models/sonic-restapi.yang diff --git a/src/sonic-restapi b/src/sonic-restapi index 86543d0db5..bcc6f704a5 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit 86543d0db544362bb27912ed40449920c3d7c0d1 +Subproject commit bcc6f704a54454f326f069501b01759dbb732bb3 diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index d36a6b6374..bd7b51ce5a 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -46,7 +46,6 @@ Table of Contents * [Scheduler](#scheduler) * [Port QoS Map](#port-qos-map) * [Queue](#queue) - * [Restapi](#restapi) * [Tacplus Server](#tacplus-server) * [TC to Priority group map](#tc-to-priority-group-map) * [TC to Queue map](#tc-to-queue-map) @@ -1412,18 +1411,6 @@ name as object key and member list as attribute. } ``` -### Restapi -``` -{ -"RESTAPI": { - "certs": { - "ca_crt": "/etc/sonic/credentials/ame_root.pem", - "server_key": "/etc/sonic/credentials/restapiserver.key", - "server_crt": "/etc/sonic/credentials/restapiserver.crt", - "client_crt_cname": "client.sonic.net" - } -} -``` ### Tacplus Server diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 74c081ef14..aee9d4650c 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -148,7 +148,6 @@ setup( './yang-models/sonic-scheduler.yang', './yang-models/sonic-wred-profile.yang', './yang-models/sonic-queue.yang', - './yang-models/sonic-restapi.yang', './yang-models/sonic-dscp-fc-map.yang', './yang-models/sonic-exp-fc-map.yang', './yang-models/sonic-dscp-tc-map.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 7207d4337a..6c1f47d80f 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1118,14 +1118,6 @@ "port": "50051" } }, - "RESTAPI": { - "certs": { - "ca_crt": "/etc/sonic/credentials/ame_root.pem", - "server_key": "/etc/sonic/credentials/restapiserver.key", - "server_crt": "/etc/sonic/credentials/restapiserver.crt", - "client_crt_cname": "client.sonic.net" - } - }, "FLEX_COUNTER_TABLE": { "PFCWD": { "FLEX_COUNTER_STATUS": "enable" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json b/src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json deleted file mode 100644 index 0804ceac58..0000000000 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "RESTAPI_TABLE_WITH_INCORRECT_CERT": { - "desc": "RESTAPI TABLE_WITH_INCORRECT_CERT failure.", - "eStr": ["server_crt"] - }, - "RESTAPI_TABLE_WITH_VALID_CONFIG": { - "desc": "RESTAPI TABLE WITH VALID CONFIG." - } -} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json deleted file mode 100644 index 48505a0e0c..0000000000 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "RESTAPI_TABLE_WITH_INCORRECT_CERT": { - "sonic-restapi:sonic-restapi": { - "sonic-restapi:RESTAPI": { - "certs": { - "ca_crt": "abcd.config", - "server_crt": "a/b/c", - "server_key": "123", - "client_crt_cname": "client" - } - } - } - }, - "RESTAPI_TABLE_WITH_VALID_CONFIG": { - "sonic-restapi:sonic-restapi": { - "sonic-restapi:RESTAPI": { - "certs": { - "ca_crt": "/etc/sonic/credentials/ame_root.pem", - "server_crt": "/etc/sonic/credentials/restapiserver.crt", - "server_key": "/etc/sonic/credentials/restapiserver.key", - "client_crt_cname": "client.sonic.net" - } - } - } - } -} diff --git a/src/sonic-yang-models/yang-models/sonic-restapi.yang b/src/sonic-yang-models/yang-models/sonic-restapi.yang deleted file mode 100644 index d42db48648..0000000000 --- a/src/sonic-yang-models/yang-models/sonic-restapi.yang +++ /dev/null @@ -1,63 +0,0 @@ -module sonic-restapi { - - yang-version 1.1; - - namespace "http://github.com/Azure/sonic-restapi"; - prefix restapi; - - import ietf-inet-types { - prefix inet; - } - - organization - "SONiC"; - - contact - "SONiC"; - - description "RESTAPI YANG Module for SONiC OS"; - - revision 2022-10-05 { - description "First Revision"; - } - - container sonic-restapi { - - container RESTAPI { - - description "RESTAPI TABLE part of config_db.json"; - - container certs { - - leaf ca_crt { - type string { - pattern '(/[a-zA-Z0-9_-]+)*/([a-zA-Z0-9_-]+).pem'; - } - description "Local path for ca_crt."; - } - - leaf server_crt { - type string { - pattern '(/[a-zA-Z0-9_-]+)*/([a-zA-Z0-9_-]+).crt'; - } - description "Local path for server_crt."; - } - - leaf client_crt_cname { - type string { - pattern '(/[a-zA-Z0-9_-.]+)*/([a-zA-Z0-9_-.]+)./[a-z]{3}'; - } - description "Client cert name."; - } - - leaf server_key { - type string { - pattern '(/[a-zA-Z0-9_-]+)*/([a-zA-Z0-9_-]+).key'; - } - description "Local path for server_key."; - } - - } - } - } -}