From f61eca892027811bf40b5a3f3725d6b3b236770d Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 19 Mar 2020 19:08:57 +0000 Subject: [PATCH] clh: Add comments around clh api To make easier to know what a method of API is expected to do without go to cloud-hypervisor documentation. Signed-off-by: Jose Carlos Venegas Munoz --- virtcontainers/clh.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virtcontainers/clh.go b/virtcontainers/clh.go index d7424544e7..10a6048a0c 100644 --- a/virtcontainers/clh.go +++ b/virtcontainers/clh.go @@ -72,13 +72,20 @@ const ( // The main purpose is to hide the client in an interface to allow mock testing. // This is an interface that has to match with OpenAPI CLH client type clhClient interface { + // Check for the REST API availability VmmPingGet(ctx context.Context) (chclient.VmmPingResponse, *http.Response, error) + // Shut the VMM down ShutdownVMM(ctx context.Context) (*http.Response, error) + // Create the VM CreateVM(ctx context.Context, vmConfig chclient.VmConfig) (*http.Response, error) + // Dump the VM information // No lint: golint suggest to rename to VMInfoGet. VmInfoGet(ctx context.Context) (chclient.VmInfo, *http.Response, error) //nolint:golint + // Boot the VM BootVM(ctx context.Context) (*http.Response, error) + // Add/remove CPUs to/from the VM VmResizePut(ctx context.Context, vmResize chclient.VmResize) (*http.Response, error) + // Add VFIO PCI device to the VM VmAddDevicePut(ctx context.Context, vmAddDevice chclient.VmAddDevice) (*http.Response, error) }