use of bio.terra.workspace.generated.model.ApiCreatedControlledAzureIp in project terra-workspace-manager by DataBiosphere.
the class ControlledAzureResourceApiController method createAzureIp.
@Override
public ResponseEntity<ApiCreatedControlledAzureIp> createAzureIp(UUID workspaceId, @Valid ApiCreateControlledAzureIpRequestBody body) {
features.azureEnabledCheck();
final AuthenticatedUserRequest userRequest = getAuthenticatedInfo();
ControlledResourceFields commonFields = toCommonFields(workspaceId, body.getCommon(), userRequest);
ControlledAzureIpResource resource = ControlledAzureIpResource.builder().common(commonFields).ipName(body.getAzureIp().getName()).region(body.getAzureIp().getRegion()).build();
final ControlledAzureIpResource createdIp = controlledResourceService.createControlledResourceSync(resource, commonFields.getIamRole(), userRequest, body.getAzureIp()).castByEnum(WsmResourceType.CONTROLLED_AZURE_IP);
var response = new ApiCreatedControlledAzureIp().resourceId(createdIp.getResourceId()).azureIp(createdIp.toApiResource());
return new ResponseEntity<>(response, HttpStatus.OK);
}
Aggregations