vmware / python-client-for-vmware-cloud-on-aws

Python Client for VMware Cloud on AWS is an open-source Python-based tool. Written in Python, the tool enables VMware Cloud on AWS users to automate the consumption of their VMware Cloud on AWS SDDC.
Other
23 stars 20 forks source link

Feature: implemented NSX-T Search API #85

Closed fr0gger03 closed 2 years ago

fr0gger03 commented 2 years ago

A new function in pyVMC - search_nsx - leverages the NSX-T search API for fast return of objects from the NSX-T proxy. At this point it only works for native NSX-T objects - i.e. it is not integrated with the AWS integration API.

The search function in pyVMC leverages a shared function to automatically create a table using prettytable... The "generate_table" function reads the keys of a json payload passed as an argument and uses those keys as the column headers for a prettytable. Due to the widely divergent data returned by different objects, some manipulation of the data is necessary in the search function prior to passing the "results" argument to the generate_table function.

Today, the new "search-nsx" function accepts only a single argument (though the API allows for more). For example:

./pyVMC.py search-nsx Segment

Signed-off-by: Tom Twyman ttwyman@vmware.com