Conversation
Create endpoints and evals, and run a check on an endpoint
Trigger and get the status of endpoint checks.
| endpointNewCmd := &cobra.Command{ | ||
| Use: "new <exec-id>", | ||
| Short: "Create a new endpoint in Unweave", | ||
| Long: wordwrap.String("Create a new endpoint in Unweave.\n\n"+ | ||
| "Eg. unweave endpoint new <exec-id>\n\n", | ||
| ui.MaxOutputLineLength), | ||
| Args: cobra.ExactArgs(1), | ||
| Aliases: []string{"new", "n", "create", "c"}, | ||
| RunE: cmd.EndpointCreate, | ||
| } |
There was a problem hiding this comment.
This is a wip syntax right? I think the way we want to expose this is probably:
unweave endpoint new <endpoint-name> and then unweave deploy <endpoint-name>.
There was a problem hiding this comment.
Yes, likely. Once you've got the ERD for this we can hash out the details, and I can make the changes easily 💯
ernesto-jimenez
left a comment
There was a problem hiding this comment.
Sorry for the delay. Code-wise everything looked OK, but I wanted to test things and have been struggling a bit with staging being inaccessible and how to connect to the local env.
| } | ||
|
|
||
| func (s *EndpointService) List(ctx context.Context, userID, projectID string) ([]types.Endpoint, error) { | ||
| uri := fmt.Sprintf("projects/%s/%s/endpoints", userID, projectID) |
There was a problem hiding this comment.
Question: do we have too hard-code URLs in both the client and the server? How do we ensure they are aligned?
There was a problem hiding this comment.
Yes, the paths are 'hard coded' in the client (cli), and the router's mux.
Right now, we make sure they are aligned by smoke testing / using them
| ui.Infof("id: %s", endpoint.ID) | ||
| ui.Infof("exec id: %s", endpoint.ExecID) | ||
| ui.Infof("http: %s\n", endpoint.HTTPEndpoint) | ||
| } |
There was a problem hiding this comment.
💡 tangential idea for the future: we'll probably end-up wanting to provide output in structured formats like JSON.
One small improvement in the future would probably be implementing something like ui.Output(endpoints) and handle the presentation in text/json/something else.
There was a problem hiding this comment.
This is VERY much a temporary output, to have something, while we work out what's the best something we can print.
Add endpoint and eval commands on the CLI