Files
kata-containers/virtcontainers/pkg/cloud-hypervisor/Makefile
Jose Carlos Venegas Munoz dcac021637 clh: Add Generation tools for API client
cloud-hypervisor provides an API server to send commands
in a qmp and Firecracker style over an Unix socket.

The API is defined via OpenAPI, this commit adds
scripts to help to generate a client using:

https://github.com/OpenAPITools/openapi-generator

This will make easy to update any change related with the API
in the future.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-12-05 15:36:26 +00:00

22 lines
532 B
Makefile

#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
all: | update-yaml generate-client-code
generate-client-code: clean-generated-code
docker run --rm \
--user $$(id -u):$$(id -g) \
-v $${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/cloud-hypervisor.yaml \
-g go \
-o /local/client
update-yaml:
curl -OL https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/master/vmm/src/api/openapi/cloud-hypervisor.yaml
clean-generated-code:
rm "./client" -rf