diff --git a/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromDirectoryApi.java b/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromDirectoryApi.java index 9dd32b9..deb5000 100644 --- a/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromDirectoryApi.java +++ b/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromDirectoryApi.java @@ -65,7 +65,7 @@ public TerraformBootFromDirectoryApi( @Operation(description = "Validate the Terraform modules in the given directory.") @GetMapping(value = "/validate/{module_directory}", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) - public TerraformValidationResult validate( + public TerraformValidationResult validateFromDirectory( @Parameter(name = "module_directory", description = "directory name where the Terraform module files exist.") @PathVariable("module_directory") String moduleDirectory, @@ -87,7 +87,7 @@ public TerraformValidationResult validate( @Operation(description = "Deploy resources via Terraform from the given directory.") @PostMapping(value = "/deploy/{module_directory}", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) - public TerraformResult deploy( + public TerraformResult deployFromDirectory( @Parameter(name = "module_directory", description = "directory name where the Terraform module files exist.") @PathVariable("module_directory") String moduleDirectory, @@ -112,7 +112,7 @@ public TerraformResult deploy( @DeleteMapping(value = "/destroy/{module_directory}", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) - public TerraformResult destroy( + public TerraformResult destroyFromDirectory( @Parameter(name = "module_directory", description = "directory name where the Terraform module files exist.") @PathVariable("module_directory") String moduleDirectory, diff --git a/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromGitRepoApi.java b/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromGitRepoApi.java index 9ff3dbd..36e9304 100644 --- a/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromGitRepoApi.java +++ b/src/main/java/org/eclipse/xpanse/terraform/boot/api/controllers/TerraformBootFromGitRepoApi.java @@ -58,8 +58,13 @@ public TerraformBootFromGitRepoApi(TerraformGitRepoService terraformGitRepoServi @PostMapping(value = "/validate", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) - public TerraformValidationResult validateWithScripts( - @Valid @RequestBody TerraformDeployFromGitRepoRequest request) { + public TerraformValidationResult validateScriptsFromGitRepo( + @Valid @RequestBody TerraformDeployFromGitRepoRequest request, + @RequestHeader(name = "X-Custom-RequestId", required = false) UUID uuid) { + if (Objects.isNull(uuid)) { + uuid = UUID.randomUUID(); + } + MDC.put("TASK_ID", uuid.toString()); return terraformGitRepoService.validateWithScripts(request); }