Skip to content

New Feature Request 'createGraph()' function #207

@demit733

Description

@demit733

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions