-
Notifications
You must be signed in to change notification settings - Fork 18
Description
I would like to request a new function called createGraph().
This feature would automate the creation of secret and token security features, to allow the authentication of a new Graph, alleviating manual steps for the programmer and reduce the number of incidences of login issues being reported.
Start off with defining a connection:
conn = tg.TigerGraphConnection(host="", graphname="<graph_name>", username="", password="" tgCloud="True")
Pseudo code:
found = conn.check_exist_graphs(conn.graphname)
if (not found):
conn.createGraph()
g = Graph(conn)
else:
g= Graph(conn)
The createGraph() function will get the graph_name from connection object and call gsql("CREATE GRAPH "+ conn.graphname). Once the graph is created and checking to see if the connection is for the tgCloud. If so, then the createGraph() function would create the secret and token, printing out the secret and token with its expiration date or saving it to a configuration file. The createGraph() function would execute the conn.getToken() function, authenticating the connection for the graph_name.
Future instantiations of the connection can be done by passing in the token with username and password:
conn = tg.TigerGraphConnection(host="", graphname="<graph_name>", apiToken="<valid_Token>", username="", password="" tgCloud="True")