vmshepherd.http package¶
Submodules¶
vmshepherd.http.rpc_api module¶
-
class
vmshepherd.http.rpc_api.
RpcApi
(allowed_methods=None)[source]¶ Bases:
aiohttp_jsonrpc.handler.JSONRPCView
RPC Api to manage virtual machines
-
enabled_checker
()[source]¶ Access decorator which checks if a RPC method is enabled by our configuration
-
get_vm_metadata
(preset, vm_id)[source]¶ Get vm metadata
Parameters: - preset (string) – preset name
- vm_id (int) – Virtual Machine id
Returns: Metadata for Virtual Machine
Return type: dict
- Sample response:
{ 'time_shutdown' : "12312312321' }
-
list_vms
(preset)[source]¶ Listing virtual machines in a given preset
Parameters: preset (string) – preset name Returns: (Size of a preset, list of virtual machines) - first element of a tuple is a size of virtual machines in a preset
- second element is a dict which contains all Virtual Machines, where every element of this dict looks like that:
{ "VIRTUAL_MACHINE_ID": { "ip": "IP_ADDR", "state": "VM_STATE" }
Return type: tuple - Sample response:
( 1, {'180aa486-ee46-4628-ab1c-f4554b63231': {'ip': '172.1.1.2', 'state': 'running'}} )
-