getRequestStatus reference

The getRequestStatus script retrieves the status of an asynchronous request such as requestMachines and requestReturnMachines.

Calling convention

Windows:
getRequestStatus.bat -f input.json
Linux®:
getRequestStatus.sh -f input.json

Input

(Required) A JSON file in the following format:
{
  "requests":
    {
      "requestId": "Required. Valid value type is string. Unique ID to identify this request in the cloud provider"
    }
}
For example:
{
  "requests":
    {
      "requestId": "req-33e9ed03-62c0-4b46-b7cd-3c54fb497b72"
    }
}
Find a sample getRequestStatus at:
  • Windows: Installation_top\hostfactory\1.2\samples\providers\custom\scripts\getRequestStatus.bat.
  • Linux: $EGO_TOP/hostfactory/1.2/samples/providers/custom/scripts/getRequestStatus.sh.

Output

A JSON file in the following format:
{
   "requests": {
      "requestId":  "(mandatory)(string) Unique ID to identify this request in the cloud provider",
      "message": "(optional)(string) Any additional message the caller should know",
      "status": "(mandatory)(string) Status of request. Possible values: 'running', 'complete', 'complete_with_error'. You should check the machine information, if any, when the value is 'complete' or 'complete_with_error'",
      "machines": {
           "machineId" : "(mandatory)(string) ID of the machine being retrieved from provider",
           "name": "(mandatory)(string) Host name of the machine",
           "result": "(mandatory)(string) "Status of this request related to this machine. Possible values:  'executing', 'fail', 'succeed'. For example,
call requestMachines with templateId and machineCount 3, and then call getRequestStatus to check the status of this request. We should get 3 machines with
result 'succeed'. If any machine is missing or the status is not correct, that machine is not usable.",
           "status" : "(optional)(string) Status of machine. Expected values: running, stopped, terminated, shutting-down, stopping."
           "privateIpAddress" : "(mandatory)(string) private IP address of the machine",
           "publicIpAddress" :  "(optional)(string) public IP address of the machine",
           "launchtime": (mandatory)(numeric) Launch time of the machine in seconds (UTC format)",
           "message": "(mandatory if the value of 'result' parameter is 'fail')(string). Additional message for the request status of this machine"
          }
    }
}
For example:
{
  "requests" :  {
    "requestId": "req-33e9ed03-62c0-4b46-b7cd-3c54fb497b72",
    "status" : "complete",
    "machines" :  {
      "machineId" : "abcduKg",
      "name" : "hostskFVtVRMki",
      "status" : "RUNNING",
      "result" : "succeed",
      "privateIpAddress" : "192.168.195.222",
      "publicIpAddress" : "9.111.186.156",
      "launchtime" : 1516131665,
      "message" : ""
    } 
  } 
}