Create REST Operation to DELETE Product by ID
Create REST Operation to DELETE Product by ID
- We can quickly create a DELETE method by ID by copying the previously created PUT method and replacing PUT with DELETE.
productIdResource.addMethod("DELETE", new Integration(
IntegrationProps.builder()
.type(IntegrationType.HTTP_PROXY)
.integrationHttpMethod("DELETE")
.uri("http://" + apiStackProps.networkLoadBalancer().getLoadBalancerDnsName() +
":8080/api/products/{id}")
.options(IntegrationOptions.builder()
.vpcLink(apiStackProps.vpcLink())
.connectionType(ConnectionType.VPC_LINK)
.requestParameters(productIdIntegrationParameters)
.build())
.build()), MethodOptions.builder()
.requestParameters(productIdMethodParameters)
.build());
