vmware-archive / pyvcloud

Python SDK for VMware vCloud Director
https://vmware.github.io/pyvcloud
Other
170 stars 190 forks source link

Use non-Admin API to query VMs wherever possible #774

Open andrew-lee-1089 opened 3 years ago

andrew-lee-1089 commented 3 years ago

If possible do not use the Admin API:

In the query_vm_by_name method use the non-Admin API I was tempted just to create a new method called query_vm_by_name_not_as_admin but decided that wasn't necessary: I think this fine, both the Admin and non-Admin query return an XML object with a 'href' which is what we care about: As per https://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/types/QueryResultVMRecordType.html and https://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/types/QueryResultAdminVMRecordType.html both return something with a href

@shashim22 added this method last summer in https://github.com/vmware/pyvcloud/pull/367/files so should definitely review, :-)


This change is Reviewable

vmwclabot commented 3 years ago

@andrew-lee-metaswitch, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot commented 3 years ago

@andrew-lee-metaswitch, VMware has approved your signed contributor license agreement.