-
Notifications
You must be signed in to change notification settings - Fork 6
/
ElasticCluster.cs
33 lines (31 loc) · 1.11 KB
/
ElasticCluster.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Nest;
namespace Elasticsearch.Powershell
{
[Cmdlet(VerbsCommon.Get, "ElasticCluster")]
public class ElasticCluster : ElasticCmdlet
{
protected override void ProcessRecord()
{
var health = this.Client.ClusterHealth();
this.CheckResponse(health);
WriteObject(new Types.Cluster
{
ConnectionSettings = this.Client.ConnectionSettings,
ActivePrimaryShards = health.ActivePrimaryShards,
ActiveShards = health.ActiveShards,
Name = health.ClusterName,
InitializingShards = health.InitializingShards,
NumberOfDataNodes = health.NumberOfDataNodes,
NumberOfNodes = health.NumberOfNodes,
NumberOfPendingTasks = health.NumberOfPendingTasks,
RelocatingShards = health.RelocatingShards,
Status = health.Status,
UnassignedShards = health.UnassignedShards
});
}
}
}