From ff342dd0d1dc6d5077008aecc47b1d0062aaebdb Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sat, 30 Jul 2016 00:05:04 -0500 Subject: [PATCH] Remove get_list_servers() Fix influxdata/influxdb-python#342 ``SHOW_SERVERS`` was removed in influxdata/influxdb#6470 --- influxdb/client.py | 19 ------------------- influxdb/tests/client_test.py | 33 --------------------------------- 2 files changed, 52 deletions(-) diff --git a/influxdb/client.py b/influxdb/client.py index 5e60011c..e65254a3 100644 --- a/influxdb/client.py +++ b/influxdb/client.py @@ -588,25 +588,6 @@ def get_list_retention_policies(self, database=None): ) return list(rsp.get_points()) - def get_list_servers(self): - """Get the list of servers in InfluxDB cluster. - - :returns: all nodes in InfluxDB cluster - :rtype: list of dictionaries - - :Example: - - :: - - >> servers = client.get_list_servers() - >> servers - [{'cluster_addr': 'server01:8088', - 'id': 1, - 'raft': True, - 'raft-leader': True}] - """ - return list(self.query("SHOW SERVERS").get_points()) - def get_list_users(self): """Get the list of all users in InfluxDB. diff --git a/influxdb/tests/client_test.py b/influxdb/tests/client_test.py index e602cdff..a50d93ce 100644 --- a/influxdb/tests/client_test.py +++ b/influxdb/tests/client_test.py @@ -484,39 +484,6 @@ def test_get_list_database_fails(self): with _mocked_session(cli, 'get', 401): cli.get_list_database() - def test_get_list_servers(self): - data = {'results': [ - {'series': [ - {'columns': ['id', 'cluster_addr', 'raft', 'raft-leader'], - 'values': [ - [1, 'server01:8088', True, True], - [2, 'server02:8088', True, False], - [3, 'server03:8088', True, False]]}]} - ]} - - with _mocked_session(self.cli, 'get', 200, json.dumps(data)): - self.assertListEqual( - self.cli.get_list_servers(), - [{'cluster_addr': 'server01:8088', - 'id': 1, - 'raft': True, - 'raft-leader': True}, - {'cluster_addr': 'server02:8088', - 'id': 2, - 'raft': True, - 'raft-leader': False}, - {'cluster_addr': 'server03:8088', - 'id': 3, - 'raft': True, - 'raft-leader': False}] - ) - - @raises(Exception) - def test_get_list_servers_fails(self): - cli = InfluxDBClient('host', 8086, 'username', 'password') - with _mocked_session(cli, 'get', 401): - cli.get_list_servers() - def test_create_retention_policy_default(self): example_response = '{"results":[{}]}' pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy