Skip to content

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

@MattDevy

Description

@MattDevy

Summary

elastic cloud serverless projects search create --help exposes only generic flags (--input-file, --wait, --save-as, --credentials-file, --config-file, --force, --dry-run). The required body fields name and region_id are not available as flags, so creating a project requires writing a JSON file just to set two scalars.

Reproducer

$ elastic cloud serverless projects search create --help
Usage: elastic cloud serverless projects search create [options]

Create an Elasticsearch project

Options:
  --input-file <path>        path to a JSON file to use as command input
  --dry-run                  validate all inputs and exit without performing any action
  --wait                     Wait for the project to reach "initialized" phase before returning
  --save-as <name>           store returned credentials in the OS keychain and upsert a context of this name
  --credentials-file <path>  write credentials to a standalone YAML config fragment at this path (0600)
  --config-file <path>       override the config file written by --save-as
  --force                    overwrite an existing context (--save-as) or file (--credentials-file)
  -h, --help                 display help for command

Current creation flow:

cat > /tmp/body.json <<'EOF'
{ "name": "cli-demo", "region_id": "aws-us-east-1" }
EOF

elastic cloud serverless projects search create \
  --input-file /tmp/body.json --wait --save-as cli-demo

Expected behavior

Expose top-level body fields as flags. At minimum:

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

This matches what sister CLIs (gcloud, aws) do, and what users likely expect given the rest of the CLI surface already does this elsewhere (e.g. es indices create --index <name>).

This likely applies to other create endpoints too, including cloud serverless projects observability create and cloud serverless projects security create.

Environment

  • elastic v0.1.1 on macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions