forked from huaweicloud/huaweicloud-sdk-go-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_source_server_associated_with_task.go
178 lines (149 loc) · 5 KB
/
model_source_server_associated_with_task.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
package model
import (
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/utils"
"errors"
"github.com/dysodeng/huaweicloud-sdk-go-v3/core/converter"
"strings"
)
// SourceServerAssociatedWithTask 任务关联的源端信息
type SourceServerAssociatedWithTask struct {
// 源端在SMS数据库中的ID
Id *string `json:"id,omitempty"`
// 源端服务器ip,注册源端时必选,更新非必选
Ip string `json:"ip"`
// 用来区分不同源端服务器的名称
Name string `json:"name"`
// 源端服务器的OS类型,分为Windows和Linux,注册必选,更新非必选
OsType SourceServerAssociatedWithTaskOsType `json:"os_type"`
// 操作系统版本,注册必选,更新非必选
OsVersion *string `json:"os_version,omitempty"`
// 是否是OEM操作系统(Windows)
OemSystem *bool `json:"oem_system,omitempty"`
// 当前源端服务器状态 unavailable:环境校验不通过 waiting:等待 initialize:初始化 replicate:复制 syncing:持续同步 stopping:暂停中 stopped:已暂停 deleting:删除中 error:错误 cloning:等待克隆完成 testing:测试中 finished:启动目的端完成
State *SourceServerAssociatedWithTaskState `json:"state,omitempty"`
}
func (o SourceServerAssociatedWithTask) String() string {
data, err := utils.Marshal(o)
if err != nil {
return "SourceServerAssociatedWithTask struct{}"
}
return strings.Join([]string{"SourceServerAssociatedWithTask", string(data)}, " ")
}
type SourceServerAssociatedWithTaskOsType struct {
value string
}
type SourceServerAssociatedWithTaskOsTypeEnum struct {
WINDOWS SourceServerAssociatedWithTaskOsType
LINUX SourceServerAssociatedWithTaskOsType
}
func GetSourceServerAssociatedWithTaskOsTypeEnum() SourceServerAssociatedWithTaskOsTypeEnum {
return SourceServerAssociatedWithTaskOsTypeEnum{
WINDOWS: SourceServerAssociatedWithTaskOsType{
value: "WINDOWS",
},
LINUX: SourceServerAssociatedWithTaskOsType{
value: "LINUX",
},
}
}
func (c SourceServerAssociatedWithTaskOsType) Value() string {
return c.value
}
func (c SourceServerAssociatedWithTaskOsType) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *SourceServerAssociatedWithTaskOsType) 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 SourceServerAssociatedWithTaskState struct {
value string
}
type SourceServerAssociatedWithTaskStateEnum struct {
UNAVAILABLE SourceServerAssociatedWithTaskState
WAITING SourceServerAssociatedWithTaskState
INITIALIZE SourceServerAssociatedWithTaskState
REPLICATE SourceServerAssociatedWithTaskState
SYNCING SourceServerAssociatedWithTaskState
STOPPING SourceServerAssociatedWithTaskState
STOPPED SourceServerAssociatedWithTaskState
DELETING SourceServerAssociatedWithTaskState
ERROR SourceServerAssociatedWithTaskState
CLONING SourceServerAssociatedWithTaskState
TESTING SourceServerAssociatedWithTaskState
FINISHED SourceServerAssociatedWithTaskState
}
func GetSourceServerAssociatedWithTaskStateEnum() SourceServerAssociatedWithTaskStateEnum {
return SourceServerAssociatedWithTaskStateEnum{
UNAVAILABLE: SourceServerAssociatedWithTaskState{
value: "unavailable",
},
WAITING: SourceServerAssociatedWithTaskState{
value: "waiting",
},
INITIALIZE: SourceServerAssociatedWithTaskState{
value: "initialize",
},
REPLICATE: SourceServerAssociatedWithTaskState{
value: "replicate",
},
SYNCING: SourceServerAssociatedWithTaskState{
value: "syncing",
},
STOPPING: SourceServerAssociatedWithTaskState{
value: "stopping",
},
STOPPED: SourceServerAssociatedWithTaskState{
value: "stopped",
},
DELETING: SourceServerAssociatedWithTaskState{
value: "deleting",
},
ERROR: SourceServerAssociatedWithTaskState{
value: "error",
},
CLONING: SourceServerAssociatedWithTaskState{
value: "cloning",
},
TESTING: SourceServerAssociatedWithTaskState{
value: "testing",
},
FINISHED: SourceServerAssociatedWithTaskState{
value: "finished",
},
}
}
func (c SourceServerAssociatedWithTaskState) Value() string {
return c.value
}
func (c SourceServerAssociatedWithTaskState) MarshalJSON() ([]byte, error) {
return utils.Marshal(c.value)
}
func (c *SourceServerAssociatedWithTaskState) 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")
}
}