ECE Command line

ecctl est l’interface de ligne de commande pour les API Elasticsearch Service et Elastic Cloud Enterprise (ECE). Elle regroupe les opérations typiques dont les opérateurs ont généralement besoin dans un seul outil de ligne de commande.

Avantages d’ecctl :

  • Plus facile à utiliser que l’interface utilisateur du cloud ou que l’utilisation directe de l’API RESTful.
  • Vous aide à automatiser le cycle de vie du déploiement.
  • Fournit une base pour l’intégration avec d’autres outils

Installation

Docs ecctl install

List deployment

ecctl deployment list --config recette
{
      "id": "264c3a81562a470c94793f5a07b9925a",
      "name": "tst-calves",
      "resources": [
        {
          "cloud_id": "tst-calves:MTAuNTYuNjAuMjMxLmlwLmVzLmlvOjkyNDMkOTgyOTU1ZDdiMmQ0NDQ3OGE4ODhhMThkNTE5MGQ1MzYkOTIyYWNjZTVmYjE5NGExZjkwNDVmNTQwNzNjMDc1MDU=",
          "id": "982955d7b2d44478a888a18d5190d536",
          "kind": "elasticsearch",
          "ref_id": "main-elasticsearch",
          "region": "ece-region",
          "warnings": null
        },
        {
          "elasticsearch_cluster_ref_id": "main-elasticsearch",
          "id": "922acce5fb194a1f9045f54073c07505",
          "kind": "kibana",
          "ref_id": "main-kibana",
          "region": "ece-region",
          "warnings": null
        }
      ]
}

Deployment Update

ecctl deployment show --generate-update-payload 264c3a81562a470c94793f5a07b9925a --config recette > deployment_example_update.json
cat deployment_example_update.json
{
  "name": "tst-calves",
  "prune_orphans": false,
  "resources": {
    "apm": null,
    "appsearch": null,
    "elasticsearch": [
      {
        "display_name": "tst-calves",
        "plan": {
          "autoscaling_enabled": false,
          "cluster_topology": [
            {
              "autoscaling_max": {
                "resource": "memory",
                "value": 2097152
              },
              "elasticsearch": {
                "node_attributes": {
                  "data": "hot"
                }
              },
              "id": "hot_content",
              "instance_configuration_id": "data.default",
              "node_roles": [
                "master",
                "ingest",
                "transform",
                "data_hot",
                "remote_cluster_client",
                "data_content"
              ],
              "size": {
                "resource": "memory",
                "value": 2048
              },
              "topology_element_control": {
                "min": {
                  "resource": "memory",
                  "value": 1024
                }
              },
              "zone_count": 1
            }
          ],
          "deployment_template": {
            "id": "default"
          },
          "elasticsearch": {
            "version": "7.16.3"
          }
        },
        "ref_id": "main-elasticsearch",
        "region": "ece-region",
        "settings": {
          "curation": {
            "specs": []
          },
          "dedicated_masters_threshold": 6,
          "snapshot": {
            "enabled": false,
            "repository": {
              "default": {}
            },
            "retention": {},
            "slm": true,
            "suspended": []
          },
          "trust": {
            "accounts": [
              {
                "account_id": "b655b630af014f2687d14d6bf8a8e30a",
                "trust_all": true,
                "trust_allowlist": null
              }
            ],
            "external": null
          }
        }
      }
    ],
    "enterprise_search": null,
    "integrations_server": null,
    "kibana": [
      {
        "display_name": "tst-calves",
        "elasticsearch_cluster_ref_id": "main-elasticsearch",
        "plan": {
          "cluster_topology": [
            {
              "instance_configuration_id": "kibana",
              "size": {
                "resource": "memory",
                "value": 1024
              },
              "zone_count": 1
            }
          ],
          "kibana": {
            "system_settings": {
              "elasticsearch_url": "http://982955d7b2d44478a888a18d5190d536.containerhost:9244"
            },
            "version": "7.16.3"
          },
          "transient": {
            "strategy": {
              "autodetect": {}
            }
          }
        },
        "ref_id": "main-kibana",
        "region": "ece-region",
        "settings": {}
      }
    ]
  }
}
vim deployment_example_update.json
{
  "name": "tst-calves",
  "prune_orphans": false,
  "resources": {
    "apm": null,
    "appsearch": null,
    "elasticsearch": [
      {
        "display_name": "tst-calves",
        "plan": {
          "autoscaling_enabled": false,
          "cluster_topology": [
            {
              "autoscaling_max": {
                "resource": "memory",
                "value": 2097152
              },
              "elasticsearch": {
                "node_attributes": {
                  "data": "hot"
                }
              },
              "id": "hot_content",
              "instance_configuration_id": "data.default",
              "node_roles": [
                "master",
                "ingest",
                "transform",
                "data_hot",
                "remote_cluster_client",
                "data_content"
              ],
              "size": {
                "resource": "memory",
                "value": 2048
              },
              "topology_element_control": {
                "min": {
                  "resource": "memory",
                  "value": 1024
                }
              },
              "zone_count": 1
            }
          ],
          "deployment_template": {
            "id": "default"
          },
          "elasticsearch": {
            "version": "7.17.1"
          }
        },
        "ref_id": "main-elasticsearch",
        "region": "ece-region",
        "settings": {
          "curation": {
            "specs": []
          },
          "dedicated_masters_threshold": 6,
          "snapshot": {
            "enabled": false,
            "repository": {
              "default": {}
            },
            "retention": {},
            "slm": true,
            "suspended": []
          },
          "trust": {
            "accounts": [
              {
                "account_id": "b655b630af014f2687d14d6bf8a8e30a",
                "trust_all": true,
                "trust_allowlist": null
              }
            ],
            "external": null
          }
        }
      }
    ],
    "enterprise_search": null,
    "integrations_server": null,
    "kibana": [
      {
        "display_name": "tst-calves",
        "elasticsearch_cluster_ref_id": "main-elasticsearch",
        "plan": {
          "cluster_topology": [
            {
              "instance_configuration_id": "kibana",
              "size": {
                "resource": "memory",
                "value": 1024
              },
              "zone_count": 1
            }
          ],
          "kibana": {
            "system_settings": {
              "elasticsearch_url": "http://982955d7b2d44478a888a18d5190d536.containerhost:9244"
            },
            "version": "7.17.1"
          },
          "transient": {
            "strategy": {
              "grow_and_shrink": {}
            }
          }
        },
        "ref_id": "main-kibana",
        "region": "ece-region",
        "settings": {}
      }
    ]
  }
}
ecctl deployment update 264c3a81562a470c94793f5a07b9925a -f test.json --prune-orphans --config recette
{
  "id": "264c3a81562a470c94793f5a07b9925a",
  "name": "tst-calves",
  "resources": [
    {
      "cloud_id": "tst-calves:MTAuNTYuNjAuMjMxLmlwLmVzLmlvOjkyNDMkOTgyOTU1ZDdiMmQ0NDQ3OGE4ODhhMThkNTE5MGQ1MzYkOTIyYWNjZTVmYjE5NGExZjkwNDVmNTQwNzNjMDc1MDU=",
      "id": "982955d7b2d44478a888a18d5190d536",
      "kind": "elasticsearch",
      "ref_id": "main-elasticsearch",
      "region": "ece-region",
      "warnings": null
    },
    {
      "elasticsearch_cluster_ref_id": "main-elasticsearch",
      "id": "922acce5fb194a1f9045f54073c07505",
      "kind": "kibana",
      "ref_id": "main-kibana",
      "region": "ece-region",
      "warnings": null
    }
  ]
}