forked from huaweicloud/huaweicloud-sdk-go-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_source_servers_response_body.go
281 lines (230 loc) · 7.87 KB
/
model_source_servers_response_body.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
package model
import (
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
// SourceServersResponseBody 源端服务器列表信息
type SourceServersResponseBody struct {
// 源端服务器ID
Id *string `json:"id,omitempty"`
// 源端服务器的IP地址
Ip *string `json:"ip,omitempty"`
// 源端服务器名称
Name *string `json:"name,omitempty"`
// 企业项目ID
EnterpriseProjectId *string `json:"enterprise_project_id,omitempty"`
// 源端服务器的注册时间
AddDate *int64 `json:"add_date,omitempty"`
// 操作系统类型,OS_TYPE (WINDOWS/LINUX)
OsType *SourceServersResponseBodyOsType `json:"os_type,omitempty"`
// 系统详细版本号,如CENTOS7.6等
OsVersion *string `json:"os_version,omitempty"`
// 是否是OEM操作系统(Windows)
OemSystem *bool `json:"oem_system,omitempty"`
// 源端服务器状态 unavailable:环境校验不通过 waiting:等待 initialize:初始化 replicate:复制 syncing:持续同步 stopping:暂停中 stopped:已暂停 deleting:删除中 error:错误 cloning:等待克隆完成 cutovering:启动目的端中 finished:启动目的端完成
State *SourceServersResponseBodyState `json:"state,omitempty"`
// 源端服务器与主机迁移服务端是否连接
Connected *bool `json:"connected,omitempty"`
// 源端CPU核心数
CpuQuantity *int32 `json:"cpu_quantity,omitempty"`
// 源端物理内存大小(单位:字节)
Memory *int64 `json:"memory,omitempty"`
CurrentTask *TaskByServerSources `json:"current_task,omitempty"`
// 源端校验检查项列表
Checks *[]EnvironmentCheck `json:"checks,omitempty"`
InitTargetServer *InitTargetServer `json:"init_target_server,omitempty"`
// 已复制的大小(单位:字节)
Replicatesize *int64 `json:"replicatesize,omitempty"`
// 迁移周期(migration_cycle)上一次变化的时间
StageActionTime *int64 `json:"stage_action_time,omitempty"`
// 需要迁移的数据量总大小(单位:字节)
Totalsize *int64 `json:"totalsize,omitempty"`
// Agent上一次连接状态发生变化的时间
LastVisitTime *int64 `json:"last_visit_time,omitempty"`
// 迁移周期 cutovering:启动目的端中 cutovered:启动目的端完成 checking:检查中 setting:设置中 replicating:复制中 syncing:同步中
MigrationCycle *SourceServersResponseBodyMigrationCycle `json:"migration_cycle,omitempty"`
// 源端状态(state)上次发生变化的时间
StateActionTime *int64 `json:"state_action_time,omitempty"`
}
func (o SourceServersResponseBody) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "SourceServersResponseBody struct{}"
}
return strings.Join([]string{"SourceServersResponseBody", string(data)}, " ")
}
type SourceServersResponseBodyOsType struct {
value string
}
type SourceServersResponseBodyOsTypeEnum struct {
WINDOWS SourceServersResponseBodyOsType
LINUX SourceServersResponseBodyOsType
}
func GetSourceServersResponseBodyOsTypeEnum() SourceServersResponseBodyOsTypeEnum {
return SourceServersResponseBodyOsTypeEnum{
WINDOWS: SourceServersResponseBodyOsType{
value: "WINDOWS",
},
LINUX: SourceServersResponseBodyOsType{
value: "LINUX",
},
}
}
func (c SourceServersResponseBodyOsType) Value() string {
return c.value
}
func (c SourceServersResponseBodyOsType) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *SourceServersResponseBodyOsType) UnmarshalJSON(b []byte) error {
myConverter := converter.StringConverterFactory("string")
if myConverter == nil {
return errors.New("unsupported StringConverter type: string")
}
interf, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\""))
if err != nil {
return err
}
if val, ok := interf.(string); ok {
c.value = val
return nil
} else {
return errors.New("convert enum data to string error")
}
}
type SourceServersResponseBodyState struct {
value string
}
type SourceServersResponseBodyStateEnum struct {
UNAVAILABLE SourceServersResponseBodyState
WAITING SourceServersResponseBodyState
INITIALIZE SourceServersResponseBodyState
REPLICATE SourceServersResponseBodyState
SYNCING SourceServersResponseBodyState
STOPPING SourceServersResponseBodyState
STOPPED SourceServersResponseBodyState
DELETING SourceServersResponseBodyState
ERROR SourceServersResponseBodyState
CLONING SourceServersResponseBodyState
CUTOVERING SourceServersResponseBodyState
FINISHED SourceServersResponseBodyState
}
func GetSourceServersResponseBodyStateEnum() SourceServersResponseBodyStateEnum {
return SourceServersResponseBodyStateEnum{
UNAVAILABLE: SourceServersResponseBodyState{
value: "unavailable",
},
WAITING: SourceServersResponseBodyState{
value: "waiting",
},
INITIALIZE: SourceServersResponseBodyState{
value: "initialize",
},
REPLICATE: SourceServersResponseBodyState{
value: "replicate",
},
SYNCING: SourceServersResponseBodyState{
value: "syncing",
},
STOPPING: SourceServersResponseBodyState{
value: "stopping",
},
STOPPED: SourceServersResponseBodyState{
value: "stopped",
},
DELETING: SourceServersResponseBodyState{
value: "deleting",
},
ERROR: SourceServersResponseBodyState{
value: "error",
},
CLONING: SourceServersResponseBodyState{
value: "cloning",
},
CUTOVERING: SourceServersResponseBodyState{
value: "cutovering",
},
FINISHED: SourceServersResponseBodyState{
value: "finished",
},
}
}
func (c SourceServersResponseBodyState) Value() string {
return c.value
}
func (c SourceServersResponseBodyState) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *SourceServersResponseBodyState) UnmarshalJSON(b []byte) error {
myConverter := converter.StringConverterFactory("string")
if myConverter == nil {
return errors.New("unsupported StringConverter type: string")
}
interf, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\""))
if err != nil {
return err
}
if val, ok := interf.(string); ok {
c.value = val
return nil
} else {
return errors.New("convert enum data to string error")
}
}
type SourceServersResponseBodyMigrationCycle struct {
value string
}
type SourceServersResponseBodyMigrationCycleEnum struct {
CUTOVERING SourceServersResponseBodyMigrationCycle
CUTOVERED SourceServersResponseBodyMigrationCycle
CHECKING SourceServersResponseBodyMigrationCycle
SETTING SourceServersResponseBodyMigrationCycle
REPLICATING SourceServersResponseBodyMigrationCycle
SYNCING SourceServersResponseBodyMigrationCycle
}
func GetSourceServersResponseBodyMigrationCycleEnum() SourceServersResponseBodyMigrationCycleEnum {
return SourceServersResponseBodyMigrationCycleEnum{
CUTOVERING: SourceServersResponseBodyMigrationCycle{
value: "cutovering",
},
CUTOVERED: SourceServersResponseBodyMigrationCycle{
value: "cutovered",
},
CHECKING: SourceServersResponseBodyMigrationCycle{
value: "checking",
},
SETTING: SourceServersResponseBodyMigrationCycle{
value: "setting",
},
REPLICATING: SourceServersResponseBodyMigrationCycle{
value: "replicating",
},
SYNCING: SourceServersResponseBodyMigrationCycle{
value: "syncing",
},
}
}
func (c SourceServersResponseBodyMigrationCycle) Value() string {
return c.value
}
func (c SourceServersResponseBodyMigrationCycle) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *SourceServersResponseBodyMigrationCycle) UnmarshalJSON(b []byte) error {
myConverter := converter.StringConverterFactory("string")
if myConverter == nil {
return errors.New("unsupported StringConverter type: string")
}
interf, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\""))
if err != nil {
return err
}
if val, ok := interf.(string); ok {
c.value = val
return nil
} else {
return errors.New("convert enum data to string error")
}
}