Add ecctl project list command for serverless projects#753
Add ecctl project list command for serverless projects#753
ecctl project list command for serverless projects#753Conversation
Introduce support for Elastic Cloud Serverless projects in ecctl,
starting with the ability to list projects. The command calls the
Serverless Projects API (`/api/v1/serverless/projects/{type}`) for
elasticsearch, observability, and security project types.
- Add `pkg/project/` API layer with types, validation, and HTTP client
- Add `cmd/project/` with parent command and `list` subcommand
- Support `--type` flag to filter by project type
- Add text formatter template for tabular output
- Regenerate bindata.go and docs
- Include unit tests with 87.5% coverage
Co-authored-by: Cursor <cursoragent@cursor.com>
633a9c1 to
8e7118a
Compare
tobio
left a comment
There was a problem hiding this comment.
LGTM, though I tend to think we should be adding support in cloud-sdk-go first and using that here. Though that's a wider decision.
| func init() { | ||
| Command.AddCommand(listCmd) | ||
|
|
||
| listCmd.Flags().String("type", "", "Filters by project type (elasticsearch, observability, security)") |
There was a problem hiding this comment.
Does it make sense to support multiple type flags?
project list --type elasticsearch --type security
There was a problem hiding this comment.
It feels like if we're supporting Serverless API's in ecctl, then we should also support those APIs in cloud-sdk-go, i.e this file should be added there instead of directly into ecctl?
|
|
||
| ### SEE ALSO | ||
|
|
||
| * [ecctl](ecctl.md) - Elastic Cloud Control |
There was a problem hiding this comment.
| * [ecctl](ecctl.md) - Elastic Cloud Control | |
| * [ecctl](/reference/ecctl.md) - Elastic Cloud Control |
It looks like this should have a /reference prefix.
Did these files get generated by make docs or did AI just try itself? I'm not familiar enough with the docs in this project to know if there's an issue with the docs generator or just AI being AI.
Summary
ecctl project listcommand that queries the Elastic Cloud Serverless Projects API to list elasticsearch, observability, and security projectspkg/project/API layer with types, validation, and direct HTTP client calls to/api/v1/serverless/projects/{type}endpoints--typeflag to filter by a specific project type; omitting lists all typesTest plan
make lintpasses with 0 issuesmake unitpasses — all existing tests continue to pass, newcmd/projecttests passmake bindataregenerated successfullymake docsregenerated successfullyecctl project --helpandecctl project listshow correct outputMade with Cursor