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

Add GET /index API #4069

Closed
clintongormley opened this Issue Nov 4, 2013 · 6 comments

Comments

Projects
None yet
6 participants
@clintongormley
Copy link
Member

commented Nov 4, 2013

While we have the index exists API:

HEAD /index

and we have:

GET /index/_aliases
GET /index/_mapping
GET /index/_settings
GET /index/_warmer

We don't have a GET /index API which would return all info about the index (ie aliases, settings, mappings, warmers) which could be used to recreate the index with a different name or on a different cluster.

@spinscale

This comment has been minimized.

Copy link
Member

commented Nov 24, 2013

Hey,

implementation for this is not too complex (see my commit), however, do you think it makes sense, if warmers and aliases could also directly be added when creating an index, so one could pipe this into a create index call?

This is the current output

» curl 'localhost:9200/test?pretty'
{
  "settings" : {
    "index.tests.seed" : "-429205130377286056",
    "index.compound_format" : "0.9941336967222938",
    "index.merge.policy.type" : "org.elasticsearch.index.merge.policy.LogDocMergePolicyProvider",
    "index.number_of_replicas" : "5",
    "index.number_of_shards" : "10",
    "index.version.created" : "1000002",
    "index.uuid" : "d70IIOiGQLiFdau4ZBVifw",
    "index.refresh_interval" : "10s"
  },
  "mappings" : {
    "test" : {
      "properties" : {
        "message" : {
          "type" : "string",
          "store" : true
        }
      }
    }
  },
  "aliases" : {
    "thetest" : { }
  },
  "warmers" : {
    "warmer_1" : {
      "types" : [ ],
      "source" : {
        "query" : {
          "match_all" : { }
        }
      }
    }
  }
}
@dakrone

This comment has been minimized.

Copy link
Member

commented Dec 6, 2013

@spinscale +1, I personally vote for keeping the warmers and aliases in, just to get all the information.

@clintongormley

This comment has been minimized.

Copy link
Member Author

commented Dec 17, 2013

@spinscale Nice - I didn't see this commit. Warmers can already be added in the create index API, but you're right, aliases can't be. I think it would be nice to support this too.

Also see #4140

Bumping this issue to 1.0.1

@kevinkluge kevinkluge added v1.1.0 and removed v1.0.1 labels Feb 11, 2014

@s1monw s1monw added v1.2.0 and removed v1.1.0 labels Mar 12, 2014

@clintongormley clintongormley added v1.3.0 and removed v1.2.0 labels Apr 28, 2014

@clintongormley

This comment has been minimized.

Copy link
Member Author

commented Apr 28, 2014

Also see #4614

@clintongormley

This comment has been minimized.

Copy link
Member Author

commented Apr 28, 2014

Copied comment over from #4614

With the removal of _aliases (#4539) we've lost an endpoint for efficiently listing available indices & aliases, which Kibana relies on for computing timestamped indices.

It would be nice to have an _indices endpoint that could efficiently return a list of indices with a configurable amount of additional granularity, eg mappings, settings, aliases.

Bonus points if we could support wildcard matching here for both index and alias names, eg

** Every index name **

/_indices

** Every index with its aliases and settings **

/_indices?aliases

** Every index named mydata-* or with an alias matching mydata-, along with its mapping *

/mydata-*/_indices?mapping
@spinscale

This comment has been minimized.

Copy link
Member

commented Jul 29, 2014

@clintongormley your proposal currently clashes with the RestGetMappingAction due to a mapping for /{index}/_mapping/{type}

spinscale added a commit to spinscale/elasticsearch that referenced this issue Aug 8, 2014

REST API: Added action to get all index information at once
This includes mappings, settings, aliases and warmers.

Can be specified like this

GET /foo
GET /foo/_settings,_warmers
GET /*/_aliases

TODO
/_indices
/_indices?aliases

Closes elastic#4069

@colings86 colings86 self-assigned this Aug 11, 2014

@colings86 colings86 removed the adoptme label Aug 11, 2014

colings86 added a commit to colings86/elasticsearch that referenced this issue Sep 11, 2014

Indices API: Added GET Index API
Returns information about settings, aliases, warmers, and mappings. Basically returns the IndexMetadata. This new endpoint replaces the /{index}/_alias|_aliases|_mapping|_mappings|_settings|_warmer|_warmers and /_alias|_aliases|_mapping|_mappings|_settings|_warmer|_warmers endpoints whilst maintaining the same response formats.  The only exception to this is on the /_alias|_aliases|_warmer|_warmers endpoint which will now return a section for 'aliases' or 'warmers' even if no aliases or warmers exist. This backwards compatibility change is documented in the reference docs.

Closes elastic#4069

colings86 added a commit that referenced this issue Sep 11, 2014

Indices API: Added GET Index API
Returns information about settings, aliases, warmers, and mappings. Basically returns the IndexMetadata. This new endpoint replaces the /{index}/_alias|_aliases|_mapping|_mappings|_settings|_warmer|_warmers and /_alias|_aliases|_mapping|_mappings|_settings|_warmer|_warmers endpoints whilst maintaining the same response formats. The only exception to this is on the /_alias|_aliases|_warmer|_warmers endpoint which will now return a section for 'aliases' or 'warmers' even if no aliases or warmers exist. This backwards compatibility change is documented in the reference docs.

Closes #4069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.