Help Center/
Graph Engine Service/
devg/
Using the Service Plane SDK/
Initializing the Client of the GES Service Plane
Updated on 2022-11-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"; String userId = "userId"; 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 graph name and floating and public IP addresses on the Graph Management page of the GES console. For details, see Graph Management Overview.
- To obtain the region name, domain name, username, user ID, and project 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 displayed page, the Account Name is the domain name, the IAM User Name is the username, and the IAM User ID is the user ID. In the Projects pane, the Project Name is the region name, and the value of Project ID is the project 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.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot