-
Notifications
You must be signed in to change notification settings - Fork 39
/
converter.go
102 lines (96 loc) · 3.04 KB
/
converter.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
package resourcestatus
import "github.com/seal-io/walrus/pkg/dao/types/status"
// virtualMachineStatusConverter generate the summary use following table, other status is treated as transitioning.
//
// | Human Readable Status | Human Sensible Status |
// | --------------------- | --------------------- |
// | running | |
// | stopped | Inactive |
// | deallocated | Inactive |
// ref: https://learn.microsoft.com/en-us/azure/virtual-machines/states-billing#get-states-using-instance-view
var virtualMachineStatusConverter = status.NewConverter(
[]string{
"running",
},
nil,
[]string{
"stopped",
"deallocated",
},
nil,
)
// mySQLFlexibleServerStatusConverter generate the summary use following table, other status is treated as transitioning.
//
// | Human Readable Status | Human Sensible Status |
// | --------------------- | --------------------- |
// | Ready | |
// | Stopped | Inactive |
// | Disabled | Inactive |
// ref: https://learn.microsoft.com/en-us/rest/api/mysql/flexibleserver/servers/get
var mySQLFlexibleServerStatusConverter = status.NewConverter(
[]string{
"Ready",
},
nil,
[]string{
"Stopped",
"Disabled",
},
nil,
)
// postgreSQLFlexibleServerStatusConverter generate the summary use following table, other status is treated as transitioning.
//
// | Human Readable Status | Human Sensible Status |
// | --------------------- | --------------------- |
// | Ready | |
// | Stopped | Inactive |
// | Disabled | Inactive |
// ref: https://learn.microsoft.com/en-us/rest/api/postgresql/flexibleserver/servers/get
var postgreSQLFlexibleServerStatusConverter = status.NewConverter(
[]string{
"Ready",
},
nil,
[]string{
"Stopped",
"Disabled",
},
nil,
)
// redisCacheStatusConverter generate the summary use following table, other status is treated as transitioning.
//
// | Human Readable Status | Human Sensible Status |
// | --------------------- | --------------------- |
// | Succeeded | |
// | Failed | Error |
// | Disabled | Inactive |
// ref: https://learn.microsoft.com/en-us/rest/api/redis/redis/get
var redisCacheStatusConverter = status.NewConverter(
[]string{
"Succeeded",
},
nil,
[]string{
"Disabled",
},
[]string{
"Failed",
},
)
// virtualNetworkStatusConverter generate the summary use following table, other status is treated as transitioning.
//
// | Human Readable Status | Human Sensible Status |
// | --------------------- | --------------------- |
// | Succeeded | |
// | Failed | Error |
// ref: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/virtual-networks/get
var virtualNetworkStatusConverter = status.NewConverter(
[]string{
"Succeeded",
},
nil,
nil,
[]string{
"Failed",
},
)