Skip to content

Commit 13792c7

Browse files
committed
minimum docs on the new cluster calls
1 parent eb29fe5 commit 13792c7

File tree

11 files changed

+71
-30
lines changed

11 files changed

+71
-30
lines changed

new_docs/build/cluster/health.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,25 @@ <h4>- Cluster</h4>
5454
</aside>
5555
<article>
5656
<div id="content-margin-fix"><h1>Health</h1>
57-
<p>cluster health has not yet been mapped
57+
<p>Get cluster health simple
5858

5959
</p>
60+
<pre><code><span class="keyword">var</span> r = <span class="keyword">this</span>._client.Health(HealthLevel.Cluster);</code></pre>
61+
<p>Cluster health just for one (or more) index
62+
63+
</p>
64+
<pre><code><span class="keyword">var</span> r = <span class="keyword">this</span>._client.Health(<span class="keyword">new</span>[] { Test.<span class="keyword">Default</span>.DefaultIndex }, HealthLevel.Cluster);</code></pre>
65+
<p>Advanced options are mapped as well
66+
67+
</p>
68+
<pre><code><span class="keyword">var</span> r = <span class="keyword">this</span>._client.Health(<span class="keyword">new</span> HealthParams
69+
{
70+
CheckLevel = HealthLevel.Shards,
71+
Timeout = <span class="string">"30s"</span>,
72+
WaitForMinNodes = <span class="number">1</span>,
73+
WaitForRelocatingShards = <span class="number">0</span>,
74+
WaitForStatus = HealthStatus.Green
75+
});</code></pre>
6076

6177
</div>
6278
</article>

new_docs/build/cluster/nodes-info.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ <h4>- Cluster</h4>
5454
</aside>
5555
<article>
5656
<div id="content-margin-fix"><h1>Nodes info</h1>
57-
<p>Nodes info has not yet been mapped
57+
<pre><code><span class="keyword">var</span> r = <span class="keyword">this</span>._client.NodeInfo(NodesInfo.All);
58+
<span class="keyword">var</span> node = r.Nodes.Values.First();</code></pre>
59+
<p>You can then traverse all the stats i.e:
5860

5961
</p>
62+
<pre><code>node.OS.CPU.Idle</code></pre>
6063

6164
</div>
6265
</article>

new_docs/build/cluster/nodes-stats.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,14 @@ <h4>- Cluster</h4>
5454
</aside>
5555
<article>
5656
<div id="content-margin-fix"><h1>Nodes stats</h1>
57-
<p>Nodes stats has not yet been mapped
57+
<p>var r = this._client.NodeInfo(NodesInfo.All);
5858

5959
</p>
60+
<pre><code> <span class="keyword">var</span> node = r.Nodes.First();</code></pre>
61+
<p>you can than traverse the node info objects i.e:
62+
63+
</p>
64+
<pre><code> node.Value.OS.Cpu.CacheSizeInBytes;</code></pre>
6065

6166
</div>
6267
</article>

new_docs/build/core/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ <h2>Aditional parameters</h2>
9292
</p>
9393
<pre><code>client.Index(post, <span class="keyword">new</span> IndexParameters() { Refresh = <span class="keyword">true</span> });</code></pre>
9494
<h2>Bulk Indexing</h2>
95-
<p>Instead of passing <code>T</code> just pass <code>IEnumerable&lt;T&gt;</code> to <code>IndexMany()</code> or <code>IndexManyAsync()</code>.
95+
<p>Instead of passing <code>T</code> just pass an <code>IEnumerable&lt;T&gt;</code> to <code>IndexMany()</code> or <code>IndexManyAsync()</code>.
9696

9797
</p>
9898
<p><strong>Note</strong>

new_docs/contents/cluster/health.markdown

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ menuitem: health
77

88

99
# Health
10+
Get cluster health simple
1011

11-
cluster health has not yet been mapped
12+
var r = this._client.Health(HealthLevel.Cluster);
13+
14+
Cluster health just for one (or more) index
15+
16+
var r = this._client.Health(new[] { Test.Default.DefaultIndex }, HealthLevel.Cluster);
17+
18+
Advanced options are mapped as well
19+
20+
var r = this._client.Health(new HealthParams
21+
{
22+
CheckLevel = HealthLevel.Shards,
23+
Timeout = "30s",
24+
WaitForMinNodes = 1,
25+
WaitForRelocatingShards = 0,
26+
WaitForStatus = HealthStatus.Green
27+
});
1228

new_docs/contents/cluster/nodes-info.markdown

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ menusection: cluster
55
menuitem: nodes-info
66
---
77

8-
98
# Nodes info
109

11-
Nodes info has not yet been mapped
10+
var r = this._client.NodeInfo(NodesInfo.All);
11+
var node = r.Nodes.Values.First();
12+
13+
14+
You can then traverse all the stats i.e:
1215

16+
node.OS.CPU.Idle

new_docs/contents/cluster/nodes-stats.markdown

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@ menuitem: nodes-stats
88

99
# Nodes stats
1010

11-
Nodes stats has not yet been mapped
11+
var r = this._client.NodeInfo(NodesInfo.All);
12+
13+
var node = r.Nodes.First();
14+
15+
you can than traverse the node info objects i.e:
16+
17+
node.Value.OS.Cpu.CacheSizeInBytes;
1218

new_docs/contents/core/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Similarly to force a wait for a refresh
4343

4444
## Bulk Indexing
4545

46-
Instead of passing `T` just pass `IEnumerable<T>` to `IndexMany()` or `IndexManyAsync()`.
46+
Instead of passing `T` just pass an `IEnumerable<T>` to `IndexMany()` or `IndexManyAsync()`.
4747

4848
**Note**
4949
For asynchronous commands there's a special connection setting which automatically semaphores threaded communication

src/Nest.Tests.Integration/Cluster/NodeTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ public class NodeTests : BaseElasticSearchTests
88
{
99
[Test]
1010
public void NodeInfo()
11-
{
11+
{
12+
1213
var r = this._client.NodeInfo(NodesInfo.All);
14+
1315
Assert.True(r.IsValid);
1416
Assert.IsNotNull(r.Nodes);
1517
var node = r.Nodes.Values.First();
@@ -29,7 +31,8 @@ public void NodeStats()
2931
var r = this._client.NodeStats(NodeInfoStats.All);
3032
Assert.True(r.IsValid);
3133
Assert.IsNotNull(r.Nodes);
32-
var node = r.Nodes.Values.First();
34+
var node = r.Nodes.Values.First();
35+
3336
Assert.IsNotNull(node.Indices);
3437
Assert.IsNotNull(node.FileSystem);
3538
Assert.IsNotNull(node.OS);

src/Nest.Tests.Unit/Cluster/HealthTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public void ShardHealth()
4343
public void DetailedHealth()
4444
{
4545
var r = this._client.Health(new HealthParams
46-
{
47-
CheckLevel = HealthLevel.Shards,
48-
Timeout = "30s",
49-
WaitForMinNodes = 1,
50-
WaitForRelocatingShards = 0,
51-
WaitForStatus = HealthStatus.Green
52-
});
46+
{
47+
CheckLevel = HealthLevel.Shards,
48+
Timeout = "30s",
49+
WaitForMinNodes = 1,
50+
WaitForRelocatingShards = 0,
51+
WaitForStatus = HealthStatus.Green
52+
});
5353
var u = new Uri(r.ConnectionStatus.RequestUrl);
5454
u.AbsolutePath.Should().StartWith("/_cluster/health");
5555
u.Query.Should().Contain("level=shards");

0 commit comments

Comments
 (0)