Get task results from a RESTful API client

PUT method to get results of tasks submitted to a session from a RESTful API client.

Method URL Description
PUT https://host_name:port/platform/rest/symrest/v1/clientapi/session/taskresults Get a list of task results for a session, which was created from a RESTful API client.

Request

PUT https://host_name:port/platform/rest/symrest/v1/clientapi/session/taskresults?parameters
Table 1. Request parameters
Parameter Type Required/Optional Description
clusterId string Optional ID of the cluster. When your installation includes multiple clusters, if you do not specify a cluster but defined multiple clusters in the clusters parameter in symrest.json, any cluster is used for the specified application.
applicationName string Required Name of the application.
sessionId string Required ID of the session.
countMax number Optional Maximum number of tasks to fetch results.
filter string Optional Comma-separated task ID set to filter task results, for example, "taskId1,taskId2".
csrftoken string Optional CSRF token that is obtained with successful login.

This command takes a JSON request string, which must contain the task output format as input similar to the following example:

PUT https://mysymresthost.example.com:8050/platform/rest/symrest/v1/clientapi/session/taskresults?applicationName=symping7.3.2&sessionId=1200&csrftoken=915ee7644f431e630dac68b9ab3e40bc
 {
            "taskOutputFormat":
           [
                "SOAM_STRING",
                "SOAM_UINT32", <-- loop counter (can be any number type, but value must be > 0)
                "SOAM_ARRAY_START",
                "SOAM_INT64", <-- first element
                "SOAM_UINT64", <-- second element
                "SOAM_ARRAY_END",
                "SOAM_BINARY"
            ]
}

In this example, the SOAM_ARRAY_START and SOAM_ARRAY_END tags encompass list data types. If your list includes elements with SOAM_INT64 and SOAM_UINT64, use a definition similar to the example. The loop count is defined just before the SOAM_ARRAY_START parameter. If the loop count for the list does not immediately precede the first element in the list, you must update the service code for this change.

The taskOutputFormat parameter supports the following data types: SOAM_INT32, SOAM_UINT32, SOAM_FLOAT, SOAM_DOUBLE, SOAM_BOOL, SOAM_CHAR, SOAM_INT64, SOAM_BYTES:nbytes, SOAM_BYTE_ARRAY, SOAM_STRING_CHARS, SOAM_INT16, SOAM_UINT16, SOAM_UINT64, SOAM_DATA_BLOCK , SOAM_ARRAY_START, and SOAM_ARRAY_END.

The SOAM_BYTES:nbytes tag is different from SOAM_BYTE_ARRAY. Unlike SOAM_BYTE_ARRAY which encodes the array length in the output stream, SOAM_BYTES does not; so the expected format is SOAM_BYTES:10 if 10 bytes are expected. If the byte array length is variable, you must use the SOAM_BYTE_ARRAY, instead of SOAM_BYTES; ensure that you update the service code for this change.

Response

The command returns a list of tasks results; for example:
{
    "taskOutputList": [
    {
        "taskId": "id",
        "taskTag": "id",
        "lastTaskRecoveryId": "id",
        "isSuccessful": "true",		
        "outputData": [
            "Test",
            "2",
            "1",
            "8192",
            "-1",
            "192",          
            "base64encoded"
        ],      
        "errorMessage": "",
    },
   {
         …
    }
   ]
}
Table 2. Response codes
Status code Description
200 Success
400 Bad request
401 Unauthorized
403 Forbidden