Help Center/
Graph Engine Service/
devg/
Using the Service Plane SDK/
Initializing the Client of the GES Service Plane
Updated on 2022-09-14 GMT+08:00
Initializing the Client of the GES Service Plane
To use the GES SDK to access GES, you need to initialize the GES client.
- When you access a graph through the intranet, the endpoint is the intranet IP address on the GES console or the privateIp field in the return result of the graph details query.
- When you access a graph through the Internet, the endpoint is the Internet IP address on the GES console or the publicIp field in the return result of the graph details query.
The sample code is as follows:
String endPoint = "endpoint"; String version = "v1.0"; String projectId = "project_id"; String graphName = "graph_name"; // Note: When the public network is used for access, token authentication must be used, and the following dominName, userName, and password must be provided. String regionName = "region_name"; String domainName = "domain_name"; String userName = "user_name"; String password = "user_password"; GraphInfo graphInfo = new GraphInfo(endPoint, version, projectId, userId, graphName, regionName, domainName, userName, password); // Generate and initialize the graph client. During initialization, an object with the same name as the graph is generated by default. This object can be directly used in Gremlin commands. GraphClient graphClient = new GraphClient(AuthenticationMode.TOKEN,graphInfo);
- You can view the floating and public IP addresses on the Graph Management page of the GES console. For details, see .
- To obtain the user ID, move the cursor on your username in the upper right corner of the GES console and select My Credentials from the drop-down list. On the API Credentials page, obtain the IAM user ID.
Parent topic: Using the Service Plane SDK
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.