Search in sources :

Example 1 with LeaderRepresentation

use of com.netflix.titus.api.endpoint.v2.rest.representation.LeaderRepresentation in project titus-control-plane by Netflix.

the class LeaderResource method getLeader.

@GET
public LeaderRepresentation getLeader() {
    MasterDescription masterDescription = masterMonitor.getLatestLeader();
    LeaderRepresentation.Builder builder = LeaderRepresentation.newBuilder().withHostname(masterDescription.getHostname()).withHostIP(masterDescription.getHostIP()).withApiPort(masterDescription.getApiPort()).withApiStatusUri(masterDescription.getApiStatusUri()).withCreateTime(masterDescription.getCreateTime());
    return builder.build();
}
Also used : MasterDescription(com.netflix.titus.api.supervisor.service.MasterDescription) LeaderRepresentation(com.netflix.titus.api.endpoint.v2.rest.representation.LeaderRepresentation) GET(javax.ws.rs.GET)

Aggregations

LeaderRepresentation (com.netflix.titus.api.endpoint.v2.rest.representation.LeaderRepresentation)1 MasterDescription (com.netflix.titus.api.supervisor.service.MasterDescription)1 GET (javax.ws.rs.GET)1