Syntax to Find All Individual Results

POST /core/health-query-tasks submits a request for all individual results for the latest execution of a configuration.

Input

Use the supported input parameters to control the command output.

Parameter Description
URL https://$vRA:8090/core/health-query-tasks
$vRA

Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server.

$healthtoken Specifies a valid authentication token for the health services API.
Note: The request does not use the API endpoint so healthbroker-proxy-service/api is not used.

Response Status Codes

One of the following codes is displayed as a result of your synchronization request.

Status Code Description
200 OK Your request succeeded and the object was updated.
400 BAD REQUEST The data you provided in the POST failed validation. Inspect the response body for details.
401 UNAUTHORIZED The request might not authenticate the user or authentication credentials required.

curl Command to Retrieve all the Individual Results for the Latest Execution

The following example command retrieves the individual results for the execution named /health/result/overall-results/Report_089adaf3-44d3-4cb2-a1a5-d2de4f376e73-20180322-19.29.00.0471.
curl -X --insecure -H "content-type: application/json" -H "x-xenon-auth-token: $healthtoken" https://$vRA:8090/core/health-query-tasks
{
    "taskInfo": {
        "isDirect": true
    },
    "querySpec": {
        "query": {
            "occurance": "MUST_OCCUR",
            "booleanClauses": [{
                "occurance": "MUST_OCCUR",
                "term": {
                    "propertyName": "documentKind",
                    "matchValue": "com:vmware:healthbroker:states:IndividualTestResultServiceState",
                    "matchType": "TERM"
                }
            },
            {
                "occurance": "MUST_OCCUR",
                "term": {
                    "propertyName": "overallResultsLink",
                    "matchValue": "/health/result/overall-results/Report_089adaf3-44d3-4cb2-a1a5-d2de4f376e73-20180322-19.29.00.0471",
                    "matchType": "TERM"
                }
            }]
        },
        "sortTerm": {
            "propertyName": "state",
            "propertyType": "STRING"
        },
        "sortOrder": "DESC",
        "options": ["EXPAND_CONTENT",
        "SORT"]
    }
}

JSON Output

The following snippet is from the output that shows all the individual results for the latest execution of the configuration. This section shows an example of the message that appears if the test fails. The value of the overallResultsLink is the matched value from the input body.
{
    "taskInfo": {
    ...
    },
    "querySpec": {
        "query": {
        ...
        }
    },
    "results": {        
        "documentLinks": [            
            "/health/exec/executions/12858d4c34f278755680551d322f0"        
        ],        
        "documents": {            
            "/health/result/individual-result/Report_089..." : {                
                "testMethod": {                    
                    "name": "Check Storage Reservation Policy to Reservation Assignments",                    
                    "description": "This test collects all storages that are assigned a storage reservation policy(from all tenants), and checks them against created reservations(in the specified tenant) to see if that storage is assigned to a reservation.",                    
                    "descriptionType": "text",                    
                    "severity": "NORMAL",                    
                    "methodName": "CheckIfAllStorageReservationPoliciesAreAssignedToReservations",                    
                    "accessLevel": "NORMAL",                    
                    "enabled": false,                    
                    "configurationReferences": []                
                },                
                "startTime": "1521746961853",                
                "endTime": "1521746962763",                
                "state": "FAILED",                
                "message": "[Storage reservation policy [Rainpole High Speed] is assigned to storage [Datastore1], but the storage is not in any reservation in tenant [rainpole].]\n[Storage reservation policy [Rainpole Low Cost] is assigned to storage [VNXe:nsx61-data1], but the storage is not in any reservation in tenant [rainpole].]\n[Storage reservation policy [Rainpole High Speed] is assigned to storage [VNXe:nsx61-data2], but the storage is not in any reservation in tenant [rainpole].] expected [false] but found [true]",                
                "remediationType": "html",                
                "remediation": "http://pubs.vmware.com/vrealize-automation-72/index.jsp#com.vmware.vrealize.automation.doc/GUID-95AADE6A-4CE2-4AC9-9D1F-1E42DC3E52FF.html",                
                "overallResultsLink": "/health/result/overall-results/Report_089adaf3-44d3-4cb2-a1a5-d2de4f376e73-20180322-19.29.00.0471",   
            ...
            },
        ...
        },
    ...
    },
...
}