-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1607 from hanbingleixue/develop
Add front-end pages and services with dynamic mounting function
- Loading branch information
Showing
17 changed files
with
884 additions
and
118 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
sermant-backend/src/main/java/io/sermant/backend/controller/HotPluggingController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* 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 io.sermant.backend.controller; | ||
|
||
import io.sermant.backend.entity.config.Result; | ||
import io.sermant.backend.entity.config.ResultCodeType; | ||
import io.sermant.backend.entity.hotplugging.HotPluggingConfig; | ||
import io.sermant.backend.service.HotPluggingService; | ||
|
||
import org.apache.commons.lang.StringUtils; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.annotation.Resource; | ||
|
||
/** | ||
* Hot Plugging controller | ||
* | ||
* @author zhp | ||
* @since 2024-08-22 | ||
*/ | ||
@RestController | ||
@RequestMapping("/sermant") | ||
public class HotPluggingController { | ||
@Resource | ||
private HotPluggingService hotPluggingService; | ||
|
||
/** | ||
* publish configuration | ||
* | ||
* @param hotPluggingConfig hot plugging configuration information | ||
* @return The result of publish hot plugging configuration | ||
*/ | ||
@PostMapping("/publishHotPluggingConfig") | ||
public Result<Boolean> publishHotPluggingConfig(@RequestBody HotPluggingConfig hotPluggingConfig) { | ||
if (hotPluggingConfig == null || StringUtils.isEmpty(hotPluggingConfig.getCommandType()) | ||
|| StringUtils.isEmpty(hotPluggingConfig.getInstanceIds())) { | ||
return new Result<>(ResultCodeType.MISS_PARAM); | ||
} | ||
return hotPluggingService.publishHotPluggingConfig(hotPluggingConfig); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.