X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FNetconfViaRestconf.robot;h=947dd3e2c7d22b027b484aa543a933b921ccbe89;hb=refs%2Fchanges%2F15%2F33915%2F8;hp=4d55e50f1020e6edfc6b039d6debf5cb399c5bf1;hpb=5b6c3589c60b49fcc90aaae388ac4a5b34d363ea;p=integration%2Ftest.git diff --git a/csit/libraries/NetconfViaRestconf.robot b/csit/libraries/NetconfViaRestconf.robot index 4d55e50f10..947dd3e2c7 100644 --- a/csit/libraries/NetconfViaRestconf.robot +++ b/csit/libraries/NetconfViaRestconf.robot @@ -114,6 +114,26 @@ Post_Xml_Template_Folder_Via_Restconf ${xml_data}= Resolve_Xml_Data_From_Template_Folder ${folder} ${mapping_as_string} Post_Xml_Via_Restconf ${uri_part} ${xml_data} +Post_Json_Via_Restconf + [Arguments] ${uri_part} ${json_data} + [Documentation] Post JSON data to given controller-config URI, check reponse text is empty and status_code is 204. + BuiltIn.Log ${uri_part} + BuiltIn.Log ${json_data} + # As seen in previous two Keywords, Post does not need long specific URI. + # But during Lithium development, Post ceased to do merge, so those Keywords do not work anymore. + # This Keyword can still be used with specific URI to create a new container and fail if a container was already present. + ${response}= RequestsLibrary.Post ${NetconfViaRestconf__active_config_session} ${uri_part} data=${json_data} headers=${HEADERS_YANG_JSON} + BuiltIn.Log ${response.text} + BuiltIn.Should_Be_Empty ${response.text} + BuiltIn.Should_Be_Equal_As_Strings ${response.status_code} 204 + +Post_Json_Template_Folder_Via_Restconf + [Arguments] ${folder} ${mapping_as_string}={} + [Documentation] Resolve URI and data from folder, POST to restconf. + ${uri_part}= Resolve_URI_From_Template_Folder ${folder} ${mapping_as_string} + ${json_data}= Resolve_Json_Data_From_Template_Folder ${folder} ${mapping_as_string} + Post_Json_Via_Restconf ${uri_part} ${json_data} + Put_Xml_Via_Restconf [Arguments] ${uri_part} ${xml_data} [Documentation] Put XML data to given controller-config URI, check reponse text is empty and status_code is one of allowed ones.