diff --git a/docker_build/gate.yml b/docker_build/gate.yml index d83f1a7765..7fbe8ca31d 100644 --- a/docker_build/gate.yml +++ b/docker_build/gate.yml @@ -9,6 +9,9 @@ services: baseUrl: http://localhost:8095 userGroupApiPath: /platformservice/v1/users/{username}/userGroups/importAndCache enabled: true + dashboard: + baseUrl: http://localhost:8094 + enabled: true security: basic: enabled: true diff --git a/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy b/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy index 83538db82e..8aca08ca75 100644 --- a/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy +++ b/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy @@ -90,6 +90,8 @@ class AuthConfig { .antMatchers(HttpMethod.OPTIONS, "/**").permitAll() .antMatchers(PermissionRevokingLogoutSuccessHandler.LOGGED_OUT_URL).permitAll() .antMatchers('/auth/user').permitAll() + .antMatchers(HttpMethod.POST,'/autopilot/registerCanary').permitAll() + .antMatchers(HttpMethod.GET,'/autopilot/mgmt/**').permitAll() .antMatchers('/plugins/deck/**').permitAll() .antMatchers(HttpMethod.POST, '/webhooks/**').permitAll() .antMatchers(HttpMethod.POST, '/notifications/callbacks/**').permitAll() @@ -125,6 +127,8 @@ class AuthConfig { .sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .authorizeRequests() .antMatchers("/auth/login").permitAll() + .antMatchers(HttpMethod.POST,'/autopilot/registerCanary').permitAll() + .antMatchers(HttpMethod.GET,'/autopilot/mgmt/**').permitAll() .antMatchers('/**/favicon.ico').permitAll() .antMatchers(HttpMethod.OPTIONS, "/**").permitAll() .antMatchers(PermissionRevokingLogoutSuccessHandler.LOGGED_OUT_URL).permitAll() diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/GateConfig.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/GateConfig.groovy index 765297ff19..1533370531 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/GateConfig.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/config/GateConfig.groovy @@ -231,6 +231,12 @@ class GateConfig extends RedisHttpSessionConfiguration { createClient "platform", OpsmxPlatformService, okHttpClient } + @Bean + @ConditionalOnProperty("services.dashboard.enabled") + OpsmxDashboardService opsmxDashboardService(OkHttpClient okHttpClient) { + createClient "dashboard", OpsmxDashboardService, okHttpClient + } + @Bean ClouddriverServiceSelector clouddriverServiceSelector(ClouddriverService defaultClouddriverService, OkHttpClient okHttpClient, diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy index 48de237c41..97bb3dfd4f 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy @@ -55,11 +55,11 @@ class OpsmxAutopilotController { @Autowired OpsmxAutopilotService opsmxAutopilotService - @Autowired - ServiceConfiguration serviceConfiguration - - @Autowired - OkHttpClient okHttpClient + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}", method = RequestMethod.GET) + Object getAutoResponse1(@PathVariable("type") String type) { + return opsmxAutopilotService.getAutoResponse1(type) + } @ApiOperation(value = "Endpoint for autopilot rest services") @RequestMapping(value = "/{type}/{source}", method = RequestMethod.GET) @@ -78,25 +78,50 @@ class OpsmxAutopilotController { @RequestParam(name = "appId",required = false) Integer appId, @RequestParam(value = "pipelineid", required = false) String pipelineId, @RequestParam(value = "applicationName",required = false) String applicationName, - @RequestParam(value = "username", required = false) String userName, + @RequestParam(value = "username", required = false) String username, + @RequestParam(value = "userName", required = false) String userName, @RequestParam(value = "templateName", required = false) String templateName, @RequestParam(value = "credentialType", required = false) String credentialType, @RequestParam(value = "id", required = false) Integer canaryId, @RequestParam(value = "service", required = false) Integer service, @RequestParam(value = "canaryId", required = false) Integer canary, + @RequestParam(value = "canaryid", required = false) Integer canaryid, @RequestParam(value = "clusterId", required = false) Long clusterId, - @RequestParam(value = "version", required = false) String version){ + @RequestParam(value = "version", required = false) String version, + @RequestParam(value="canaryAnalysisId", required=false) Integer canaryAnalysisId, + @RequestParam(value = "metric", required = false) String metric, + @RequestParam(value = "account", required = false) String account, + @RequestParam(value = "metricType", required = false) String metricType, + @RequestParam(value = "isBoxplotData", required = false) boolean isBoxplotData, + @RequestParam(value = "metricname", required = false) String metricname, + @RequestParam(value = "numofver", required = false) Integer numofver, + @RequestParam(value = "serviceName", required = false) String serviceName, + @RequestParam(value = "platform", required = false) String platform, + @RequestParam(value = "ruleId", required = false) Integer ruleId, + @RequestParam(value = "zone", required = false) String zone, + @RequestParam(value = "type", required = false) String appType, + @RequestParam(value = "metricTemplate", required = false) String metricTemplate, + @RequestParam(value = "logTemplate", required = false) String logTemplate, + @RequestParam(value = "riskanalysis_id", required = false) Integer riskanalysis_id, + @RequestParam(value = "service_id", required = false) Integer service_id, + @RequestParam(value = "userId", required = false) Integer userId, + @RequestParam(value = "logTemplateName", required = false) String logTemplateName, + @RequestParam(value = "forceDelete", required = false) boolean forceDelete, + @RequestParam(value = "deleteAssociateRuns", required = false) boolean deleteAssociateRuns){ return opsmxAutopilotService.getAutoResponse(type, source, id, applicationId, serviceId, startTime, endTime, intervalMins, limit, sourceType, - accountName, templateType, name, appId, pipelineId, applicationName, userName, templateName, credentialType, canaryId, service, canary, clusterId, version) + accountName, templateType, name, appId, pipelineId, applicationName, username, userName, templateName, credentialType, canaryId, canaryid, service, canary, clusterId, version, canaryAnalysisId, + metric,account,metricType,isBoxplotData,metricname,numofver,serviceName,platform,ruleId,zone,appType,metricTemplate,logTemplate,riskanalysis_id,service_id, + userId,logTemplateName,forceDelete,deleteAssociateRuns) } @ApiOperation(value = "Endpoint for autopilot rest services") @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.GET) Object getAutoResponse4(@PathVariable("type") String type, @PathVariable("source") String source, - @PathVariable("source1") String source1) { + @PathVariable("source1") String source1, + @RequestParam(value = "Ids", required = false) String[] applicationsIds) { - return opsmxAutopilotService.getAutoResponse4(type, source, source1) + return opsmxAutopilotService.getAutoResponse4(type, source, source1, applicationsIds) } @ApiOperation(value = "Endpoint for autopilot rest services") @@ -120,21 +145,56 @@ class OpsmxAutopilotController { return opsmxAutopilotService.getAutoResponse6(type, source, source1, source2, source3) } + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}", method = RequestMethod.DELETE) + Object deleteAutoResponse1(@PathVariable("type") String type) { + + return opsmxAutopilotService.deleteAutoResponse1(type) + } + @ApiOperation(value = "Endpoint for autopilot rest services") @RequestMapping(value = "/{type}/{source}", method = RequestMethod.DELETE) Object deleteAutoResponse(@PathVariable("type") String type, - @PathVariable("source") String source) { + @PathVariable("source") String source, + @RequestParam(value = "applicationId", required = false) Integer applicationId, + @RequestParam(value = "pipelineid",required = false) String pipelineId, + @RequestParam(value = "applicationName",required = false) String applicationName, + @RequestParam(value = "accountName",required = false) String accountName, + @RequestParam(value = "sourceType",required = false) String sourceType, + @RequestParam(value = "credentialType",required = false) String credentialType, + @RequestParam(value = "canaryId",required = false) Integer canaryId) { + return opsmxAutopilotService.deleteAutoResponse(type, source, applicationId, pipelineId, applicationName, accountName, sourceType, credentialType, canaryId) - return opsmxAutopilotService.deleteAutoResponse(type, source) } - @ApiOperation(value = "Endpoint for Oes rest services") + @ApiOperation(value = "Endpoint for autopilot rest services") @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.DELETE) - Object deleteAutoResponse4(@PathVariable("type") String type, + Object deleteAutoResponse3(@PathVariable("type") String type, @PathVariable("source") String source, @PathVariable("source1") String source1) { - return opsmxAutopilotService.deleteAutoResponse4(type, source, source1) + return opsmxAutopilotService.deleteAutoResponse3(type, source, source1) + } + + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}/{source}/{source1}/{source2}", method = RequestMethod.DELETE) + Object deleteAutoResponse4(@PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2")String source2) { + + return opsmxAutopilotService.deleteAutoResponse4(type, source, source1, source2) + } + + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}/{source}/{source1}/{source2}/{source3}", method = RequestMethod.DELETE) + Object deleteAutoResponse5(@PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @PathVariable("source3") String source3) { + + return opsmxAutopilotService.deleteAutoResponse5(type, source, source1, source2, source3) } @ApiOperation(value = "Endpoint for autopilot rest services") @@ -145,6 +205,16 @@ class OpsmxAutopilotController { return opsmxAutopilotService.postAutoResponse(type,data) } + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}/{source}", method = RequestMethod.POST) + Object postAutoResponse1(@PathVariable("type") String type, + @PathVariable("source") String source, + @RequestParam(value = "isEdit", required = false) Boolean isEdit, + @RequestBody(required = false) Object data) { + + return opsmxAutopilotService.postAutoResponse1(type, source, isEdit, data) + } + @ApiOperation(value = "Endpoint for autopilot rest services") @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.POST) Object postAutoResponse4(@PathVariable("type") String type, @@ -178,4 +248,46 @@ class OpsmxAutopilotController { return opsmxAutopilotService.postAutoResponse6(type, source, source1, source2, source3, data) } + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}", method = RequestMethod.PUT) + Object updateAutopilotResponse(@PathVariable("version") String version, + @PathVariable("type") String type, + @RequestBody(required = false) Object data) { + + return opsmxAutopilotService.updateAutopilotResponse(version, type, data) + } + + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}/{source}", method = RequestMethod.PUT) + Object updateAutopilotResponse1(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @RequestBody(required = false) Object data) { + + return opsmxAutopilotService.updateAutopilotResponse1(version, type, source, data) + } + + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.PUT) + Object updateAutopilotResponse2(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @RequestBody(required = false) Object data) { + + return opsmxAutopilotService.updateAutopilotResponse2(version, type, source, source1, data) + } + + @ApiOperation(value = "Endpoint for autopilot rest services") + @RequestMapping(value = "/{type}/{source}/{source1}/{source2}", method = RequestMethod.PUT) + Object updatePlatformResponse3(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @RequestBody(required = false) Object data) { + + return opsmxAutopilotService.updateAutopilotResponse3(version, type, source, source1, source2, data) + } + } diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxDashboardController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxDashboardController.groovy new file mode 100644 index 0000000000..fdc2496eb1 --- /dev/null +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxDashboardController.groovy @@ -0,0 +1,223 @@ +/* + * Copyright 2020 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.netflix.spinnaker.gate.controllers + + +import com.netflix.spinnaker.gate.services.internal.OpsmxDashboardService +import groovy.util.logging.Slf4j +import io.swagger.annotations.ApiOperation +import okhttp3.OkHttpClient +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression +import org.springframework.web.bind.annotation.* + +@RequestMapping("/dashboardservice") +@RestController +@Slf4j +@ConditionalOnExpression('${services.dashboard.enabled:false}') +class OpsmxDashboardController { +/* + * Copyright 2020 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + @Autowired + OpsmxDashboardService opsmxDashboardService + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}", method = RequestMethod.GET) + Object getDashboardResponse1(@PathVariable("version") String version, + @PathVariable("type") String type) { + return opsmxDashboardService.getDashboardResponse1(version, type) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.GET) + Object getDashboardResponse(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source) { + return opsmxDashboardService.getDashboardResponse(version, type, source) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}", method = RequestMethod.GET) + Object getDashboardResponse4(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1) { + + return opsmxDashboardService.getDashboardResponse4(version, type, source, source1) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}/{source2}", method = RequestMethod.GET) + Object getDashboardResponse5(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2) { + + return opsmxDashboardService.getDashboardResponse5(version, type, source, source1, source2) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}/{source2}/{source3}", method = RequestMethod.GET) + Object getDashboardResponse6(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @PathVariable("source3") String source3) { + + return opsmxDashboardService.getDashboardResponse6(version, type, source, source1, source2, source3) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}", method = RequestMethod.DELETE) + Object deleteDashboardResponse(@PathVariable("version") String version, + @PathVariable("type") String type) { + + return opsmxDashboardService.deleteDashboardResponse(version, type) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.DELETE) + Object deleteDashboardResponse1(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source) { + + return opsmxDashboardService.deleteDashboardResponse1(version, type, source) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}", method = RequestMethod.DELETE) + Object deleteDashboardResponse4(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1) { + + return opsmxDashboardService.deleteDashboardResponse4(version, type, source, source1) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}", method = RequestMethod.POST) + Object postDashboardResponse(@PathVariable("version") String version, + @PathVariable("type") String type, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.postDashboardResponse(version, type,data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.POST) + Object postDashboardResponse3(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.postDashboardResponse3(version, type, source, data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}", method = RequestMethod.POST) + Object postDashboardResponse4(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.postDashboardResponse4(version, type, source, source1, data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}/{source2}", method = RequestMethod.POST) + Object postDashboardResponse5(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.postDashboardResponse5(version, type, source, source1, source2, data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}/{source2}/{source3}", method = RequestMethod.POST) + Object postDashboardResponse6(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @PathVariable("source3") String source3, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.postDashboardResponse6(version, type, source, source1, source2, source3, data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}", method = RequestMethod.PUT) + Object updateDashboardResponse(@PathVariable("version") String version, + @PathVariable("type") String type, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.updateDashboardResponse(version, type, data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.PUT) + Object updateDashboardResponse1(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.updateDashboardResponse1(version, type, source, data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}", method = RequestMethod.PUT) + Object updateDashboardResponse2(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.updateDashboardResponse2(version, type, source, source1, data) + } + + @ApiOperation(value = "Endpoint for dashboard rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}/{source2}", method = RequestMethod.PUT) + Object updateDashboardResponse3(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @RequestBody(required = false) Object data) { + + return opsmxDashboardService.updateDashboardResponse3(version, type, source, source1, source2, data) + } +} diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy index 8ecb4a5503..39719017c7 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy @@ -49,11 +49,12 @@ class OpsmxPlatformController { @Autowired OpsmxPlatformService opsmxPlatformService - @Autowired - ServiceConfiguration serviceConfiguration - - @Autowired - OkHttpClient okHttpClient + @ApiOperation(value = "Endpoint for platform rest services") + @RequestMapping(value = "/{version}/{type}", method = RequestMethod.GET) + Object getPlatformResponse1(@PathVariable("version") String version, + @PathVariable("type") String type) { + return opsmxPlatformService.getPlatformResponse1(version, type) + } @ApiOperation(value = "Endpoint for platform rest services") @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.GET) @@ -99,12 +100,20 @@ class OpsmxPlatformController { } @ApiOperation(value = "Endpoint for platform rest services") - @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.DELETE) + @RequestMapping(value = "/{version}/{type}", method = RequestMethod.DELETE) Object deletePlatformResponse(@PathVariable("version") String version, + @PathVariable("type") String type) { + + return opsmxPlatformService.deletePlatformResponse(version, type) + } + + @ApiOperation(value = "Endpoint for platform rest services") + @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.DELETE) + Object deletePlatformResponse1(@PathVariable("version") String version, @PathVariable("type") String type, @PathVariable("source") String source) { - return opsmxPlatformService.deletePlatformResponse(version, type, source) + return opsmxPlatformService.deletePlatformResponse1(version, type, source) } @ApiOperation(value = "Endpoint for platform rest services") @@ -176,7 +185,7 @@ class OpsmxPlatformController { @RequestMapping(value = "/{version}/{type}", method = RequestMethod.PUT) Object updatePlatformResponse(@PathVariable("version") String version, @PathVariable("type") String type, - @RequestBody Object data) { + @RequestBody(required = false) Object data) { return opsmxPlatformService.updatePlatformResponse(version, type, data) } @@ -186,19 +195,31 @@ class OpsmxPlatformController { Object updatePlatformResponse1(@PathVariable("version") String version, @PathVariable("type") String type, @PathVariable("source") String source, - @RequestBody Object data) { + @RequestBody(required = false) Object data) { return opsmxPlatformService.updatePlatformResponse1(version, type, source, data) } @ApiOperation(value = "Endpoint for platform rest services") - @RequestMapping(value = "/{version}/{type}/{source}/{source1}/{source2}", method = RequestMethod.PUT) + @RequestMapping(value = "/{version}/{type}/{source}/{source1}", method = RequestMethod.PUT) Object updatePlatformResponse2(@PathVariable("version") String version, @PathVariable("type") String type, @PathVariable("source") String source, @PathVariable("source1") String source1, - @PathVariable("source2") String source2) { + @RequestBody(required = false) Object data) { + + return opsmxPlatformService.updatePlatformResponse2(version, type, source, source1, data) + } + + @ApiOperation(value = "Endpoint for platform rest services") + @RequestMapping(value = "/{version}/{type}/{source}/{source1}/{source2}", method = RequestMethod.PUT) + Object updatePlatformResponse3(@PathVariable("version") String version, + @PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @RequestBody(required = false) Object data) { - return opsmxPlatformService.updatePlatformResponse2(version, type, source, source1, source2) + return opsmxPlatformService.updatePlatformResponse3(version, type, source, source1, source2, data) } } diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy index 0e0ab0afcd..e72bfd9412 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy @@ -43,18 +43,44 @@ interface OpsmxAutopilotService { @Query("pipelineid") String pipelineid, @Query("applicationName") String applicationName, @Query("username") String username, + @Query("userName") String userName, @Query("templateName") String templateName, @Query("credentialType") String credentialType, @Query("id") Integer canaryId, @Query("service") Integer service, @Query("canaryId") Integer canary, + @Query("canaryid") Integer canaryid, @Query("clusterId") Long clusterId, - @Query("version") String version) + @Query("version") String version, + @Query("canaryAnalysisId") Integer canaryAnalysisId, + @Query("metric") String metric, + @Query("account") String account, + @Query("metricType") String metricType, + @Query("isBoxplotData") boolean isBoxplotData, + @Query("metricname") String metricname, + @Query("numofver") Integer numofver, + @Query("serviceName") String serviceName, + @Query("platform") String platform, + @Query("ruleId") Integer ruleId, + @Query("zone") String zone, + @Query("type") String appType, + @Query("metricTemplate") String metricTemplate, + @Query("logTemplate") String logTemplate, + @Query("riskanalysis_id") Integer riskanalysis_id, + @Query("service_id") Integer service_id, + @Query("userId") Integer userId, + @Query("logTemplateName") String logTemplateName, + @Query("forceDelete") boolean forceDelete, + @Query("deleteAssociateRuns") boolean deleteAssociateRuns) + + @GET("/autopilot/{type}") + Object getAutoResponse1(@Path('type') String type) @GET("/autopilot/{type}/{source}/{source1}") Object getAutoResponse4(@Path('type') String type, @Path('source') String source, - @Path('source1') String source1) + @Path('source1') String source1, + @Query("Ids") String[] applicationsIds) @GET("/autopilot/{type}/{source}/{source1}/{source2}") Object getAutoResponse5(@Path('type') String type, @@ -69,19 +95,48 @@ interface OpsmxAutopilotService { @Path('source2') String source2, @Path('source3') String source3) + @DELETE("/autopilot/{type}") + Object deleteAutoResponse1(@Path('type') String type) + @DELETE("/autopilot/{type}/{source}") Object deleteAutoResponse(@Path('type') String type, - @Path('source') String source) + @Path('source') String source, + @Query("applicationId") Integer applicationId, + @Query("pipelineid") String pipelineid, + @Query("applicationName") String applicationName, + @Query("accountName") String accountName, + @Query("sourceType") String sourceType, + @Query("credentialType") String credentialType, + @Query("canaryId") Integer canaryId) @DELETE("/autopilot/{type}/{source}/{source1}") - Object deleteAutoResponse4(@Path('type') String type, + Object deleteAutoResponse3(@Path('type') String type, @Path('source') String source, @Path('source1') String source1) + @DELETE("/autopilot/{type}/{source}/{source1}/{source2}") + Object deleteAutoResponse4(@Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source1') String source2) + + @DELETE("/autopilot/{type}/{source}/{source1}/{source2}/{source3}") + Object deleteAutoResponse5(@Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source1') String source2, + @Path('source1') String source3) + @POST("/autopilot/{type}") Object postAutoResponse(@Path('type') String type, @Body Object data) + @POST("/autopilot/{type}/{source}") + Object postAutoResponse1(@Path('type') String type, + @Path('source') String source, + @Query("isEdit") Boolean pipelineid, + @Body Object data) + @POST("/autopilot/{type}/{source}/{source1}") Object postAutoResponse4(@Path('type') String type, @Path('source') String source, @@ -103,4 +158,30 @@ interface OpsmxAutopilotService { @Path('source3') String source3, @Body Object data) + @PUT("/autopilot/{type}") + Object updateAutopilotResponse(@Path('version') String version, + @Path('type') String type, + @Body Object data) + + @PUT("/autopilot/{type}/{source}") + Object updateAutopilotResponse1(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Body Object data) + + @PUT("/autopilot/{type}/{source}/{source1}") + Object updateAutopilotResponse2(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Body Object data) + + @PUT("/autopilot/{type}/{source}/{source1}/{source2}") + Object updateAutopilotResponse3(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Body Object data) + } diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxDashboardService.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxDashboardService.groovy new file mode 100644 index 0000000000..07a91f0ea9 --- /dev/null +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxDashboardService.groovy @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.netflix.spinnaker.gate.services.internal + + +import retrofit.http.* + +interface OpsmxDashboardService { + + @GET("/dashboardservice/{version}/{type}") + Object getDashboardResponse1(@Path('version') String version, + @Path('type') String type) + + @GET("/dashboardservice/{version}/{type}/{source}") + Object getDashboardResponse(@Path('version') String version, + @Path('type') String type, + @Path('source') String source) + + @GET("/dashboardservice/{version}/{type}/{source}/{source1}") + Object getDashboardResponse4(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1) + + @GET("/dashboardservice/{version}/{type}/{source}/{source1}/{source2}") + Object getDashboardResponse5(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2) + + @GET("/dashboardservice/{version}/{type}/{source}/{source1}/{source2}/{source3}") + Object getDashboardResponse6(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Path('source3') String source3) + + @DELETE("/dashboardservice/{version}/{type}") + Object deleteDashboardResponse(@Path('version') String version, + @Path('type') String type) + + @DELETE("/dashboardservice/{version}/{type}/{source}") + Object deleteDashboardResponse1(@Path('version') String version, + @Path('type') String type, + @Path('source') String source) + + @DELETE("/dashboardservice/{version}/{type}/{source}/{source1}") + Object deleteDashboardResponse4(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1) + + @POST("/dashboardservice/{version}/{type}") + Object postDashboardResponse(@Path('version') String version, + @Path('type') String type, + @Body Object data) + + @POST("/dashboardservice/{version}/{type}/{source}") + Object postDashboardResponse3(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Body Object data) + + @POST("/dashboardservice/{version}/{type}/{source}/{source1}") + Object postDashboardResponse4(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Body Object data) + + @POST("/dashboardservice/{version}/{type}/{source}/{source1}/{source2}") + Object postDashboardResponse5(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Body Object data) + + @POST("/dashboardservice/{version}/{type}/{source}/{source1}/{source2}/{source3}") + Object postDashboardResponse6(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Path('source3') String source3, + @Body Object data) + + @PUT("/dashboardservice/{version}/{type}") + Object updateDashboardResponse(@Path('version') String version, + @Path('type') String type, + @Body Object data) + + @PUT("/dashboardservice/{version}/{type}/{source}") + Object updateDashboardResponse1(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Body Object data) + + @PUT("/dashboardservice/{version}/{type}/{source}/{source1}") + Object updateDashboardResponse2(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Body Object data) + + @PUT("/dashboardservice/{version}/{type}/{source}/{source1}/{source2}") + Object updateDashboardResponse3(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Body Object data) + +} diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy index 743b6d14cd..3362df7992 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy @@ -21,6 +21,11 @@ import retrofit.http.* interface OpsmxPlatformService { + + @GET("/platformservice/{version}/{type}") + Object getPlatformResponse1(@Path('version') String version, + @Path('type') String type) + @GET("/platformservice/{version}/{type}/{source}") Object getPlatformResponse(@Path('version') String version, @Path('type') String type, @@ -49,8 +54,12 @@ interface OpsmxPlatformService { @Path('source2') String source2, @Path('source3') String source3) - @DELETE("/platformservice/{version}/{type}/{source}") + @DELETE("/platformservice/{version}/{type}") Object deletePlatformResponse(@Path('version') String version, + @Path('type') String type) + + @DELETE("/platformservice/{version}/{type}/{source}") + Object deletePlatformResponse1(@Path('version') String version, @Path('type') String type, @Path('source') String source) @@ -106,11 +115,19 @@ interface OpsmxPlatformService { @Path('source') String source, @Body Object data) - @PUT("/platformservice/{version}/{type}/{source}/{source1}/{source2}") + @PUT("/platformservice/{version}/{type}/{source}/{source1}") Object updatePlatformResponse2(@Path('version') String version, @Path('type') String type, @Path('source') String source, @Path('source1') String source1, - @Path('source2') String source2) + @Body Object data) + + @PUT("/platformservice/{version}/{type}/{source}/{source1}/{source2}") + Object updatePlatformResponse3(@Path('version') String version, + @Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Body Object data) }