1

/operations/sal-flow:add-flow api 呼び出しを使用して Lithium の DLUX 経由で単純なフロー ルールを追加しようとしていますが、エラーしか表示されません。誰か助けてください。

誰かが追加したサンプル フローのプレビューでも、本当に役に立ちますか?

プレビュー フレームに表示される現在の入力は次のとおりです。

http://localhost:8181/restconf/operations/sal-flow:add-flow

{
    "add-flow": {
        "input": {
            "match": {
                "ethernet-match": {
                    "ethernet-type": {
                        "type": "2048"
                    }
                },
                "ipv4-source": "10.0.0.1/32"
            },
            "instructions": {
                "instruction": [
                    {
                        "order": "0",
                        "apply-actions": {
                            "action": [
                                {
                                    "drop-action": {},
                                    "order": "0"
                                }
                            ]
                        }
                    }
                ]
            },
            "flow-name": "test",
            "table_id": "0"
        }
    }
}

現在のエラーは次のとおりです。

「サーバー エラー: サーバーで予期しない状況が発生したため、要求を満たすことができませんでした。-: 操作中に予期しないエラーが発生しました」

Postman で同じ要求を行うと、次のエラーが発生します。

{
  "errors": {
    "error": [
      {
        "error-type": "protocol",
        "error-tag": "malformed-message",
        "error-message": "Error parsing input: Schema node with name add-flow wasn't found under (urn:opendaylight:flow:service?revision=2013-08-19)add-flow."
      }
    ]
  }
}

xml を使用した例を見てきましたが、何も機能していないようです。dlux を介してネットワーク トポロジを表示できるので、すべて正常に接続されていると思います。

よろしくお願いします。

4

2 に答える 2

0

私はDLUXを使用して同じ問題を抱えています。とにかく、このリンクhttps://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:End_to_End_Flowsから XML POST リクエストを使用して解決策を見つけることができました。Chrome で POSTMAN アプリケーションを使用してリクエストを送信できます。リクエストの本文は次のようになります。

POST http://localhost:8080/restconf/operations/sal-flow:add-flow

認証ヘッダーも追加します。

コンテンツ タイプ: アプリケーション/xml

受け入れる: アプリケーション/xml

体:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<input xmlns="urn:opendaylight:flow:service">
   <barrier>false</barrier>
   <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>

   <cookie>55</cookie>
   <flags>SEND_FLOW_REM</flags>
   <hard-timeout>0</hard-timeout>
   <idle-timeout>0</idle-timeout>
   <installHw>false</installHw>
   <match>
    <ethernet-match>
     <ethernet-type>
       <type>2048</type>
     </ethernet-type>
    </ethernet-match>
    <ipv4-destination>10.0.10.2/32</ipv4-destination>
   </match>
   <instructions>
    <instruction>
     <order>0</order>
     <apply-actions>
       <action>
         <output-action>
           <output-node-connector>1</output-node-connector>
         </output-action>
         <order>0</order>
       </action>
     </apply-actions>
    </instruction>
   </instructions>
   <priority>0</priority>
   <strict>false</strict>
   <table_id>0</table_id>
</input>
于 2016-02-18T13:34:51.820 に答える