use of org.openkilda.northbound.dto.v1.switches.DeleteSwitchResult in project open-kilda by telstra.
the class SwitchServiceImpl method deleteSwitch.
/**
* {@inheritDoc}
*/
@Override
public CompletableFuture<DeleteSwitchResult> deleteSwitch(SwitchId switchId, boolean force) {
String correlationId = RequestCorrelationId.getId();
CommandMessage deleteCommand = new CommandMessage(new DeleteSwitchRequest(switchId, force), System.currentTimeMillis(), correlationId, Destination.WFM);
return messagingChannel.sendAndGet(nbworkerTopic, deleteCommand).thenApply(DeleteSwitchResponse.class::cast).thenApply(response -> new DeleteSwitchResult(response.isDeleted()));
}
use of org.openkilda.northbound.dto.v1.switches.DeleteSwitchResult in project open-kilda by telstra.
the class NorthboundServiceImpl method deleteSwitch.
@Override
public DeleteSwitchResult deleteSwitch(SwitchId switchId, boolean force) {
HttpHeaders httpHeaders = buildHeadersWithCorrelationId();
httpHeaders.set(Utils.EXTRA_AUTH, String.valueOf(System.currentTimeMillis()));
String url = "/api/v1/switches/{switch_id}?force={force}";
return restTemplate.exchange(url, HttpMethod.DELETE, new HttpEntity(httpHeaders), DeleteSwitchResult.class, switchId, force).getBody();
}
Aggregations