### Enrollment token creation examples Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_enrollment-token_create.md Examples showing how to create enrollment tokens with different roles and validity periods. The last example is available for ECE only. ```bash ecctl [globalFlags] enrollment-token create --role coordinator ``` ```bash ecctl [globalFlags] enrollment-token create --role coordinator --role proxy ``` ```bash ecctl [globalFlags] enrollment-token create --role allocator --validity 120s ``` ```bash ecctl [globalFlags] enrollment-token create --role allocator --validity 2h {ece-icon} (Available for ECE only) ``` -------------------------------- ### Install ecctl on Windows with go install Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Steps to install ecctl on Windows using Go. First confirm Go is installed, then install the latest version or a specific tag, and finally verify the installation. ```powershell go version ``` ```powershell go install github.com/elastic/ecctl@latest ``` ```powershell go install github.com/elastic/ecctl@v{{version.ecctl}} ``` ```powershell ecctl version ``` -------------------------------- ### Options for ecctl deployment resource start Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_resource_start.md Options for the ecctl deployment resource start command. The --kind flag is required. Use --all to start all instances of a defined resource kind, or --i to specify instance IDs. --ignore-missing quietly proceeds if an instance does not exist. --ref-id is optional and auto-discovered if not set. ```bash --all Starts all instances of a defined resource kind -h, --help help for start --ignore-missing If set and the specified instance does not exist, then quietly proceed to the next instance -i, --instance-id strings Deployment instance IDs to start (e.g. instance-0000000001) --kind string Required deployment resource kind (apm, appsearch, kibana, elasticsearch) --ref-id string Optional deployment RefId, if not set, the RefId will be auto-discovered ``` -------------------------------- ### Restore a deployment with example output Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_restore.md Example command that restores a deployment with the specified ID and shows the JSON response containing the deployment ID. ```shell $ ecctl deployment restore 5c17ad7c8df73206baa54b6e2829d9bc { "id": "5c17ad7c8df73206baa54b6e2829d9bc" } ``` -------------------------------- ### ecctl deployment extension update examples Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_extension_update.md Examples showing how to generate an update payload, edit it, and apply it with the --file flag. The third example also uploads a new extension file using --extension-file. ```bash ecctl deployment extension update --generate-payload > update.json ``` ```bash ecctl deployment extension update --file update.json ``` ```bash ecctl deployment extension update --file update.json --extension-file extension.zip ``` -------------------------------- ### ecctl deployment create examples Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_create.md Examples of creating deployments with ecctl. Shows default creation, tracking progress with --track, listing deployment templates, generating a payload, creating from a file, and retrying with a request ID. ```bash ## Create a deployment with the default values $ ecctl deployment create --name my-deployment --deployment-template=aws-io-optimized-v2 --region=us-east-1 ## To make the command wait until the resources have been created use the "--track" flag, which will output the current stage on which the deployment resources are in. $ ecctl deployment create --name my-deployment --deployment-template=aws-io-optimized-v2 --region=us-east-1 --track [...] Deployment [b6ecbea3d5c84124b7dca457f2892086] - [Elasticsearch][b6ecbea3d5c84124b7dca457f2892086]: finished running all the plan steps (Total plan duration: 5m11.s) Deployment [91c4d60acb804ba0a27651fac02780ec] - [Kibana][8a9d9916cd6e46a7bb0912211d76e2af]: finished running all the plan steps (Total plan duration: 4m29.58s) ## In order to use the "--deployment-template" flag, you'll need to know which deployment templates ara available to you. You'll need to run the following command to view your deployment templates: $ ecctl platform deployment-template list ## Use the "--generate-payload" flag to save the definition to a file for later use. $ ecctl deployment create --name my-deployment --version=7.11.2 --generate-payload > create_example.json ## Create a deployment through the file definition. $ ecctl deployment create --file create_example.json --track ## To retry a deployment when the previous deployment creation failed, use the request ID provided in the error response of the previous command: $ ecctl deployment create --request-id=GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb ``` -------------------------------- ### ecctl platform allocator vacate examples Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_allocator_vacate.md Multiple examples demonstrating various vacate options: moving from multiple allocators, filtering by resource kind, specifying resource IDs, setting maintenance mode, controlling concurrency, overriding health discovery, and skipping snapshots or data migration. The final example shows skipping tracking, which is not recommended. ```shell ecctl platform allocator vacate i-05e245252362f7f1d # Move everything from multiple allocators ecctl platform allocator vacate i-05e245252362f7f1d i-2362f7f1d252362f7 # filter by a resource kind ecctl platform allocator vacate -k kibana i-05e245252362f7f1d # Only move specific resource IDs ecctl platform allocator vacate -r f521dedb07194c478fbbc6624f3bbf8f -r f404eea372cc4ea5bd553d47a09705cd i-05e245252362f7f1d # Specify multiple allocator targets ecctl platform allocator vacate -t i-05e245252362f7f2d -t i-2362f7f1d252362f7 i-05e245252362f7f1d ecctl platform allocator vacate --target i-05e245252362f7f2d --target i-2362f7f1d252362f7 --kind kibana i-05e245252362f7f1d # Set the allocators to maintenance mode before vacating them ecctl platform allocator vacate --maintenance -t i-05e245252362f7f2d -t i-2362f7f1d252362f7 i-05e245252362f7f1d # Set the amount of maximum moves to happen at any time ecctl platform allocator vacate --concurrency 10 i-05e245252362f7f1d # Override the allocator health auto discovery ecctl platform allocator vacate --allocator-down=true i-05e245252362f7f1d # Override the skip_snapshot setting ecctl platform allocator vacate --skip-snapshot=true i-05e245252362f7f1d -r f521dedb07194c478fbbc6624f3bbf8f # Override the skip_data_migration setting ecctl platform allocator vacate --skip-data-migration=true i-05e245252362f7f1d -r f521dedb07194c478fbbc6624f3bbf8f # Skips tracking the vacate progress which will cause the command to return almost immediately. # Not recommended since it can lead to failed vacates without the operator knowing about them. ecctl platform allocator vacate --skip-tracking i-05e245252362f7f1d ``` -------------------------------- ### Start a deployment resource Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_resource_start.md Starts a previously stopped deployment resource. The command requires a deployment ID and the resource kind (apm, appsearch, kibana, elasticsearch). Use --all to start all instances of the kind, or --i to specify instance IDs. ```bash ecctl deployment resource start --kind [--all|--i ,] [flags] ``` -------------------------------- ### Example: Set credentials for a GCS snapshot repository Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_elasticsearch_keystore_update.md Demonstrates updating the keystore with GCS credentials by providing a JSON file with the secrets object. The example shows the file contents and the command to apply it. ```bash # Set credentials for a GCS snapshot repository $ cat gcs-creds.json { "secrets": { "gcs.client.default.credentials_file": { "as_file": true, "value": { "type": "service_account", "project_id": "project-id", "private_key_id": "key-id", "private_key": "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----\n", "client_email": "service-account-email", "client_id": "client-id", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account-email" } } } } $ ecctl deployment elasticsearch keystore set --file=gcs-creds.json ... ``` -------------------------------- ### ecctl deployment resource start Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_resource_start.md Starts a previously stopped deployment resource. This command requires a deployment ID and a resource kind, and can start all instances or specific instance IDs. ```APIDOC ## ecctl deployment resource start ### Description Starts a previously stopped deployment resource. ### Usage ``` ecctl deployment resource start --kind [--all|--i ,] [flags] ``` ### Parameters #### Arguments - **deployment id** (string) - Required - The ID of the deployment. #### Options - **--all** (boolean) - Optional - Starts all instances of a defined resource kind. - **-h, --help** (boolean) - Optional - Help for start. - **--ignore-missing** (boolean) - Optional - If set and the specified instance does not exist, then quietly proceed to the next instance. - **-i, --instance-id strings** (string slice) - Optional - Deployment instance IDs to start (e.g. instance-0000000001). - **--kind string** (string) - Required - Deployment resource kind (apm, appsearch, kibana, elasticsearch). - **--ref-id string** (string) - Optional - Deployment RefId, if not set, the RefId will be auto-discovered. ### Example ``` ecctl deployment resource start --kind elasticsearch --all ``` ``` -------------------------------- ### Example of ecctl deployment search with query file Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_search.md Example of creating a query file and using it with the ecctl deployment search command. The query file contains a query_string query that searches for deployments with name 'admin'. The output is truncated with [...]. ```bash $ cat query_string_query.json { "query": { "query_string": { "query": "name: admin" } } } $ ecctl deployment search -f query_string_query.json [...] ``` -------------------------------- ### Update proxy settings examples Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_proxy_settings_update.md Shows two usage examples: updating only defined proxy settings and overriding all proxy settings with the --full flag. ```bash ## Update only the defined proxy settings $ ecctl platform proxy settings update --file settings.json --region us-east-1 ## Update by overriding all proxy settings $ ecctl platform proxy settings update --file settings.json --region us-east-1 --full ``` -------------------------------- ### Build ecctl from source Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Build ecctl from source on any operating system. Clone the repository, build the binary, or install directly with Go into GOBIN or GOPATH/bin. ```bash git clone https://github.com/elastic/ecctl.git cd ecctl go build . ``` ```bash go install . ``` -------------------------------- ### ecctl user update examples Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_user_update.md Two examples: updating a specific user with role and email, and updating the current user with email and password prompt. ```bash * Update a platform user ecctl user update --username xochitl --role ece_platform_viewer --email xo@example.com * Update the current platform user ecctl user update --current --email xo@example.com --password ``` -------------------------------- ### Build ecctl locally with make ecctl Source: https://github.com/elastic/ecctl/blob/master/CONTRIBUTING.md Build a temporary ecctl binary in the project root. Requires the environment setup prerequisites to be completed. ```console cd ${GOPATH}/src/github.com/elastic/ecctl make ecctl ``` -------------------------------- ### Create a platform user with two roles Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_user_create.md Example command that creates a platform user named sam89 with the roles ece_platform_viewer and ece_deployment_viewer. ```bash * Create a platform user who has two roles assigned ecctl user create --username sam89 --role ece_platform_viewer --role ece_deployment_viewer ``` -------------------------------- ### Query examples for allocator list Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_allocator_list.md Query examples for the --query flag. Use --query status.maintenance_mode:true to find allocators in maintenance mode, and --query capacity.memory.total:\>10240 to find allocators with more than 10GB of capacity. ```text * Allocators set to maintenance mode: --query status.maintenance_mode:true * Allocators with more than 10GB of capacity: --query capacity.memory.total:\>10240 ``` -------------------------------- ### Extract and install ecctl binary to /usr/local/bin Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Extract the downloaded ecctl archive and copy the ecctl binary to /usr/local/bin, a directory in the PATH. The version placeholder {{version.ecctl}} is substituted during documentation build. ```bash tar -xzf ecctl_{{version.ecctl}}_linux_amd64.tar.gz sudo cp ecctl /usr/local/bin ``` -------------------------------- ### Show command help option Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_proxy_settings_show.md Displays the help option for the show command. Use -h or --help to get help for the show command. ```bash -h, --help help for show ``` -------------------------------- ### ecctl deployment create Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_create.md Creates a deployment from a file definition or using the defaults from the deployment template. Default values are provided by the deployment template, simplifying the getting started experience. When version is not specified, the latest available stack version will automatically be used. ```APIDOC ## ecctl deployment create ### Description Creates a deployment from a file definition or using the defaults from the deployment template. Default values are provided by the deployment template, simplifying the getting started experience. When version is not specified, the latest available stack version will automatically be used. ### Synopsis ``` ecctl deployment create {--file | --es-size --es-zones | --es-node-topology } [flags] ``` ### Options - **--deployment-template** (string) - Deployment template ID on which to base the deployment from - **-f, --file** (string) - DeploymentCreateRequest file definition. See help for more information - **--generate-payload** - Returns the deployment payload without actually creating the deployment resources - **-h, --help** - help for create - **--name** (string) - Optional name for the deployment - **--request-id** (string) - Optional request ID - Can be found in the Stderr device when a previous deployment creation failed. For more information see the examples in the help command page - **-t, --track** - Tracks the progress of the performed task - **--version** (string) - Version to use, if not specified, the latest available stack version will be used ### Examples ``` ## Create a deployment with the default values $ ecctl deployment create --name my-deployment --deployment-template=aws-io-optimized-v2 --region=us-east-1 ## To make the command wait until the resources have been created use the "--track" flag, which will output the current stage on which the deployment resources are in. $ ecctl deployment create --name my-deployment --deployment-template=aws-io-optimized-v2 --region=us-east-1 --track [...] Deployment [b6ecbea3d5c84124b7dca457f2892086] - [Elasticsearch][b6ecbea3d5c84124b7dca457f2892086]: finished running all the plan steps (Total plan duration: 5m11.s) Deployment [91c4d60acb804ba0a27651fac02780ec] - [Kibana][8a9d9916cd6e46a7bb0912211d76e2af]: finished running all the plan steps (Total plan duration: 4m29.58s) ## In order to use the "--deployment-template" flag, you'll need to know which deployment templates ara available to you. You'll need to run the following command to view your deployment templates: $ ecctl platform deployment-template list ## Use the "--generate-payload" flag to save the definition to a file for later use. $ ecctl deployment create --name my-deployment --version=7.11.2 --generate-payload > create_example.json ## Create a deployment through the file definition. $ ecctl deployment create --file create_example.json --track ## To retry a deployment when the previous deployment creation failed, use the request ID provided in the error response of the previous command: $ ecctl deployment create --request-id=GMZPMRrcMYqHdmxjIQkHbdjnhPIeBElcwrHwzVlhGUSMXrEIzVXoBykSVRsKncNb ``` ### See also - [ecctl deployment](/reference/ecctl_deployment.md) - Manages deployments ``` -------------------------------- ### Upgrade ecctl with Homebrew and go install Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Upgrade ecctl using the same installation method as the original install. For Homebrew on macOS, run 'brew upgrade ecctl'. For Windows installations via 'go install', run 'go install github.com/elastic/ecctl@latest'. ```bash brew upgrade ecctl ``` ```powershell go install github.com/elastic/ecctl@latest ``` -------------------------------- ### Install ecctl with Homebrew Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Installs ecctl on macOS using Homebrew. Requires Homebrew to be installed. ```bash brew tap elastic/tap brew install elastic/tap/ecctl ``` -------------------------------- ### Verify ecctl installation Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Verifies the ecctl installation by printing the version. ```bash ecctl version ``` -------------------------------- ### ecctl auth key create options Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_auth_key_create.md Lists the available options for the create command, including the --description flag for setting a user API key description and the -h/--help flag for help. ```bash --description string User API key description -h, --help help for create ``` -------------------------------- ### ecctl init command syntax Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_init.md Displays the usage syntax for the ecctl init command, which creates an initial configuration file. ```bash ecctl init [flags] ``` -------------------------------- ### Install ecctl .rpm package on RHEL/CentOS/Fedora Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Download and install the ecctl .rpm package on RHEL/CentOS/Fedora systems using rpm. The version placeholder {{version.ecctl}} is substituted during documentation build. ```bash curl -L -O https://download.elastic.co/downloads/ecctl/{{version.ecctl}}/ecctl_{{version.ecctl}}_linux_64-bit.rpm sudo rpm -i ecctl_{{version.ecctl}}_linux_64-bit.rpm ``` -------------------------------- ### Options for ecctl deployment resource start-maintenance Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_resource_start-maintenance.md Lists the options available for the start-maintenance command, including --all, --help, --ignore-missing, --instance-id, --kind, and --ref-id. ```bash --all Starts maintenance mode on all instances of a defined resource kind -h, --help help for start-maintenance --ignore-missing If set and the specified instance does not exist, then quietly proceed to the next instance -i, --instance-id strings Deployment instance IDs to use (e.g. instance-0000000001) --kind string Required deployment resource kind (apm, appsearch, kibana, elasticsearch) --ref-id string Optional deployment RefId, if not set, the RefId will be auto-discovered ``` -------------------------------- ### Install ecctl .deb package on Debian/Ubuntu Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Download and install the ecctl .deb package on Debian/Ubuntu systems using dpkg. The version placeholder {{version.ecctl}} is substituted during documentation build. ```bash curl -L -O https://download.elastic.co/downloads/ecctl/{{version.ecctl}}/ecctl_{{version.ecctl}}_linux_64-bit.deb sudo dpkg -i ecctl_{{version.ecctl}}_linux_64-bit.deb ``` -------------------------------- ### Create deployment template with definition file Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_template_create.md Creates a new deployment template using the provided definition file. The --file flag is required and specifies the deployment template definition. Use --template-id to set a custom ID; otherwise an auto-generated ID is used. The --hide-instance-configurations flag hides instance configurations, visible only in JSON output. ```bash ecctl deployment template create --file [flags] ``` -------------------------------- ### ecctl deployment template show options Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_template_show.md Lists the options for the show command, including --hide-instance-configurations, --stack-version, and --template-id. ```bash -h, --help help for show --hide-instance-configurations Hides instance configurations - only visible when using the JSON output --stack-version string Optional filter to only return deployment templates which are valid for the specified stack version. --template-id string Required template ID to update. ``` -------------------------------- ### Generate configuration file with ecctl init Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-configuring.md Run the ecctl init command to interactively generate a configuration file. The command prompts for the offering type, region, API key, and default output format, then writes the configuration to ~/.ecctl/config.json. The output shows the full interactive session and confirms the configuration file location. ```shell $ ecctl init Welcome to Elastic Cloud Control (ecctl)! This command will guide you through authenticating and setting some default values. Missing configuration file, would you like to initialise it? [y/n]: y Select which type of Elastic Cloud offering you will be working with: [1] Elastic Cloud (default). [2] Elastic Cloud Enterprise (ECE). [3] Elasticsearch Service Private (ESSP). Please enter your choice: 1 Using "https://api.elastic-cloud.com" as the API endpoint. Select a region you would like to have as default: GCP [1] us-central1 (Iowa) [2] us-east1 (S. Carolina) [3] us-east4 (N. Virginia) [4] us-west1 (Oregon) [5] northamerica-northeast1 (Montreal) [6] southamerica-east1 (São Paulo) [7] australia-southeast1 (Sydney) [8] europe-west1 (Belgium) [9] europe-west2 (London) [10] europe-west3 (Frankfurt) [11] asia-northeast1 (Tokyo) [12] asia-south1 (Mumbai) [13] asia-southeast1 (Singapore) AWS [14] us-east-1 (N. Virginia) [15] us-west-1 (N. California) [16] us-west-2 (Oregon) [17] eu-central-1 (Frankfurt) [18] eu-west-2 (London) [19] eu-west-1 (Ireland) [20] ap-northeast-1 (Tokyo) [21] ap-southeast-1 (Singapore) [22] ap-southeast-2 (Sydney) [23] sa-east-1 (São Paulo) Azure [24] eastus2 (Virginia) [25] westus2 (Washington) [26] westeurope (Netherlands) [27] uksouth (London) [28] japaneast (Tokyo) [29] southeastasia (Singapore) Please enter your choice: 1 Create a new Elastic Cloud API key (https://cloud.elastic.co/account/keys) and/or Paste your API Key and press enter: xxxxx What default output format would you like? [1] text - Human-readable output format, commands with no output templates defined will fall back to JSON. [2] json - JSON formatted output API responses. Please enter a choice: 1 Your credentials seem to be valid. You're all set! Here are some commands to try: $ ecctl deployment list Config written to /home/myuser/.ecctl/config.json ``` -------------------------------- ### ecctl deployment show examples Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_show.md Examples of using ecctl deployment show to display specific resource information (kibana, apm) and to generate an update payload. The --generate-update-payload flag is mutually exclusive with --kind. ```bash * Shows kibana resource information from a given deployment: ecctl deployment show --kind kibana * Shows apm resource information from a given deployment with a specified ref-id. ecctl deployment show --kind apm --ref-id apm-server * Return the current deployment state as a valid update payload. Note that usage of --generate-update-payload is mutually exclusive to --kind. ecctl deployment show --generate-update-payload > update.json ``` -------------------------------- ### Enable command help options Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_user_enable.md Displays the help information for the enable command. ```bash -h, --help help for enable ``` -------------------------------- ### Show instance configuration Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_instance-configuration_show.md Shows an instance configuration. The command requires a configuration ID and supports flags for version, help, and showing deleted configurations. ```bash ecctl platform instance-configuration show [flags] ``` -------------------------------- ### ecctl deployment template help option Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_template.md Displays the help option for the template command. ```bash -h, --help help for template ``` -------------------------------- ### Pull request title examples with area prefixes Source: https://github.com/elastic/ecctl/blob/master/CONTRIBUTING.md Example pull request titles prefixed by the affected package or area (e.g., 'elasticsearch', 'docs', 'trivial'). The 'trivial' prefix is reserved for changes that do not alter generated executable code. ```console elasticsearch: Remove unnecessary cluster list sorting docs: Improve the contributor documentation trivial: Fix a couple of typos on elasticsearch.List ``` -------------------------------- ### ecctl init help flag Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_init.md Shows the help flag for the ecctl init command. ```bash -h, --help help for init ``` -------------------------------- ### Commit message example with issue reference Source: https://github.com/elastic/ecctl/blob/master/CONTRIBUTING.md Example commit message following the project's guidelines: a short subject line (50 chars max), a blank line, and a detailed explanatory paragraph. Includes an issue reference using the 'Closes' keyword. ```console elasticsearch: Remove unnecessary cluster list sorting Removes the unnecessary sorting on the obtained API response since the cluster list is already sorted by the backend. Closes #1234 ``` -------------------------------- ### ecctl deployment resource start-maintenance command syntax Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_resource_start-maintenance.md Starts maintenance mode on a deployment resource. The command requires a deployment ID and a resource kind (apm, appsearch, kibana, elasticsearch). Use --all to start maintenance on all instances of the resource kind, or --i to specify instance IDs. ```bash ecctl deployment resource start-maintenance --kind [--all|--i ,] [flags] ``` -------------------------------- ### Options for ecctl platform role create Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_role_create.md Options for the create command: --file specifies the filename of the role to create, and -h, --help shows help for create. ```bash --file string File name of the role to create -h, --help help for create ``` -------------------------------- ### Filter examples for allocator list Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_allocator_list.md Filter examples for the --filter flag. Use --filter instanceType:i3.large to filter by instance type, and --filter instanceType:i3.large --filter instanceFamily:gcp.highcpu.1 to filter by both instance type and family. Filter is a post-query action and doesn't support OR; all filter arguments are applied as AND. ```text * Allocators with instance type i3.large : --filter instanceType:i3.large * Allocators with instance type i3.large AND instance family gcp.highcpu.1 : --filter instanceType:i3.large --filter instanceFamily:gcp.highcpu.1 ``` -------------------------------- ### ecctl deployment elasticsearch keystore update Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_elasticsearch_keystore_update.md Documentation for the ecctl deployment elasticsearch keystore update command, including synopsis, examples, and options. ```APIDOC ## ecctl deployment elasticsearch keystore update ### Description Updates the contents of an Elasticsearch keystore. ### Synopsis Changes the contents of the Elasticsearch resource keystore from the specified deployment by using the PATCH method. The payload is a partial payload where any omitted current keystore items are not removed, unless the secrets are set to "null": {"secrets": {"my-secret": null}}. The contents of the specified file should be formatted to match the Elastic Cloud API "secrets" object. ### Usage ``` ecctl deployment elasticsearch keystore update [--ref-id ] {--file=.json} [flags] ``` ### Examples ``` # Set credentials for a GCS snapshot repository $ cat gcs-creds.json { "secrets": { "gcs.client.default.credentials_file": { "as_file": true, "value": { "type": "service_account", "project_id": "project-id", "private_key_id": "key-id", "private_key": "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----\n", "client_email": "service-account-email", "client_id": "client-id", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account-email" } } } } $ ecctl deployment elasticsearch keystore set --file=gcs-creds.json ... # Set multiple secrets in one playload $ cat multiple.json { "secrets": { "my-secret": { "value": "my-value" }, "my-other-secret": { "value": "my-other-value" } } } $ ecctl deployment elasticsearch keystore set --file=multiple.json ... ``` ### Options ``` -f, --file string Required json formatted file path with the keystore secret contents. -h, --help help for update --ref-id string Optional ref_id to use for the Elasticsearch resource, auto-discovered if not specified. ``` ### Options inherited from parent commands :::{include} _snippets/inherited-options.md ::: ### See also * [ecctl deployment elasticsearch keystore](/reference/ecctl_deployment_elasticsearch_keystore.md) - Manages Elasticsearch resource keystores ``` -------------------------------- ### ecctl platform instance-configuration usage Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_instance-configuration.md Shows the usage for the instance-configuration command. Use with the -h or --help flag to display help information. ```bash ecctl platform instance-configuration [flags] ``` -------------------------------- ### Compute SHA-256 checksum of downloaded artifact Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-installing.md Computes the SHA-256 checksum of the downloaded artifact. Includes examples for macOS (shasum) and Linux (sha256sum). ```bash # macOS shasum -a 256 ecctl_{{version.ecctl}}_darwin_arm64.tar.gz # Linux sha256sum ecctl_{{version.ecctl}}_linux_amd64.tar.gz ``` -------------------------------- ### ecctl deployment resource help option Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_resource.md Displays the help option for the resource command. ```bash -h, --help help for resource ``` -------------------------------- ### Synopsis for ecctl platform repository create Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_repository_create.md This is the synopsis for the 'ecctl platform repository create' command. It shows the required arguments: repository name and settings file, with optional flags. ```bash ecctl platform repository create --settings [flags] ``` -------------------------------- ### ecctl platform repository help option Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_repository.md Shows the help flag for the repository command. ```bash -h, --help help for repository ``` -------------------------------- ### ecctl platform help flag Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform.md Displays the help flag for the ecctl platform command. Use -h or --help to get help for the platform command. ```bash -h, --help help for platform ``` -------------------------------- ### Create an extension with ecctl deployment extension create Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_extension_create.md Creates an extension. Use --version to specify the Elastic stack version, --type to choose between bundle or plugin, and either --file or --download-url to provide the extension archive. ```bash ecctl deployment extension create --version --type {--file | --download-url } [--description ] [flags] ``` -------------------------------- ### Example: Set multiple secrets in one payload Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_elasticsearch_keystore_update.md Shows how to update multiple keystore secrets in a single request by providing a JSON file with multiple secret entries. ```bash # Set multiple secrets in one playload $ cat multiple.json { "secrets": { "my-secret": { "value": "my-value" }, "my-other-secret": { "value": "my-other-value" } } } $ ecctl deployment elasticsearch keystore set --file=multiple.json ... ``` -------------------------------- ### ecctl platform constructor list command Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_constructor_list.md Lists all constructors in the platform. Use the -h or --help flag to display help for the list command. ```bash ecctl platform constructor list [flags] ``` -------------------------------- ### Options for ecctl deployment extension create Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_extension_create.md Options for the create command. The --type flag accepts bundle or plugin. The --version flag accepts a numeric version for plugins, a major version like 7.*, or a wildcard * for bundles. ```bash --description string Optional flag to add a description to the extension. --download-url string Optional flag to define the URL to download the extension archive. --file string Optional flag to upload an extension from a local file path. -h, --help help for create --type string Extension type. Can be one of [bundle, plugin]. --version string Elastic stack version. Numeric version for plugins, e.g. 7.10.0. Major version e.g. 7.*, or wildcards e.g. * for bundles. ``` -------------------------------- ### Create a serverless project with ecctl Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_project_create.md Use this command to create a serverless project. The command accepts flags for specifying the project name, type, and tier. ```bash ecctl project create [flags] ``` -------------------------------- ### ecctl deployment resource start-maintenance Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_resource_start-maintenance.md Starts maintenance mode on a deployment resource. Use the deployment ID and resource kind to target the resource, and optionally specify all instances or specific instance IDs. ```APIDOC ## ecctl deployment resource start-maintenance ### Description Starts maintenance mode on a deployment resource. ### Command `ecctl deployment resource start-maintenance --kind [--all|--i ,] [flags]` ### Parameters #### Arguments - **deployment id** (string) - Required - The deployment ID. #### Options - **--all** (boolean) - Optional - Starts maintenance mode on all instances of a defined resource kind. - **--ignore-missing** (boolean) - Optional - If set and the specified instance does not exist, then quietly proceed to the next instance. - **-i, --instance-id strings** (string slice) - Optional - Deployment instance IDs to use (e.g. instance-0000000001). - **--kind string** (string) - Required - Deployment resource kind (apm, appsearch, kibana, elasticsearch). - **--ref-id string** (string) - Optional - Deployment RefId, if not set, the RefId will be auto-discovered. - **-h, --help** (boolean) - Optional - Help for start-maintenance. ### Inherited Options Inherited options from parent commands are available. See the parent command documentation for details. ### See Also - [ecctl deployment resource](/reference/ecctl_deployment_resource.md) - Manages deployment resources ``` -------------------------------- ### Update deployment command with --track flag Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-example-update-deployment.md Command to update the deployment using the JSON file. The --track flag monitors progress. Replace $DEPLOYMENT_ID with the deployment ID from the create example. ```sh ecctl deployment update [--track] $DEPLOYMENT_ID -f update-deployment.json ``` -------------------------------- ### List deployment templates Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_template_list.md Lists deployment templates. The command accepts optional flags to filter results, hide instance configurations, or specify a stack version. ```bash ecctl deployment template list [flags] ``` -------------------------------- ### ecctl deployment create output Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl-example-create-deployment.md Example output from the ecctl deployment create command. It shows the created deployment ID, name, and resource details including cloud_id, credentials (password redacted), and the APM secret_token. ```json { "created": true, "id": "7229888e7bf8350c7e4d07d7374171c0", "name": "My first ecctl deployment", "resources": [ { "cloud_id": "My_first_ecctl_deployment:dXMtY2VudHJhbDEuZ2NwLmZvdW5kaXQubm8kYjFlZWVjOGQ0YWVlNGY3ZDgxNTM2Zjc1ZjZhN2Y1MDgkM2ViZTAzNmI0NDhkNDc3Y2E2ZTJjZTQ5NmE4ZDQ5ODA=", "credentials": { "password": "REDACTED", "username": "elastic" }, "id": "b1eeec8d4aee4f7d81536f75f6a7f508", "kind": "elasticsearch", "ref_id": "main-elasticsearch", "region": "gcp-us-central1" }, { "elasticsearch_cluster_ref_id": "main-elasticsearch", "id": "3ebe036b448d477ca6e2ce496a8d4980", "kind": "kibana", "ref_id": "main-kibana", "region": "gcp-us-central1" }, { "elasticsearch_cluster_ref_id": "main-elasticsearch", "id": "5a03472f6dfe4f17acbe62622823b9cb", "kind": "apm", "ref_id": "main-apm", "region": "gcp-us-central1", "secret_token": "zfufcfe15eCVJk78b5" } ] } ``` -------------------------------- ### Show a serverless project with ecctl project show Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_project_show.md Shows the specified serverless project. The command requires a project ID and accepts optional flags. ```shell ecctl project show [flags] ``` -------------------------------- ### Options for ecctl user show Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_user_show.md Options for the ecctl user show command. Use --current to display details of the currently authenticated user, and -h or --help to get help for the show subcommand. ```shell --current Shows details of the current user -h, --help help for show ``` -------------------------------- ### ecctl platform enrollment-token command syntax Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_enrollment-token.md Displays the help for the enrollment-token command and lists its available options. ```shell ecctl platform enrollment-token [flags] ``` -------------------------------- ### Show help for ecctl deployment extension list Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_extension_list.md Shows help for the list command. The -h or --help flag is available for the list subcommand. ```bash -h, --help help for list ``` -------------------------------- ### ecctl platform constructor show command Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_constructor_show.md Shows information about a specific constructor. The command requires a constructor ID and supports the --help flag. ```bash ecctl platform constructor show [flags] ``` -------------------------------- ### ecctl platform instance-configuration create Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_instance-configuration_create.md Command to create a new instance configuration using a JSON file definition. ```APIDOC ## ecctl platform instance-configuration create ### Description Creates a new instance configuration. ### Usage ``` ecctl platform instance-configuration create -f [flags] ``` ### Options - `-f, --file string` - Instance configuration JSON file definition - `-h, --help` - help for create - `--id string` - Optional ID to set for the instance configuration (Overrides id if present) ### Options inherited from parent commands - `--config string` - Config file location - `--host string` - URL of the Elastic Cloud Enterprise API - `--output string` - Output format (json|text) - `--user string` - Username to use for authentication - `--pass string` - Password to use for authentication - `--insecure` - Skip TLS certificate verification - `--timeout duration` - Timeout for the request - `--verbose` - Verbose mode - `--silent` - Silent mode - `--help` - Show help ### See also - [ecctl platform instance-configuration](/reference/ecctl_platform_instance-configuration.md) - Manages instance configurations ``` -------------------------------- ### Show command options Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_extension_show.md Options for the show command. The --include-deployments flag includes deployments referencing this extension, up to 10000 deployments. ```bash -h, --help help for show --include-deployments Include deployments referencing this extension. Up to only 10000 deployments will be included. ``` -------------------------------- ### List instance configurations Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_instance-configuration_list.md Lists the instance configurations. This command is part of the ecctl platform instance-configuration management group. ```shell ecctl platform instance-configuration list [flags] ``` -------------------------------- ### ecctl deployment create command syntax Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_create.md Shows the command syntax for creating a deployment. The command requires one of the mutually exclusive options: --file, --es-size with --es-zones, or --es-node-topology. ```bash ecctl deployment create {--file | --es-size --es-zones | --es-node-topology } [flags] ``` -------------------------------- ### Show keystore settings command syntax Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_elasticsearch_keystore_show.md Use this command to display the settings from the Elasticsearch resource keystore. The deployment ID is required, and an optional --ref-id flag can specify the Elasticsearch resource reference ID; if not provided, it is auto-discovered. ```bash ecctl deployment elasticsearch keystore show [--ref-id ] [flags] ``` -------------------------------- ### ecctl platform repository list command Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_repository_list.md Lists all the snapshot repositories. Use the -h or --help flag to display help for the list command. ```bash ecctl platform repository list [flags] ``` -------------------------------- ### Options for ecctl user key list Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_user_key_list.md Options for the list command: --all lists all API keys for all platform users, --user specifies the user ID, and -h shows help. ```bash --all If specified, lists all API keys for all platform users -h, --help help for list --user string user id for the specified action ``` -------------------------------- ### Show snapshot repository configuration Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_platform_repository_show.md Use this command to obtain the configuration of a snapshot repository. Replace with the actual repository name and optionally add flags. ```bash ecctl platform repository show [flags] ``` -------------------------------- ### List deployment extensions with ecctl Source: https://github.com/elastic/ecctl/blob/master/docs/reference/ecctl_deployment_extension_list.md Lists all deployment extensions. The command accepts flags, including -h or --help to display help for the list command. ```bash ecctl deployment extension list [flags] ```