Module upgrade via Tenant API
The Install/Update operation will create a "job" on the server side and return HTTP status 201 along with a location of the newly created install job.
If the module supports version 2 of the _tenant interface the module may either return 204 (No Content) if job is successfully completed. If the module chooses to perform the tenant operation asynchronously, it returns 201 (Created) with Location header. For example:
Request:
POST {{url}}/_/tenant
{
"module_to": "{{upgrade_version}}",
"parameters": [{
"key": "loadSample",
"value": "false"
},{
"key": "loadReference",
"value": "false"
}]
}
Response:
{
"id" : "458b6397-c4d2-46b2-a771-ace8a310bcea",
"tenant" : {{tenant}},
"tenantAttributes" : {
"module_to" : "{{upgrade_version}}",
"parameters" : [ {
"key" : "loadSample",
"value" : "false"
}, {
"key" : "loadReference",
"value" : "false"
} ]
},
"complete" : false,
"messages" : [ ]
}
Location: /_/tenant/458b6397-c4d2-46b2-a771-ace8a310bcea
This location can then be inspected with HTTP GET for the progress of the install operation. The location is same base URI as install, but with a slash + the job ID.
To be sure that there are no errors after Install/Upgrade we can send GET request to {{url}}/_/tenant/{{job_id}} API (again) with a wait parameter until "complete" is true.
For example:
Request:
GET {{url}}/_/tenant/458b6397-c4d2-46b2-a771-ace8a310bcea?wait=30000
Response:
{
"id" : "a4d49bed-52f9-439d-9d2e-2fb77e9081af",
"tenant" : "{{tenant}}",
"tenantAttributes" : {
"module_to" : "{{upgrade_version}}",
"parameters" : [ {
"key" : "loadSample",
"value" : "false"
}, {
"key" : "loadReference",
"value" : "false"
} ]
},
"complete" : true,
"messages" : [ ]
}