fix:启动,停止,暂停实例修改字段

Former-commit-id: 4c0b1f8d1d342d3076ec08286a459a5aae74b39d
This commit is contained in:
qiwang 2023-10-24 20:10:08 +08:00
parent 4a3df1b22a
commit 5b6da2274b
5 changed files with 68 additions and 81 deletions

View File

@ -236,7 +236,8 @@ type(
type (
StartServerReq {
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"osStart" copier:"OsStart"`
Action []map[string]string `json:"Action,optional" copier:"Action"`
start_action string `json:"start_action" copier:"start_action"`
}
StartServerResp {
@ -244,29 +245,24 @@ type (
ErrorMsg string `json:"errorMsg,omitempty"`
Code int32 `json:"code,omitempty"`
}
OsStart {
os_start string `json:"os_start" copier:"os_start"`
}
)
type(
StopServerReq{
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"os_start" copier:"OsStart"`
Action []map[string]string `json:"Action,optional" copier:"Action"`
stop_action string `json:"stop_action" copier:"stop_action"`
}
StopServerResp {
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
Code int32 `json:"code,omitempty"` }
OsStop {
OsStop string `json:"os_stop" copier:"OsStop"`
}
)
type(
RebootServerReq{
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"os_start" copier:"OsStart"`
Reboot Reboot `json:"reboot" copier:"Reboot"`
}
RebootServerResp {
Msg string `json:"msg,omitempty"`
@ -280,16 +276,14 @@ type(
type(
PauseServerReq{
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"os_start" copier:"OsStart"`
Action []map[string]string `json:"Action,optional" copier:"Action"`
pause_action string `json:"pause_action" copier:"pause_action"`
}
PauseServerResp {
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
Code int32 `json:"code,omitempty"`
}
OsPause {
Pause string `json:"pause" copier:"Pause"`
}
)
type (

View File

@ -2416,7 +2416,8 @@ type UpdateServerResp struct {
type StartServerReq struct {
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"osStart" copier:"OsStart"`
Action []map[string]string `json:"Action,optional" copier:"Action"`
Start_action string `json:"start_action" copier:"start_action"`
}
type StartServerResp struct {
@ -2425,13 +2426,10 @@ type StartServerResp struct {
Code int32 `json:"code,omitempty"`
}
type OsStart struct {
Os_start string `json:"os_start" copier:"os_start"`
}
type StopServerReq struct {
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"os_start" copier:"OsStart"`
Action []map[string]string `json:"Action,optional" copier:"Action"`
Stop_action string `json:"stop_action" copier:"stop_action"`
}
type StopServerResp struct {
@ -2440,13 +2438,9 @@ type StopServerResp struct {
Code int32 `json:"code,omitempty"`
}
type OsStop struct {
OsStop string `json:"os_stop" copier:"OsStop"`
}
type RebootServerReq struct {
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"os_start" copier:"OsStart"`
Reboot Reboot `json:"reboot" copier:"Reboot"`
}
type RebootServerResp struct {
@ -2461,7 +2455,8 @@ type Reboot struct {
type PauseServerReq struct {
ServerId string `json:"server_id" copier:"ServerId"`
OsStart OsStart `json:"os_start" copier:"OsStart"`
Action []map[string]string `json:"Action,optional" copier:"Action"`
Pause_action string `json:"pause_action" copier:"pause_action"`
}
type PauseServerResp struct {
@ -2470,10 +2465,6 @@ type PauseServerResp struct {
Code int32 `json:"code,omitempty"`
}
type OsPause struct {
Pause string `json:"pause" copier:"Pause"`
}
type DeleteServerReq struct {
ServerId string `form:"server_id" copier:"ServerId"`
}

4
go.mod
View File

@ -15,6 +15,7 @@ require (
github.com/jinzhu/copier v0.3.5
github.com/nacos-group/nacos-sdk-go/v2 v2.2.3
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/redis/go-redis/v9 v9.2.1
github.com/robfig/cron/v3 v3.0.1
github.com/shopspring/decimal v1.3.1
@ -25,7 +26,7 @@ require (
gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20230830120334-bf6d99c715ef
gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549d86a
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231011071802-c6a7637b74e4
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231023073226-621f06a5f10c
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231024105731-cbdceff549c9
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4
gitlink.org.cn/jcce-pcm/utils v0.0.2
go.opentelemetry.io/otel/trace v1.14.0
@ -95,7 +96,6 @@ require (
github.com/openzipkin/zipkin-go v0.4.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect

6
go.sum
View File

@ -761,6 +761,7 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@ -840,6 +841,7 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nacos-group/nacos-sdk-go/v2 v2.2.1/go.mod h1:ys/1adWeKXXzbNWfRNbaFlX/t6HVLWdpsNDvmoWTw0g=
@ -1041,8 +1043,8 @@ gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549
gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549d86a/go.mod h1:BhOgwM1LC+BD46DjTaQyYQVZs1CikwI5Pl/6qzKUexc=
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231011071802-c6a7637b74e4 h1:iv78VZ5+j6/VNkEyD/GSmTJ96rpxzpKDUNknAoXsAmg=
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231011071802-c6a7637b74e4/go.mod h1:uyvpVqG1jHDXX+ubXI0RBwnWXzVykD/mliqGQIDvRoo=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231023073226-621f06a5f10c h1:1w6KnIUnXYVzr2r/I67HFHH/3SbyjuTznOfwUt7dbHc=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231023073226-621f06a5f10c/go.mod h1:m75SVNfNa1TUBlQtBfR0CeETQ0ez2RIUqlSCn1Mb/js=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231024105731-cbdceff549c9 h1:r352e/Vrnity+BgrWyWCgn8uT2xPg6O86g+H4aIOdX8=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231024105731-cbdceff549c9/go.mod h1:m75SVNfNa1TUBlQtBfR0CeETQ0ez2RIUqlSCn1Mb/js=
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4 h1:r2hBP5G/bbkPpDTPk3ENnQxD82vkoYMSeNHYhNAVRX4=
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4/go.mod h1:zRdVJiv4r4jgBli2xpYGmV0n6Gmz8fkZ5pJaNK2MbTU=
gitlink.org.cn/jcce-pcm/utils v0.0.2 h1:Stif8W9C9TOCS2hw4g+OlOywDrsVYNrkiyKfBrWkT0w=