-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a85d2b
commit ba5fb1f
Showing
1 changed file
with
0 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1 @@ | ||
= `AsyncTigerGraphConnection` | ||
|
||
|
||
A TigerGraphConnection object provides the HTTP(S) communication used by all other modules. | ||
This object is the **asynchronous** version of the connection object. If you want to use pyTigerGraph in an synchronous | ||
environment, use the `TigerGraphConnection` object. | ||
|
||
The `AsyncTigerGraphConnection` object is the main object that you will interact with when using pyTigerGraph. | ||
It provides the same core functionality as the synchronous `TigerGraphConnection` object, but with asynchronous methods. | ||
|
||
**Note:** `AsyncTigerGraphConnection` does not currently support the GDS or TigerGraph CoPilot APIs found in the synchronous version. | ||
|
||
To test your connection, you can use the `echo()` method. This method sends a simple request to the server and returns the response. | ||
|
||
```python | ||
from pyTigerGraph import TigerGraphConnection | ||
|
||
conn = AsyncTigerGraphConnection( | ||
host="http://localhost", | ||
graphname="MyGraph", | ||
username="tigergraph", | ||
password="tigergraph") | ||
|
||
resp = await conn.echo() | ||
|
||
print(resp) | ||
``` | ||
|
||
== \__init__() | ||
`__init__(host: str = "http://127.0.0.1", graphname: str = "MyGraph", gsqlSecret: str = "", username: str = "tigergraph", password: str = "tigergraph", tgCloud: bool = False, restppPort: Union[int, str] = "9000", gsPort: Union[int, str] = "14240", gsqlVersion: str = "", version: str = "", apiToken: str = "", useCert: bool = None, certPath: str = None, debug: bool = None, sslPort: Union[int, str] = "443", gcp: bool = False, jwtToken: str = "")` | ||
Initiate a connection object (doc string copied from synchronous __init__). | ||
|
||
[discrete] | ||
==== Parameters: | ||
* `host`: The host name or IP address of the TigerGraph server. Make sure to include the | ||
protocol (http:// or https://). If `certPath` is `None` and the protocol is https, | ||
a self-signed certificate will be used. | ||
* `graphname`: The default graph for running queries. | ||
* `gsqlSecret`: The secret key for GSQL. + | ||
See https://docs.tigergraph.com/tigergraph-server/current/user-access/managing-credentials#_secrets.[this] for more details. | ||
* `username`: The username on the TigerGraph server. | ||
* `password`: The password for that user. | ||
* `tgCloud`: Set to `True` if using TigerGraph Cloud. If your hostname contains `tgcloud`, then | ||
this is automatically set to `True`, and you do not need to set this argument. | ||
* `restppPort`: The port for REST++ queries. | ||
* `gsPort`: The port for gsql server. | ||
* `gsqlVersion`: The version of the GSQL client to be used. Effectively the version of the database | ||
being connected to. | ||
* `version`: DEPRECATED; use `gsqlVersion`. | ||
* `apiToken`: DEPRECATED; use `getToken()` with a secret to get a session token. | ||
* `useCert`: DEPRECATED; the need for a CA certificate is now determined by URL scheme. | ||
* `certPath`: The filesystem path to the CA certificate. Required in case of https connections. | ||
* `debug`: DEPRECATED; configure standard logging in your app. | ||
* `sslPort`: Port for fetching SSL certificate in case of firewall. | ||
* `gcp`: DEPRECATED. Previously used for connecting to databases provisioned on GCP in TigerGraph Cloud. | ||
* `jwtToken`: The JWT token generated from customer side for authentication | ||
|
||
[discrete] | ||
==== Raises: | ||
TigerGraphException: In case on invalid URL scheme. | ||
|
||
|