weizhouapache commented on code in PR #9251: URL: https://github.com/apache/cloudstack/pull/9251#discussion_r1639621858
########## core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java: ########## @@ -270,6 +275,17 @@ private Answer execute(UpdateNetworkCommand cmd) { return new Answer(cmd, new CloudRuntimeException("Failed to update interface mtu")); } + private Answer execute(ManageServiceCommand cmd) { + String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + String args = cmd.getAction() + " " + cmd.getServiceName(); + ExecutionResult result = _vrDeployer.executeInVR(routerIp, VRScripts.MANAGE_SERVICE, args); + if (result.isSuccess()) { + return new Answer(cmd, true, "Keepalived stopped successfully. Details: " + result.getDetails()); Review Comment: `Service <service name>` instead of `keepalived` ? ########## core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java: ########## @@ -270,6 +275,17 @@ private Answer execute(UpdateNetworkCommand cmd) { return new Answer(cmd, new CloudRuntimeException("Failed to update interface mtu")); } + private Answer execute(ManageServiceCommand cmd) { + String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + String args = cmd.getAction() + " " + cmd.getServiceName(); + ExecutionResult result = _vrDeployer.executeInVR(routerIp, VRScripts.MANAGE_SERVICE, args); + if (result.isSuccess()) { + return new Answer(cmd, true, "Keepalived stopped successfully. Details: " + result.getDetails()); + } else { + return new Answer(cmd, false, "Failed to stop keepalived. Detail: " + result.getDetails()); Review Comment: here too ########## core/src/main/java/com/cloud/agent/api/ManageServiceCommand.java: ########## @@ -0,0 +1,49 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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.cloud.agent.api; Review Comment: may be better move to `com.cloud.agent.api.routing` package ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org