Hi Hitoshi,

See my answers below:

> On Oct 18, 2019, at 4:56 AM, Hitoshi Kaneko <[email protected]> 
> wrote:
> 
> Luis Gomez-san, 
> 
> This is Hitoshi.
> 
> Thank you for your answer and kindness.
> 
> I have tried to use “POST Method”, describing below.
> Is my command correct?

It seems correct but have you also tried the PUT with the original body and the 
modified URL I suggested?

> However, it has error ended.
> May it be problems of ODL?

If you get HTTP 500, there is surely some logging in the kara.log that can be 
used to troubleshoot further.

> Do I have better use new version of ODL?

We push lot of fixes in every release, so yes I would suggest to use a newest 
version from this page: 
https://docs.opendaylight.org/en/stable-sodium/downloads.html 
<https://docs.opendaylight.org/en/stable-sodium/downloads.html>

Also make sure the JUNOS is 17.4X or more updated version. I heard previous 
versions have some problems with ODL.

BR/Luis


> 
> 
> Thank you.
> Regards,
> Hitoshi Kaneko
> E-mail: Hitoshi Kaneko <[email protected]>
> 
> =====================================================-
> kaneko@kaneko-PowerEdge-T130-3:~$ curl -v -k -u admin:admin -H "Content-Type: 
> application/json" -X POST 
> http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/Juniper-tst02/yang-ext:mount/configuration:configuration/interfaces/interface/ge-0%2F0%2F2/
>  -d '
>> {
>>  "unit": [
>>    {
>>      "name": "0",
>>      "family": {
>>        "inet": {
>>          "address": [
>>            {
>>              "name": "192.168.30.2/24"
>>            }
>>          ]
>>        }
>>      }
>>    }
>>  ]
>> }' | jq .
> Note: Unnecessary use of -X or --request, POST is already inferred.
>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                 Dload  Upload   Total   Spent    Left  Speed
>  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     
> 0*   Trying 127.0.0.1...
> * Connected to localhost (127.0.0.1) port 8181 (#0)
> * Server auth using Basic with user 'admin'
>> POST 
>> /restconf/config/network-topology:network-topology/topology/topology-netconf/node/Juniper-tst02/yang-ext:mount/configuration:configuration/interfaces/interface/ge-0%2F0%2F2/
>>  HTTP/1.1
>> Host: localhost:8181
>> Authorization: Basic YWRtaW46YWRtaW4=
>> User-Agent: curl/7.47.0
>> Accept: */*
>> Content-Type: application/json
>> Content-Length: 208
>> 
> } [208 bytes data]
> * upload completely sent off: 208 out of 208 bytes
> < HTTP/1.1 500 Server Error
> < Set-Cookie: JSESSIONID=1orv2m1ta3ng1na395yrbtz9k;Path=/restconf
> < Set-Cookie: rememberMe=deleteMe; Path=/restconf; Max-Age=0; Expires=Thu, 
> 17-Oct-2019 20:39:27 GMT
> < Content-Type: text/html;charset=ISO-8859-1
> < Cache-Control: must-revalidate,no-cache,no-store
> < Content-Length: 2832
> < Server: Jetty(8.1.19.v20160209)
> < 
> { [2832 bytes data]
> 100  3040  100  2832  100   208   474k  35677 --:--:-- --:--:-- --:--:--  553k
> * Connection #0 to host localhost left intact
> parse error: Invalid numeric literal at line 2, column 0
> kaneko@kaneko-PowerEdge-T130-3:~$ 
> 
> 
> -----Original Message-----
> From: Luis Gomez <[email protected]> 
> Sent: Friday, October 18, 2019 3:38 PM
> To: Hitoshi Kaneko <[email protected]>
> Cc: discuss <[email protected]>; netconf-dev 
> <[email protected]>
> Subject: Re: [OpenDaylight Discuss] about setting NIC-IP-address through 
> ODL/Netconf(there have been progress)
> 
> Hi Hitoshi,
> 
> 0.5.3-Boron-SR3, may I ask why you are using so old version of ODL? this 
> version is long time not supported in ODL :(
> 
> Regarding the ERROR, I think you are using wrong method here:
> 
> if you use PUT you have to specify the interface in the URL, something like 
> this:
> 
> curl -v -k -u admin:admin -H "Content-Type: application/json" -X PUT 
> http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/Juniper-tst02/yang-ext:mount/configuration:configuration/interfaces/interface/ge-0%2F0%2F2
>  -d '
> {
> "interface": [
>   {
>     "name": "ge-0/0/2",
>     "unit": [
>       {
>         "name": "0",
>         "family": {
>           "inet": {
>             "address": [
>               {
>                 "name": "192.168.30.5/24"
>               }
>             ]
>           }
>         }
>       }
>     ]
>   }
> ]
> }'
> 
> If you do not want to specify interface in URL, then you can use POST vs PUT.
> 
> BR/Luis
> 
> 
>> On Oct 17, 2019, at 10:47 PM, Hitoshi Kaneko 
>> <[email protected]> wrote:
>> 
>> Hello, my name is Hitoshi Kaneko.
>> I belong to NTT Laboratories.
>> Although I have queried about above title the other day, as there have been 
>> progress, I am sorry but please let me query again.
>> Our state is below.
>> (Target machine is Juniper vMX, ODL version is 0.5.3-Boron-SR3 )
>> (1)  "Getting NIC-IP-address through ODL/Netconf" was normal ended (below 
>> log㈰)
>> (2)  "Changing NIC-IP-address through ODL/Netconf" was normal ended (below 
>> log㈪)
>> (3)  "Deleting NIC-IP-address through ODL/Netconf" was normal ended(below 
>> log㈫)
>> But, 
>> (4)  "Creating NIC-IP-address through ODL/Netconf" was error ended(below 
>> log㈬)
>> About (4), Where is there my mistake?
>> Or, Is feature if "Creating NIC-IP-address through ODL/Netconf" supported by 
>> ODL ?
>> I am happy if you send comment for my question.
>> Thank you.
>> Regards,
>> Hitoshi Kaneko
>> E-mail: Hitoshi Kaneko <[email protected]>
>> 
>> ================= LOGS ===============
>> ㈰kaneko@kaneko-PowerEdge-T130-3:~$ curl -v -k -u admin:admin -H 
>> "Content-Type: application/xml" -X GET 
>> http://localhost:8181/restconf/config/network-topology:network-topolog
>> y/topology/topology-netconf/node/Juniper-tst02/yang-ext:mount/
>> configuration:configuration/interfaces/interface/ge-0%2F0%2F2 | jq .
>> Note: Unnecessary use of -X or --request, GET is already inferred.
>> % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>>                                Dload  Upload   Total   Spent    Left  Speed
>> 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     
>> 0*   Trying 127.0.0.1...
>> * Connected to localhost (127.0.0.1) port 8181 (#0)
>> * Server auth using Basic with user 'admin'
>>> GET
>> /restconf/config/network-topology:network-topology/topology/topology-n
>> etconf/node/Juniper-tst02/yang-ext:mount/configuration:configu
>> ration/interfaces/interface/ge-0%2F0%2F2 HTTP/1.1
>>> Host: localhost:8181
>>> Authorization: Basic YWRtaW46YWRtaW4=
>>> User-Agent: curl/7.47.0
>>> Accept: */*
>>> Content-Type: application/xml
>>> 
>> < HTTP/1.1 200 OK
>> < Set-Cookie: JSESSIONID=jireinjf2qxd1cpw6tiy59zjm;Path=/restconf
>> < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Set-Cookie: 
>> rememberMe=deleteMe; Path=/restconf; Max-Age=0; Expires=Thu, 
>> 17-Oct-2019 14:25:24 GMT < Content-Type: application/yang.data+json < 
>> Vary: Accept-Encoding, User-Agent < Transfer-Encoding: chunked < 
>> Server: Jetty(8.1.19.v20160209) < { [127 bytes data]
>> 100   116    0   116    0     0   8705      0 --:--:-- --:--:-- --:--:--  
>> 8923
>> * Connection #0 to host localhost left intact {
>> "interface": [
>>   {
>>     "name": "ge-0/0/2",
>>     "unit": [
>>       {
>>         "name": "0",
>>         "family": {
>>           "inet": {
>>             "address": [
>>               {
>>                 "name": "192.168.30.2/24"
>>               }
>>             ]
>>           }
>>         }
>>       }
>>     ]
>>   }
>> ]
>> }
>> 
>> 
>> ㈪kaneko@kaneko-PowerEdge-T130-3:~$ curl -v -k -u admin:admin -H 
>> "Content-Type: application/json" -X PUT 
>> http://localhost:8181/restconf/config/network-topology:network-topolog
>> y/topology/topology-netconf/node/Juniper-tst02/yang-ext:mount/
>> configuration:configuration/interfaces/interface/ge-0%2F0%2F2/ -d '
>>> {
>>> "interface": [
>>>   {
>>>     "name": "ge-0/0/2",
>>>     "unit": [
>>>       {
>>>         "name": "0",
>>>         "family": {
>>>           "inet": {
>>>             "address": [
>>>               {
>>>                 "name": "192.168.30.5/24"
>>>               }
>>>             ]
>>>           }
>>>         }
>>>       }
>>>     ]
>>>   }
>>> ]
>>> }' | jq .
>> % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>>                                Dload  Upload   Total   Spent    Left  Speed
>> 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     
>> 0*   Trying 127.0.0.1...
>> * Connected to localhost (127.0.0.1) port 8181 (#0)
>> * Server auth using Basic with user 'admin'
>>> PUT
>> /restconf/config/network-topology:network-topology/topology/topology-n
>> etconf/node/Juniper-tst02/yang-ext:mount/configuration:configu
>> ration/interfaces/interface/ge-0%2F0%2F2/ HTTP/1.1
>>> Host: localhost:8181
>>> Authorization: Basic YWRtaW46YWRtaW4=
>>> User-Agent: curl/7.47.0
>>> Accept: */*
>>> Content-Type: application/json
>>> Content-Length: 323
>>> 
>> } [323 bytes data]
>> * upload completely sent off: 323 out of 323 bytes < HTTP/1.1 200 OK < 
>> Set-Cookie: JSESSIONID=1u8ofuwyp7lng1yie18rq35z3;Path=/restconf
>> < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Set-Cookie: 
>> rememberMe=deleteMe; Path=/restconf; Max-Age=0; Expires=Thu, 
>> 17-Oct-2019 14:25:47 GMT < Content-Length: 0 < Server: 
>> Jetty(8.1.19.v20160209) <
>> 100   323    0     0  100   323      0    339 --:--:-- --:--:-- --:--:--   
>> 340
>> * Connection #0 to host localhost left intact
>> 
>> 
>> 
>> ㈫kaneko@kaneko-PowerEdge-T130-3:~$ curl -v -k -u admin:admin -H 
>> "Content-Type: application/xml" -X DELETE 
>> http://localhost:8181/restconf/config/network-topology:network-topolog
>> y/topology/topology-netconf/node/Juniper-tst02/yang-ext:mount/
>> configuration:configuration/interfaces/interface/ge-0%2F0%2F2 | jq .
>> % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>>                                Dload  Upload   Total   Spent    Left  Speed
>> 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     
>> 0*   Trying 127.0.0.1...
>> * Connected to localhost (127.0.0.1) port 8181 (#0)
>> * Server auth using Basic with user 'admin'
>>> DELETE
>> /restconf/config/network-topology:network-topology/topology/topology-n
>> etconf/node/Juniper-tst02/yang-ext:mount/configuration:configu
>> ration/interfaces/interface/ge-0%2F0%2F2 HTTP/1.1
>>> Host: localhost:8181
>>> Authorization: Basic YWRtaW46YWRtaW4=
>>> User-Agent: curl/7.47.0
>>> Accept: */*
>>> Content-Type: application/xml
>>> 
>> 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     
>> 0< HTTP/1.1 200 OK
>> < Set-Cookie: JSESSIONID=2z8764ry74kg1v9j5q28vmz7k;Path=/restconf
>> < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Set-Cookie: 
>> rememberMe=deleteMe; Path=/restconf; Max-Age=0; Expires=Thu, 
>> 17-Oct-2019 14:27:14 GMT < Content-Length: 0 < Server: 
>> Jetty(8.1.19.v20160209) <
>> 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
>> * Connection #0 to host localhost left intact
>> 
>> 
>> ㈬kaneko@kaneko-PowerEdge-T130-3:~$ curl -v -k -u admin:admin -H 
>> "Content-Type: application/json" -X PUT 
>> http://localhost:8181/restconf/config/network-topology:network-topolog
>> y/topology/topology-netconf/node/Juniper-tst02/yang-ext:mount/
>> configuration:configuration/interfaces -d '
>>> {
>>> "interface": [
>>>   {
>>>     "name": "ge-0/0/2",
>>>     "unit": [
>>>       {
>>>         "name": "0",
>>>         "family": {
>>>           "inet": {
>>>             "address": [
>>>               {
>>>                 "name": "192.168.30.5/24"
>>>               }
>>>             ]
>>>           }
>>>         }
>>>       }
>>>     ]
>>>   }
>>> ]
>>> }' | jq .
>> % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>>                                Dload  Upload   Total   Spent    Left  Speed
>> 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     
>> 0*   Trying 127.0.0.1...
>> * Connected to localhost (127.0.0.1) port 8181 (#0)
>> * Server auth using Basic with user 'admin'
>>> PUT
>> /restconf/config/network-topology:network-topology/topology/topology-n
>> etconf/node/Juniper-tst02/yang-ext:mount/configuration:configu
>> ration/interfaces HTTP/1.1
>>> Host: localhost:8181
>>> Authorization: Basic YWRtaW46YWRtaW4=
>>> User-Agent: curl/7.47.0
>>> Accept: */*
>>> Content-Type: application/json
>>> Content-Length: 323
>>> 
>> } [323 bytes data]
>> * upload completely sent off: 323 out of 323 bytes < HTTP/1.1 400 Bad 
>> Request < Set-Cookie: 
>> JSESSIONID=1qpy21c0uw5aqm0xpkxabgl4h;Path=/restconf
>> < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Set-Cookie: 
>> rememberMe=deleteMe; Path=/restconf; Max-Age=0; Expires=Thu, 
>> 17-Oct-2019 14:27:53 GMT < Content-Type: application/json < 
>> Transfer-Encoding: chunked < Server: Jetty(8.1.19.v20160209) < { [7487 
>> bytes data]
>> 100  7797    0  7474  100   323  1271k  56252 --:--:-- --:--:-- --:--:-- 
>> 1459k
>> * Connection #0 to host localhost left intact {
>> "errors": {
>>   "error": [
>>     {
>>       "error-type": "protocol",
>>       "error-tag": "malformed-message",
>>       "error-message": "Error parsing input: Schema node with name 
>> interface wasn't found under 
>> (http://xml.juniper.net/xnm/1.1/xnm?revision=2015-09-11)configuration.",
>>       "error-info": "java.lang.IllegalStateException: Schema node 
>> with name interface wasn't found under (http://xml.juniper -- snip
>>     }
>>   ]
>> }
>> }
>> kaneko@kaneko-PowerEdge-T130-3:~$
>> 
>> 
>> 
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> 
>> View/Reply Online (#8454): 
>> https://lists.opendaylight.org/g/Discuss/message/8454
>> Mute This Topic: https://lists.opendaylight.org/mt/35011870/1217165
>> Group Owner: [email protected]
>> Unsubscribe: https://lists.opendaylight.org/g/Discuss/unsub  
>> [[email protected]]
>> -=-=-=-=-=-=-=-=-=-=-=-
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8457): https://lists.opendaylight.org/g/Discuss/message/8457
Mute This Topic: https://lists.opendaylight.org/mt/35011870/21656
Group Owner: [email protected]
Unsubscribe: https://lists.opendaylight.org/g/Discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to