Skip to content

Commit

Permalink
Merge ac5909c into acfcb24
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtief committed Sep 24, 2021
2 parents acfcb24 + ac5909c commit e4eaf3a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tools/Vrops.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,24 @@ def get_resources(self, target: str, token: str,
adapterkind: str,
resourcekinds: list, # Array of resource kind keys
resource_class, #
resource_status: list = None # Array of resource data collection stats
resource_status: list = None, # Array of resource data collection stats
resource_health: list = None # Array of resource health
) -> (list, int):
logger.debug(f'Getting {resourcekinds} from {target}')
url = "https://" + target + "/suite-api/api/resources/bulk/relationships"
querystring = {
'pageSize': 10000
}
resource_status_array = [] if not resource_status else resource_status
resource_health_array = [] if not resource_health else resource_health
payload = {
"relationshipType": "DESCENDANT",
"resourceIds": uuids,
"resourceQuery": {
"adapterKind": [adapterkind],
"resourceKind": resourcekinds,
"resourceStatus": resource_status_array
"resourceStatus": resource_status_array,
"resourceHealth": resource_health_array
},
"hierarchyDepth": 5
}
Expand Down Expand Up @@ -183,7 +186,13 @@ def get_vms(self, target, token, parent_uuids, vcenter_uuid):
vm_chunks, api_chunk_responding = self.get_resources(target, token, uuid_list, adapterkind="VMWARE",
resourcekinds=["VirtualMachine"],
resource_class=VirtualMachine,
resource_status=["DATA_RECEIVING"])
resource_status=[
"DATA_RECEIVING",
"UNKNOWN"],
resource_health=["GREEN", "YELLOW",
"ORANGE", "GREY"]
)

vms.extend(vm_chunks)
api_responding.append(api_chunk_responding)
logger.debug(f'Number of VMs collected: {len(vms)}')
Expand Down

0 comments on commit e4eaf3a

Please sign in to comment.