Get scheduled requests
GET method to view the list of scheduled cloud provisioning requests.
Method | URL | Description |
---|---|---|
GET | https://host_name:port/platform/rest/hostfactory/scheduleddemandrequests | Gets a list of scheduled requests that are submitted to the HostFactory service. |
Prerequisite
You must be the cluster administrator, a read-only cluster administrator, or your user account must be assigned the HF_ALL_REQUESTOR_VIEW permission.
Request
GET https://host_name:port/platform/rest/hostfactory/scheduleddemandrequests?parameters
Parameter | Type | Required/Optional | Description |
---|---|---|---|
reqName | String | Optional | Name of the requestor. To view requests for multiple requestors, specify a comma-separated
list of requestor names (for example, reqName=symA,symB ). |
status | String | Optional | Status of the scheduled request. Valid request status are:
status=Created,Active,Closing,Closed ). |
requestId | String | Optional | ID of the scheduled request. To view hosts provisioned for multiple request IDs, specify a
comma-separated list of request IDs (for example,
&requestId=1114,1115 ). |
requestName | String | Optional | Name of the scheduled request. To view hosts provisioned with specific request names, specify
a comma-separated list of request names (for example,
&requestName=AppA,AppB ). |
createTime | String | Optional | The date and time at which the scheduled request was submitted, represented as a number of
seconds since Linux® epoch (January 1 1970 00:00:00).
|
startTimeOfFirstDemand | Number | Optional | The date and time at which the first request instance by the scheduled request was scheduled
to start, represented as a number of seconds since Linux
epoch (January 1 1970 00:00:00).
|
lastSubmittedTime | Number | Optional | The date and time at which the last request instance by the scheduled request was scheduled
to start, represented as a number of seconds since Linux
epoch (January 1 1970 00:00:00).
|
nextSubmissionTime | Number | Optional | The date and time at which the next request instance by the scheduled request will be
scheduled to start, represented as a number of seconds since Linux epochs (January 1 1970 00:00:00).
|
hfcsrftoken | string | Optional | CSRF token that is obtained with successful login. |
sortBy | String | Optional | Field name by which data must be sorted, which could be: reqName, requestName, requestId, requestComments, status, createTime, startTimeOfFirstDemand, lastSubmittedTime, nextSubmissionTime, schedule, overlapAction, templOrUnit, or templOrUnitQuantity. While you can sort by all fields, you can specify only one field at a time. For example, to sort by each request's creation time, add &sortBy=createTime to the URL. Include the sortOrder parameter to specify the sort order, either ascending or descending. |
sortOrder | Boolean | Optional | Order in which to sort data, either ascending (asc) or descending (desc), for the field name specified in the sortBy parameter. For example, to sort start time in ascending order, add &sortBy=startTime&sortOrder=asc. |
pageSize | Number | Optional | Maximum number of query results per page. You can control this number by configuring the
HF_REST_RESULT_DEFAULT_PAGESIZE and
HF_REST_RESULT_MAX_PAGESIZE parameters in the
hostfactoryconf.json file.
|
startIndex | Number | Optional | Start index of paginated query results. Valid value is 0 (default) or an
integer multiple of the pageSize parameter. For example, when
pageSize is 25, startIndex must be 0,
25, 50, or so on. The startIndex and
pageSize work together to return query results. For example:
|
If you use curl, the command might look like the following
example:
curl --header -b /tmp/cookie --cacert /opt/ibm/spectrumcomputing/wlp/usr/shared/resources/security/cacert.pem --tlsv1.2 -X GET https://myprimaryhost.example.com:9443/platform/rest/hostfactory/scheduleddemandrequests?hfcsrftoken=915ee7644f431e630dac68b9ab3e40bc&reqName=symA,symB&status=Active,Closed&requestId=1114,1115&requestName=AppA,AppB&createTime=10000,20000&sortBy=createTime&sortOrder=desc&startIndex=0&pageSize=100
Response
This command returns a JSON object that follows this
template:
{"page":${current page number}, "records":${total number of records}, "rows":[scheduled requests array], "total":${total page number when pagination}}
For
example:
{
"page": 1,
"records": 3,
"rows": [
{
"createTime": 1598927752,
"lastSubmittedTime": 0,
"nextSubmissionTime": 1601280121,
"overlapAction": "close",
"reqName": "admin",
"requestComments": "Comments",
"requestId": "SD-c812f4e9-ef8e-4a36-a765-96a7b82079d2",
"requestName": "sample3",
"schedule": "FREQ=DAILY;COUNT=3",
"startTimeOfFirstDemand": 1601280121,
"status": "Active",
"templateOrUnit": "Template-VM-5",
"templateOrUnitQuantity": 1
},
{
"createTime": 1602729928,
"lastSubmittedTime": 1602729937,
"nextSubmissionTime": 0,
"overlapAction": "close",
"reqName": "admin",
"requestComments": "Comments",
"requestId": "SD-7a5f39e5-88f2-4029-a62e-9943ae55fc19",
"requestName": "sample2",
"schedule": "",
"startTimeOfFirstDemand": 0,
"status": "Closed",
"templateOrUnit": "Template-VM-5",
"templateOrUnitQuantity": 1
},
{
"createTime": 1603161640,
"lastSubmittedTime": 1603161648,
"nextSubmissionTime": 0,
"overlapAction": "close",
"reqName": "admin",
"requestComments": "Comments",
"requestId": "SD-2a1f611a-4953-4f22-8d90-ed1bc0841274",
"requestName": "sample1",
"schedule": "",
"startTimeOfFirstDemand": 0,
"status": "Active",
"templateOrUnit": "Template-VM-5",
"templateOrUnitQuantity": 1
}
],
"total": 1
}
The
output appears on a single line; it is split here for clarity.Status code | Description |
---|---|
200 | OK |
400 | Bad request |
500 | Internal server error. Check the log files and look for hints in the API response body. |