Skip to content

Commit fa33344

Browse files
author
Rahji Abdurehman
committed
small changes
1 parent 3d2b428 commit fa33344

File tree

2 files changed

+16
-31
lines changed

2 files changed

+16
-31
lines changed

examples/tutorial.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,24 @@ def main(host='localhost', port=8086):
4545
print("Write points: {0}".format(json_body))
4646
client.write_points(json_body)
4747

48-
print("Queying data: " + query)
48+
print("Querying data: " + query)
4949
result = client.query(query)
5050

5151
print("Result: {0}".format(result))
5252

53+
#
54+
print("Remove admin privilege from user")
55+
client.unset_database_admin(dbuser)
56+
57+
dbusers = client.get_database_users()
58+
print("Get list of database users again: {0}".format(dbusers))
59+
60+
print("Switch user: " + dbuser)
61+
client.switch_user(dbuser, dbuser_password)
62+
63+
print("Write points: {0}".format(json_body))
64+
client.write_points(json_body)
65+
5366
print("Switch user: " + user)
5467
client.switch_user(user, password)
5568

influxdb/client.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def send_packet(self, packet):
648648

649649
def ping(self, database):
650650
"""
651-
List interfaces
651+
Healthcheck
652652
"""
653653
url = "ping"
654654

@@ -662,7 +662,7 @@ def ping(self, database):
662662

663663
def force_compaction(self, database):
664664
"""
665-
List interfaces
665+
Force raft compaction
666666
"""
667667
url = "raft/force_compaction"
668668

@@ -674,20 +674,6 @@ def force_compaction(self, database):
674674

675675
return response.json()
676676

677-
def list_interfaces(self, database):
678-
"""
679-
List interfaces
680-
"""
681-
url = "interfaces"
682-
683-
response = self.request(
684-
url=url,
685-
method='GET',
686-
status_code=200
687-
)
688-
689-
return response.json()
690-
691677
# Cluster config endpoints
692678
# get list of cluster servers
693679
# curl http://localhost:8086/cluster_admins?u=root&p=root
@@ -777,17 +763,3 @@ def drop_shard(self, database):
777763
)
778764

779765
return True
780-
781-
def is_in_sync(self, database):
782-
"""
783-
Return whether cluster is in sync or not
784-
"""
785-
url = "sync"
786-
787-
response = self.request(
788-
url=url,
789-
method='GET',
790-
status_code=200
791-
)
792-
793-
return json.loads(response.text)

0 commit comments

Comments
 (0)
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