@@ -19,8 +19,8 @@ package com.netflix.spinnaker.clouddriver.controllers
19
19
import com.netflix.spinnaker.clouddriver.model.JobProvider
20
20
import com.netflix.spinnaker.clouddriver.model.JobStatus
21
21
import com.netflix.spinnaker.kork.web.exceptions.NotFoundException
22
- import io.swagger.annotations.ApiOperation
23
- import io.swagger.annotations.ApiParam
22
+ import io.swagger.v3.oas. annotations.Operation
23
+ import io.swagger.v3.oas. annotations.Parameter
24
24
import org.springframework.beans.factory.annotation.Autowired
25
25
import org.springframework.context.MessageSource
26
26
import org.springframework.security.access.prepost.PreAuthorize
@@ -42,12 +42,12 @@ class JobController {
42
42
MessageSource messageSource
43
43
44
44
@PreAuthorize (" hasPermission(#application, 'APPLICATION', 'READ') and hasPermission(#account, 'ACCOUNT', 'READ')" )
45
- @ApiOperation ( value = " Collect a JobStatus" , notes = " Collects the output of the job." )
45
+ @Operation ( summary = " Collect a JobStatus" , description = " Collects the output of the job." )
46
46
@RequestMapping (value = " /{account}/{location}/{id:.+}" , method = RequestMethod .GET )
47
- JobStatus collectJob (@ApiParam ( value = " Application name" , required = true ) @PathVariable String application ,
48
- @ApiParam ( value = " Account job was created by" , required = true ) @PathVariable String account ,
49
- @ApiParam ( value = " Namespace, region, or zone job is running in" , required = true ) @PathVariable String location ,
50
- @ApiParam ( value = " Unique identifier of job being looked up" , required = true ) @PathVariable String id ) {
47
+ JobStatus collectJob (@Parameter ( description = " Application name" , required = true ) @PathVariable String application ,
48
+ @Parameter ( description = " Account job was created by" , required = true ) @PathVariable String account ,
49
+ @Parameter ( description = " Namespace, region, or zone job is running in" , required = true ) @PathVariable String location ,
50
+ @Parameter ( description = " Unique identifier of job being looked up" , required = true ) @PathVariable String id ) {
51
51
Authentication auth = SecurityContextHolder . getContext(). getAuthentication();
52
52
Collection<JobStatus > jobMatches = jobProviders. findResults {
53
53
return it. collectJob(account, location, id)
@@ -59,26 +59,26 @@ class JobController {
59
59
}
60
60
61
61
@PreAuthorize (" hasPermission(#application, 'APPLICATION', 'EXECUTE') and hasPermission(#account, 'ACCOUNT', 'WRITE')" )
62
- @ApiOperation ( value = " Cancel a Job" , notes = " Cancels the job." )
62
+ @Operation ( summary = " Cancel a Job" , description = " Cancels the job." )
63
63
@RequestMapping (value = " /{account}/{location}/{id:.+}" , method = RequestMethod .DELETE )
64
- void cancelJob (@ApiParam ( value = " Application name" , required = true ) @PathVariable String application ,
65
- @ApiParam ( value = " Account job is running in" , required = true ) @PathVariable String account ,
66
- @ApiParam ( value = " Namespace, region, or zone job is running in" , required = true ) @PathVariable String location ,
67
- @ApiParam ( value = " Unique identifier of job to be canceled" , required = true ) @PathVariable String id ) {
64
+ void cancelJob (@Parameter ( description = " Application name" , required = true ) @PathVariable String application ,
65
+ @Parameter ( description = " Account job is running in" , required = true ) @PathVariable String account ,
66
+ @Parameter ( description = " Namespace, region, or zone job is running in" , required = true ) @PathVariable String location ,
67
+ @Parameter ( description = " Unique identifier of job to be canceled" , required = true ) @PathVariable String id ) {
68
68
jobProviders. forEach {
69
69
it. cancelJob(account, location, id)
70
70
}
71
71
}
72
72
73
73
@PreAuthorize (" hasPermission(#application, 'APPLICATION', 'READ') and hasPermission(#account, 'ACCOUNT', 'READ')" )
74
- @ApiOperation ( value = " Collect a file from a job" , notes = " Collects the file result of a job." )
74
+ @Operation ( summary = " Collect a file from a job" , description = " Collects the file result of a job." )
75
75
@RequestMapping (value = " /{account}/{location}/{id}/{fileName:.+}" , method = RequestMethod .GET )
76
76
Map<String , Object > getFileContents (
77
- @ApiParam ( value = " Application name" , required = true ) @PathVariable String application ,
78
- @ApiParam ( value = " Account job was created by" , required = true ) @PathVariable String account ,
79
- @ApiParam ( value = " Namespace, region, or zone job is running in" , required = true ) @PathVariable String location ,
80
- @ApiParam ( value = " Unique identifier of job being looked up" , required = true ) @PathVariable String id ,
81
- @ApiParam ( value = " File name to look up" , required = true ) @PathVariable String fileName
77
+ @Parameter ( description = " Application name" , required = true ) @PathVariable String application ,
78
+ @Parameter ( description = " Account job was created by" , required = true ) @PathVariable String account ,
79
+ @Parameter ( description = " Namespace, region, or zone job is running in" , required = true ) @PathVariable String location ,
80
+ @Parameter ( description = " Unique identifier of job being looked up" , required = true ) @PathVariable String id ,
81
+ @Parameter ( description = " File name to look up" , required = true ) @PathVariable String fileName
82
82
) {
83
83
Collection<Map<String , Object > > results = jobProviders. findResults {
84
84
it. getFileContents(account, location, id, fileName)
0 commit comments