From fdbdad593bf1992fc16ea664f422bf54704c2788 Mon Sep 17 00:00:00 2001 From: Carlos Lapao Date: Fri, 8 Nov 2024 11:28:22 +0000 Subject: [PATCH] Adds endpoint to the orchestrator to query a host hardware - Adds the support for an orchestrator to query the hardware endpoint of a host returning the raw data to use with terraform --- src/controllers/orchestrator.go | 989 +++++++++--------- .../create_host_reverse_proxy_host.go | 2 +- .../delete_host_reverse_proxy_host.go | 2 +- ...lete_host_reverse_proxy_host_http_route.go | 2 +- .../update_host_reverse_proxy_host.go | 2 +- ...pdate_host_reverse_proxy_host_tcp_route.go | 1 + 6 files changed, 523 insertions(+), 475 deletions(-) diff --git a/src/controllers/orchestrator.go b/src/controllers/orchestrator.go index a24f2ee..dc42f52 100644 --- a/src/controllers/orchestrator.go +++ b/src/controllers/orchestrator.go @@ -32,6 +32,14 @@ func registerOrchestratorHostsHandlers(ctx basecontext.ApiContext, version strin WithHandler(GetOrchestratorHostHandler()). Register() + restapi.NewController(). + WithMethod(restapi.GET). + WithVersion(version). + WithPath("/orchestrator/hosts/{id}/hardware"). + WithRequiredClaim(constants.LIST_CLAIM). + WithHandler(GetOrchestratorHostHardwareInfoHandler()). + Register() + restapi.NewController(). WithMethod(restapi.POST). WithVersion(version). @@ -353,16 +361,16 @@ func registerOrchestratorHostsHandlers(ctx basecontext.ApiContext, version strin Register() } -// @Summary Gets all hosts from the orchestrator -// @Description This endpoint returns all hosts from the orchestrator -// @Tags Orchestrator -// @Produce json -// @Success 200 {object} []models.OrchestratorHostResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts [get] +// @Summary Gets all hosts from the orchestrator +// @Description This endpoint returns all hosts from the orchestrator +// @Tags Orchestrator +// @Produce json +// @Success 200 {object} []models.OrchestratorHostResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts [get] func GetOrchestratorHostsHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -399,17 +407,17 @@ func GetOrchestratorHostsHandler() restapi.ControllerHandler { } } -// @Summary Gets a host from the orchestrator -// @Description This endpoint returns a host from the orchestrator -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 200 {object} models.OrchestratorHostResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id} [get] +// @Summary Gets a host from the orchestrator +// @Description This endpoint returns a host from the orchestrator +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 200 {object} models.OrchestratorHostResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id} [get] func GetOrchestratorHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -434,17 +442,56 @@ func GetOrchestratorHostHandler() restapi.ControllerHandler { } } -// @Summary Register a Host in the orchestrator -// @Description This endpoint register a host in the orchestrator -// @Tags Orchestrator -// @Produce json -// @Param hostRequest body models.OrchestratorHostRequest true "Host Request" -// @Success 200 {object} models.OrchestratorHostResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts [post] +// @Summary Gets a host hardware info from the orchestrator +// @Description This endpoint returns a host hardware info from the orchestrator +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 200 {object} models.SystemUsageResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/hardware [get] +func GetOrchestratorHostHardwareInfoHandler() restapi.ControllerHandler { + return func(w http.ResponseWriter, r *http.Request) { + defer r.Body.Close() + ctx := GetBaseContext(r) + defer Recover(ctx, r, w) + orchestratorSvc := orchestrator.NewOrchestratorService(ctx) + + vars := mux.Vars(r) + id := vars["id"] + + host, err := orchestratorSvc.GetHost(ctx, id) + if err != nil { + ReturnApiError(ctx, w, models.NewFromError(err)) + return + } + + hw, err := orchestratorSvc.GetHostHardwareInfo(host) + if err != nil { + ReturnApiError(ctx, w, models.NewFromError(err)) + return + } + + w.WriteHeader(http.StatusOK) + _ = json.NewEncoder(w).Encode(hw) + ctx.LogInfof("Orchestrator host hardware info returned successfully") + } +} + +// @Summary Register a Host in the orchestrator +// @Description This endpoint register a host in the orchestrator +// @Tags Orchestrator +// @Produce json +// @Param hostRequest body models.OrchestratorHostRequest true "Host Request" +// @Success 200 {object} models.OrchestratorHostResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts [post] func RegisterOrchestratorHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -483,17 +530,17 @@ func RegisterOrchestratorHostHandler() restapi.ControllerHandler { } } -// @Summary Unregister a host from the orchestrator -// @Description This endpoint unregister a host from the orchestrator -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id} [delete] +// @Summary Unregister a host from the orchestrator +// @Description This endpoint unregister a host from the orchestrator +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id} [delete] func UnregisterOrchestratorHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -511,16 +558,16 @@ func UnregisterOrchestratorHostHandler() restapi.ControllerHandler { } } -// @Summary Enable a host in the orchestrator -// @Description This endpoint will enable an existing host in the orchestrator -// @Tags Orchestrator -// @Produce json -// @Success 200 {object} models.OrchestratorHostResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/enable [put] +// @Summary Enable a host in the orchestrator +// @Description This endpoint will enable an existing host in the orchestrator +// @Tags Orchestrator +// @Produce json +// @Success 200 {object} models.OrchestratorHostResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/enable [put] func EnableOrchestratorHostsHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -545,16 +592,16 @@ func EnableOrchestratorHostsHandler() restapi.ControllerHandler { } } -// @Summary Disable a host in the orchestrator -// @Description This endpoint will disable an existing host in the orchestrator -// @Tags Orchestrator -// @Produce json -// @Success 200 {object} models.OrchestratorHostResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/disable [put] +// @Summary Disable a host in the orchestrator +// @Description This endpoint will disable an existing host in the orchestrator +// @Tags Orchestrator +// @Produce json +// @Success 200 {object} models.OrchestratorHostResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/disable [put] func DisableOrchestratorHostsHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -579,17 +626,17 @@ func DisableOrchestratorHostsHandler() restapi.ControllerHandler { } } -// @Summary Update a Host in the orchestrator -// @Description This endpoint updates a host in the orchestrator -// @Tags Orchestrator -// @Produce json -// @Param hostRequest body models.OrchestratorHostUpdateRequest true "Host Update Request" -// @Success 200 {object} models.OrchestratorHostResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts [put] +// @Summary Update a Host in the orchestrator +// @Description This endpoint updates a host in the orchestrator +// @Tags Orchestrator +// @Produce json +// @Param hostRequest body models.OrchestratorHostUpdateRequest true "Host Update Request" +// @Success 200 {object} models.OrchestratorHostResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts [put] func UpdateOrchestratorHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -650,16 +697,16 @@ func UpdateOrchestratorHostHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator resource overview -// @Description This endpoint returns orchestrator resource overview -// @Tags Orchestrator -// @Produce json -// @Success 200 {object} models.HostResourceOverviewResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/overview/resources [get] +// @Summary Get orchestrator resource overview +// @Description This endpoint returns orchestrator resource overview +// @Tags Orchestrator +// @Produce json +// @Success 200 {object} models.HostResourceOverviewResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/overview/resources [get] func GetOrchestratorOverviewHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -690,17 +737,17 @@ func GetOrchestratorOverviewHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator host resources -// @Description This endpoint returns orchestrator host resources -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 200 {object} models.HostResourceOverviewResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/overview/{id}/resources [get] +// @Summary Get orchestrator host resources +// @Description This endpoint returns orchestrator host resources +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 200 {object} models.HostResourceOverviewResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/overview/{id}/resources [get] func GetOrchestratorHostResourcesHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -725,16 +772,16 @@ func GetOrchestratorHostResourcesHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator Virtual Machines -// @Description This endpoint returns orchestrator Virtual Machines -// @Tags Orchestrator -// @Produce json -// @Success 200 {object} []models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines [get] +// @Summary Get orchestrator Virtual Machines +// @Description This endpoint returns orchestrator Virtual Machines +// @Tags Orchestrator +// @Produce json +// @Success 200 {object} []models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines [get] func GetOrchestratorVirtualMachinesHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -760,16 +807,16 @@ func GetOrchestratorVirtualMachinesHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator Virtual Machine -// @Description This endpoint returns orchestrator Virtual Machine by its ID -// @Tags Orchestrator -// @Produce json -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{id} [get] +// @Summary Get orchestrator Virtual Machine +// @Description This endpoint returns orchestrator Virtual Machine by its ID +// @Tags Orchestrator +// @Produce json +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{id} [get] func GetOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -794,17 +841,17 @@ func GetOrchestratorVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Deletes orchestrator virtual machine -// @Description This endpoint deletes orchestrator virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Virtual Machine ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{id} [delete] +// @Summary Deletes orchestrator virtual machine +// @Description This endpoint deletes orchestrator virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Virtual Machine ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{id} [delete] func DeleteOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -826,17 +873,17 @@ func DeleteOrchestratorVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator virtual machine status -// @Description This endpoint returns orchestrator virtual machine status -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Virtual Machine ID" -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{vmId}/status [get] +// @Summary Get orchestrator virtual machine status +// @Description This endpoint returns orchestrator virtual machine status +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Virtual Machine ID" +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{vmId}/status [get] func GetOrchestratorVirtualMachineStatusHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -859,17 +906,17 @@ func GetOrchestratorVirtualMachineStatusHandler() restapi.ControllerHandler { } } -// @Summary Renames orchestrator virtual machine -// @Description This endpoint renames orchestrator virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Virtual Machine ID" -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{id}/rename [put] +// @Summary Renames orchestrator virtual machine +// @Description This endpoint renames orchestrator virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Virtual Machine ID" +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{id}/rename [put] func RenameOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -909,17 +956,17 @@ func RenameOrchestratorVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Configures orchestrator virtual machine -// @Description This endpoint configures orchestrator virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{vmId}/set [put] +// @Summary Configures orchestrator virtual machine +// @Description This endpoint configures orchestrator virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{vmId}/set [put] func SetOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -958,17 +1005,17 @@ func SetOrchestratorVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Starts orchestrator virtual machine -// @Description This endpoint starts orchestrator virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{vmId}/start [put] +// @Summary Starts orchestrator virtual machine +// @Description This endpoint starts orchestrator virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{vmId}/start [put] func StartOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1000,17 +1047,17 @@ func StartOrchestratorVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Stops orchestrator virtual machine -// @Description This endpoint sops orchestrator virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{vmId}/stop [put] +// @Summary Stops orchestrator virtual machine +// @Description This endpoint sops orchestrator virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{vmId}/stop [put] func StopOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1042,17 +1089,17 @@ func StopOrchestratorVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Executes a command in a orchestrator virtual machine -// @Description This endpoint executes a command in a orchestrator virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines/{vmId}/execute [put] +// @Summary Executes a command in a orchestrator virtual machine +// @Description This endpoint executes a command in a orchestrator virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines/{vmId}/execute [put] func ExecutesOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1091,17 +1138,17 @@ func ExecutesOrchestratorVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator host virtual machines -// @Description This endpoint returns orchestrator host virtual machines -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 200 {object} []models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines [get] +// @Summary Get orchestrator host virtual machines +// @Description This endpoint returns orchestrator host virtual machines +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 200 {object} []models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines [get] func GetOrchestratorHostVirtualMachinesHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1129,18 +1176,18 @@ func GetOrchestratorHostVirtualMachinesHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator host virtual machine -// @Description This endpoint returns orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId} [get] +// @Summary Get orchestrator host virtual machine +// @Description This endpoint returns orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId} [get] func GetOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1166,18 +1213,18 @@ func GetOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Deletes orchestrator host virtual machine -// @Description This endpoint deletes orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId} [delete] +// @Summary Deletes orchestrator host virtual machine +// @Description This endpoint deletes orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId} [delete] func DeleteOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1200,18 +1247,18 @@ func DeleteOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Get orchestrator host virtual machine status -// @Description This endpoint returns orchestrator host virtual machine status -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/status [get] +// @Summary Get orchestrator host virtual machine status +// @Description This endpoint returns orchestrator host virtual machine status +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/status [get] func GetOrchestratorHostVirtualMachineStatusHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1235,18 +1282,18 @@ func GetOrchestratorHostVirtualMachineStatusHandler() restapi.ControllerHandler } } -// @Summary Renames orchestrator host virtual machine -// @Description This endpoint renames orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/rename [put] +// @Summary Renames orchestrator host virtual machine +// @Description This endpoint renames orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/rename [put] func RenameOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1287,18 +1334,18 @@ func RenameOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Configures orchestrator host virtual machine -// @Description This endpoint configures orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/set [put] +// @Summary Configures orchestrator host virtual machine +// @Description This endpoint configures orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/set [put] func SetOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1338,18 +1385,18 @@ func SetOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Starts orchestrator host virtual machine -// @Description This endpoint starts orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/start [put] +// @Summary Starts orchestrator host virtual machine +// @Description This endpoint starts orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/start [put] func StartOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1382,18 +1429,18 @@ func StartOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Starts orchestrator host virtual machine -// @Description This endpoint starts orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/stop [put] +// @Summary Starts orchestrator host virtual machine +// @Description This endpoint starts orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/stop [put] func StopOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1426,18 +1473,18 @@ func StopOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Executes a command in a orchestrator host virtual machine -// @Description This endpoint executes a command in a orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Success 200 {object} models.VirtualMachineConfigResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/execute [put] +// @Summary Executes a command in a orchestrator host virtual machine +// @Description This endpoint executes a command in a orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Success 200 {object} models.VirtualMachineConfigResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/execute [put] func ExecutesOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1477,18 +1524,18 @@ func ExecutesOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Register a virtual machine in a orchestrator host -// @Description This endpoint registers a virtual machine in a orchestrator host -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param request body models.RegisterVirtualMachineRequest true "Register Virtual Machine Request" -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/register [post] +// @Summary Register a virtual machine in a orchestrator host +// @Description This endpoint registers a virtual machine in a orchestrator host +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param request body models.RegisterVirtualMachineRequest true "Register Virtual Machine Request" +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/register [post] func RegisterOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1526,19 +1573,19 @@ func RegisterOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Unregister a virtual machine in a orchestrator host -// @Description This endpoint unregister a virtual machine in a orchestrator host -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param vmId path string true "Virtual Machine ID" -// @Param request body models.UnregisterVirtualMachineRequest true "Register Virtual Machine Request" -// @Success 200 {object} models.ParallelsVM -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/unregister [post] +// @Summary Unregister a virtual machine in a orchestrator host +// @Description This endpoint unregister a virtual machine in a orchestrator host +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param vmId path string true "Virtual Machine ID" +// @Param request body models.UnregisterVirtualMachineRequest true "Register Virtual Machine Request" +// @Success 200 {object} models.ParallelsVM +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines/{vmId}/unregister [post] func UnregisterOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1577,18 +1624,18 @@ func UnregisterOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler } } -// @Summary Creates a orchestrator host virtual machine -// @Description This endpoint creates a orchestrator host virtual machine -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param request body models.CreateVirtualMachineRequest true "Create Virtual Machine Request" -// @Success 200 {object} models.CreateVirtualMachineResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/machines [post] +// @Summary Creates a orchestrator host virtual machine +// @Description This endpoint creates a orchestrator host virtual machine +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param request body models.CreateVirtualMachineRequest true "Create Virtual Machine Request" +// @Success 200 {object} models.CreateVirtualMachineResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/machines [post] func CreateOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1627,17 +1674,17 @@ func CreateOrchestratorHostVirtualMachineHandler() restapi.ControllerHandler { } } -// @Summary Creates a virtual machine in one of the hosts for the orchestrator -// @Description This endpoint creates a virtual machine in one of the hosts for the orchestrator -// @Tags Orchestrator -// @Produce json -// @Param request body models.CreateVirtualMachineRequest true "Create Virtual Machine Request" -// @Success 200 {object} models.CreateVirtualMachineResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/machines [post] +// @Summary Creates a virtual machine in one of the hosts for the orchestrator +// @Description This endpoint creates a virtual machine in one of the hosts for the orchestrator +// @Tags Orchestrator +// @Produce json +// @Param request body models.CreateVirtualMachineRequest true "Create Virtual Machine Request" +// @Success 200 {object} models.CreateVirtualMachineResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/machines [post] func CreateOrchestratorVirtualMachineHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1676,17 +1723,17 @@ func CreateOrchestratorVirtualMachineHandler() restapi.ControllerHandler { // region Orchestrator Reverse Proxy -// @Summary Gets orchestrator host reverse proxy hosts -// @Description This endpoint returns orchestrator host reverse proxy hosts -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 200 {object} []models.ReverseProxyHost -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts [get] +// @Summary Gets orchestrator host reverse proxy hosts +// @Description This endpoint returns orchestrator host reverse proxy hosts +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 200 {object} []models.ReverseProxyHost +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts [get] func GetOrchestratorHostReverseProxyHostsHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1709,17 +1756,17 @@ func GetOrchestratorHostReverseProxyHostsHandler() restapi.ControllerHandler { } } -// @Summary Gets orchestrator host reverse proxy hosts -// @Description This endpoint returns orchestrator host reverse proxy hosts -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 200 {object} models.ReverseProxyHost -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id} [get] +// @Summary Gets orchestrator host reverse proxy hosts +// @Description This endpoint returns orchestrator host reverse proxy hosts +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 200 {object} models.ReverseProxyHost +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id} [get] func GetOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1743,17 +1790,17 @@ func GetOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { } } -// @Summary Creates a orchestrator host reverse proxy host -// @Description This endpoint creates a orchestrator host reverse proxy host -// @Tags Orchestrator -// @Produce json -// @Param request body models.ReverseProxyHostCreateRequest true "Create Host Reverse Proxy Host Request" -// @Success 200 {object} models.ReverseProxyHost -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts [post] +// @Summary Creates a orchestrator host reverse proxy host +// @Description This endpoint creates a orchestrator host reverse proxy host +// @Tags Orchestrator +// @Produce json +// @Param request body models.ReverseProxyHostCreateRequest true "Create Host Reverse Proxy Host Request" +// @Success 200 {object} models.ReverseProxyHost +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts [post] func CreateOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1793,17 +1840,17 @@ func CreateOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { } } -// @Summary Updates an orchestrator host reverse proxy host -// @Description This endpoint updates an orchestrator host reverse proxy host -// @Tags Orchestrator -// @Produce json -// @Param request body models.ReverseProxyHostUpdateRequest true "Update Host Reverse Proxy Host Request" -// @Success 200 {object} models.ReverseProxyHost -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id} [put] +// @Summary Updates an orchestrator host reverse proxy host +// @Description This endpoint updates an orchestrator host reverse proxy host +// @Tags Orchestrator +// @Produce json +// @Param request body models.ReverseProxyHostUpdateRequest true "Update Host Reverse Proxy Host Request" +// @Success 200 {object} models.ReverseProxyHost +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id} [put] func UpdateOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1844,18 +1891,18 @@ func UpdateOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { } } -// @Summary Deletes an orchestrator host reverse proxy host -// @Description This endpoint deletes an orchestrator host reverse proxy host -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param reverse_proxy_host_id path string true "Reverse Proxy Host ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id} [delete] +// @Summary Deletes an orchestrator host reverse proxy host +// @Description This endpoint deletes an orchestrator host reverse proxy host +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param reverse_proxy_host_id path string true "Reverse Proxy Host ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id} [delete] func DeleteOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1878,17 +1925,17 @@ func DeleteOrchestratorHostReverseProxyHostHandler() restapi.ControllerHandler { } } -// @Summary Upserts an orchestrator host reverse proxy host http route -// @Description This endpoint upserts an orchestrator host reverse proxy host http route -// @Tags Orchestrator -// @Produce json -// @Param request body models.ReverseProxyHostUpdateRequest true "Upsert Host Reverse Proxy Host Http Routes Request" -// @Success 200 {object} models.ReverseProxyHost -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id}/http_routes [post] +// @Summary Upserts an orchestrator host reverse proxy host http route +// @Description This endpoint upserts an orchestrator host reverse proxy host http route +// @Tags Orchestrator +// @Produce json +// @Param request body models.ReverseProxyHostUpdateRequest true "Upsert Host Reverse Proxy Host Http Routes Request" +// @Success 200 {object} models.ReverseProxyHost +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id}/http_routes [post] func UpsertOrchestratorHostReverseProxyHostHttpRouteHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1929,19 +1976,19 @@ func UpsertOrchestratorHostReverseProxyHostHttpRouteHandler() restapi.Controller } } -// @Summary Deletes an orchestrator host reverse proxy host http route -// @Description This endpoint deletes an orchestrator host reverse proxy host http route -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Param reverse_proxy_host_id path string true "Reverse Proxy Host ID" -// @Param route_id path string true "Route ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id}/http_routes/{route_id} [delete] +// @Summary Deletes an orchestrator host reverse proxy host http route +// @Description This endpoint deletes an orchestrator host reverse proxy host http route +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Param reverse_proxy_host_id path string true "Reverse Proxy Host ID" +// @Param route_id path string true "Route ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id}/http_routes/{route_id} [delete] func DeleteOrchestratorHostReverseProxyHostHttpRouteHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1965,17 +2012,17 @@ func DeleteOrchestratorHostReverseProxyHostHttpRouteHandler() restapi.Controller } } -// @Summary Update an orchestrator host reverse proxy host tcp route -// @Description This endpoint updates an orchestrator host reverse proxy host tcp route -// @Tags Orchestrator -// @Produce json -// @Param request body models.ReverseProxyHostUpdateRequest true "Update Host Reverse Proxy Host tcp Routes Request" -// @Success 200 {object} models.ReverseProxyHost -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id}/tcp_route [post] +// @Summary Update an orchestrator host reverse proxy host tcp route +// @Description This endpoint updates an orchestrator host reverse proxy host tcp route +// @Tags Orchestrator +// @Produce json +// @Param request body models.ReverseProxyHostUpdateRequest true "Update Host Reverse Proxy Host tcp Routes Request" +// @Success 200 {object} models.ReverseProxyHost +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/hosts/{reverse_proxy_host_id}/tcp_route [post] func UpdateOrchestratorHostReverseProxyHostTcpRouteHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -2016,17 +2063,17 @@ func UpdateOrchestratorHostReverseProxyHostTcpRouteHandler() restapi.ControllerH } } -// @Summary Restarts orchestrator host reverse proxy -// @Description This endpoint restarts orchestrator host reverse proxy -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/restart [put] +// @Summary Restarts orchestrator host reverse proxy +// @Description This endpoint restarts orchestrator host reverse proxy +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/restart [put] func RestartsOrchestratorHostReverseProxyHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -2048,17 +2095,17 @@ func RestartsOrchestratorHostReverseProxyHandler() restapi.ControllerHandler { } } -// @Summary Enables orchestrator host reverse proxy -// @Description This endpoint enables orchestrator host reverse proxy -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/enable [put] +// @Summary Enables orchestrator host reverse proxy +// @Description This endpoint enables orchestrator host reverse proxy +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/enable [put] func EnableOrchestratorHostReverseProxyHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -2080,17 +2127,17 @@ func EnableOrchestratorHostReverseProxyHandler() restapi.ControllerHandler { } } -// @Summary Disables orchestrator host reverse proxy -// @Description This endpoint disables orchestrator host reverse proxy -// @Tags Orchestrator -// @Produce json -// @Param id path string true "Host ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/disable [put] +// @Summary Disables orchestrator host reverse proxy +// @Description This endpoint disables orchestrator host reverse proxy +// @Tags Orchestrator +// @Produce json +// @Param id path string true "Host ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/orchestrator/hosts/{id}/reverse-proxy/disable [put] func DisableOrchestratorHostReverseProxyHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() diff --git a/src/orchestrator/create_host_reverse_proxy_host.go b/src/orchestrator/create_host_reverse_proxy_host.go index 2f96819..0f32951 100644 --- a/src/orchestrator/create_host_reverse_proxy_host.go +++ b/src/orchestrator/create_host_reverse_proxy_host.go @@ -62,6 +62,7 @@ func (s *OrchestratorService) CreateHostReverseProxyHost(ctx basecontext.ApiCont return nil, api_error } + s.Refresh() return resp, nil } @@ -79,6 +80,5 @@ func (s *OrchestratorService) CallCreateHostReverseProxyHost(host *data_models.O return nil, err } - s.Refresh() return &rep, nil } diff --git a/src/orchestrator/delete_host_reverse_proxy_host.go b/src/orchestrator/delete_host_reverse_proxy_host.go index 6430d4b..01a1b67 100644 --- a/src/orchestrator/delete_host_reverse_proxy_host.go +++ b/src/orchestrator/delete_host_reverse_proxy_host.go @@ -36,6 +36,7 @@ func (s *OrchestratorService) DeleteHostReverseProxyHost(ctx basecontext.ApiCont return err } + s.Refresh() return nil } @@ -56,6 +57,5 @@ func (s *OrchestratorService) CallDeleteHostReverseProxyHost(host *data_models.O return errors.NewWithCodef(400, "Error deleting reverse proxy host %s: %v", rpHostId, api_response.StatusCode) } - s.Refresh() return nil } diff --git a/src/orchestrator/delete_host_reverse_proxy_host_http_route.go b/src/orchestrator/delete_host_reverse_proxy_host_http_route.go index 5cad059..0ee6f3a 100644 --- a/src/orchestrator/delete_host_reverse_proxy_host_http_route.go +++ b/src/orchestrator/delete_host_reverse_proxy_host_http_route.go @@ -36,6 +36,7 @@ func (s *OrchestratorService) DeleteHostReverseProxyHostHttpRoute(ctx basecontex return err } + s.Refresh() return nil } @@ -56,6 +57,5 @@ func (s *OrchestratorService) CallHostReverseProxyHostHttpRoute(host *data_model return errors.NewWithCodef(400, "Error deleting reverse proxy host %s http route %v: %v", rpHostId, httpRouteId, api_response.StatusCode) } - s.Refresh() return nil } diff --git a/src/orchestrator/update_host_reverse_proxy_host.go b/src/orchestrator/update_host_reverse_proxy_host.go index 30c2f32..588154f 100644 --- a/src/orchestrator/update_host_reverse_proxy_host.go +++ b/src/orchestrator/update_host_reverse_proxy_host.go @@ -62,6 +62,7 @@ func (s *OrchestratorService) UpdateHostReverseProxyHost(ctx basecontext.ApiCont return nil, api_error } + s.Refresh() return resp, nil } @@ -79,6 +80,5 @@ func (s *OrchestratorService) CallUpdateHostReverseProxyHost(host *data_models.O return nil, err } - s.Refresh() return &rep, nil } diff --git a/src/orchestrator/update_host_reverse_proxy_host_tcp_route.go b/src/orchestrator/update_host_reverse_proxy_host_tcp_route.go index ff000d7..44b086d 100644 --- a/src/orchestrator/update_host_reverse_proxy_host_tcp_route.go +++ b/src/orchestrator/update_host_reverse_proxy_host_tcp_route.go @@ -62,6 +62,7 @@ func (s *OrchestratorService) UpdateHostReverseProxyHostTcpRoute(ctx basecontext return nil, api_error } + s.Refresh() return resp, nil }