MostafaElSayedF
Enthusiast
Enthusiast

NSX REST API Explore

Can you tell us about your experience with the NSX API? Sharing with you one of the good sites for  api understand and library for coding NSX-T Data Center REST API - VMware API Explorer - VMware {code}

Not only for NSX it is for all the VMware codes.Home - VMware {code}

I hope this answer your question and i hope that this become answer or helpful comment for you. also, for More details and more information just follow my blog https://www.syncgates.com Mostafa Fahmy
Tags (1)
0 Kudos
2 Replies
frippeisking
Contributor
Contributor

I've just started out so I might have a few knowledge gaps here.

But for one I'm missing the Odata filter capabilities of NSX REST API from what I can tell.
The only way to filter is via the search API which is awkward.

Created an action which takes a resource type and builds a query string. Passes it through a URI encoding to be safe but
I cannot get this to work. Authentication is successful.

Not sure what error code 98 is.

 

2020-11-24 09:06:15.583 +01:00 INFO(com.my.nsx/searchResourceByName) queryString: query=resource_type:group
2020-11-24 09:06:15.587 +01:00 INFO(com.my.nsx/searchResourceByName) GET: Encoded - /api/v1/search/query?query=resource_type:group
2020-11-24 09:06:15.674 +01:00 DEBUG(com.my.nsx/searchResourceByName) {"module_name":"common-service","error_message":"/api/api/v1/search/query","error_code":98}
2020-11-24 09:06:15.675 +01:00 ERROR(com.my.nsx/searchResourceByName) REST: Resource does not exist
2020-11-24 09:06:15.676 +01:00 INFO(com.my.nsx/searchResourceByName) null

 

 

A normal get on a resource works but returns all id's. Not wanting to filter on the client side for obvious performance reasons when the env scales.


0 Kudos
frippe75
Contributor
Contributor

Follow up...

 

"error_message":"/api/api/v1/search/query"


Had "<endpoint>:/api" as my REST host and passed /api to my request... So /api/api was off course incorrect. Just couldn't pick that up reading the error message. 

0 Kudos