Ошибка отправки потока в REST ODL API с помощью Postman

Я пытаюсь отправить этот поток в REST API дистрибутива ODL Nytrogen с помощью этого URL-адреса:

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.


person juanan martinez    schedule 19.04.2018    source источник


Ответы (2)


попробуйте только этот URL:

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

(в основном удаляя «инструкции/инструкции/3»)

person jamo    schedule 19.04.2018

вы должны установить тип контекста тела запроса на application/xml на почтальоне

person nephilim_boy    schedule 20.04.2018