| 1 | THIS FILE IS A WORK IN PROGRESS. |
| 2 | |
| 3 | In this file, we will try to formalise the protocol (over JSON) used to make |
| 4 | PHP and JavaScript communicate (for now only from PHP to JS). |
| 5 | |
| 6 | The root element is an object which (may) has the following entries. |
| 7 | |
| 8 | |
| 9 | Always: |
| 10 | ======= |
| 11 | |
| 12 | - error_code: Used to indicate if and what error occured. Possible values: |
| 13 | - 0: no error |
| 14 | - 1: unknown error |
| 15 | |
| 16 | - error_message: If error_code is different from 0, this value contains a |
| 17 | message describing the error which can be display to the user. |
| 18 | |
| 19 | |
| 20 | "login" or "logout": |
| 21 | ==================== |
| 22 | |
| 23 | - user: When the current user changes, this entry is present and contains the |
| 24 | name of the new current user. When the user is not logged in, the current user |
| 25 | is "guest". |
| 26 | |
| 27 | |
| 28 | "dom0s": |
| 29 | ======== |
| 30 | |
| 31 | - dom0s: An array containing all the Dom0s the user is able to see. |
| 32 | |
| 33 | - dom0s[i]: An object describing a Dom0. |
| 34 | - id: A unique identifier for this Dom0. |
| 35 | - address: The full address of this Dom0 (name/IP ':' port). |
| 36 | - ro: A boolean which indicates if this dom0 whether read-only (the user cannot |
| 37 | migrate a vm to it. |
| 38 | - domUs: An array containing all the DomUs belonging to this Dom0 the user is |
| 39 | able to see. |
| 40 | |
| 41 | - dom0s[i].domUs[j]: An object describing a DomU. |
| 42 | - cpus: An array containing the utilisation level in percentage of the CPUs. |
| 43 | - id: Unique identifier of the DomU. |
| 44 | - name: The name of the DomU. |
| 45 | - ro: A boolean which indicates whether this domU is read-only. |
| 46 | - state: The current power state (Running, Halted, Paused). |
| 47 | |
| 48 | |
| 49 | "domU": |
| 50 | ======= |
| 51 | |
| 52 | - domU: An object describing the requested DomU. |
| 53 | - cpus: An array containing the utilisation level in percentage of the CPUs. |
| 54 | - weight: A domain with a weight of 512 will get twice as much CPU as a domain with a weight |
| 55 | of 256 on a contended host. Legal weights range from 1 to 65535 and the default is 256 |
| 56 | - cap: The cap optionally fixes the maximum amount of CPU a domain will be able to consume, |
| 57 | even if the host system has idle CPU cycles. The cap is expressed in percentage of one |
| 58 | physical CPU: 100 is 1 physical CPU, 50 is half a CPU, 400 is 4 CPUs, etc. |
| 59 | The default, 0, means there is no upper cap. |
| 60 | - d_min_ram: Dynamic Minimum RAM : how many min RAM the system can have while running |
| 61 | - d_max_ram: Dynamic Max RAM : how many max RAM the system can have while running |
| 62 | - s_min_ram: Static Min RAM : how many min RAM the system can have at startup |
| 63 | - s_max_ram: Static Max RAM : how many max RAM the system can have at startup |
| 64 | - dom0_id: The identifier of the Dom0 this DomU belongs to. |
| 65 | - id: Unique identifier of the DomU. |
| 66 | - kernel: The path to the kernel. |
| 67 | - name: The name of the DomU. |
| 68 | - on_crash: Action to do after the DomU crashes. |
| 69 | - on_reboot: Action to do after the DomU reboots. |
| 70 | - on_shutdown: Action to do after the DomU shutdowns. |
| 71 | - ro: A boolean which indicates whether this domU is read-only. |
| 72 | - state: The current power state (Running, Halted, Paused). |
| 73 | - start_time: Timestamp which indicates when the DomU started. |
| 74 | - on_reboot: behavior of a DomU after a reboot (can be destroy/restart/preserve) |
| 75 | - on_shutdown: behavior of a DomU after a shutdown (can be destroy/restart/preserve) |
| 76 | - on_crash: behavior of a DomU after a crash (can be destroy/restart/preserve) |
| 77 | |
| 78 | |
| 79 | |