Tuesday, 21 June 2022

Atlas client: Get the status of the service instance the client is pointing to

AtlasClientV2#getAdminStatus() method return status of the service instance the client is pointing to.

 

Step 1: Define atlas-application.properties file under src/main/resources folder.

 

atlas-application.properties

atlas.client.readTimeoutMSecs=30000
atlas.client.connectTimeoutMSecs=30000

 

Step 2: Define ServiceStatus class.

 

ServiceStatus.java

package com.sample.app.server;

import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasServiceException;

public class ServiceStatus {
  public static void main(String[] args) throws AtlasServiceException {
    AtlasClientV2 atlasClient = new AtlasClientV2(new String[] { "http://localhost:21000" },
        new String[] { "admin", "admin" });

    String status = atlasClient.getAdminStatus();
    System.out.println(status);
  }
}



 

Previous                                                    Next                                                    Home

No comments:

Post a Comment