VMware Networking Community
jagadeesan1
Contributor
Contributor

NSX Multi-hypervisor API keeps returning 501 Not Implemented

First I got the cookie like below

curl -k -c cookie.file -Happlication/x-www-form-urlencoded -d "username=user&&password=xyzn" -X POST https://<fqdn>/ws.v1/login

and tried using the following request

curl -k -b cookie.file -Happlication/x-www-form-urlencoded -X GET https://<fqdn>/ws.v1/control-cluster/node?_page_length=1000&fields=*

tried  other similar request they all return 501  Not Implemented

Similar request we have tried using the API inspector  inside the NSX Manager ( Multi-hypervisor), It worked !!!.

Any help Greatly Appreciated !!!!

Thanks in Advance

Reply
0 Kudos
1 Reply
ddesmidt
VMware Employee
VMware Employee

What version of NSX-MH are you using?

I followed the same steps you did with success.

Note: 192.168.30.11 is my NSX-MH Controller.

Authentication

===========

root@localhost:~# curl -k -c cookies.txt -d 'username=admin&password=admin' https://192.168.30.11/ws.v1/login

Successful Authentication.

You successfully authenticated.  Use the cookie in this reply in future requests.

root@localhost:~# cat cookies.txt

# Netscape HTTP Cookie File

# http://curl.haxx.se/rfc/cookie_spec.html

# This file was generated by libcurl! Edit at your own risk.

192.168.30.11   FALSE   /       TRUE    0       nvp_sessionid   b3e3387c0c17bb1fb9c3702cbecca589

Request to get the Transport Zone

=========================

root@localhost:~# curl -k -b cookies.txt -s https://192.168.30.11/ws.v1/transport-zone

{"results": [{"_schema": "/ws.v1/schema/TransportZone", "_href": "/ws.v1/transport-zone/349106cf-d4e0-439c-9b52-d123d837908a"}], "result_count": 1}root@localhost:~#

# I like the display better with "python -m json.tool" :slightly_smiling_face:

root@localhost:~# curl -k -b cookies.txt -s https://192.168.30.11/ws.v1/transport-zone  | python -m json.tool

{

    "result_count": 1,

    "results": [

        {

            "_href": "/ws.v1/transport-zone/349106cf-d4e0-439c-9b52-d123d837908a",

            "_schema": "/ws.v1/schema/TransportZone"

        }

    ]

}

Can you give your output?

Reply
0 Kudos