Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Feature Request 'createGraph()' function #207

Open
demit733 opened this issue Dec 12, 2023 · 0 comments
Open

New Feature Request 'createGraph()' function #207

demit733 opened this issue Dec 12, 2023 · 0 comments

Comments

@demit733
Copy link

demit733 commented Dec 12, 2023

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant