Skip to content

Comments

Add ecctl project list command for serverless projects#753

Open
Kushmaro wants to merge 1 commit intomasterfrom
add-project-list-command
Open

Add ecctl project list command for serverless projects#753
Kushmaro wants to merge 1 commit intomasterfrom
add-project-list-command

Conversation

@Kushmaro
Copy link
Contributor

@Kushmaro Kushmaro commented Feb 17, 2026

Summary

  • Add ecctl project list command that queries the Elastic Cloud Serverless Projects API to list elasticsearch, observability, and security projects
  • Introduce pkg/project/ API layer with types, validation, and direct HTTP client calls to /api/v1/serverless/projects/{type} endpoints
  • Support --type flag to filter by a specific project type; omitting lists all types
  • Include text formatter template for tabular output (ID, NAME, TYPE, REGION, ALIAS) and JSON output
  • Add unit tests for the list command with 87.5% coverage (7 test cases)
  • Regenerate bindata.go and docs

Test plan

  • make lint passes with 0 issues
  • make unit passes — all existing tests continue to pass, new cmd/project tests pass
  • make bindata regenerated successfully
  • make docs regenerated successfully
  • Manual verification: ecctl project --help and ecctl project list show correct output
  • Manual verification: `ecctl project list --type <elasticsearch/observability/security> show correct output

Made with Cursor

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>
Copy link
Member

@tobio tobio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to support multiple type flags?

project list --type elasticsearch --type security

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants