Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -457,31 +457,31 @@ public ResponseEntity<String> getVoltageLevelSwitches(
@PathVariable("nodeUuid") UUID nodeUuid,
@PathVariable("voltageLevelId") String voltageLevelId,
@Parameter(description = "Should get in upstream built node ?") @RequestParam(value = "inUpstreamBuiltParentNode", required = false, defaultValue = "false") boolean inUpstreamBuiltParentNode) {
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getVoltageLevelInformation(nodeUuid, rootNetworkUuid, voltageLevelId, inUpstreamBuiltParentNode, "switches"));
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getVoltageLevelTopologyInfos(nodeUuid, rootNetworkUuid, voltageLevelId, inUpstreamBuiltParentNode, "switches"));
}

@GetMapping(value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/network/voltage-levels/{voltageLevelId}/bus-bar-sections")
@Operation(summary = "get bus bar sections information for a given network and voltage level")
@ApiResponse(responseCode = "200", description = "Bus bar sections information of the given voltage level retrieved")
public ResponseEntity<String> getBusBarSectionsInfo(
public ResponseEntity<String> getVoltageLevelBusBarSections(
@PathVariable("studyUuid") UUID studyUuid,
@PathVariable("rootNetworkUuid") UUID rootNetworkUuid,
@PathVariable("nodeUuid") UUID nodeUuid,
@PathVariable("voltageLevelId") String voltageLevelId,
@Parameter(description = "Should get in upstream built node ?") @RequestParam(value = "inUpstreamBuiltParentNode", required = false, defaultValue = "false") boolean inUpstreamBuiltParentNode) {
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getVoltageLevelInformation(nodeUuid, rootNetworkUuid, voltageLevelId, inUpstreamBuiltParentNode, "bus-bar-sections"));
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getVoltageLevelTopologyInfos(nodeUuid, rootNetworkUuid, voltageLevelId, inUpstreamBuiltParentNode, "bus-bar-sections"));
}

@GetMapping(value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/network/voltage-levels/{voltageLevelId}/feeder-bays-and-bus-bar-sections")
@Operation(summary = "get feeder bays and bus bar sections information for a given network and voltage level")
@ApiResponse(responseCode = "200", description = "Feeder bays and bus bar sections information of the given voltage level retrieved")
public ResponseEntity<String> getFeederBaysBusBarSectionsInfo(
@GetMapping(value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/network/voltage-levels/{voltageLevelId}/feeder-bays")
@Operation(summary = "get feeder bays informations for a given network and voltage level")
@ApiResponse(responseCode = "200", description = "Feeder bays informations of the given voltage level retrieved")
public ResponseEntity<String> getVoltageLevelFeederBays(
@PathVariable("studyUuid") UUID studyUuid,
@PathVariable("rootNetworkUuid") UUID rootNetworkUuid,
@PathVariable("nodeUuid") UUID nodeUuid,
@PathVariable("voltageLevelId") String voltageLevelId,
@Parameter(description = "Should get in upstream built node ?") @RequestParam(value = "inUpstreamBuiltParentNode", required = false, defaultValue = "false") boolean inUpstreamBuiltParentNode) {
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getVoltageLevelInformation(nodeUuid, rootNetworkUuid, voltageLevelId, inUpstreamBuiltParentNode, "feeder-bays-and-bus-bar-sections"));
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getVoltageLevelTopologyInfos(nodeUuid, rootNetworkUuid, voltageLevelId, inUpstreamBuiltParentNode, "feeder-bays"));
}

@GetMapping(value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/network/voltage-levels/{voltageLevelId}/substation-id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ public List<IdentifiableInfos> getVoltageLevelBusesOrBusbarSections(UUID network
}, networkUuid, voltageLevelId).getBody();
}

public String getVoltageLevelInformation(UUID networkUuid, String variantId,
String voltageLevelId,
String path) {
public String getVoltageLevelTopologyInfos(UUID networkUuid, String variantId,
String voltageLevelId,
String path) {
UriComponentsBuilder builder = UriComponentsBuilder.fromPath(DELIMITER + NETWORK_MAP_API_VERSION
+ "/networks/{networkUuid}/voltage-levels/{voltageLevelId}/" + path);
if (!StringUtils.isBlank(variantId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1792,12 +1792,12 @@ public List<IdentifiableInfos> getVoltageLevelBusesOrBusbarSections(UUID nodeUui
return networkMapService.getVoltageLevelBusesOrBusbarSections(networkUuid, variantId, voltageLevelId, busPath);
}

public String getVoltageLevelInformation(UUID nodeUuid, UUID rootNetworkUuid, String voltageLevelId,
String path) {
public String getVoltageLevelTopologyInfos(UUID nodeUuid, UUID rootNetworkUuid, String voltageLevelId,
String path) {
UUID networkUuid = rootNetworkService.getNetworkUuid(rootNetworkUuid);
String variantId = networkModificationTreeService.getVariantId(nodeUuid, rootNetworkUuid);

return networkMapService.getVoltageLevelInformation(networkUuid, variantId, voltageLevelId, path);
return networkMapService.getVoltageLevelTopologyInfos(networkUuid, variantId, voltageLevelId, path);
}

public String getVoltageLevelSubstationId(UUID studyUuid, UUID nodeUuid, UUID rootNetworkUuid, String voltageLevelId, boolean inUpstreamBuiltParentNode) {
Expand All @@ -1810,9 +1810,9 @@ public List<IdentifiableInfos> getVoltageLevelBusesOrBusbarSections(UUID nodeUui
return getVoltageLevelBusesOrBusbarSections(nodeUuidToSearchIn, rootNetworkUuid, voltageLevelId, "buses-or-busbar-sections");
}

public String getVoltageLevelInformation(UUID nodeUuid, UUID rootNetworkUuid, String voltageLevelId, boolean inUpstreamBuiltParentNode, String path) {
public String getVoltageLevelTopologyInfos(UUID nodeUuid, UUID rootNetworkUuid, String voltageLevelId, boolean inUpstreamBuiltParentNode, String path) {
UUID nodeUuidToSearchIn = getNodeUuidToSearchIn(nodeUuid, rootNetworkUuid, inUpstreamBuiltParentNode);
return getVoltageLevelInformation(nodeUuidToSearchIn, rootNetworkUuid, voltageLevelId, path);
return getVoltageLevelTopologyInfos(nodeUuidToSearchIn, rootNetworkUuid, voltageLevelId, path);
}

@Transactional
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/gridsuite/study/server/NetworkMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public MockResponse dispatch(RecordedRequest request) {
return new MockResponse(200, Headers.of(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE), SWITCHES_INFOS_JSON);
case "/v1/networks/" + NETWORK_UUID_STRING + "/voltage-levels/" + VOLTAGE_LEVEL_ID + "/bus-bar-sections?variantId=first_variant_id":
return new MockResponse(200, Headers.of(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE), BUSBAR_SECTIONS_INFO_JSON);
case "/v1/networks/" + NETWORK_UUID_STRING + "/voltage-levels/" + VOLTAGE_LEVEL_ID + "/feeder-bays-and-bus-bar-sections?variantId=first_variant_id":
case "/v1/networks/" + NETWORK_UUID_STRING + "/voltage-levels/" + VOLTAGE_LEVEL_ID + "/feeder-bays?variantId=first_variant_id":
return new MockResponse(200, Headers.of(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE), FEEDER_BAYS_BUSBAR_SECTIONS_INFO_JSON);
case "/v1/networks/" + NETWORK_UUID_STRING + "/voltage-levels/" + VOLTAGE_LEVEL_ID + "/substation-id?variantId=first_variant_id":
return new MockResponse.Builder().code(200).body(SUBSTATION_ID_1).build();
Expand Down Expand Up @@ -605,7 +605,7 @@ void testGetFeederBaysBusBarSectionsInfo(final MockWebServer server) throws Exce
UUID firstRootNetworkUuid = studyTestUtils.getOneRootNetworkUuid(studyEntity.getId());
AbstractNode node = getRootNode(studyEntity.getId()).getChildren().stream().findFirst().orElseThrow();

mvcResult = mockMvc.perform(get("/v1/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/network/voltage-levels/{voltageLevelId}/feeder-bays-and-bus-bar-sections",
mvcResult = mockMvc.perform(get("/v1/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/network/voltage-levels/{voltageLevelId}/feeder-bays",
studyEntity.getId(), firstRootNetworkUuid, node.getId(), VOLTAGE_LEVEL_ID))
.andExpect(status().isOk())
.andReturn();
Expand All @@ -614,7 +614,7 @@ void testGetFeederBaysBusBarSectionsInfo(final MockWebServer server) throws Exce

var requests = TestUtils.getRequestsDone(1, server);
assertTrue(requests.stream().anyMatch(r -> r.matches(
"/v1/networks/" + NETWORK_UUID_STRING + "/voltage-levels/" + VOLTAGE_LEVEL_ID + "/feeder-bays-and-bus-bar-sections\\?variantId=first_variant_id")));
"/v1/networks/" + NETWORK_UUID_STRING + "/voltage-levels/" + VOLTAGE_LEVEL_ID + "/feeder-bays\\?variantId=first_variant_id")));

}

Expand Down