EMI.SYS.FILE.INSTALL
Initiates install process of the file from the local temp location. It can also be used to monitor the progress of the installation.
This method takes “session id” and “file name” as parameters. Installation is a task that requires almost exclusive control over the system. Hence it could be started only when all the tasks such as emi.sys.file.get or emi.conf.commit has been completed. The first call to the method will initiate the installation. Following calls may contain filename or omit it, since it is possible to have only one ongoing install process. The results will contain the progress report on the installation.
Request Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| session | JSON String | yes | Session ID |
| filename | JSON String | yes | Specify the local file name which is to be executed |
Response
| Name | Type | Description |
|---|---|---|
| filename | JSON String | File name |
| status | JSON String | File installation status. Returned by install script. |
| complete | JSON Int | File install completition %. Value can be from -1 to 100, where -1 means not applicable. |
Error Codes
| Reference | Description |
|---|---|
| EOK | No errors (contains warnings) |
| EBADPARAM | Error in parameters |
| ENOTFOUND | The specified file not found |
| EGENERAL | Some other error |
| ESESSION | Session with the given ID is not found |
Examples
1st Request to EMI-RPC Server:
{
"EMI-RPC": "1.0",
"id": 1,
"method":"emi.sys.file.install",
"params": {
"session":"some_session_id",
"filename":"file.pkg"
}
}
Response from EMI-RPC Server:
{
"EMI-RPC": "1.0",
"id": 1,
"result":{
"filename":"file.pkg",
"status":"installing",
"complete": 0
}
}
2nd Request to EMI-RPC Server:
{
"EMI-RPC": "1.0",
"id": 2,
"method": "emi.sys.file.install",
"params": {"session": "some_session_id" }
}
Response from EMI-RPC Server:
{
"EMI-RPC": "1.0",
"id": 2,
"result": {
"filename":"file.pkg",
"status":"installing",
"complete": 5
}
}
