|
16 | 16 | from .ssl import SslClient
|
17 | 17 | from .watcher import WatcherClient
|
18 | 18 |
|
| 19 | +XPACK_NAMESPACES = { |
| 20 | + "ccr": CcrClient, |
| 21 | + "data_frame": Data_FrameClient, |
| 22 | + "deprecation": DeprecationClient, |
| 23 | + "graph": GraphClient, |
| 24 | + "ilm": IlmClient, |
| 25 | + "indices": IndicesClient, |
| 26 | + "license": LicenseClient, |
| 27 | + "migration": MigrationClient, |
| 28 | + "ml": MlClient, |
| 29 | + "monitoring": MonitoringClient, |
| 30 | + "rollup": RollupClient, |
| 31 | + "security": SecurityClient, |
| 32 | + "sql": SqlClient, |
| 33 | + "ssl": SslClient, |
| 34 | + "watcher": WatcherClient, |
| 35 | +} |
19 | 36 |
|
20 | 37 | class XPackClient(NamespacedClient):
|
21 |
| - namespace = "xpack" |
22 |
| - |
23 | 38 | def __init__(self, *args, **kwargs):
|
24 | 39 | super(XPackClient, self).__init__(*args, **kwargs)
|
25 |
| - self.ccr = CcrClient(self.client) |
26 |
| - self.data_frame = Data_FrameClient(self.client) |
27 |
| - self.deprecation = DeprecationClient(self.client) |
28 |
| - self.graph = GraphClient(self.client) |
29 |
| - self.ilm = IlmClient(self.client) |
30 |
| - self.indices = IndicesClient(self.client) |
31 |
| - self.license = LicenseClient(self.client) |
32 |
| - self.migration = MigrationClient(self.client) |
33 |
| - self.ml = MlClient(self.client) |
34 |
| - self.monitoring = MonitoringClient(self.client) |
35 |
| - self.rollup = RollupClient(self.client) |
36 |
| - self.security = SecurityClient(self.client) |
37 |
| - self.sql = SqlClient(self.client) |
38 |
| - self.ssl = SslClient(self.client) |
39 |
| - self.watcher = WatcherClient(self.client) |
| 40 | + |
| 41 | + for namespace in XPACK_NAMESPACES: |
| 42 | + setattr(self, namespace, getattr(self.client, namespace)) |
40 | 43 |
|
41 | 44 | @query_params("categories", "human")
|
42 | 45 | def info(self, params=None):
|
|
0 commit comments