Skip to content

Commit

Permalink
enable endpoint refactoring (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Feb 3, 2025
1 parent fc45d4b commit 9f63b91
Show file tree
Hide file tree
Showing 19 changed files with 379 additions and 123 deletions.
7 changes: 2 additions & 5 deletions cmd/zrok/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_core"
restEnvironment "github.com/openziti/zrok/rest_client_zrok/environment"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/tui"
"github.com/shirou/gopsutil/v3/host"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -77,10 +76,8 @@ func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
}
auth := httptransport.APIKeyAuth("X-TOKEN", "header", token)
req := restEnvironment.NewEnableParams()
req.Body = &rest_model_zrok.EnableRequest{
Description: cmd.description,
Host: hostDetail,
}
req.Body.Description = cmd.description
req.Body.Host = hostDetail

var prg *tea.Program
var done = make(chan struct{})
Expand Down
4 changes: 1 addition & 3 deletions controller/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ func (h *enableHandler) Handle(params environment.EnableParams, principal *rest_
}
logrus.Infof("created environment for '%v', with ziti identity '%v', and database id '%v'", principal.Email, ident.Payload.Data.ID, envId)

resp := environment.NewEnableCreated().WithPayload(&rest_model_zrok.EnableResponse{
Identity: envZId,
})
resp := environment.NewEnableCreated().WithPayload(&environment.EnableCreatedBody{Identity: envZId})

var out bytes.Buffer
enc := json.NewEncoder(&out)
Expand Down
14 changes: 5 additions & 9 deletions rest_client_zrok/environment/enable_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 87 additions & 5 deletions rest_client_zrok/environment/enable_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 32 additions & 48 deletions rest_server_zrok/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f63b91

Please sign in to comment.