我正在尝试使用此URL将此流程推送到ODL的Nytrogen发行版的REST API:
..和这个身体:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<flow-name>push-mpls-action</flow-name>
<instructions>
<instruction>
<order>3</order>
<apply-actions>
<action>
<push-mpls-action>
<ethernet-type>34887</ethernet-type>
</push-mpls-action>
<order>0</order>
</action>
<action>
<set-field>
<protocol-match-fields>
<mpls-label>27</mpls-label>
</protocol-match-fields>
</set-field>
<order>1</order>
</action>
<action>
<output-action>
<output-node-connector>2</output-node-connector>
</output-action>
<order>2</order>
</action>
</apply-actions>
</instruction>
</instructions>
<strict>false</strict>
<id>100</id>
<match>
<ethernet-match>
<ethernet-type>
<type>2048</type>
</ethernet-type>
</ethernet-match>
<in-port>1</in-port>
<ipv4-destination>10.0.0.1/32</ipv4-destination>
</match>
<idle-timeout>0</idle-timeout>
<cookie_mask>255</cookie_mask>
<cookie>401</cookie>
<priority>8</priority>
<hard-timeout>0</hard-timeout>
<installHw>false</installHw>
<table_id>0</table_id>
</flow>
REST API给了我这个:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 415 Unsupported Media Type</title>
</head>
<body>
<h2>HTTP ERROR 415</h2>
<p>Problem accessing /restconf/config/opendaylight-inventory:nodes/node/openflow:1. Reason:
<pre> Unsupported Media Type</pre>
</p>
<hr>
<i>
<small>Powered by Jetty://</small>
</i>
<hr/>
</body>
</html>
xml来自opendaylight示例,所以我认为我在写URL时做错了。
答案 0 :(得分:0)
尝试使用此网址:
(基本上删除了“说明/指令/ 3”)
答案 1 :(得分:0)
您必须在邮递员
上将Request Body上下文类型设置为application / xml