Skip to content

Commit

Permalink
SKYEDEN-3234 | Add endpoint for inactive topics
Browse files Browse the repository at this point in the history
  • Loading branch information
questras committed Dec 12, 2024
1 parent 3afe003 commit 423ae0e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hermes-console/src/api/hermes-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function fetchConstraints(): ResponsePromise<ConstraintsConfig> {
}

export function fetchInactiveTopics(): ResponsePromise<InactiveTopic[]> {
return axios.get<InactiveTopic[]>('/inactive-topics'); // TODO: specify correct endpoint
return axios.get<InactiveTopic[]>('/inactive-topics');
}

export function fetchReadiness(): ResponsePromise<DatacenterReadiness[]> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package pl.allegro.tech.hermes.management.api;

import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON;

import io.swagger.annotations.ApiOperation;
import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.HttpMethod;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import java.util.List;
import org.springframework.stereotype.Component;
import pl.allegro.tech.hermes.management.api.auth.Roles;
import pl.allegro.tech.hermes.management.domain.detection.InactiveTopic;
import pl.allegro.tech.hermes.management.domain.detection.InactiveTopicsStorageService;

@Component
@Path("/inactive-topics")
public class InactiveTopicsEndpoint {
private final InactiveTopicsStorageService storageService;

public InactiveTopicsEndpoint(InactiveTopicsStorageService storageService) {
this.storageService = storageService;
}

@GET
@Produces(APPLICATION_JSON)
@RolesAllowed(Roles.ADMIN)
@ApiOperation(value = "All inactive topics", response = List.class, httpMethod = HttpMethod.GET)
public List<InactiveTopic> getConsumersWorkloadConstraints() {
return storageService.getInactiveTopics();
}
}

0 comments on commit 423ae0e

Please sign in to comment.