Class: JayAPI::Elasticsearch::Indices::Settings
- Inherits:
-
Object
- Object
- JayAPI::Elasticsearch::Indices::Settings
- Defined in:
- lib/jay_api/elasticsearch/indices/settings.rb,
lib/jay_api/elasticsearch/indices/settings/blocks.rb
Overview
Represents the settings of an Elasticsearch Index.
Defined Under Namespace
Classes: Blocks
Instance Attribute Summary collapse
-
#index_name ⇒ Object
readonly
Returns the value of attribute index_name.
-
#transport_client ⇒ Object
readonly
Returns the value of attribute transport_client.
Instance Method Summary collapse
-
#all ⇒ Hash
A Hash with all the settings for the index.
-
#blocks ⇒ JayAPI::Elasticsearch::Indices::Settings::Blocks
The blocks settings for the given index.
-
#initialize(transport_client, index_name) ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize(transport_client, index_name) ⇒ Settings
Returns a new instance of Settings.
16 17 18 19 |
# File 'lib/jay_api/elasticsearch/indices/settings.rb', line 16 def initialize(transport_client, index_name) @transport_client = transport_client @index_name = index_name end |
Instance Attribute Details
#index_name ⇒ Object (readonly)
Returns the value of attribute index_name.
10 11 12 |
# File 'lib/jay_api/elasticsearch/indices/settings.rb', line 10 def index_name @index_name end |
#transport_client ⇒ Object (readonly)
Returns the value of attribute transport_client.
10 11 12 |
# File 'lib/jay_api/elasticsearch/indices/settings.rb', line 10 def transport_client @transport_client end |
Instance Method Details
#all ⇒ Hash
Returns A Hash with all the settings for the index. It looks like this:
{
"number_of_shards" => "5",
"blocks" => { "read_only_allow_delete" => "false", "write" => "false" },
"provided_name" => "xyz01_tests",
"creation_date" => "1588701800423",
"number_of_replicas" => "1",
"uuid" => "VFx2e5t0Qgi-1zc2PUkYEg",
"version" => { "created" => "7010199", "upgraded" => "7100299"}
}.
38 39 40 41 |
# File 'lib/jay_api/elasticsearch/indices/settings.rb', line 38 def all transport_client.indices.get_settings(index: index_name) .fetch(index_name).fetch('settings').fetch('index') end |
#blocks ⇒ JayAPI::Elasticsearch::Indices::Settings::Blocks
Returns The blocks settings for the given index.
45 46 47 |
# File 'lib/jay_api/elasticsearch/indices/settings.rb', line 45 def blocks @blocks ||= ::JayAPI::Elasticsearch::Indices::Settings::Blocks.new(self) end |