Skip to content

fix: expose --name and --region-id flags on project create#476

Open
margaretjgu wants to merge 3 commits into
mainfrom
fix/cloud-project-create-name-region-flags
Open

fix: expose --name and --region-id flags on project create#476
margaretjgu wants to merge 3 commits into
mainfrom
fix/cloud-project-create-name-region-flags

Conversation

@margaretjgu

@margaretjgu margaretjgu commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Closes #328.

cloud serverless projects {search,observability,security} create only showed generic flags (--input-file, --wait, etc.). The required body fields name and region_id had no flag equivalents, forcing users to write a JSON file just to set two scalars.

Root cause: the codegen API definitions for the three create commands had no body schema, so buildCommandSchema produced an empty z.looseObject({}) with no derived flags.

Fix: add a body: z.object({ name, region_id }) to each create definition. The existing buildCommandSchema -> extractSchemaArgs -> defineCommand pipeline handles the rest automatically, registering --name and --region-id flags and routing them into the POST body.

Before:

elastic cloud serverless projects search create --input-file /tmp/body.json --wait

After:

elastic cloud serverless projects search create --name cli-demo --region-id aws-us-east-1 --wait

Applies to all three project types: search, observability, security.

Test plan

  • elastic cloud serverless projects search create --help shows --name and --region-id
  • elastic cloud serverless projects observability create --help shows --name and --region-id
  • elastic cloud serverless projects security create --help shows --name and --region-id
  • --input-file still works (flags merge on top of JSON input)
  • New unit test passes: exposes --name and --region-id flags on create project commands

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 0.92s
✅ REPOSITORY gitleaks yes no no 59.69s
✅ REPOSITORY git_diff yes no no 0.74s
✅ REPOSITORY secretlint yes no no 31.23s
✅ REPOSITORY trivy yes no no 17.97s
✅ TYPESCRIPT eslint 1 0 0 4.85s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@JoshMock JoshMock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. was the code generator updated to reflect the changes to the three APIs?

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.

cloud serverless projects search create does not expose body fields (name, region_id) as flags

2 participants