Help Center/ Graph Engine Service/ devg/ Using the Management Plane SDK/ Initializing the Client of the GES Management Plane
Updated on 2022-11-14 GMT+08:00

Initializing the Client of the GES Management Plane

When using the GES SDK tool to access the GES management plane, you need to initialize the GES client. Both AK/SK and token authentication modes are supported for initializing the client. The sample code is as follows:

  • Sample code for AK/SK authentication
      String ak = "ak"; 
       String sk = "sk"; 
       String regionName = "regionname"; 
       String projectId = "project_id"; 
       GesInfo gesInfo = new GesInfo(regionName, ak, sk, projectId); 
       GesClient client = new GesClient(AuthenticationMode.AKSK, gesInfo);
  • Sample code for token authentication
      String domainName = "domainname"; 
      String userName = "username";
      String password = "password";
       String regionName = "regionname"; 
       String projectId = "project_id"; 
       GesInfo gesInfo = new GesInfo(regionName, domainName, userName, password, projectId); 
       GesClient client = new GesClient(AuthenticationMode.TOKEN, gesInfo);