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

Doc 2241 adding tg 4.1 changes (without jwt) #9

Open
wants to merge 2 commits into
base: v1.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions modules/core-functions/pages/auth.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ See https://docs.tigergraph.com/tigergraph-server/current/user-access/managing-c

[discrete]
==== Returns:
If your TigerGraph instance is running version 3.5 or before, the return value is
a tuple of `(<token>, <expiration_timestamp_unixtime>, <expiration_timestamp_ISO8601>)`.
If your TigerGraph instance is running version <=3.10, the return value is a tuple of `(<token>, <expiration_timestamp_unixtime>, <expiration_timestamp_ISO8601>)`.
The return value can be ignored, as the token is automatically set for the connection after this call.

If your TigerGraph instance is running version 3.6 or later, the return value is just the token.
If your TigerGraph instance is running version 4.0, the return value is a tuple of `(<token>, <expiration_timestamp_with_local_time>).

[NOTE]
The expiration timestamp's time zone might be different from your computer's local time
Expand All @@ -110,10 +109,11 @@ zone.
error occurred.

[discrete]
==== Endpoint:
- `POST /requesttoken`
==== Endpoints:
- `POST /requesttoken` (In TigerGraph versions 3.x)
+
See https://docs.tigergraph.com/tigergraph-server/current/api/built-in-endpoints#_request_a_token[this] for more details.
- `POST /gsql/v1/tokens` (In TigerGraph versions 4.x)


== refreshToken()
Expand All @@ -126,6 +126,9 @@ raised.
+
See https://docs.tigergraph.com/admin/admin-guide/user-access-management/user-privileges-and-authentication#rest-authentication[this] for more details.

[NOTE]
This function does not work on TigerGraph version 4.x.

[discrete]
==== Parameters:
* `secret`: The secret (string) generated in GSQL using `CREATE SECRET`.
Expand Down Expand Up @@ -191,9 +194,10 @@ so be careful.
occurred, for example if the specified token does not exist.

[discrete]
==== Endpoint:
- `DELETE /requesttoken`
==== Endpoints:
- `DELETE /requesttoken` (In TigerGraph versions 3.x)
+
See https://docs.tigergraph.com/tigergraph-server/current/api/built-in-endpoints#_delete_a_token[this] for more details.
- `POST /gsql/v1/tokens` (In TigerGraph versions 4.x)


19 changes: 16 additions & 3 deletions modules/core-functions/pages/gsql.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ time of establishing the connection will be used.
==== Returns:
The output of the statement(s) executed.

[discrete]
==== Endpoints:
- `POST /gsqlserver/gsql/file` (In TigerGraph versions 3.x)
- `POST /gsql/v1/statements` (In TigerGraph versions 4.x)


== installUDF()
`installUDF(ExprFunctions: str = "", ExprUtil: str = "") -> None`
Expand All @@ -37,6 +42,9 @@ See https://docs.tigergraph.com/gsql-ref/current/querying/func/query-user-define
==== Returns:
Status of the installation.

[discrete]
==== Endpoints:
- `PUT /gsqlserver/gsql/userdefinedfunction`

== getUDF()
`getUDF(ExprFunctions: bool = True, ExprUtil: bool = True) -> Union[str, Tuple[str, str]]`
Expand All @@ -49,10 +57,15 @@ See https://docs.tigergraph.com/gsql-ref/current/querying/func/query-user-define
==== Parameters:
* `ExprFunctions (bool, optional)`: Whether to get ExprFunctions. Defaults to True.
* `ExprUtil (bool, optional)`: Whether to get ExprUtil. Defaults to True.
* `json_out (bool, optional)``: Whether to output as JSON. Defaults to False. Only supported on version >=4.1

[discrete]
==== Returns:
str: If only one of `ExprFunctions` or `ExprUtil` is True, return of the content of that file.
Tuple[str, str]: content of ExprFunctions and content of ExprUtil.

* `str`: If only one of `ExprFunctions` or `ExprUtil` is True and json_out is False, return of the content of that file.
* `Tuple[str, str]`: If both `ExprFunctions` and `ExprUtil` are True and json_out is False, return content of ExprFunctions and content of ExprUtil.
* `Dict[str, str]`: If json_out is True, return dict with `ExprFunctions` and/or `ExprUtil` as keys and content of file as value.

[discrete]
==== Endpoints:
- `GET /gsqlserver/gsql/userdefinedfunction` (In TigerGraph versions 3.x)
- `GET /gsql/v1/udt/files` (In TigerGraph versions 4.x)
26 changes: 23 additions & 3 deletions modules/core-functions/pages/query.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ and outputs `PRINT` statement syntax.
==== Parameter:
* `queryName (str)`: Name of the query to get metadata of.

[discrete]
==== Endpoints:
- `POST /gsqlserver/gsql/queryinfo` (In TigerGraph versions 3.x)
See xref:tigergraph-server:API:built-in-endpoints.adoc_get_query_metadata[query metadata]
- `POST /gsql/v1/queries/signature` (In TigerGraph versions 4.x)


== getInstalledQueries()
`getInstalledQueries(fmt: str = "py") -> Union[dict, str, pd.DataFrame]`
Expand Down Expand Up @@ -202,9 +208,10 @@ When specifying parameter values in a dictionary:


[discrete]
==== Endpoint:
- `POST /gsqlserver/interpreted_query`
==== Endpoints:
- `POST /gsqlserver/interpreted_query` (In TigerGraph versions 3.x)
See xref:tigergraph-server:API:built-in-endpoints.adoc#_run_an_interpreted_query[Run an interpreted query]
- `POST /gsql/v1/queries/interpret` (In TigerGraph versions 4.x)



Expand Down Expand Up @@ -293,6 +300,11 @@ Add a query description and parameter descriptions. Only supported on versions o
==== Returns:
The response from the database.

[discrete]
==== Endpoints:
- `PUT /gsqlserver/gsql/description` (In TigerGraph version 4.0)
- `PUT /gsql/v1/description` (In TigerGraph versions >4.0)


== getQueryDescription()
`getQueryDescription(queryName = "all")`
Expand All @@ -309,6 +321,11 @@ If set to "all", returns the description of all queries.
==== Returns:
The description of the query(ies).

[discrete]
==== Endpoints:
- `GET /gsqlserver/gsql/description` (In TigerGraph version 4.0)
- `GET /gsql/v1/description` (In TigerGraph versions >4.0)


== dropQueryDescription()
`dropQueryDescription(queryName: str, dropParamDescriptions: bool = True)`
Expand All @@ -325,4 +342,7 @@ If set to "&#42;", drops the description of all queries.
==== Returns:
The response from the database.


[discrete]
==== Endpoints:
- `DELETE /gsqlserver/gsql/description` (In TigerGraph version 4.0)
- `DELETE /gsql/v1/description` (In TigerGraph versions >4.0)
3 changes: 2 additions & 1 deletion modules/core-functions/pages/schema.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ The schema metadata.

[discrete]
==== Endpoint:
- `GET /gsqlserver/gsql/schema`
- `GET /gsqlserver/gsql/schema` (In TigerGraph version 3.x)
See xref:tigergraph-server:API:built-in-endpoints.adoc#_show_graph_schema_metadata[Show graph schema metadata]
- `GET /gsql/v1/schema/graphs/{graph_name}` (In TigerGraph version 4.x)


== upsertData()
Expand Down
17 changes: 13 additions & 4 deletions modules/core-functions/pages/utils.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,29 @@ Monitor system usage metrics.
* `from_ts (int, optional)`: The epoch timestamp that indicates the start of the time filter.
* `to_ts (int, optional)`: The epoch timestamp that indicates the end of the time filter.
* `latest (int, optional)`: Number of datapoints to return. If provided, `from_ts` and `to_ts` will be ignored.
* `what (str, optional)`: Name of the metric to filter for. Possible choices are: +
* `what (str, optional)`: Name of the metric to filter for. Possible choices are:
- "cpu": Percentage of CPU usage by component
- "mem": Memory usage in megabytes by component
- "diskspace": Disk usage in megabytes by directory
- "network": Network traffic in bytes since the service started
- "qps": Number of requests per second by endpoint
- "servicestate": The state of the service, either online 1 or offline 0
- "connection": Number of open TCP connections
* `who (str, optional)`: Name of the component that reported the datapoint.
- "servicestate": The state of the service, either online 1 or offline 0 (Only avaliable in version <4.1)
- "connection": Number of open TCP connections (Only avaliable in version <4.1)
* `who (str, optional)`: Name of the component that reported the datapoint. (Only avaliable in version <4.1)
* `where (str, optional)`: Name of the node that reported the datapoint.

[discrete]
==== Returns:
JSON object of datapoints collected.
[NOTE]
Output format differs between 3.x and 4.x versions of TigerGraph.

[discrete]
==== Endpoints:
- `GET /ts3/api/datapoints` (In TigerGraph versions 3.x)
See xref:tigergraph-server:API:built-in-endpoints.adoc#_monitor_system_metrics_ts3_deprecated[Monitor system metrics (deprecated)]
- `POST /informant/metrics/get/{metrics_category}` (In TigerGraph versions 4.x)
See xref:tigergraph-server:API:built-in-endpoints.adoc#_monitor_system_metrics_by_category[Monitor system metrics]


== getQueryPerformance()
Expand Down
11 changes: 11 additions & 0 deletions modules/release-notes/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ Release of pyTigerGraph version 1.6.

=== Added:
* xref:pytigergraph:ai:copilot.adoc[TigerGraph CoPilot]. Added a new submodule for interacting with TigerGraph CoPilot, a framework for integrating Generative AI with TigerGraph.
* Support for TigerGraph versions 4.x
* In 4.x getUDF() can output a JSON, explicitly indicating which file body is from ExprFunctions and ExprUtils

=== Changed:
* Various endpoints changed when using TG 4.x.
* Output format for getSystemMetrics() has been changed and “servicestate” and “connection” metric categories and the “who” parameter have been removed when using TigerGraph versions 4.x.
* All endpoint requests will have the header {‘X-User-Agent": "pyTigerGraph"}
* getToken() will now only create JWT tokens when using TG 4.x.
* refreshToken() has been disabled in TG 4.x since JWT tokens do not support refreshing.



== [1.5] - 2023-09-25

Expand Down