Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET _index_template and GET _component_template request support query parameter flat_settings #83297

Merged
merged 5 commits into from
Feb 10, 2022

Conversation

Simolx
Copy link
Contributor

@Simolx Simolx commented Jan 29, 2022

GET _index_template and GET _component_template request with parameter flat_settings=true has no effect.
For example, run these requests settings are not returned in a flat format.

  • request
GET _index_template/ilm-history?pretty&flat_settings=true
  • response
{
  "index_templates" : [
    {
      "name" : "ilm-history",
      "index_template" : {
        "index_patterns" : [
          "ilm-history-5*"
        ],
        "template" : {
          "settings" : {
            "index" : {
              "lifecycle" : {
                "name" : "ilm-history-ilm-policy"
              },
              "number_of_shards" : "1",
              "auto_expand_replicas" : "0-1",
              "number_of_replicas" : "0"
            }
          },
          "mappings" : {
            "dynamic" : false,
            "properties" : {
              "index_age" : {
                "type" : "long"
              },
              "@timestamp" : {
                "format" : "epoch_millis",
                "type" : "date"
              },
              "error_details" : {
                "type" : "text"
              },
              "success" : {
                "type" : "boolean"
              },
              "index" : {
                "type" : "keyword"
              },
              "state" : {
                "dynamic" : true,
                "type" : "object",
                "properties" : {
                  "phase" : {
                    "type" : "keyword"
                  },
                  "failed_step" : {
                    "type" : "keyword"
                  },
                  "phase_definition" : {
                    "type" : "text"
                  },
                  "action_time" : {
                    "format" : "epoch_millis",
                    "type" : "date"
                  },
                  "phase_time" : {
                    "format" : "epoch_millis",
                    "type" : "date"
                  },
                  "step_info" : {
                    "type" : "text"
                  },
                  "action" : {
                    "type" : "keyword"
                  },
                  "step" : {
                    "type" : "keyword"
                  },
                  "is_auto-retryable_error" : {
                    "type" : "keyword"
                  },
                  "creation_date" : {
                    "format" : "epoch_millis",
                    "type" : "date"
                  },
                  "step_time" : {
                    "format" : "epoch_millis",
                    "type" : "date"
                  }
                }
              },
              "policy" : {
                "type" : "keyword"
              }
            }
          }
        },
        "composed_of" : [ ],
        "priority" : 2147483647,
        "version" : 5,
        "_meta" : {
          "managed" : true,
          "description" : "index template for ILM history indices"
        },
        "data_stream" : {
          "hidden" : true
        },
        "allow_auto_create" : true
      }
    }
  ]
}
  • request:
GET _component_template/logs-settings?pretty&flat_settings=true
  • response
{
  "component_templates" : [
    {
      "name" : "logs-settings",
      "component_template" : {
        "template" : {
          "settings" : {
            "index" : {
              "lifecycle" : {
                "name" : "logs"
              },
              "codec" : "best_compression",
              "query" : {
                "default_field" : [
                  "message"
                ]
              }
            }
          }
        },
        "version" : 1,
        "_meta" : {
          "managed" : true,
          "description" : "default settings for the logs index template installed by x-pack"
        }
      }
    }
  ]
}

@elasticsearchmachine elasticsearchmachine added external-contributor Pull request authored by a developer outside the Elasticsearch team v8.1.0 labels Jan 29, 2022
@fcofdez fcofdez added :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team labels Jan 31, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@mark-vieira mark-vieira added v8.2.0 and removed v8.1.0 labels Feb 2, 2022
@dakrone
Copy link
Member

dakrone commented Feb 7, 2022

@elasticmachine ok to test

@dakrone dakrone self-assigned this Feb 7, 2022
@dakrone
Copy link
Member

dakrone commented Feb 7, 2022

@elasticmachine update branch

@Simolx Simolx changed the title GET _index_template request support query parameter flat_settings GET _index_template and GET _component_template request support query parameter flat_settings Feb 8, 2022
@dakrone
Copy link
Member

dakrone commented Feb 8, 2022

@elasticmachine update branch

@Simolx
Copy link
Contributor Author

Simolx commented Feb 10, 2022

@dakrone can you help to review this PR?

@dakrone dakrone self-requested a review February 10, 2022 20:21
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Simolx

@dakrone dakrone merged commit c47548a into elastic:master Feb 10, 2022
@Simolx Simolx deleted the dev-flat_settings branch February 10, 2022 22:20
@Simolx
Copy link
Contributor Author

Simolx commented Feb 10, 2022

LGTM, thanks @Simolx

Thanks @dakrone !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Data Management Meta label for data/management team v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants