diff --git a/Makefile.work b/Makefile.work index 71175d5c4..a1ccf8715 100644 --- a/Makefile.work +++ b/Makefile.work @@ -177,6 +177,7 @@ SONIC_BUILD_INSTRUCTION := make \ HTTP_PROXY=$(http_proxy) \ HTTPS_PROXY=$(https_proxy) \ SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \ + SONIC_ENABLE_RESTAPI=$(ENABLE_RESTAPI) \ EXTRA_JESSIE_TARGETS=$(EXTRA_JESSIE_TARGETS) \ $(SONIC_OVERRIDE_BUILD_VARS) diff --git a/rules/config b/rules/config index a559a5b2f..c8a24606f 100644 --- a/rules/config +++ b/rules/config @@ -104,3 +104,6 @@ ENABLE_SFLOW = y # ENABLE_MGMT_FRAMEWORK - build docker-sonic-mgt-framework for CLI and REST server support ENABLE_MGMT_FRAMEWORK = y + +# ENABLE_RESTAPI - build docker-sonic-restapi for configuring the switch using REST APIs +ENABLE_RESTAPI = n diff --git a/rules/docker-restapi.mk b/rules/docker-restapi.mk index 66d602059..7c02e0d4e 100644 --- a/rules/docker-restapi.mk +++ b/rules/docker-restapi.mk @@ -10,9 +10,11 @@ $(DOCKER_RESTAPI)_PATH = $(DOCKERS_PATH)/$(DOCKER_RESTAPI_STEM) $(DOCKER_RESTAPI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +ifeq ($(ENABLE_RESTAPI), y) SONIC_DOCKER_IMAGES += $(DOCKER_RESTAPI) SONIC_STRETCH_DOCKERS += $(DOCKER_RESTAPI) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_RESTAPI) +endif $(DOCKER_RESTAPI)_CONTAINER_NAME = rest-api $(DOCKER_RESTAPI)_RUN_OPT += --cap-add NET_ADMIN --privileged -t diff --git a/slave.mk b/slave.mk index 8f8c4dd87..8e7253d7e 100644 --- a/slave.mk +++ b/slave.mk @@ -100,6 +100,10 @@ ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) ENABLE_SYSTEM_TELEMETRY = N endif +ifeq ($(SONIC_ENABLE_RESTAPI),y) +ENABLE_RESTAPI = y +endif + ifeq ($(SONIC_ENABLE_SYNCD_RPC),y) ENABLE_SYNCD_RPC = y endif @@ -190,6 +194,7 @@ $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") $(info "HTTP_PROXY" : "$(HTTP_PROXY)") $(info "HTTPS_PROXY" : "$(HTTPS_PROXY)") $(info "ENABLE_SYSTEM_TELEMETRY" : "$(ENABLE_SYSTEM_TELEMETRY)") +$(info "ENABLE_RESTAPI" : "$(ENABLE_RESTAPI)") $(info "ENABLE_ZTP" : "$(ENABLE_ZTP)") $(info "SONIC_DEBUGGING_ON" : "$(SONIC_DEBUGGING_ON)") $(info "SONIC_PROFILING_ON" : "$(SONIC_PROFILING_ON)") @@ -643,6 +648,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)" export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)" export enable_system_telemetry="$(ENABLE_SYSTEM_TELEMETRY)" + export enable_restapi="$(ENABLE_RESTAPI)" export enable_ztp="$(ENABLE_ZTP)" export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)" export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)"