You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: i18n/en/docusaurus-plugin-content-docs/current/07-develop/01-sdk.md
+53-6Lines changed: 53 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,14 @@ TDengine IDMP SDK allows you to programmatically access the entire data assets w
12
12
13
13
## Java SDK Usage Guide
14
14
15
-
### Introducing the SDK
15
+
### Prerequisites
16
16
17
-
If your development environment already has Maven, it is recommended to install idmp-sdk into the local Maven repository first for reference in the project.
17
+
1. Install the latest stable version of Java. (At least Java 11)
18
+
2. Install the Maven command-line tool.
19
+
20
+
### Install the SDK
21
+
22
+
Install idmp-sdk into the local Maven repository first for reference in the project.
18
23
19
24
```bash
20
25
cd idmp-java-sdk
@@ -85,6 +90,10 @@ public class ElementApiTest {
85
90
86
91
## Python SDK Usage Guide
87
92
93
+
### Prerequisites
94
+
95
+
Install the Python development environment. (python>=3.10 is required)
96
+
88
97
### Installing the SDK
89
98
90
99
You can install the Python SDK using pip. First, enter the `idmp-python-sdk` directory, then run the following command:
@@ -167,6 +176,48 @@ with idmp_sdk.ApiClient(configuration) as api_client:
167
176
print("Exception when calling UomResourceApi->api_v1_uomclasses_get: %s\n"% e)
168
177
```
169
178
179
+
## Cloud Service SDK Usage
180
+
181
+
If you are using the [IDMP Cloud Service Edition](https://idmp.tdengine.com/), you cannot use the login method described above. Because the login authentication process for the cloud service differs from the enterprise edition, the cloud service frontend code encapsulates more complex login logic. It is recommended that you first log in to the cloud service through a browser, then find any request to the backend API from the Network tab of the browser's developer tools, for example: /api/v1/permissions/menus this request (if you can't filter out this request, you can refresh the page and filter again), copy the following three pieces of data:
182
+
183
+
1. The host part of the request URL, which differs for different IDMP instances. Its format is `https://<instance ID>.idmp.tdengine.com`.
184
+
2. The value of the request header "Access-token", which is the token used for cloud service authentication.
185
+
3. The value of the request header "Authorization", which is the token used for IDMP authentication. Note that you need to remove the prefix "Bearer ".
186
+
187
+
Then set these 3 values into environment variables respectively. For example:
For other languages, simply replace the `-g` parameter with the corresponding language name, and the --library parameter with the corresponding library name. Additionally, different languages have different additional parameters, which can be specified via --additional-properties. For details, please refer to the [OpenAPI Generator Documentation](https://openapi-generator.tech/docs/generators) and click on the corresponding language name for more information.
191
-
192
-
## Using SDK with Cloud Service
193
-
194
-
If you are using the [cloud version of IDMP](https://cloud.tdengine.com/), the login method described above cannot be used. Since the login authentication process for the cloud service differs from the enterprise version, the front-end code of the cloud service encapsulates more complex login logic. It is recommended to first log in to the cloud service through a browser, then obtain the authentication token from the "Authorization" request header in the browser's developer tools, and finally set the token in environment variables.
0 commit comments