使用Postman将流推送到REST ODL API时出错

时间:2018-04-19 19:33:36

标签: opendaylight

我正在尝试使用此URL将此流程推送到ODL的Nytrogen发行版的REST API:

  

http://192.168.21.144:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/flow-node-inventory:table/0/flow/100/instructions/instruction/3

..和这个身体:

<?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时做错了。

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

您必须在邮递员

上将Request Body上下文类型设置为application / xml