mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-21 00:24:07 +08:00
Compare commits
908 Commits
release/3.
...
release/3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5466a88ac3 | ||
|
|
3a23f64836 | ||
|
|
cc48edc32d | ||
|
|
a77dfee4d3 | ||
|
|
e70c1244e3 | ||
|
|
bc8ee81afd | ||
|
|
be3d7a4fbb | ||
|
|
3f8c5fd12c | ||
|
|
d06343b6cf | ||
|
|
19335a1fbf | ||
|
|
999f6e2dba | ||
|
|
6f94124e81 | ||
|
|
fa457b0461 | ||
|
|
38778aae06 | ||
|
|
38cd512516 | ||
|
|
23cc211deb | ||
|
|
48d764dd36 | ||
|
|
d708af7781 | ||
|
|
4e806ed185 | ||
|
|
0ac14febc8 | ||
|
|
a1b2a4ddcd | ||
|
|
f405cb921b | ||
|
|
112026b778 | ||
|
|
b230711ded | ||
|
|
716d4d2172 | ||
|
|
182777e677 | ||
|
|
2fdb1430a4 | ||
|
|
bb1f439a04 | ||
|
|
595be9b0ed | ||
|
|
1f9b473521 | ||
|
|
6f47aa8ad3 | ||
|
|
c2c981c40f | ||
|
|
3eefd80d84 | ||
|
|
97d438e4a4 | ||
|
|
3aec0a110e | ||
|
|
ab5245bd29 | ||
|
|
3eb4a31c46 | ||
|
|
e5a5439ac9 | ||
|
|
41e2a194e4 | ||
|
|
64c801dbca | ||
|
|
34fa66230b | ||
|
|
1fd2b2eebc | ||
|
|
72e99816a2 | ||
|
|
1cf5771607 | ||
|
|
91efa6f48d | ||
|
|
400a87221d | ||
|
|
7e6fb93a3e | ||
|
|
f91526f96f | ||
|
|
e5cabfb3a8 | ||
|
|
68a31e0d14 | ||
|
|
be45e166cb | ||
|
|
0bc58b8fe3 | ||
|
|
7d92493e3a | ||
|
|
4663ecddf4 | ||
|
|
0bd0782268 | ||
|
|
c5b719b21f | ||
|
|
7b470196ef | ||
|
|
f1113a9c23 | ||
|
|
b56e49de6d | ||
|
|
3f270e8bd3 | ||
|
|
de893473d6 | ||
|
|
6809f62d95 | ||
|
|
c345991bd4 | ||
|
|
e5f95e0986 | ||
|
|
e8bd33751c | ||
|
|
727801bff5 | ||
|
|
3e56e4acb8 | ||
|
|
f79abe479a | ||
|
|
ec8e58554a | ||
|
|
5a731d8176 | ||
|
|
4515843a2c | ||
|
|
8c1b1f80b6 | ||
|
|
4b95ec7f0d | ||
|
|
8ddf04e3dd | ||
|
|
3b268ad6fb | ||
|
|
21e7ea198c | ||
|
|
c09676aa9f | ||
|
|
ee69f560ae | ||
|
|
92e75e87c9 | ||
|
|
4b2869cf4e | ||
|
|
249abee22d | ||
|
|
27e99f8b51 | ||
|
|
5d1d963990 | ||
|
|
9c27a7cafd | ||
|
|
433aa54055 | ||
|
|
cf8377ea72 | ||
|
|
0a71acd86b | ||
|
|
780418219c | ||
|
|
e5487fab4f | ||
|
|
546ec09848 | ||
|
|
1e49aa17b7 | ||
|
|
bf3b06cd8c | ||
|
|
289a6bcf4b | ||
|
|
46b80f79a3 | ||
|
|
0438db6938 | ||
|
|
4d9b6e1599 | ||
|
|
2f4401a407 | ||
|
|
e9855290e8 | ||
|
|
228d45b7a1 | ||
|
|
f977e44885 | ||
|
|
ecfe897c2e | ||
|
|
7370f1ecf1 | ||
|
|
bd0d22e7e4 | ||
|
|
997141525d | ||
|
|
477d5845d5 | ||
|
|
fb886c6f25 | ||
|
|
44a9f29c94 | ||
|
|
20473f6544 | ||
|
|
af19d59bc8 | ||
|
|
11a66c13c3 | ||
|
|
ea4535cbbb | ||
|
|
2ab2c5b0dd | ||
|
|
b1bd51d040 | ||
|
|
e4c1d4181b | ||
|
|
356fa8d02d | ||
|
|
dd32b0aacc | ||
|
|
4c00f92502 | ||
|
|
d4a714af2c | ||
|
|
da702c8284 | ||
|
|
649eac69ef | ||
|
|
0cf01d2f0a | ||
|
|
120ed1f695 | ||
|
|
4acc7a580f | ||
|
|
facbe5433a | ||
|
|
96088d3465 | ||
|
|
4b98425f0c | ||
|
|
4ac3f8e4fa | ||
|
|
d48b88ec83 | ||
|
|
c0659c1453 | ||
|
|
99598a4804 | ||
|
|
651f2c3f9c | ||
|
|
fa12b95e21 | ||
|
|
93a659c81c | ||
|
|
9def31ddfe | ||
|
|
f98104ad20 | ||
|
|
6b0be1317e | ||
|
|
5a9e9f66e4 | ||
|
|
b5d4885007 | ||
|
|
58ba106c61 | ||
|
|
fb406e91c4 | ||
|
|
462ff5c2d8 | ||
|
|
a1fbc8455b | ||
|
|
50e28166ef | ||
|
|
92381b0213 | ||
|
|
65b1fbae34 | ||
|
|
918265ea49 | ||
|
|
5591bbec4e | ||
|
|
8f0ac8e19b | ||
|
|
307fb3a116 | ||
|
|
3bd3dda026 | ||
|
|
a396868d6a | ||
|
|
794b2896f4 | ||
|
|
2443cc9a3c | ||
|
|
56ebaea85e | ||
|
|
37cefd0d64 | ||
|
|
8a2c03d683 | ||
|
|
ed136fb2f0 | ||
|
|
3b3cbb94d6 | ||
|
|
79614b5939 | ||
|
|
6fce123623 | ||
|
|
d9ddbb5bcf | ||
|
|
e871084a85 | ||
|
|
170b08329d | ||
|
|
a433306ba4 | ||
|
|
0737e5ed39 | ||
|
|
b9c8dc01fb | ||
|
|
748d547b88 | ||
|
|
59d979043e | ||
|
|
9f9e5eed10 | ||
|
|
e9638cc461 | ||
|
|
8f15091db1 | ||
|
|
3ee4ae370a | ||
|
|
99eb111954 | ||
|
|
d968caaa47 | ||
|
|
a5530fee10 | ||
|
|
87b4a151df | ||
|
|
1d463ed8c8 | ||
|
|
63638b15d1 | ||
|
|
5c4bf3e03c | ||
|
|
b239ca7b15 | ||
|
|
87ca98b362 | ||
|
|
04eaf773fe | ||
|
|
4aa2299b47 | ||
|
|
9c8337ae8f | ||
|
|
a8e9c3f510 | ||
|
|
290a32b9de | ||
|
|
94fe13ddc5 | ||
|
|
ad071de5a0 | ||
|
|
b570dc9d82 | ||
|
|
aa9de0f84d | ||
|
|
9285208d1c | ||
|
|
4112e7052d | ||
|
|
f33aa39eed | ||
|
|
cd2499c3b0 | ||
|
|
e2fa8d48e6 | ||
|
|
a1750c6dd0 | ||
|
|
5a93924ff2 | ||
|
|
0c32be0707 | ||
|
|
62fe7d977d | ||
|
|
fb4206d904 | ||
|
|
3afbb86fad | ||
|
|
aeaa6939c7 | ||
|
|
950e7696bc | ||
|
|
8bf5eb3321 | ||
|
|
91e558e74a | ||
|
|
d196c943eb | ||
|
|
61e6a98328 | ||
|
|
61e81748d7 | ||
|
|
51563912b0 | ||
|
|
215f9c4d1d | ||
|
|
a32021969a | ||
|
|
18e98f598e | ||
|
|
520af18f9e | ||
|
|
28fab54660 | ||
|
|
4f9bbe0674 | ||
|
|
d3fb8a60d7 | ||
|
|
3276164c8b | ||
|
|
d759c27bf6 | ||
|
|
ce827235b3 | ||
|
|
9534c153c3 | ||
|
|
e4eb798fda | ||
|
|
34cef736d3 | ||
|
|
a175ca421f | ||
|
|
03b13297e8 | ||
|
|
1b3c442407 | ||
|
|
949c202692 | ||
|
|
47be971d66 | ||
|
|
77a36234a4 | ||
|
|
2f89114413 | ||
|
|
2322118457 | ||
|
|
fa5fbccf2b | ||
|
|
c5cf45772c | ||
|
|
6daa0a1d4f | ||
|
|
a304d30020 | ||
|
|
8aed26a110 | ||
|
|
6c78e3d349 | ||
|
|
83a5574e5d | ||
|
|
f05ed6ccb6 | ||
|
|
73ca4a9ee8 | ||
|
|
144bc806b8 | ||
|
|
144ebc6e8b | ||
|
|
33fd165939 | ||
|
|
08971d413a | ||
|
|
c321c6c4b7 | ||
|
|
45d627da21 | ||
|
|
24a6b94fc8 | ||
|
|
7fd2a886b4 | ||
|
|
4a9030636b | ||
|
|
15ba242294 | ||
|
|
12b8efa2a1 | ||
|
|
715c1ba936 | ||
|
|
a50e8a797e | ||
|
|
a314b7a37b | ||
|
|
f3838108cd | ||
|
|
756e1f5570 | ||
|
|
9425460800 | ||
|
|
bebdc5532c | ||
|
|
069805fa89 | ||
|
|
eae078398b | ||
|
|
068a89b234 | ||
|
|
b27a0af647 | ||
|
|
7bc16cacad | ||
|
|
700e513595 | ||
|
|
9113050534 | ||
|
|
89c80a43f8 | ||
|
|
e2d86cc624 | ||
|
|
99e30e2dc1 | ||
|
|
110555570c | ||
|
|
7a80b316ac | ||
|
|
1445a91007 | ||
|
|
d4a81bedf9 | ||
|
|
05313e1f9a | ||
|
|
372646dd0d | ||
|
|
617adad306 | ||
|
|
8ad98ea029 | ||
|
|
869d434ce1 | ||
|
|
1b5c347408 | ||
|
|
bccdbae49d | ||
|
|
63fe793a2f | ||
|
|
e9e6ff2425 | ||
|
|
dcdcbcae11 | ||
|
|
b1d2f2e2fc | ||
|
|
0473fe6524 | ||
|
|
08bef5e63f | ||
|
|
743b4d2561 | ||
|
|
66b937acc5 | ||
|
|
0781273c26 | ||
|
|
8a619edb7a | ||
|
|
32429e54b7 | ||
|
|
28b00fc130 | ||
|
|
b42df76abd | ||
|
|
15ee6e6920 | ||
|
|
9bb48de844 | ||
|
|
e8f7ab6676 | ||
|
|
14542810a8 | ||
|
|
3175bdd0cc | ||
|
|
25003603aa | ||
|
|
74ea904e4c | ||
|
|
ae2926168c | ||
|
|
12335b8f62 | ||
|
|
b118cbe143 | ||
|
|
8b0437f988 | ||
|
|
0fdb86ecb1 | ||
|
|
254bac3ffe | ||
|
|
472721bc18 | ||
|
|
f62c00d342 | ||
|
|
b62c930289 | ||
|
|
ed583438b1 | ||
|
|
0dda6257fc | ||
|
|
9944fc1e27 | ||
|
|
86524a8574 | ||
|
|
822c972ce8 | ||
|
|
23ec7d77c7 | ||
|
|
83a30f1c7c | ||
|
|
ff287c632e | ||
|
|
e98516a94a | ||
|
|
8176d74976 | ||
|
|
59419868a0 | ||
|
|
c733a582dd | ||
|
|
6fcba7d320 | ||
|
|
0cb9db8835 | ||
|
|
7230a47ed3 | ||
|
|
c6e8eb6d10 | ||
|
|
7b9b78fed3 | ||
|
|
7a0420dc1a | ||
|
|
952879c40e | ||
|
|
2fb5c0b24e | ||
|
|
899184eb4b | ||
|
|
93330a3c2a | ||
|
|
001519224c | ||
|
|
949979fca1 | ||
|
|
5d6abcc7df | ||
|
|
498961324c | ||
|
|
916a05c9bf | ||
|
|
44b78f47d5 | ||
|
|
203284a6f9 | ||
|
|
14be39a37f | ||
|
|
05afabb69c | ||
|
|
95290a1c0d | ||
|
|
08f240762b | ||
|
|
953f235110 | ||
|
|
861f827101 | ||
|
|
7c20400bc6 | ||
|
|
070876e760 | ||
|
|
35542cb381 | ||
|
|
d0b166364a | ||
|
|
b20725656e | ||
|
|
fa6991ce94 | ||
|
|
fb39dbc772 | ||
|
|
85c21e6dbb | ||
|
|
77f0ccf889 | ||
|
|
da3383d81a | ||
|
|
5fec0b66a5 | ||
|
|
20b6277c6a | ||
|
|
3eedb00e11 | ||
|
|
d8251ce270 | ||
|
|
7d4a57cf33 | ||
|
|
562fbb2afe | ||
|
|
51f0d8448d | ||
|
|
9d479e6293 | ||
|
|
3955c45d63 | ||
|
|
49737431a2 | ||
|
|
52c76cb49c | ||
|
|
c1198af38e | ||
|
|
be56970506 | ||
|
|
c2d83b0007 | ||
|
|
080c77685c | ||
|
|
18c63a1fdc | ||
|
|
7478891d74 | ||
|
|
e336583552 | ||
|
|
c0f88cc35d | ||
|
|
f636bd4c15 | ||
|
|
eb7f0d465d | ||
|
|
fa2e55ce14 | ||
|
|
6d2c73e1bc | ||
|
|
ce542891d9 | ||
|
|
8f02b26ae3 | ||
|
|
4a3d0bef39 | ||
|
|
93c94454d5 | ||
|
|
fa7dd281e8 | ||
|
|
5f78b96dad | ||
|
|
29d428a6db | ||
|
|
d8f1cd5bf6 | ||
|
|
ead643b844 | ||
|
|
f399796852 | ||
|
|
be77084d0e | ||
|
|
61c52e6cb5 | ||
|
|
3a42c05133 | ||
|
|
5d2d5f2cb1 | ||
|
|
849756946b | ||
|
|
18ae833a5e | ||
|
|
bfb913105d | ||
|
|
d9e5df08db | ||
|
|
daeca7f7bf | ||
|
|
bd117d6d1e | ||
|
|
383b73551a | ||
|
|
71351daa59 | ||
|
|
a5b44df050 | ||
|
|
882c5ddc86 | ||
|
|
37e6b25f4a | ||
|
|
5a2d4737f3 | ||
|
|
f7b11621a7 | ||
|
|
13bef96917 | ||
|
|
cfafea78e7 | ||
|
|
e94e63d6d4 | ||
|
|
b8b8174632 | ||
|
|
59ead8ac15 | ||
|
|
0750fad9b4 | ||
|
|
09274e2574 | ||
|
|
102361dc2a | ||
|
|
a4197e96b1 | ||
|
|
ac2015d6df | ||
|
|
7dd0fcf719 | ||
|
|
aed78bbb72 | ||
|
|
ed29d7b702 | ||
|
|
2fb625c0f0 | ||
|
|
62726047e8 | ||
|
|
1c8285bbd2 | ||
|
|
0885c45f34 | ||
|
|
5e623616d0 | ||
|
|
98dbf2e10b | ||
|
|
aee280b5d7 | ||
|
|
7fb48f891d | ||
|
|
a19cdad2f4 | ||
|
|
175283c94d | ||
|
|
3245626bb7 | ||
|
|
3a18169f39 | ||
|
|
ba79c4c67b | ||
|
|
08cfb1ee71 | ||
|
|
cc38f00731 | ||
|
|
ca563a3221 | ||
|
|
affd6fb567 | ||
|
|
4a3ae9da7f | ||
|
|
d8d04512ba | ||
|
|
eac60b484b | ||
|
|
3e170f8a9b | ||
|
|
14f66686d9 | ||
|
|
a3b0b2193c | ||
|
|
af24cbfaa3 | ||
|
|
8ef6b60a42 | ||
|
|
df00cdbd04 | ||
|
|
df37a12fc2 | ||
|
|
afc653bb48 | ||
|
|
cae9564f29 | ||
|
|
2b45e26243 | ||
|
|
89f6f9985c | ||
|
|
daeb7bb144 | ||
|
|
4fc343f577 | ||
|
|
35e6f3992a | ||
|
|
b1f320bdd5 | ||
|
|
e843eecbd1 | ||
|
|
597a9d38ca | ||
|
|
03b1a0c0a1 | ||
|
|
168248ef97 | ||
|
|
a965ecf107 | ||
|
|
e46f6dc0e1 | ||
|
|
0659981e24 | ||
|
|
58db9ddf0f | ||
|
|
7e2a369fae | ||
|
|
d07d8f9652 | ||
|
|
367e92858f | ||
|
|
251639353d | ||
|
|
e8ef3ab74e | ||
|
|
6e8a97b995 | ||
|
|
721b80e2fe | ||
|
|
3d705eee3f | ||
|
|
799b7eacb7 | ||
|
|
7f9bb72ce3 | ||
|
|
860030929d | ||
|
|
1914e2b054 | ||
|
|
fdfe3bb374 | ||
|
|
b1c84895e5 | ||
|
|
e8ce6da148 | ||
|
|
b29d752647 | ||
|
|
ddda51d272 | ||
|
|
1574970148 | ||
|
|
f96e632384 | ||
|
|
41bf5a1c17 | ||
|
|
1f645f550a | ||
|
|
72bf32b8db | ||
|
|
93e7780d1d | ||
|
|
3ad7ac7e18 | ||
|
|
888c527fa9 | ||
|
|
f577998f60 | ||
|
|
57fe0a05af | ||
|
|
dcfe21a5ee | ||
|
|
0c3fe7e440 | ||
|
|
1452c4d817 | ||
|
|
d9c7f08c74 | ||
|
|
f33b779c24 | ||
|
|
05405def86 | ||
|
|
644d1a0056 | ||
|
|
5b50b77c13 | ||
|
|
9a836d37b5 | ||
|
|
cc8ca3656d | ||
|
|
6a7e1ccaf4 | ||
|
|
2423107c23 | ||
|
|
f80a0c2a2e | ||
|
|
5c38e6935e | ||
|
|
908c7c2d81 | ||
|
|
fd8ee54deb | ||
|
|
1b98d99905 | ||
|
|
f423eb9011 | ||
|
|
0ee58ec243 | ||
|
|
a3318a87c0 | ||
|
|
40bc2e3ae1 | ||
|
|
ef7674af30 | ||
|
|
fa8e8e555e | ||
|
|
2e167d8599 | ||
|
|
19f4328ed1 | ||
|
|
62d009f2f8 | ||
|
|
2718d7bf4e | ||
|
|
007566c4b5 | ||
|
|
5bcc2a4298 | ||
|
|
3913a71f5c | ||
|
|
f4fb2b55a2 | ||
|
|
071f919d1e | ||
|
|
59309efd8c | ||
|
|
7a64637e14 | ||
|
|
f4baf1761a | ||
|
|
f8dc741763 | ||
|
|
1739d4f805 | ||
|
|
c681805629 | ||
|
|
2f4e7d585e | ||
|
|
d3c3a201b8 | ||
|
|
9933db70a3 | ||
|
|
624acc21f9 | ||
|
|
f361618f06 | ||
|
|
790f9fc1a3 | ||
|
|
e86909c43a | ||
|
|
9085ee9775 | ||
|
|
34c7a31106 | ||
|
|
52bbe4d74e | ||
|
|
2190de3e77 | ||
|
|
d58e8f3b67 | ||
|
|
a431d7ca20 | ||
|
|
8fed2fc64b | ||
|
|
68900b3fab | ||
|
|
4ddb4e14a5 | ||
|
|
1c9a926247 | ||
|
|
0ac45d9ff7 | ||
|
|
45a4848808 | ||
|
|
0fb6de4d80 | ||
|
|
1bcd3dcab6 | ||
|
|
291230694d | ||
|
|
140ac46e67 | ||
|
|
0e5f5221f0 | ||
|
|
5813d64a7d | ||
|
|
6444825331 | ||
|
|
adfad567f6 | ||
|
|
cf7c63be3f | ||
|
|
1d78192a36 | ||
|
|
462b832e1a | ||
|
|
06fad05278 | ||
|
|
1695947221 | ||
|
|
4c40e3bf40 | ||
|
|
4f270a3ff0 | ||
|
|
6a7382f5be | ||
|
|
a7cff31e3c | ||
|
|
874699a1d7 | ||
|
|
c3c5b0b156 | ||
|
|
22bc479420 | ||
|
|
64387f83d8 | ||
|
|
b4438122f9 | ||
|
|
11ee270911 | ||
|
|
70b78835d3 | ||
|
|
0faa2bfb9c | ||
|
|
991b3bb5cf | ||
|
|
608a18eed4 | ||
|
|
292ca54153 | ||
|
|
a157596973 | ||
|
|
23bc582407 | ||
|
|
cfe5b990f9 | ||
|
|
58f6f37891 | ||
|
|
5ab5fbdf92 | ||
|
|
374d15b701 | ||
|
|
e57dcee3e4 | ||
|
|
01ca954399 | ||
|
|
7da2fa556c | ||
|
|
4c50f40771 | ||
|
|
85a9d51e58 | ||
|
|
8009857c8a | ||
|
|
e2826b1338 | ||
|
|
7e88a79a8d | ||
|
|
51f0ff4d9c | ||
|
|
bd922dfe14 | ||
|
|
096ce97503 | ||
|
|
336b8fa6f9 | ||
|
|
499be25fc0 | ||
|
|
4ec48d5a66 | ||
|
|
b7861f5341 | ||
|
|
c2a82bd9cd | ||
|
|
ee8b23bdc7 | ||
|
|
1b3979fb97 | ||
|
|
26ac56c1a6 | ||
|
|
1833456c45 | ||
|
|
50dc428692 | ||
|
|
d403d6d62f | ||
|
|
8fca2c7c8f | ||
|
|
5dac5a465b | ||
|
|
f3c9ad15da | ||
|
|
12040bd5aa | ||
|
|
6367d20757 | ||
|
|
4dbbb2b1b5 | ||
|
|
7a756c5766 | ||
|
|
ce7212a798 | ||
|
|
e0c6ea920d | ||
|
|
892b769d3a | ||
|
|
0f31a7d479 | ||
|
|
cafc8dedc7 | ||
|
|
5f168a76af | ||
|
|
985b56353b | ||
|
|
0570476c5c | ||
|
|
2d641b4e30 | ||
|
|
3bc58d2c8e | ||
|
|
4b472cfd30 | ||
|
|
04e79b5140 | ||
|
|
7435c8bc29 | ||
|
|
8031105ea2 | ||
|
|
d7fd2b7d8c | ||
|
|
2f50aae082 | ||
|
|
4ec8b1f523 | ||
|
|
2c97fdaf46 | ||
|
|
ed06f6ed84 | ||
|
|
6e29509da4 | ||
|
|
9a3df26dc1 | ||
|
|
9b335e2afa | ||
|
|
8ebb409ef3 | ||
|
|
61757b8e8a | ||
|
|
67b8fa74f3 | ||
|
|
bc72a0c172 | ||
|
|
49d73df622 | ||
|
|
a9c1a9c5a4 | ||
|
|
653eaf019e | ||
|
|
df443d9593 | ||
|
|
51216bdc80 | ||
|
|
3c7917425b | ||
|
|
0dd7604d6a | ||
|
|
eb72141e52 | ||
|
|
235aba14f4 | ||
|
|
e81dc6c36d | ||
|
|
5edd07e805 | ||
|
|
7139672f63 | ||
|
|
926cabd695 | ||
|
|
e28cb2edcc | ||
|
|
bf9c9251f9 | ||
|
|
4fc93016dd | ||
|
|
3b29ecb087 | ||
|
|
6b6c965299 | ||
|
|
bdb9929628 | ||
|
|
4a04405b5d | ||
|
|
ff27373bb2 | ||
|
|
9bad7f3485 | ||
|
|
0eb4468c79 | ||
|
|
d8b614bbdf | ||
|
|
776438f682 | ||
|
|
321e54def0 | ||
|
|
0f0bb35170 | ||
|
|
7b0ceddd6b | ||
|
|
e2fafe2b46 | ||
|
|
f396592d2e | ||
|
|
18fca8d90b | ||
|
|
7c85b20733 | ||
|
|
48c0c536fc | ||
|
|
188662cd51 | ||
|
|
dd01e8cf49 | ||
|
|
ca7f5495fe | ||
|
|
34b7d1e9c3 | ||
|
|
13a3e1c778 | ||
|
|
603b3f8b8e | ||
|
|
2c1e0a4fe2 | ||
|
|
f9a9f92003 | ||
|
|
8d1c0ba9c9 | ||
|
|
845ba285fc | ||
|
|
72f1e58833 | ||
|
|
1cc1ff7213 | ||
|
|
6c15c80abb | ||
|
|
7869e3d134 | ||
|
|
2e0efc6c4a | ||
|
|
1d440b57ce | ||
|
|
e3c564bd56 | ||
|
|
45e04c4d50 | ||
|
|
ee0f6de3b0 | ||
|
|
608be69260 | ||
|
|
88fa459aac | ||
|
|
b4bb5d902f | ||
|
|
7f467ab3a7 | ||
|
|
5c1714d11d | ||
|
|
5f36cbb31c | ||
|
|
850544ee4d | ||
|
|
7ff8935abc | ||
|
|
874cf21b00 | ||
|
|
231fefed1f | ||
|
|
5dd591f1bb | ||
|
|
ab32057ab1 | ||
|
|
84fec885e8 | ||
|
|
8057b95ac2 | ||
|
|
9adac58590 | ||
|
|
f409fca66b | ||
|
|
edd7136d3e | ||
|
|
b1c80010cc | ||
|
|
5ff255d622 | ||
|
|
fb531b4d68 | ||
|
|
03cd5dc63a | ||
|
|
fa48381bd7 | ||
|
|
38a6decc25 | ||
|
|
627495d200 | ||
|
|
37b823a43c | ||
|
|
112eb0d7ae | ||
|
|
bee314a0e6 | ||
|
|
60ef016f42 | ||
|
|
da235de896 | ||
|
|
68a425ebd5 | ||
|
|
15f6b94bec | ||
|
|
d8dd372cb0 | ||
|
|
e14a596d9f | ||
|
|
a0ab40dbb8 | ||
|
|
75e49ac8c6 | ||
|
|
590ec32860 | ||
|
|
57fd313b43 | ||
|
|
86e4df54d9 | ||
|
|
a9f60a7b1a | ||
|
|
087de62171 | ||
|
|
8577cb096e | ||
|
|
2110057bac | ||
|
|
3c09ce17d0 | ||
|
|
dc870afaed | ||
|
|
fcb8bba00c | ||
|
|
7996a02a80 | ||
|
|
3349dc46c5 | ||
|
|
a85fd307d3 | ||
|
|
37f1906f72 | ||
|
|
d5096ad4ee | ||
|
|
24da237790 | ||
|
|
d34b00ddc4 | ||
|
|
2f47d93215 | ||
|
|
1bbf79528b | ||
|
|
0c0c4fc94d | ||
|
|
01de80ed09 | ||
|
|
3861bb6bc1 | ||
|
|
681fee1317 | ||
|
|
2496a12833 | ||
|
|
c76062406d | ||
|
|
df94352e00 | ||
|
|
5b9c7ba9f2 | ||
|
|
e8dc05084a | ||
|
|
0774a2ded0 | ||
|
|
50421b06b9 | ||
|
|
7e7825a681 | ||
|
|
45b8a7afd9 | ||
|
|
4ec1fc58d9 | ||
|
|
69564365b9 | ||
|
|
54caca2d04 | ||
|
|
ce3241d046 | ||
|
|
40773180fa | ||
|
|
32411bf2ec | ||
|
|
c99265e743 | ||
|
|
2d4cff4ef1 | ||
|
|
bb90b5e8a1 | ||
|
|
b1c4bc276f | ||
|
|
1923e36740 | ||
|
|
7bec5e6f7e | ||
|
|
b40be2608b | ||
|
|
46d2f6efb7 | ||
|
|
d55f1db7ff | ||
|
|
0bcc19d7c1 | ||
|
|
b395dc8cee | ||
|
|
c908e0c19a | ||
|
|
ce5a95607f | ||
|
|
d4ba5ca52e | ||
|
|
92129824c0 | ||
|
|
7326b1fb0d | ||
|
|
1b5756fe1c | ||
|
|
08f8ce1f7c | ||
|
|
2c5234b97e | ||
|
|
37049bd5f3 | ||
|
|
177ba6cf2c | ||
|
|
bf2bb9878f | ||
|
|
530b2a1422 | ||
|
|
1eba8b8a7e | ||
|
|
4829e0d285 | ||
|
|
b29d6d4f4e | ||
|
|
d41c3bfea7 | ||
|
|
907058464a | ||
|
|
c727334bc4 | ||
|
|
b7e2c462cb | ||
|
|
1efc0fe07b | ||
|
|
9d1b407c40 | ||
|
|
67c2435f4f | ||
|
|
c11c79ef71 | ||
|
|
c245013e59 | ||
|
|
83b4916646 | ||
|
|
f6d1ea7b25 | ||
|
|
c988fd1b1f | ||
|
|
f6df6d34e0 | ||
|
|
44183902f7 | ||
|
|
64fda24e76 | ||
|
|
0701512da9 | ||
|
|
71499e7e1b | ||
|
|
6f6cf7cd64 | ||
|
|
8f175ec326 | ||
|
|
c0c26c7c40 | ||
|
|
42cd5b1435 | ||
|
|
4fafb8ae75 | ||
|
|
8349dcbba3 | ||
|
|
85a792d2b1 | ||
|
|
71fee70283 | ||
|
|
456c5fb50e | ||
|
|
b706356ba9 | ||
|
|
ed2bba3dd5 | ||
|
|
b6e701a6b2 | ||
|
|
c21636b521 | ||
|
|
2e0f424c73 | ||
|
|
a2f30806cf | ||
|
|
0c0b4b43aa | ||
|
|
209bee4181 | ||
|
|
ba265a7b83 | ||
|
|
1a8f8dcb93 | ||
|
|
2a01c86428 | ||
|
|
dc75d93414 | ||
|
|
fe44564bf7 | ||
|
|
8cd23304ae | ||
|
|
4b8e13f171 | ||
|
|
b6739ba7e8 | ||
|
|
3db7b0c962 | ||
|
|
0d6480723d | ||
|
|
9a91bf244c | ||
|
|
b1a641ca4d | ||
|
|
c65e1e0855 | ||
|
|
d8fc57b217 | ||
|
|
f9a47d94c7 | ||
|
|
ac2c3697bf | ||
|
|
b1048baef3 | ||
|
|
bfc1f0125f | ||
|
|
4b6d0107b0 | ||
|
|
1948c12012 | ||
|
|
6345086c5b | ||
|
|
08d412669d | ||
|
|
c85a8d354e | ||
|
|
03be58f39a | ||
|
|
60cb619043 | ||
|
|
91c39cf8cd | ||
|
|
f73ac4844f | ||
|
|
e681f66aad | ||
|
|
d7bf41e173 | ||
|
|
ea3247eaba | ||
|
|
d91dbf5f47 | ||
|
|
52129c544b | ||
|
|
a3b3e9c627 | ||
|
|
04c73b189d | ||
|
|
f75dbefbfd | ||
|
|
a2e4490613 | ||
|
|
2c32832946 | ||
|
|
18239e30cc | ||
|
|
77d6e24ae7 | ||
|
|
d5f6473d57 | ||
|
|
f7d927cbdd | ||
|
|
56a3d9c05d | ||
|
|
a4b76036c5 | ||
|
|
9e20cce793 | ||
|
|
f7b3b0c1a0 | ||
|
|
6404e3c2a0 | ||
|
|
9a1b040933 | ||
|
|
b5468ca840 | ||
|
|
77bbb2bda8 | ||
|
|
562498da68 | ||
|
|
b91c19bcb5 | ||
|
|
e48c4d0bb2 | ||
|
|
8c3872000a | ||
|
|
7fde85b83f | ||
|
|
262096d99d | ||
|
|
60ba83b40f | ||
|
|
5834ec297e | ||
|
|
8701c6172e | ||
|
|
d912e29772 | ||
|
|
bf0adeb0e2 | ||
|
|
8857a6281e | ||
|
|
5537648dc7 | ||
|
|
158750373b | ||
|
|
8a719ffe1f | ||
|
|
c1278bf088 | ||
|
|
86d6a224cd | ||
|
|
6b6a15e6b8 | ||
|
|
4a2b10e842 | ||
|
|
38557f8bcd | ||
|
|
8739393e52 | ||
|
|
fdad1303bc | ||
|
|
bd2d11f964 | ||
|
|
01c962f1c6 | ||
|
|
d5ec862e26 | ||
|
|
1e04ddfe5e | ||
|
|
67a6f9687d | ||
|
|
9bfb6c0c8e | ||
|
|
b4fff49236 | ||
|
|
8536166426 | ||
|
|
4bd9051ae4 | ||
|
|
74c272cfae | ||
|
|
38aed0ca4a | ||
|
|
06eea75674 | ||
|
|
ad73aa590a | ||
|
|
4322981be4 | ||
|
|
655d3632fa | ||
|
|
cd34e0db95 | ||
|
|
aae5d0dc33 | ||
|
|
51b2f4d3af | ||
|
|
f7987dbf61 | ||
|
|
f1282345f1 | ||
|
|
9046117e00 |
10
.github/pull_request_template.md
vendored
10
.github/pull_request_template.md
vendored
@@ -1,15 +1,9 @@
|
||||
**这个 PR 实现什么功能/修复什么问题**:
|
||||
|
||||
<!--
|
||||
- [ ] 功能、bugfix描述
|
||||
- [ ] 冒烟测试
|
||||
- [ ] 单元测试编写
|
||||
-->
|
||||
|
||||
**是否需要 backport 到之前的 release 分支**:
|
||||
|
||||
<!--
|
||||
如果不需要,填写 "NONE".
|
||||
如果需要,就以下面 item 的格式写 release 分支名,并提交对应的 cherry-pick PR:
|
||||
- release/3.1
|
||||
- release/2.8.0
|
||||
- release/2.6.0
|
||||
-->
|
||||
|
||||
60
.github/workflows/docker.yml
vendored
60
.github/workflows/docker.yml
vendored
@@ -41,36 +41,6 @@ jobs:
|
||||
make cmd/esxi-agent
|
||||
make docker-alpine-build F='-j4 cmd/host cmd/vpcagent cmd/region-dns'
|
||||
|
||||
- name: Image region
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: registry.cn-beijing.aliyuncs.com/yunionio/region
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: registry.cn-beijing.aliyuncs.com
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.region
|
||||
|
||||
- name: Image host
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: registry.cn-beijing.aliyuncs.com/yunionio/host
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: registry.cn-beijing.aliyuncs.com
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.host
|
||||
|
||||
- name: Image host-deployer
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: registry.cn-beijing.aliyuncs.com/yunionio/host-deployer
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: registry.cn-beijing.aliyuncs.com
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.host-deployer
|
||||
|
||||
- name: Image baremetal-agent
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
@@ -131,6 +101,16 @@ jobs:
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.logger
|
||||
|
||||
- name: Image region
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: registry.cn-beijing.aliyuncs.com/yunionio/region
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: registry.cn-beijing.aliyuncs.com
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.region
|
||||
|
||||
- name: Image scheduler
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
@@ -201,6 +181,26 @@ jobs:
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.notify
|
||||
|
||||
- name: Image host
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: registry.cn-beijing.aliyuncs.com/yunionio/host
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: registry.cn-beijing.aliyuncs.com
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.host
|
||||
|
||||
- name: Image host-deployer
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: registry.cn-beijing.aliyuncs.com/yunionio/host-deployer
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: registry.cn-beijing.aliyuncs.com
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.host-deployer
|
||||
|
||||
- name: Image cloudevent
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -30,7 +30,6 @@ _output
|
||||
/relay
|
||||
/structargtest
|
||||
.idea
|
||||
.vscode
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
|
||||
16
Makefile
16
Makefile
@@ -10,7 +10,7 @@ BUILD_SCRIPT := $(ROOT_DIR)/build/build.sh
|
||||
ifeq ($(ONECLOUD_CI_BUILD),)
|
||||
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
||||
GIT_BRANCH := $(shell git name-rev --name-only HEAD)
|
||||
GIT_VERSION := $(shell git describe --always --tags --abbrev=14 $(GIT_COMMIT)^{commit})
|
||||
GIT_VERSION := $(shell git describe --tags --abbrev=14 $(GIT_COMMIT)^{commit})
|
||||
GIT_TREE_STATE := $(shell s=`git status --porcelain 2>/dev/null`; if [ -z "$$s" ]; then echo "clean"; else echo "dirty"; fi)
|
||||
BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
else
|
||||
@@ -51,7 +51,6 @@ ifdef LIBQEMUIO_PATH
|
||||
X_CGO_LDFLAGS := ${CGO_LDFLAGS_ENV} -laio -lqemuio -lpthread -L ${LIBQEMUIO_PATH}/src
|
||||
endif
|
||||
|
||||
export GOOS ?= linux
|
||||
export GO111MODULE:=on
|
||||
export CGO_CFLAGS = ${X_CGO_CFLAGS}
|
||||
export CGO_LDFLAGS = ${X_CGO_LDFLAGS}
|
||||
@@ -76,7 +75,7 @@ install: prepare_dir
|
||||
|
||||
|
||||
gencopyright:
|
||||
@bash scripts/gencopyright.sh pkg cmd
|
||||
@sh scripts/gencopyright.sh pkg cmd
|
||||
|
||||
test:
|
||||
@go test $(GO_BUILD_FLAGS) $(shell go list ./... | egrep -v 'host-image|hostimage')
|
||||
@@ -188,7 +187,7 @@ dep:
|
||||
@$(MAKE) mod
|
||||
|
||||
mod:
|
||||
go get -d $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p'))
|
||||
go get $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p'))
|
||||
go mod tidy
|
||||
go mod vendor -v
|
||||
|
||||
@@ -291,15 +290,10 @@ gen-swagger: gen-swagger-check
|
||||
$(ROOT_DIR)/scripts/codegen.py swagger-code
|
||||
$(ROOT_DIR)/scripts/codegen.py swagger-yaml
|
||||
|
||||
swagger-serve-only:
|
||||
swagger-serve: gen-swagger
|
||||
$(ROOT_DIR)/scripts/codegen.py swagger-serve
|
||||
|
||||
swagger-serve: gen-model-api gen-swagger swagger-serve-only
|
||||
|
||||
swagger-site: gen-model-api gen-swagger
|
||||
$(ROOT_DIR)/scripts/codegen.py swagger-site
|
||||
|
||||
.PHONY: gen-model-api-check gen-model-api gen-swagger-check gen-swagger swagger-serve swagger-site
|
||||
.PHONY: gen-model-api-check gen-model-api gen-swagger-check gen-swagger swagger-serve
|
||||
|
||||
REGISTRY ?= "registry.cn-beijing.aliyuncs.com/yunionio"
|
||||
VERSION ?= $(shell git describe --exact-match 2> /dev/null || \
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:1.0.0
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:latest
|
||||
|
||||
ADD ./_output/alpine-build/bin/ansibleserver /opt/yunion/bin/ansibleserver
|
||||
ADD ./_output/bin/ansibleserver /opt/yunion/bin/ansibleserver
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
FROM alpine:3.11.6
|
||||
FROM frolvlad/alpine-glibc:glibc-2.28
|
||||
|
||||
MAINTAINER "Yousong Zhou <zhouyousong@yunionyun.com>"
|
||||
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"
|
||||
|
||||
# openssh-client, for ansible ssh connection
|
||||
RUN set -x \
|
||||
&& apk update \
|
||||
&& apk add openssh-client \
|
||||
&& apk add ansible \
|
||||
&& apk add tzdata ca-certificates \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache tzdata ansible ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:v0.0.3
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:v0.0.2
|
||||
|
||||
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{{.os_type}} 镜像 {{.name}} 上传完成
|
||||
@@ -1,66 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="width: 650px; margin-bottom: 20px;" border="0" cellpadding="0" cellspacing="0" align="center">
|
||||
<tr style="height: 50px; background: #333; overflow: hidden;">
|
||||
<td>
|
||||
<table style="margin-left: 20px;">
|
||||
<tr>
|
||||
<td>
|
||||
<img src="data:{{.login_logo_format}};base64,{{.login_logo}}" alt="" style="color: #fff; height: 32px; vertical-align: middle;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table style="float: right;">
|
||||
<tr>
|
||||
<td style="padding-left: 20px; padding-right: 20px;">
|
||||
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">产品</a>
|
||||
</td>
|
||||
<td style="padding-left: 20px; padding-right: 20px;">
|
||||
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">解决方案</a>
|
||||
</td>
|
||||
<td style="padding-left: 20px; padding-right: 20px;">
|
||||
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">服务</a>
|
||||
</td>
|
||||
<td style="padding-left: 20px; padding-right: 20px;">
|
||||
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">帮助与文档</a>
|
||||
</td>
|
||||
<td style="padding-left: 20px; padding-right: 20px;">
|
||||
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">关于我们</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 100%;" colspan="2">
|
||||
<table style="padding: 20px 10px; width: 100%;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 20px;">
|
||||
亲爱的{{.name}},您好:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 10px;">请点击下面的链接,完成用户邮箱的激活:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 30px;"><a href="{{.link}}">{{.link}}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="width: 96%;">
|
||||
<td colspan="2" style="border-top: 1px dashed #ccc; color: #333; font-size: 12px; padding-bottom: 10px; font-weight: 100;">*为了确保您的帐号安全,该链接仅48小时内访问有效,请勿直接回复此邮件。</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="background: #333; text-align: right; padding-right: 20px; font-size: 12px; color: #fff; height: 50px;">版权所有 © {{.copyright}} 保留一切权利</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
镜像 {{.name}} 上传完成
|
||||
@@ -1 +0,0 @@
|
||||
Yunion Verify
|
||||
@@ -1,42 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type BillTasksCreateOptions struct {
|
||||
options.BaseListOptions
|
||||
CloudaccountId string `help:"cloudaccount Id" required:"true"`
|
||||
StartDay int `help:"start day of billing cycle, example: 20060102"`
|
||||
EndDay int `help:"end day of billing cycle, example: 20060102"`
|
||||
}
|
||||
R(&BillTasksCreateOptions{}, "bill-tasks-create", "create bill task",
|
||||
func(s *mcclient.ClientSession, args *BillTasksCreateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.BillTasks.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -32,22 +32,12 @@ import (
|
||||
func init() {
|
||||
type BucketListOptions struct {
|
||||
options.BaseListOptions
|
||||
DistinctField string `help:"query specified distinct field"`
|
||||
}
|
||||
R(&BucketListOptions{}, "bucket-list", "List all buckets", func(s *mcclient.ClientSession, args *BucketListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.DistinctField) > 0 {
|
||||
params.Add(jsonutils.NewString(args.DistinctField), "extra_field")
|
||||
result, err := modules.Buckets.Get(s, "distinct-field", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(result)
|
||||
return nil
|
||||
}
|
||||
result, err := modules.Buckets.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -56,10 +46,10 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketIdOptions struct {
|
||||
type BucketShowOptions struct {
|
||||
ID string `help:"ID or name of bucket"`
|
||||
}
|
||||
R(&BucketIdOptions{}, "bucket-show", "Id details of bucket", func(s *mcclient.ClientSession, args *BucketIdOptions) error {
|
||||
R(&BucketShowOptions{}, "bucket-show", "Show details of bucket", func(s *mcclient.ClientSession, args *BucketShowOptions) error {
|
||||
result, err := modules.Buckets.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -68,15 +58,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&BucketIdOptions{}, "bucket-syncstatus", "Sync bucket statust", func(s *mcclient.ClientSession, args *BucketIdOptions) error {
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketUpdateOptions struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
Name string `help:"new name of bucket" json:"name"`
|
||||
|
||||
@@ -53,9 +53,6 @@ func init() {
|
||||
type CloudaccountListOptions struct {
|
||||
options.BaseListOptions
|
||||
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
|
||||
|
||||
DistinctField string `help:"distinct field"`
|
||||
ProxySetting string `help:"Proxy setting id or name"`
|
||||
}
|
||||
R(&CloudaccountListOptions{}, "cloud-account-list", "List cloud accounts", func(s *mcclient.ClientSession, args *CloudaccountListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
@@ -68,18 +65,6 @@ func init() {
|
||||
if len(args.Capability) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
|
||||
}
|
||||
if len(args.ProxySetting) > 0 {
|
||||
params.Add(jsonutils.NewString(args.ProxySetting), "proxy_setting")
|
||||
}
|
||||
}
|
||||
if len(args.DistinctField) > 0 {
|
||||
params.Add(jsonutils.NewString(args.DistinctField), "extra_field")
|
||||
result, err := modules.Cloudaccounts.Get(s, "distinct-field", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(result)
|
||||
return nil
|
||||
}
|
||||
result, err := modules.Cloudaccounts.List(s, params)
|
||||
if err != nil {
|
||||
@@ -753,129 +738,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SVMwareCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-vmware", "Update credential of a VMware cloud account", func(s *mcclient.ClientSession, args *options.SVMwareCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SAliyunCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-aliyun", "Update credential of an Aliyun cloud account", func(s *mcclient.ClientSession, args *options.SAliyunCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SAzureCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-azure", "Update credential of an Azure cloud account", func(s *mcclient.ClientSession, args *options.SAzureCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SQcloudCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-qcloud", "Update credential of a Qcloud cloud account", func(s *mcclient.ClientSession, args *options.SQcloudCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SAWSCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-aws", "Update credential of an AWS cloud account", func(s *mcclient.ClientSession, args *options.SAWSCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SOpenStackCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-openstack", "Update credential of an OpenStack cloud account", func(s *mcclient.ClientSession, args *options.SOpenStackCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SHuaweiCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-huawei", "Update credential of an Huawei cloud account", func(s *mcclient.ClientSession, args *options.SHuaweiCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SUcloudCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-ucloud", "Update credential of a Ucloud cloud account", func(s *mcclient.ClientSession, args *options.SUcloudCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SZStackCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-zstack", "Update credential of a ZStack cloud account", func(s *mcclient.ClientSession, args *options.SZStackCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SGoogleCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-google", "Update credential of a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateCredentialOptions) error {
|
||||
params, err := parseGcpCredential(args.GoogleJsonFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SS3CloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-s3", "Update credential of a generic S3 cloud account", func(s *mcclient.ClientSession, args *options.SS3CloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SCtyunCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-ctyun", "Update credential of an Ctyun cloud account", func(s *mcclient.ClientSession, args *options.SCtyunCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudaccountSyncOptions struct {
|
||||
ID string `help:"ID or Name of cloud account"`
|
||||
Force bool `help:"Force sync no matter what"`
|
||||
@@ -939,14 +801,10 @@ func init() {
|
||||
})
|
||||
|
||||
type CloudaccountPublicOptions struct {
|
||||
ID string `help:"ID or name of cloud account" json:"-"`
|
||||
Scope string `help:"public_sccope" choices:"domain|system" json:"scope"`
|
||||
SharedDomains []string `help:"shared domains" json:"shared_domains"`
|
||||
ShareMode string `help:"share_mode" choices:"account_domain|provider_domain|system"`
|
||||
ID string `help:"ID or name of cloud account"`
|
||||
}
|
||||
R(&CloudaccountPublicOptions{}, "cloud-account-public", "Mark this cloud account public ", func(s *mcclient.ClientSession, args *CloudaccountPublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "public", params)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "public", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1006,47 +864,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ClouaccountChangeOwnerOptions struct {
|
||||
ID string `help:"ID or name of cloudaccount" json:"-"`
|
||||
ProjectDomain string `json:"project_domain" help:"target domain"`
|
||||
}
|
||||
R(&ClouaccountChangeOwnerOptions{}, "cloud-account-change-owner", "Change owner domain of cloudaccount", func(s *mcclient.ClientSession, args *ClouaccountChangeOwnerOptions) error {
|
||||
if len(args.ProjectDomain) == 0 {
|
||||
return fmt.Errorf("empty project_domain")
|
||||
}
|
||||
params := jsonutils.Marshal(args)
|
||||
ret, err := modules.Cloudaccounts.PerformAction(s, args.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ClouaccountChangeProjectOptions struct {
|
||||
ID string `help:"ID or name of cloudaccount" json:"-"`
|
||||
PROJECT string `json:"project" help:"target domain"`
|
||||
}
|
||||
R(&ClouaccountChangeProjectOptions{}, "cloud-account-change-project", "Change domain/project of cloudaccount", func(s *mcclient.ClientSession, args *ClouaccountChangeProjectOptions) error {
|
||||
if len(args.PROJECT) == 0 {
|
||||
return fmt.Errorf("empty project")
|
||||
}
|
||||
params := jsonutils.Marshal(args)
|
||||
ret, err := modules.Cloudaccounts.PerformAction(s, args.ID, "change-project", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CloudaccountShowOptions{}, "cloud-account-change-owner-candidate-domains", "Show candiate domains of a cloud account changing project", func(s *mcclient.ClientSession, args *CloudaccountShowOptions) error {
|
||||
result, err := modules.Cloudaccounts.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type CloudproviderQuotaListOptions struct {
|
||||
options.BaseListOptions
|
||||
Cloudregion string `help:"ID or Name of Cloudregion"`
|
||||
QuotaType string `help:"Quota type"`
|
||||
QuotaRange string `help:"Quota range" choices:"cloudregion|cloudprovider"`
|
||||
}
|
||||
|
||||
R(&CloudproviderQuotaListOptions{}, "cloud-provider-quota-list", "List cloudprovider quota", func(s *mcclient.ClientSession, args *CloudproviderQuotaListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(args.QuotaType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.QuotaType), "quota_type")
|
||||
}
|
||||
|
||||
if len(args.QuotaRange) > 0 {
|
||||
params.Add(jsonutils.NewString(args.QuotaRange), "quota_range")
|
||||
}
|
||||
|
||||
if len(args.Cloudregion) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Cloudregion), "cloudregion")
|
||||
}
|
||||
|
||||
result, err := modules.CloudproviderQuotas.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printList(result, modules.CloudproviderQuotas.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -27,8 +27,6 @@ func init() {
|
||||
type CloudproviderRegionListOptions struct {
|
||||
options.BaseListOptions
|
||||
Region string `help:"ID or Name of Host"`
|
||||
|
||||
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
|
||||
}
|
||||
R(&CloudproviderRegionListOptions{}, "cloud-provider-region-list", "List cloudprovider region synchronization status", func(s *mcclient.ClientSession, args *CloudproviderRegionListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
|
||||
@@ -34,7 +34,6 @@ func init() {
|
||||
HasObjectStorage bool `help:"filter cloudproviders that has object storage"`
|
||||
NoObjectStorage bool `help:"filter cloudproviders that has no object storage"`
|
||||
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
|
||||
Cloudregion string `help:"filter cloudproviders by cloudregion"`
|
||||
}
|
||||
R(&CloudproviderListOptions{}, "cloud-provider-list", "List cloud providers", func(s *mcclient.ClientSession, args *CloudproviderListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
@@ -58,10 +57,6 @@ func init() {
|
||||
if len(args.Capability) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
|
||||
}
|
||||
|
||||
if len(args.Cloudregion) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Cloudregion), "cloudregion")
|
||||
}
|
||||
}
|
||||
result, err := modules.Cloudproviders.List(s, params)
|
||||
if err != nil {
|
||||
@@ -250,13 +245,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CloudproviderShowOptions{}, "cloud-provider-change-owner-candidate-domains", "Show candiate domains of a cloud provider changing owner", func(s *mcclient.ClientSession, args *CloudproviderShowOptions) error {
|
||||
result, err := modules.Cloudproviders.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -34,25 +32,12 @@ func init() {
|
||||
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers"`
|
||||
|
||||
City string `help:"List regions in the specified city"`
|
||||
|
||||
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
|
||||
|
||||
DistinctField string `help:"list the specified distinct field, e.g. city, region"`
|
||||
}
|
||||
R(&CloudregionListOptions{}, "cloud-region-list", "List cloud regions", func(s *mcclient.ClientSession, opts *CloudregionListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(opts.DistinctField) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.DistinctField), "extra_field")
|
||||
result, err := modules.Cloudregions.Get(s, "distinct-field", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(result)
|
||||
return nil
|
||||
}
|
||||
result, err := modules.Cloudregions.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -38,11 +38,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(opts.ExportFile) > 0 {
|
||||
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.DBInstanceBackups.GetColumns(s))
|
||||
} else {
|
||||
printList(result, modules.DBInstanceBackups.GetColumns(s))
|
||||
}
|
||||
printList(result, modules.DBInstanceBackups.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -84,15 +80,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceBackupIdOptions{}, "dbinstance-backup-syncstatus", "Sync DB instance backup status", func(s *mcclient.ClientSession, opts *DBInstanceBackupIdOptions) error {
|
||||
result, err := modules.DBInstanceBackups.PerformAction(s, opts.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceBackupIdOptions{}, "dbinstance-backup-delete", "Delete DB instance backup", func(s *mcclient.ClientSession, opts *DBInstanceBackupIdOptions) error {
|
||||
result, err := modules.DBInstanceBackups.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -41,12 +41,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(opts.ExportFile) > 0 {
|
||||
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.DBInstance.GetColumns(s))
|
||||
} else {
|
||||
printList(result, modules.DBInstance.GetColumns(s))
|
||||
}
|
||||
printList(result, modules.DBInstance.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -263,24 +258,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-syncstatus", "Sync status for DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-sync", "Sync conf from cloud dbinstance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "sync", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-sync-status", "Sync status for DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "sync-status", nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -107,7 +107,7 @@ func init() {
|
||||
R(
|
||||
&options.DevtoolTemplateBindingOptions{},
|
||||
"devtooltemplate-unbind",
|
||||
"UnBinding devtool template to a host/vm",
|
||||
"Binding devtool template to a host/vm",
|
||||
func(s *mcclient.ClientSession, opts *options.DevtoolTemplateBindingOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("server_id", jsonutils.NewString(opts.ServerID))
|
||||
|
||||
@@ -133,15 +133,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DiskDetailOptions{}, "disk-syncstatus", "Sync status for disk", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
ret, e := modules.Disks.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DiskUpdateOptions struct {
|
||||
ID string `help:"ID or name of disk"`
|
||||
Name string `help:"New name of disk"`
|
||||
@@ -291,14 +282,4 @@ func init() {
|
||||
printObject(srv)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DiskDetailOptions{}, "disk-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
result, err := modules.Disks.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type DistinctFieldOption struct {
|
||||
MODULE string `help:"module name"`
|
||||
FIELD string `help:"distinct field name to query"`
|
||||
}
|
||||
R(&DistinctFieldOption{}, "distinct-field", "Query values of a distinct field for a module", func(s *mcclient.ClientSession, args *DistinctFieldOption) error {
|
||||
mod, err := modulebase.GetModule(s, args.MODULE)
|
||||
if err != nil || mod == nil {
|
||||
if err != nil {
|
||||
return fmt.Errorf("module %s not found %s", args.MODULE, err)
|
||||
}
|
||||
return fmt.Errorf("No module %s found", args.MODULE)
|
||||
}
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.FIELD), "extra_field")
|
||||
result, err := mod.Get(s, "distinct-field", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -83,8 +83,6 @@ func init() {
|
||||
Desc string `help:"Description"`
|
||||
Enabled bool `help:"Set the domain enabled"`
|
||||
Disabled bool `help:"Set the domain disabled"`
|
||||
|
||||
Displayname string `help:"display name"`
|
||||
}
|
||||
R(&DomainCreateOptions{}, "domain-create", "Create a new domain", func(s *mcclient.ClientSession, args *DomainCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -97,9 +95,6 @@ func init() {
|
||||
} else if !args.Enabled && args.Disabled {
|
||||
params.Add(jsonutils.JSONFalse, "enabled")
|
||||
}
|
||||
if len(args.Displayname) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Displayname), "displayname")
|
||||
}
|
||||
result, err := modules.Domains.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -115,8 +110,6 @@ func init() {
|
||||
Enabled bool `help:"Set the domain enabled"`
|
||||
Disabled bool `help:"Set the domain disabled"`
|
||||
Driver string `help:"Set the domain Driver"`
|
||||
|
||||
Displayname string `help:"display name"`
|
||||
}
|
||||
R(&DomainUpdateOptions{}, "domain-update", "Update a domain", func(s *mcclient.ClientSession, args *DomainUpdateOptions) error {
|
||||
obj, err := modules.Domains.Get(s, args.ID, nil)
|
||||
@@ -143,9 +136,6 @@ func init() {
|
||||
} else if !args.Enabled && args.Disabled {
|
||||
params.Add(jsonutils.JSONFalse, "enabled")
|
||||
}
|
||||
if len(args.Displayname) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Displayname), "displayname")
|
||||
}
|
||||
result, err := modules.Domains.Patch(s, objId, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -75,16 +75,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ElasticCacheIdOptions{}, "elastic-cache-syncstatus", "Sync elastisc cache instance status", func(s *mcclient.ClientSession, opts *options.ElasticCacheIdOptions) error {
|
||||
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ElasticCacheIdOptions{}, "elastic-cache-delete", "Delete elastisc cache instance", func(s *mcclient.ClientSession, opts *options.ElasticCacheIdOptions) error {
|
||||
result, err := modules.ElasticCache.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -170,15 +170,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&EipSingleOptions{}, "eip-syncstatus", "Synchronize status of an EIP", func(s *mcclient.ClientSession, args *EipSingleOptions) error {
|
||||
result, err := modules.Elasticips.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerCreateEipOptions struct {
|
||||
ID string `help:"server ID or name"`
|
||||
BW int `help:"EIP bandwidth in Mbps"`
|
||||
|
||||
@@ -64,15 +64,14 @@ func init() {
|
||||
})
|
||||
|
||||
type EndpointCreateOptions struct {
|
||||
SERVICE string `help:"Service ID or Name"`
|
||||
REGION string `help:"Region"`
|
||||
INTERFACE string `help:"Interface types" choices:"internal|public|admin|console"`
|
||||
URL string `help:"URL"`
|
||||
Zone string `help:"Zone"`
|
||||
Name string `help:"Name"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
ServiceCertificate string `help:"Service certificate id or name"`
|
||||
SERVICE string `help:"Service ID or Name"`
|
||||
REGION string `help:"Region"`
|
||||
INTERFACE string `help:"Interface types" choices:"internal|public|admin|console"`
|
||||
URL string `help:"URL"`
|
||||
Zone string `help:"Zone"`
|
||||
Name string `help:"Name"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
}
|
||||
R(&EndpointCreateOptions{}, "endpoint-create", "Create endpoint", func(s *mcclient.ClientSession, args *EndpointCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -96,9 +95,6 @@ func init() {
|
||||
} else if !args.Enabled && args.Disabled {
|
||||
params.Add(jsonutils.JSONFalse, "enabled")
|
||||
}
|
||||
if len(args.ServiceCertificate) > 0 {
|
||||
params.Add(jsonutils.NewString(args.ServiceCertificate), "service_certificate")
|
||||
}
|
||||
ep, err := modules.EndpointsV3.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -108,12 +104,11 @@ func init() {
|
||||
})
|
||||
|
||||
type EndpointUpdateOptions struct {
|
||||
ID string `help:"ID or name of endpoint"`
|
||||
Url string `help:"URL"`
|
||||
Name string `help:"Name"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
ServiceCertificate string `help:"Service certificate id or name"`
|
||||
ID string `help:"ID or name of endpoint"`
|
||||
Url string `help:"URL"`
|
||||
Name string `help:"Name"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
}
|
||||
R(&EndpointUpdateOptions{}, "endpoint-update", "Update a endpoint", func(s *mcclient.ClientSession, args *EndpointUpdateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -128,9 +123,6 @@ func init() {
|
||||
} else if !args.Enabled && args.Disabled {
|
||||
params.Add(jsonutils.JSONFalse, "enabled")
|
||||
}
|
||||
if len(args.ServiceCertificate) > 0 {
|
||||
params.Add(jsonutils.NewString(args.ServiceCertificate), "service_certificate")
|
||||
}
|
||||
ep, err := modules.EndpointsV3.Patch(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -34,11 +34,8 @@ type BaseEventListOptions struct {
|
||||
OrderBy string `help:"order by specific field"`
|
||||
Action []string `help:"Log action"`
|
||||
|
||||
User string `help:"filter by operator user"`
|
||||
Project string `help:"filter by operator user's project"`
|
||||
|
||||
OwnerProjectIds []string `help:"filter by owner project ids"`
|
||||
OwnerDomainIds []string `help:"filter by owner domain ids"`
|
||||
User []string `help:"filter by operator user"`
|
||||
Project []string `help:"filter by owner project"`
|
||||
|
||||
PagingMarker string `help:"marker for pagination"`
|
||||
}
|
||||
@@ -102,20 +99,14 @@ func doEventList(man modulebase.ResourceManager, s *mcclient.ClientSession, args
|
||||
params.Add(jsonutils.NewStringArray(args.Action), "action")
|
||||
}
|
||||
if len(args.User) > 0 {
|
||||
params.Add(jsonutils.NewString(args.User), "user")
|
||||
params.Add(jsonutils.NewStringArray(args.User), "user")
|
||||
}
|
||||
if len(args.Project) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Project), "project")
|
||||
params.Add(jsonutils.NewStringArray(args.Project), "project")
|
||||
}
|
||||
if len(args.Scope) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Scope), "scope")
|
||||
}
|
||||
if len(args.OwnerProjectIds) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(args.OwnerProjectIds), "owner_project_ids")
|
||||
}
|
||||
if len(args.OwnerDomainIds) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(args.OwnerDomainIds), "owner_domain_ids")
|
||||
}
|
||||
if len(args.PagingMarker) > 0 {
|
||||
params.Add(jsonutils.NewString(args.PagingMarker), "paging_marker")
|
||||
}
|
||||
@@ -225,11 +216,6 @@ func init() {
|
||||
return doIdentityEventList(s, &nargs)
|
||||
})
|
||||
|
||||
R(&TypeEventListOptions{}, "idp-event", "Show operation event logs of keystone identity provider", func(s *mcclient.ClientSession, args *TypeEventListOptions) error {
|
||||
nargs := EventListOptions{BaseEventListOptions: args.BaseEventListOptions, Id: args.ID, Type: []string{"identity_provider"}}
|
||||
return doIdentityEventList(s, &nargs)
|
||||
})
|
||||
|
||||
R(&TypeEventListOptions{}, "project-event", "Show operation event logs of keystone projects", func(s *mcclient.ClientSession, args *TypeEventListOptions) error {
|
||||
nargs := EventListOptions{BaseEventListOptions: args.BaseEventListOptions, Id: args.ID, Type: []string{"project"}}
|
||||
return doIdentityEventList(s, &nargs)
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
@@ -52,58 +48,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type GlobalVpcPublicOptions struct {
|
||||
ID string `help:"ID or name of global vpc" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
SharedDomains []string `help:"share to domains"`
|
||||
}
|
||||
R(&GlobalVpcPublicOptions{}, "global-vpc-public", "Make global vpc public", func(s *mcclient.ClientSession, args *GlobalVpcPublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.GlobalVpcs.PerformAction(s, args.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type GlobalVpcPrivateOptions struct {
|
||||
ID string `help:"ID or name of global vpc" json:"-"`
|
||||
}
|
||||
R(&GlobalVpcPrivateOptions{}, "global-vpc-private", "Make global vpc private", func(s *mcclient.ClientSession, args *GlobalVpcPrivateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.GlobalVpcs.PerformAction(s, args.ID, "private", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&GlobalVpcShowOptions{}, "global-vpc-change-owner-candidate-domains", "Show candiate domains of a global vpc for changing owner", func(s *mcclient.ClientSession, args *GlobalVpcShowOptions) error {
|
||||
result, err := modules.GlobalVpcs.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type GlobalVpcChangeOwnerOptions struct {
|
||||
ID string `help:"ID or name of vpc" json:"-"`
|
||||
ProjectDomain string `json:"project_domain" help:"target domain"`
|
||||
}
|
||||
R(&GlobalVpcChangeOwnerOptions{}, "global-vpc-change-owner", "Change owner domain of a global vpc", func(s *mcclient.ClientSession, args *GlobalVpcChangeOwnerOptions) error {
|
||||
if len(args.ProjectDomain) == 0 {
|
||||
return fmt.Errorf("empty project_domain")
|
||||
}
|
||||
params := jsonutils.Marshal(args)
|
||||
ret, err := modules.GlobalVpcs.PerformAction(s, args.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -224,29 +224,4 @@ func init() {
|
||||
printObject(sp)
|
||||
return nil
|
||||
})
|
||||
|
||||
type GroupAddUsersOptions struct {
|
||||
GROUP string `help:"group Id or Name" json:"-"`
|
||||
USER []string `help:"list of user id or name" json:"user"`
|
||||
}
|
||||
R(&GroupAddUsersOptions{}, "group-add-users", "Add users into group",
|
||||
func(s *mcclient.ClientSession, args *GroupAddUsersOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Groups.PerformAction(s, args.GROUP, "add-users", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
R(&GroupAddUsersOptions{}, "group-remove-users", "Add users into group",
|
||||
func(s *mcclient.ClientSession, args *GroupAddUsersOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Groups.PerformAction(s, args.GROUP, "remove-users", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -203,36 +203,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&HostListOptions{}, "host-node-count", "Get host node count", func(s *mcclient.ClientSession, opts *HostListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if opts.Empty {
|
||||
params.Add(jsonutils.JSONTrue, "is_empty")
|
||||
} else if opts.Occupied {
|
||||
params.Add(jsonutils.JSONFalse, "is_empty")
|
||||
}
|
||||
if opts.Enabled {
|
||||
params.Add(jsonutils.NewInt(1), "enabled")
|
||||
} else if opts.Disabled {
|
||||
params.Add(jsonutils.NewInt(0), "enabled")
|
||||
}
|
||||
if len(opts.Uuid) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Uuid), "uuid")
|
||||
}
|
||||
if len(opts.Sn) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Sn), "sn")
|
||||
}
|
||||
result, err := modules.Hosts.Get(s, "node-count", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostUpdateOptions struct {
|
||||
ID string `help:"ID or Name of Host"`
|
||||
Name string `help:"New name of the host"`
|
||||
@@ -736,83 +706,4 @@ func init() {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostChangeOwnerOptions struct {
|
||||
ID string `help:"ID or name of host" json:"-"`
|
||||
ProjectDomain string `json:"project_domain" help:"target domain"`
|
||||
}
|
||||
R(&HostChangeOwnerOptions{}, "host-change-owner", "Change owner domain of host", func(s *mcclient.ClientSession, args *HostChangeOwnerOptions) error {
|
||||
if len(args.ProjectDomain) == 0 {
|
||||
return fmt.Errorf("empty project_domain")
|
||||
}
|
||||
params := jsonutils.Marshal(args)
|
||||
ret, err := modules.Hosts.PerformAction(s, args.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostPublicOptions struct {
|
||||
ID string `help:"ID or name of host" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
SharedDomains []string `help:"share to domains"`
|
||||
}
|
||||
R(&HostPublicOptions{}, "host-public", "Make a host public", func(s *mcclient.ClientSession, args *HostPublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Hosts.PerformAction(s, args.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostPrivateOptions struct {
|
||||
ID string `help:"ID or name of host" json:"-"`
|
||||
}
|
||||
R(&HostPrivateOptions{}, "host-private", "Make a host private", func(s *mcclient.ClientSession, args *HostPrivateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Hosts.PerformAction(s, args.ID, "private", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostChangeOwnerCandidateDomainsOptions struct {
|
||||
ID string `help:"ID or name of host"`
|
||||
}
|
||||
R(&HostChangeOwnerCandidateDomainsOptions{}, "host-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *HostChangeOwnerCandidateDomainsOptions) error {
|
||||
result, err := modules.Hosts.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostAutoMigrateOnHostDownOptions struct {
|
||||
ID string `help:"ID or name of host"`
|
||||
Enable bool `help:"enable auto migrate"`
|
||||
Disable bool `help:"disable auto migrate"`
|
||||
}
|
||||
R(&HostAutoMigrateOnHostDownOptions{}, "host-auto-migrate-on-host-down", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *HostAutoMigrateOnHostDownOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if args.Disable {
|
||||
params.Set("auto_migrate_on_host_down", jsonutils.NewString("disable"))
|
||||
} else if args.Enable {
|
||||
params.Set("auto_migrate_on_host_down", jsonutils.NewString("enable"))
|
||||
} else {
|
||||
return fmt.Errorf("missing input enable or disable")
|
||||
}
|
||||
result, err := modules.Hosts.PerformAction(s, args.ID, "auto-migrate-on-host-down", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -295,36 +294,4 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type IdentityProviderConfigEditOptions struct {
|
||||
IDP string `help:"identity provider name or ID"`
|
||||
}
|
||||
R(&IdentityProviderConfigEditOptions{}, "idp-config-edit", "Edit config yaml of an identity provider", func(s *mcclient.ClientSession, args *IdentityProviderConfigEditOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.JSONTrue, "sensitive")
|
||||
conf, err := modules.IdentityProviders.GetSpecific(s, args.IDP, "config", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
confJson, err := conf.Get("config")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
content, err := shellutils.Edit(confJson.YAMLString())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
yamlJson, err := jsonutils.ParseYAML(content)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config := jsonutils.NewDict()
|
||||
config.Add(yamlJson, "config")
|
||||
nconf, err := modules.IdentityProviders.PerformAction(s, args.IDP, "config", config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(nconf.PrettyString())
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ type ImageOptionalOptions struct {
|
||||
Unprotected bool `help:"Allow image to be deleted"`
|
||||
Standard bool `help:"Mark image as a standard image"`
|
||||
Nonstandard bool `help:"Mark image as a non-standard image"`
|
||||
Public bool `help:"make image public"`
|
||||
MinDisk int64 `help:"Disk size after expanded, in MB" metavar:"MIN_DISK_SIZE_MB"`
|
||||
MinRam int64 `help:"Minimal memory size required" metavar:"MIN_RAM_MB"`
|
||||
VirtualSize int64 `help:"Disk size after expanded, in MB"`
|
||||
@@ -54,11 +53,11 @@ type ImageOptionalOptions struct {
|
||||
Hypervisor []string `help:"Prefer hypervisor type" choices:"kvm|esxi|baremetal|container|openstack|ctyun"`
|
||||
DiskDriver string `help:"Perfer disk driver" choices:"virtio|scsi|pvscsi|ide|sata"`
|
||||
NetDriver string `help:"Preferred network driver" choices:"virtio|e1000|vmxnet3"`
|
||||
DisableUsbKbd bool `help:"Disable usb keyboard on this image(for hypervisor kvm)"`
|
||||
}
|
||||
|
||||
func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDict, args ImageOptionalOptions) error {
|
||||
if len(args.Format) > 0 {
|
||||
params.Add(jsonutils.NewString("bare"), "container-format")
|
||||
params.Add(jsonutils.NewString(args.Format), "disk-format")
|
||||
}
|
||||
if args.Protected && !args.Unprotected {
|
||||
@@ -71,9 +70,6 @@ func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDi
|
||||
} else if !args.Standard && args.Nonstandard {
|
||||
params.Add(jsonutils.JSONFalse, "is_standard")
|
||||
}
|
||||
if args.Public {
|
||||
params.Add(jsonutils.JSONTrue, "is_public")
|
||||
}
|
||||
if args.MinDisk > 0 {
|
||||
params.Add(jsonutils.NewString(fmt.Sprintf("%d", args.MinDisk)), "min_disk")
|
||||
}
|
||||
@@ -132,9 +128,6 @@ func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDi
|
||||
if len(args.Hypervisor) > 0 {
|
||||
params.Add(jsonutils.NewString(strings.Join(args.Hypervisor, ",")), "properties", "hypervisor")
|
||||
}
|
||||
if args.DisableUsbKbd {
|
||||
params.Add(jsonutils.NewString("true"), "properties", "disable_usb_kbd")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -147,7 +140,6 @@ func init() {
|
||||
Protected string `help:"filter images by protected" choices:"true|false"`
|
||||
IsUefi bool `help:"list uefi image"`
|
||||
Format []string `help:"Disk formats"`
|
||||
SubFormats []string `help:"Sub formats"`
|
||||
Name string `help:"Name filter"`
|
||||
}
|
||||
R(&ImageListOptions{}, "image-list", "List images", func(s *mcclient.ClientSession, args *ImageListOptions) error {
|
||||
@@ -178,14 +170,15 @@ func init() {
|
||||
params.Add(jsonutils.NewString(args.Name), "name")
|
||||
}
|
||||
if len(args.Format) > 0 {
|
||||
fs := jsonutils.NewArray()
|
||||
for _, f := range args.Format {
|
||||
fs.Add(jsonutils.NewString(f))
|
||||
if len(args.Format) == 1 {
|
||||
params.Add(jsonutils.NewString(args.Format[0]), "disk_format")
|
||||
} else {
|
||||
fs := jsonutils.NewArray()
|
||||
for _, f := range args.Format {
|
||||
fs.Add(jsonutils.NewString(f))
|
||||
}
|
||||
params.Add(fs, "disk_formats")
|
||||
}
|
||||
params.Add(fs, "disk_formats")
|
||||
}
|
||||
if len(args.SubFormats) > 0 {
|
||||
params.Add(jsonutils.Marshal(args.SubFormats), "sub_formats")
|
||||
}
|
||||
result, err := modules.Images.List(s, params)
|
||||
if err != nil {
|
||||
@@ -251,12 +244,28 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type ImageMembershipOptions struct {
|
||||
IMAGE string `help:"ID or name of image to share"`
|
||||
PROJECT string `help:"ID or name of project to share image with"`
|
||||
}
|
||||
type ImageMembershipAddOptions struct {
|
||||
ImageMembershipOptions
|
||||
CanShare bool `help:"Indicating whether the project can share the image with others"`
|
||||
}
|
||||
R(&ImageMembershipAddOptions{}, "image-add-project", "Add a project to private image's membership list", func(s *mcclient.ClientSession, args *ImageMembershipAddOptions) error {
|
||||
return modules.Images.AddMembership(s, args.IMAGE, args.PROJECT, args.CanShare)
|
||||
})
|
||||
|
||||
R(&ImageMembershipOptions{}, "image-remove-project", "Remove a project from private image's membership list", func(s *mcclient.ClientSession, args *ImageMembershipOptions) error {
|
||||
return modules.Images.RemoveMembership(s, args.IMAGE, args.PROJECT)
|
||||
})
|
||||
|
||||
type ImageDetailOptions struct {
|
||||
ID string `help:"Image ID or name"`
|
||||
}
|
||||
|
||||
type ImageDeleteOptions struct {
|
||||
ID []string `help:"Image ID or name" json:"-"`
|
||||
ID []string `help:"Image ID or name"`
|
||||
OverridePendingDelete *bool `help:"Delete image directly instead of pending delete" short-token:"f"`
|
||||
}
|
||||
R(&ImageDeleteOptions{}, "image-delete", "Delete a image", func(s *mcclient.ClientSession, args *ImageDeleteOptions) error {
|
||||
@@ -269,6 +278,19 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&ImageDetailOptions{}, "image-list-project", "List image members", func(s *mcclient.ClientSession, args *ImageDetailOptions) error {
|
||||
imgId, e := modules.Images.GetId(s, args.ID, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
result, e := modules.Images.ListMemberProjects(s, imgId)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printList(result, modules.Projects.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type ImageCancelDeleteOptions struct {
|
||||
ID string `help:"Image id or name" metavar:"IMAGE"`
|
||||
}
|
||||
@@ -394,12 +416,14 @@ func init() {
|
||||
|
||||
type ImagePublicOptions struct {
|
||||
ID []string `help:"ID or name of image" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain|project"`
|
||||
SharedProjects []string `help:"Share to projects"`
|
||||
SharedDomains []string `help:"Share to domains"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
ShareToProject []string `help:"Share to prject"`
|
||||
}
|
||||
R(&ImagePublicOptions{}, "image-public", "Make a image public", func(s *mcclient.ClientSession, args *ImagePublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.ID) == 0 {
|
||||
return fmt.Errorf("No image ID provided")
|
||||
} else if len(args.ID) == 1 {
|
||||
|
||||
@@ -68,7 +68,7 @@ func init() {
|
||||
type HistoricProcessInstanceStaticticsOptions struct {
|
||||
ID string `help:"ID of user"`
|
||||
}
|
||||
R(&HistoricProcessInstanceStaticticsOptions{}, "historic-process-instance-statistics", "Show statistics for historic process instance", func(s *mcclient.ClientSession, args *HistoricProcessInstanceStaticticsOptions) error {
|
||||
R(&HistoricProcessInstanceStaticticsOptions{}, "historic-process-instance-statistics", "Delete all contacts for the user", func(s *mcclient.ClientSession, args *HistoricProcessInstanceStaticticsOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.ID), "user_id")
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ func init() {
|
||||
printList(result, modules.LoadbalancerClusters.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerClusterDeleteOptions{}, "lbcluster-delete", "Delete lbcluster", func(s *mcclient.ClientSession, opts *options.LoadbalancerClusterDeleteOptions) error {
|
||||
R(&options.LoadbalancerClusterDeleteOptions{}, "lbcluster-delete", "Show lbcluster", func(s *mcclient.ClientSession, opts *options.LoadbalancerClusterDeleteOptions) error {
|
||||
lbagent, err := modules.LoadbalancerClusters.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -99,13 +99,4 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.LoadbalancerGetOptions{}, "lb-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *options.LoadbalancerGetOptions) error {
|
||||
result, err := modules.Loadbalancers.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
@@ -44,12 +43,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
listResult := modulebase.ListResult{}
|
||||
err = result.Unmarshal(&listResult)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(&listResult, []string{})
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 monitor
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
|
||||
)
|
||||
|
||||
func init() {
|
||||
aN := cmdN("suggestsysalert")
|
||||
R(&options.SuggestSysAlertListOptions{}, aN("list"), "List all suggestsysrules",
|
||||
func(s *mcclient.ClientSession, args *options.SuggestSysAlertListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.Type) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Type), "type")
|
||||
}
|
||||
ret, err := monitor.SuggestSysAlertManager.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(ret, monitor.SuggestSysAlertManager.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SSuggestAlertShowOptions{}, aN("show"), "Show details of a alert rule",
|
||||
func(s *mcclient.ClientSession, args *options.SSuggestAlertShowOptions) error {
|
||||
ret, err := monitor.SuggestSysAlertManager.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
|
||||
)
|
||||
|
||||
func init() {
|
||||
aN := cmdN("suggestsysrule")
|
||||
R(&options.SuggestRuleListOptions{}, aN("list"), "List all suggestsysrules",
|
||||
func(s *mcclient.ClientSession, args *options.SuggestRuleListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.SuggestSysRuleManager.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(ret, monitor.SuggestSysRuleManager.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SuggestRuleCreateOptions{}, aN("create"), "Create suggestsys rule",
|
||||
func(s *mcclient.ClientSession, args *options.SuggestRuleCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.SuggestSysRuleManager.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SuggestRuleShowOptions{}, aN("show"), "Show details of a alert rule",
|
||||
func(s *mcclient.ClientSession, args *options.SuggestRuleShowOptions) error {
|
||||
ret, err := monitor.SuggestSysRuleManager.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SuggestRuleUpdateOptions{}, aN("update"), "Update a alert rule",
|
||||
func(s *mcclient.ClientSession, args *options.SuggestRuleUpdateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.SuggestSysRuleManager.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SuggestRuleDeleteOptions{}, aN("delete"), "Delete alerts",
|
||||
func(s *mcclient.ClientSession, args *options.SuggestRuleDeleteOptions) error {
|
||||
ret := monitor.SuggestSysRuleManager.BatchDelete(s, args.ID, nil)
|
||||
printBatchResults(ret, monitor.SuggestSysRuleManager.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -35,7 +35,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.NatGatewayIdOptions{}, "natgateway-show", "Show a NAT gateway", func(s *mcclient.ClientSession, args *options.NatGatewayIdOptions) error {
|
||||
R(&options.NatGatewayShowOptions{}, "natgateway-show", "Show a NAT gateway", func(s *mcclient.ClientSession, args *options.NatGatewayShowOptions) error {
|
||||
results, err := modules.NatGateways.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -44,15 +44,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.NatGatewayIdOptions{}, "natgateway-syncstatus", "Sync NAT gateway status", func(s *mcclient.ClientSession, args *options.NatGatewayIdOptions) error {
|
||||
result, err := modules.NatGateways.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NatGatewayListEipOptions struct {
|
||||
ID string `help:"ID"`
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ func init() {
|
||||
City string `help:"search networks belongs to a city"`
|
||||
Usable *bool `help:"search usable networks"`
|
||||
ServerType string `help:"search networks belongs to a ServerType" choices:"guest|baremetal|container|pxe|ipmi"`
|
||||
Schedtag string `help:"filter networks by schedtag"`
|
||||
|
||||
Status string `help:"filter by network status"`
|
||||
}
|
||||
@@ -56,11 +55,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(opts.ExportFile) > 0 {
|
||||
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.Networks.GetColumns(s))
|
||||
} else {
|
||||
printList(result, modules.Networks.GetColumns(s))
|
||||
}
|
||||
printList(result, modules.Networks.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -144,10 +139,10 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkIdOptions struct {
|
||||
type NetworkShowOptions struct {
|
||||
ID string `help:"ID or Name of the zone to show"`
|
||||
}
|
||||
R(&NetworkIdOptions{}, "network-show", "Show network details", func(s *mcclient.ClientSession, args *NetworkIdOptions) error {
|
||||
R(&NetworkShowOptions{}, "network-show", "Show network details", func(s *mcclient.ClientSession, args *NetworkShowOptions) error {
|
||||
result, err := modules.Networks.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -156,7 +151,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&NetworkIdOptions{}, "network-metadata", "Show metadata of a network", func(s *mcclient.ClientSession, args *NetworkIdOptions) error {
|
||||
R(&NetworkShowOptions{}, "network-metadata", "Show metadata of a network", func(s *mcclient.ClientSession, args *NetworkShowOptions) error {
|
||||
result, err := modules.Networks.GetMetadata(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -165,7 +160,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&NetworkIdOptions{}, "network-private", "Make a network private", func(s *mcclient.ClientSession, args *NetworkIdOptions) error {
|
||||
R(&NetworkShowOptions{}, "network-private", "Make a network private", func(s *mcclient.ClientSession, args *NetworkShowOptions) error {
|
||||
result, err := modules.Networks.PerformAction(s, args.ID, "private", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -174,23 +169,16 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&NetworkIdOptions{}, "network-syncstatus", "Sync network status", func(s *mcclient.ClientSession, args *NetworkIdOptions) error {
|
||||
result, err := modules.Networks.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
type NetworkShareOptions struct {
|
||||
NetworkShowOptions
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
ShareToProject []string `help:"Share to prject"`
|
||||
}
|
||||
R(&NetworkShareOptions{}, "network-public", "Make a network public", func(s *mcclient.ClientSession, args *NetworkShareOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkShareOptions struct {
|
||||
NetworkIdOptions
|
||||
Scope string `help:"sharing scope" choices:"system|domain|project"`
|
||||
SharedProjects []string `help:"Share to prjects"`
|
||||
SharedDomains []string `help:"share to domains"`
|
||||
}
|
||||
R(&NetworkShareOptions{}, "network-public", "Make a network public", func(s *mcclient.ClientSession, args *NetworkShareOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Networks.PerformAction(s, args.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -199,7 +187,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&NetworkIdOptions{}, "network-delete", "Delete a network", func(s *mcclient.ClientSession, args *NetworkIdOptions) error {
|
||||
R(&NetworkShowOptions{}, "network-delete", "Delete a network", func(s *mcclient.ClientSession, args *NetworkShowOptions) error {
|
||||
result, err := modules.Networks.Delete(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -208,7 +196,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&NetworkIdOptions{}, "network-purge", "Purge a managed network, not delete the remote entity", func(s *mcclient.ClientSession, args *NetworkIdOptions) error {
|
||||
R(&NetworkShowOptions{}, "network-purge", "Purge a managed network, not delete the remote entity", func(s *mcclient.ClientSession, args *NetworkShowOptions) error {
|
||||
result, err := modules.Networks.PerformAction(s, args.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -401,30 +389,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&NetworkIdOptions{}, "network-change-owner-candidate-domains", "Show candiate domains of a network for changing owner", func(s *mcclient.ClientSession, args *NetworkIdOptions) error {
|
||||
result, err := modules.Networks.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkChangeOwnerOptions struct {
|
||||
ID string `help:"Network to change owner" json:"-"`
|
||||
PROJECT string `help:"Project ID or change" json:"tenant"`
|
||||
}
|
||||
R(&NetworkChangeOwnerOptions{}, "network-change-owner", "Change owner project of a network", func(s *mcclient.ClientSession, args *NetworkChangeOwnerOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
net, err := modules.Networks.PerformAction(s, args.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(net)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ func init() {
|
||||
NAME string `help:"The name of parameter"`
|
||||
}
|
||||
|
||||
R(&ParametersDeleteOptions{}, "parameter-delete", "delete parameter", func(s *mcclient.ClientSession, args *ParametersDeleteOptions) error {
|
||||
R(&ParametersDeleteOptions{}, "parameter-delete", "delete notice", func(s *mcclient.ClientSession, args *ParametersDeleteOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
|
||||
var parameter jsonutils.JSONObject
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
@@ -137,14 +136,11 @@ func init() {
|
||||
R(&PolicyPatchOptions{}, "policy-patch", "Patch policy", updateFunc)
|
||||
R(&PolicyPatchOptions{}, "policy-update", "Update policy", updateFunc)
|
||||
|
||||
type PolicyPublicOptions struct {
|
||||
ID string `help:"ID of policy to update" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
SharedDomains []string `help:"share to domains"`
|
||||
type PolicyPerformOptions struct {
|
||||
ID string `help:"ID of policy to update"`
|
||||
}
|
||||
R(&PolicyPublicOptions{}, "policy-public", "Mark a policy public", func(s *mcclient.ClientSession, args *PolicyPublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Policies.PerformAction(s, args.ID, "public", params)
|
||||
R(&PolicyPerformOptions{}, "policy-public", "Mark a policy public", func(s *mcclient.ClientSession, args *PolicyPerformOptions) error {
|
||||
result, err := modules.Policies.PerformAction(s, args.ID, "public", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -152,10 +148,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type PolicyPrivateOptions struct {
|
||||
ID string `help:"ID of policy to update" json:"-"`
|
||||
}
|
||||
R(&PolicyPrivateOptions{}, "policy-private", "Mark a policy private", func(s *mcclient.ClientSession, args *PolicyPrivateOptions) error {
|
||||
R(&PolicyPerformOptions{}, "policy-private", "Mark a policy private", func(s *mcclient.ClientSession, args *PolicyPerformOptions) error {
|
||||
result, err := modules.Policies.PerformAction(s, args.ID, "private", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -191,7 +184,11 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
yaml, err := result.GetString("policy")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(yaml)
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -383,7 +380,7 @@ func init() {
|
||||
token = s.GetToken()
|
||||
}
|
||||
|
||||
result, err := policy.ExplainRpc(context.Background(), token, req, args.Name)
|
||||
result, err := policy.PolicyManager.ExplainRpc(token, req, args.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type PolicyListOptions struct {
|
||||
options.BaseListOptions
|
||||
Policydefinition string `help:"filter by policydefinition"`
|
||||
}
|
||||
R(&PolicyListOptions{}, "policy-assignment-list", "List policy assignments", func(s *mcclient.ClientSession, args *PolicyListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.Policydefinition) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Policydefinition), "policydefinition")
|
||||
}
|
||||
result, err := modules.PolicyAssignment.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.PolicyAssignment.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type PolicyIdOptions struct {
|
||||
ID string `help:"policy assignment id or name"`
|
||||
}
|
||||
|
||||
R(&PolicyIdOptions{}, "policy-assignment-show", "Show policy assignment details", func(s *mcclient.ClientSession, args *PolicyIdOptions) error {
|
||||
result, err := modules.PolicyAssignment.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
|
||||
})
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type PolicyListOptions struct {
|
||||
options.BaseListOptions
|
||||
}
|
||||
R(&PolicyListOptions{}, "policy-definition-list", "List policy definitions", func(s *mcclient.ClientSession, args *PolicyListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.PolicyDefinition.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.PolicyDefinition.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type PolicyIdOptions struct {
|
||||
ID string `help:"policy definition name or id"`
|
||||
}
|
||||
|
||||
R(&PolicyIdOptions{}, "policy-definition-show", "Show policy definition", func(s *mcclient.ClientSession, args *PolicyIdOptions) error {
|
||||
result, err := modules.PolicyDefinition.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&PolicyIdOptions{}, "policy-definition-syncstatus", "Sync policy definition status", func(s *mcclient.ClientSession, args *PolicyIdOptions) error {
|
||||
result, err := modules.PolicyDefinition.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -82,12 +82,11 @@ func init() {
|
||||
})
|
||||
|
||||
type ProjectCreateOptions struct {
|
||||
NAME string `help:"Name of new project"`
|
||||
Displayname string `help:"display name"`
|
||||
Domain string `help:"Domain"`
|
||||
Desc string `help:"Description"`
|
||||
Enabled bool `help:"Project is enabled"`
|
||||
Disabled bool `help:"Project is disabled"`
|
||||
NAME string `help:"Name of new project"`
|
||||
Domain string `help:"Domain"`
|
||||
Desc string `help:"Description"`
|
||||
Enabled bool `help:"Project is enabled"`
|
||||
Disabled bool `help:"Project is disabled"`
|
||||
}
|
||||
R(&ProjectCreateOptions{}, "project-create", "Create a project", func(s *mcclient.ClientSession, args *ProjectCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -107,9 +106,6 @@ func init() {
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if len(args.Displayname) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Displayname), "displayname")
|
||||
}
|
||||
result, err := modules.Projects.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
@@ -80,22 +78,4 @@ func init() {
|
||||
printObject(proxysetting)
|
||||
return nil
|
||||
})
|
||||
R(&options.ProxySettingPublicOptions{}, "proxysetting-public", "Make proxysetting public", func(s *mcclient.ClientSession, opts *options.ProxySettingPublicOptions) error {
|
||||
params := jsonutils.Marshal(opts)
|
||||
result, err := modules.ProxySettings.PerformAction(s, opts.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
R(&options.ProxySettingPrivateOptions{}, "proxysetting-private", "Make proxysetting private", func(s *mcclient.ClientSession, opts *options.ProxySettingPrivateOptions) error {
|
||||
params := jsonutils.Marshal(opts)
|
||||
result, err := modules.ProxySettings.PerformAction(s, opts.ID, "private", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -94,25 +94,6 @@ type ImageQuotaOptions struct {
|
||||
Image int64 `help:"Template count" json:"image,omitzero"`
|
||||
}
|
||||
|
||||
type DomainQuotaOptions struct {
|
||||
Cloudaccount int64 `help:"cloudaccount count" json:"cloudaccount,omitzero"`
|
||||
}
|
||||
|
||||
type InfrasQuotaOptions struct {
|
||||
RegionQuotaKeys
|
||||
|
||||
Host int64 `help:"host count" json:"host,omitzero"`
|
||||
Vpc int64 `help:"vpc count" json:"vpc,omitzero"`
|
||||
}
|
||||
|
||||
type IdentityQuotaOptions struct {
|
||||
User int64 `help:"user count" json:"user,omitzero"`
|
||||
Group int64 `help:"group count" json:"group,omitzero"`
|
||||
Project int64 `help:"project count" json:"project,omitzero"`
|
||||
Role int64 `help:"role count" json:"role,omitzero"`
|
||||
Policy int64 `help:"policy count" json:"policy,omitzero"`
|
||||
}
|
||||
|
||||
type QuotaSetBaseOptions struct {
|
||||
Project string `help:"Tenant name or ID to set quota" json:"tenant,omitempty"`
|
||||
Domain string `help:"Domain name or ID to set quota" json:"domain,omitempty"`
|
||||
@@ -186,33 +167,6 @@ func init() {
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "domain-quota", "Show domain-quota for current domain", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.DomainQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "infras-quota", "Show infras-quota for current domain", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.InfrasQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "identity-quota", "Show identity-quota for current domain", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.IdentityQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ComputeQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
@@ -284,48 +238,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type DomainQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
DomainQuotaOptions
|
||||
}
|
||||
R(&DomainQuotaSetOptions{}, "domain-quota-set", "Set domain quota for domain", func(s *mcclient.ClientSession, args *DomainQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, e := modules.DomainQuotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type InfrasQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
InfrasQuotaOptions
|
||||
}
|
||||
R(&InfrasQuotaSetOptions{}, "infras-quota-set", "Set infrastructure quota for domain", func(s *mcclient.ClientSession, args *InfrasQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, e := modules.InfrasQuotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type IdentityQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
IdentityQuotaOptions
|
||||
}
|
||||
R(&IdentityQuotaSetOptions{}, "identity-quota-set", "Set identity quota for domain", func(s *mcclient.ClientSession, args *InfrasQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, e := modules.IdentityQuotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type QuotaListOptions struct {
|
||||
ProjectDomain string `help:"domain name or ID to query project quotas"`
|
||||
Refresh bool `help:"refresh" json:"refresh,omitfalse"`
|
||||
@@ -381,36 +293,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&QuotaListOptions{}, "domain-quota-list", "List domain quota of domains", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.DomainQuotas.GetQuotaList(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&QuotaListOptions{}, "infras-quota-list", "List infrastructure quota of domains", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.InfrasQuotas.GetQuotaList(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&QuotaListOptions{}, "identity-quota-list", "List identity quota of domains", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.IdentityQuotas.GetQuotaList(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CleanPendingUsageOptions struct {
|
||||
Scope string `help:"scope" choices:"domain|project"`
|
||||
Project string `help:"Tenant name or ID" json:"tenant"`
|
||||
@@ -461,30 +343,4 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CleanPendingUsageOptions{}, "clean-domain-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.DomainQuotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CleanPendingUsageOptions{}, "clean-infras-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.InfrasQuotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CleanPendingUsageOptions{}, "clean-identity-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.IdentityQuotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -85,8 +85,6 @@ func init() {
|
||||
NAME string `help:"Role name"`
|
||||
Domain string `help:"Domain"`
|
||||
Desc string `help:"Description"`
|
||||
|
||||
PublicScope string `help:"public scope" choices:"none|system"`
|
||||
}
|
||||
R(&RoleCreateOptions{}, "role-create", "Create a new role", func(s *mcclient.ClientSession, args *RoleCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -101,9 +99,6 @@ func init() {
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if len(args.PublicScope) > 0 {
|
||||
params.Add(jsonutils.NewString(args.PublicScope), "public_scope")
|
||||
}
|
||||
role, err := modules.RolesV3.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -121,7 +121,7 @@ func init() {
|
||||
printObjectRecursive(routetable)
|
||||
return nil
|
||||
})
|
||||
R(&options.RouteTableDeleteOptions{}, "routetable-delete", "Delete routetable", func(s *mcclient.ClientSession, opts *options.RouteTableDeleteOptions) error {
|
||||
R(&options.RouteTableDeleteOptions{}, "routetable-delete", "Show routetable", func(s *mcclient.ClientSession, opts *options.RouteTableDeleteOptions) error {
|
||||
routetable, err := modules.RouteTables.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type ScalingActivityListOptions struct {
|
||||
options.BaseListOptions
|
||||
}
|
||||
R(&ScalingActivityListOptions{}, "scaling-activity-list", "List Scaling Activity",
|
||||
func(s *mcclient.ClientSession, args *ScalingActivityListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
list, err := modules.ScalingActivity.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(list, modules.ScalingActivity.GetColumns(s))
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type ScalingGroupListOptions struct {
|
||||
options.BaseListOptions
|
||||
Hypervisor string `help:"Hypervisor"`
|
||||
Cloudregion string `help:"Cloudregion"`
|
||||
Network string `help:"network"`
|
||||
}
|
||||
R(&ScalingGroupListOptions{}, "scaling-group-list", "List scaling group", func(s *mcclient.ClientSession, args *ScalingGroupListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ScalingGroup.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.ScalingGroup.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type ScalingGroupShowOptions struct {
|
||||
ID string
|
||||
}
|
||||
R(&ScalingGroupShowOptions{}, "scaling-group-show", "Show scaling group", func(s *mcclient.ClientSession,
|
||||
args *ScalingGroupShowOptions) error {
|
||||
result, err := modules.ScalingGroup.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ScalingGroupCreateOptions struct {
|
||||
NAME string
|
||||
|
||||
Hypervisor string
|
||||
Cloudregion string
|
||||
Network string
|
||||
GuestTemplate string
|
||||
MinInstanceNumber string
|
||||
MaxInstanceNumber string
|
||||
DesireInstanceNumber string
|
||||
Loadbalance string
|
||||
}
|
||||
R(&ScalingGroupCreateOptions{}, "scaling-group-create", "Create scaling group", func(s *mcclient.ClientSession, args *ScalingGroupCreateOptions) error {
|
||||
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
|
||||
scalingGroup, err := modules.ScalingGroup.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(scalingGroup)
|
||||
return nil
|
||||
})
|
||||
type ScalingGroupDeleteOptions struct {
|
||||
ID string `help:"ScalingGroup ID or Name"`
|
||||
}
|
||||
R(&ScalingGroupDeleteOptions{}, "scaling-group-delete", "Delete Scaling Group", func(s *mcclient.ClientSession,
|
||||
args *ScalingGroupDeleteOptions) error {
|
||||
scalingGroup, err := modules.ScalingGroup.Delete(s, args.ID, jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(scalingGroup)
|
||||
return nil
|
||||
})
|
||||
type ScalingGroupListInstanceOptions struct {
|
||||
ID string `help:"ScalingGroup ID or Name"`
|
||||
}
|
||||
R(&ScalingGroupListInstanceOptions{}, "scaling-group-list-instance", "List all instance of Scaling Group",
|
||||
func(s *mcclient.ClientSession, args *ScalingGroupListInstanceOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("scaling_group", jsonutils.NewString(args.ID))
|
||||
servers, err := modules.Servers.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(servers, modules.Servers.GetColumns(s))
|
||||
return nil
|
||||
},
|
||||
)
|
||||
type ScalingGroupRemoveInstanceOptions struct {
|
||||
ID string `help:"ScalingGroup ID or Name"`
|
||||
SERVER string `help:"Server ID or Name"`
|
||||
Delete bool `help:"If delete the server"`
|
||||
}
|
||||
R(&ScalingGroupRemoveInstanceOptions{}, "scaling-group-remove-instance", "Remove instance of ScalingGroup",
|
||||
func(s *mcclient.ClientSession, args *ScalingGroupRemoveInstanceOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("scaling_group", jsonutils.NewString(args.ID))
|
||||
params.Set("delete_server", jsonutils.NewBool(args.Delete))
|
||||
server, err := modules.Servers.PerformAction(s, args.SERVER, "detach-scaling-group", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(server)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
type ScalingGroupEnableOptions struct {
|
||||
ID string `help:"ScalingGroup ID or Name"`
|
||||
}
|
||||
R(&ScalingGroupEnableOptions{}, "scaling-group-enable", "Enable ScalingGroup", func(s *mcclient.ClientSession,
|
||||
args *ScalingGroupEnableOptions) error {
|
||||
ret, err := modules.ScalingGroup.PerformAction(s, args.ID, "enable", jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ScalingGroupEnableOptions{}, "scaling-group-disable", "Disable ScalingGroup", func(s *mcclient.ClientSession,
|
||||
args *ScalingGroupEnableOptions) error {
|
||||
ret, err := modules.ScalingGroup.PerformAction(s, args.ID, "disable", jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type ScalingPolicyListOptions struct {
|
||||
options.BaseListOptions
|
||||
ScalingGroup string `help:"ScalingGroup ID or Name"`
|
||||
TriggerType string `help:"Trigger type" choices:"alarm|timing|cycle"`
|
||||
}
|
||||
R(&ScalingPolicyListOptions{}, "scaling-policy-list", "List Scaling Policy", func(s *mcclient.ClientSession,
|
||||
args *ScalingPolicyListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
policies, err := modules.ScalingPolicy.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(policies, modules.ScalingPolicy.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type ScalingPolicyShowOptions struct {
|
||||
ID string `help:"ScalingPolicy ID or Name"`
|
||||
}
|
||||
R(&ScalingPolicyShowOptions{}, "scaling-policy-show", "Show Scaling Policy", func(s *mcclient.ClientSession,
|
||||
args *ScalingPolicyShowOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("details", jsonutils.JSONTrue)
|
||||
policy, err := modules.ScalingPolicy.Get(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(policy)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ScalingTimer struct {
|
||||
TimingExecTime time.Time `help:"Exectime for 'timing' type trigger" json:"exec_time"`
|
||||
}
|
||||
|
||||
type ScalingCycleTimer struct {
|
||||
CycleCycleType string `help:"Cycle type for 'cycle' type trigger" json:"cycle_type"`
|
||||
CycleMinute int `help:"Minute of 'cycle' type trigger" json:"minute"`
|
||||
CycleHour int `help:"Hour of 'cycle' type trigger" json:"hour"`
|
||||
CycleWeekdays []int `help:"Weekdays for 'cycle' type trigger" json:"weekdays"`
|
||||
CycleMonthDays []int `help:"Month days for 'cycle' type trigger" json:"month_days"`
|
||||
CycleStartTime time.Time `help:"Start time for 'cycle' type trigger" json:"start_time"`
|
||||
CycleEndTime time.Time `help:"End time for 'cycle' type trigger" json:"end_time"`
|
||||
}
|
||||
|
||||
type ScalingAlarm struct {
|
||||
AlarmCumulate int `help:"Cumulate times alarm will trigger, for 'alarm' trigger" json:"cumulate"`
|
||||
AlarmCycle int `help:"Monitoring cycle for indicators, for 'alarm' trigger" json:"cycle"`
|
||||
AlarmIndicator string `help:"Indicator for 'alarm' trigger" json:"indicator"`
|
||||
AlarmWrapper string `help:"Wrapper for Indicators" choices:"max|min|average" json:"wrapper"`
|
||||
AlarmOperator string `help:"Operator between Indicator and Operator" json:"operator"`
|
||||
AlarmValue float64 `help:"Value of Indicator" json:"value"`
|
||||
}
|
||||
|
||||
type ScalingPolicyCreateOptions struct {
|
||||
NAME string `help:"ScalingPolicy Name" json:"name"`
|
||||
ScalingGroup string `help:"ScalingGroup ID or Name" json:"scaling_group"`
|
||||
TriggerType string `help:"Trigger type" choices:"alarm|timing|cycle" json:"trigger_type"`
|
||||
|
||||
ScalingTimer
|
||||
ScalingCycleTimer
|
||||
ScalingAlarm
|
||||
|
||||
Action string `help:"Action for scaling policy" choices:"add|remove|set" json:"action"`
|
||||
Number int `help:"Instance number for action" json:"number"`
|
||||
Unit string `help:"Unit for Number" choices:"s|%" json:"unit"`
|
||||
CoolingTime int `help:"Cooling time, unit: s" json:"cooling_time"`
|
||||
}
|
||||
|
||||
R(&ScalingPolicyCreateOptions{}, "scaling-policy-create", "Create Scaling Policy",
|
||||
func(s *mcclient.ClientSession, args *ScalingPolicyCreateOptions) error {
|
||||
spCreateInput := api.ScalingPolicyCreateInput{
|
||||
ScalingGroup: args.ScalingGroup,
|
||||
TriggerType: args.TriggerType,
|
||||
Timer: api.ScalingTimerCreateInput{
|
||||
args.TimingExecTime,
|
||||
},
|
||||
CycleTimer: api.ScalingCycleTimerCreateInput{
|
||||
CycleType: args.CycleCycleType,
|
||||
Minute: args.CycleMinute,
|
||||
Hour: args.CycleHour,
|
||||
WeekDays: args.CycleWeekdays,
|
||||
MonthDays: args.CycleMonthDays,
|
||||
StartTime: args.CycleStartTime,
|
||||
EndTime: args.CycleEndTime,
|
||||
},
|
||||
Alarm: api.ScalingAlarmCreateInput{
|
||||
Cumulate: args.AlarmCumulate,
|
||||
Cycle: args.AlarmCycle,
|
||||
Indicator: args.AlarmIndicator,
|
||||
Wrapper: args.AlarmWrapper,
|
||||
Operator: args.AlarmOperator,
|
||||
Value: args.AlarmValue,
|
||||
},
|
||||
Action: args.Action,
|
||||
Number: args.Number,
|
||||
Unit: args.Unit,
|
||||
CoolingTime: args.CoolingTime,
|
||||
}
|
||||
spCreateInput.Name = args.NAME
|
||||
ret, err := modules.ScalingPolicy.Create(s, jsonutils.Marshal(spCreateInput))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type ScalingPolicyEnableOptions struct {
|
||||
ID string `help:"ScalingPolicy ID or Name"`
|
||||
}
|
||||
R(&ScalingPolicyEnableOptions{}, "scaling-policy-enable", "Enable ScalingPolicy", func(s *mcclient.ClientSession,
|
||||
args *ScalingPolicyEnableOptions) error {
|
||||
ret, err := modules.ScalingPolicy.PerformAction(s, args.ID, "enable", jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ScalingPolicyEnableOptions{}, "scaling-policy-disable", "Disable ScalingPolicy",
|
||||
func(s *mcclient.ClientSession, args *ScalingPolicyEnableOptions) error {
|
||||
ret, err := modules.ScalingPolicy.PerformAction(s, args.ID, "disable", jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type ScalingPolicyTriggerOptions struct {
|
||||
ID string `help:"ScalingPolicy ID or Name"`
|
||||
}
|
||||
R(&ScalingPolicyTriggerOptions{}, "scaling-policy-trigger", "Trigger ScalingPolicy's action",
|
||||
func(s *mcclient.ClientSession, args *ScalingPolicyTriggerOptions) error {
|
||||
ret, err := modules.ScalingPolicy.PerformAction(s, args.ID, "trigger", jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type ScalingPolicyDeleteOptions struct {
|
||||
ID string `help:"ScalingPolicy ID or Name"`
|
||||
}
|
||||
R(&ScalingPolicyDeleteOptions{}, "scaling-policy-delete", "Delete SclaingPolicy",
|
||||
func(s *mcclient.ClientSession, args *ScalingPolicyDeleteOptions) error {
|
||||
ret, err := modules.ScalingPolicy.Delete(s, args.ID, jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -25,20 +25,33 @@ import (
|
||||
func init() {
|
||||
type SecGroupRulesListOptions struct {
|
||||
options.BaseListOptions
|
||||
Secgroup string `help:"Secgroup ID or Name"`
|
||||
SecgroupName string `help:"Search rules by fuzzy secgroup name"`
|
||||
Projects []string `help:"Filter rules by project"`
|
||||
Direction string `help:"filter Direction of rule" choices:"in|out"`
|
||||
Protocol string `help:"filter Protocol of rule" choices:"any|tcp|udp|icmp"`
|
||||
Action string `help:"filter Actin of rule" choices:"allow|deny"`
|
||||
Ports string `help:"filter Ports of rule"`
|
||||
Ip string `help:"filter cidr of rule"`
|
||||
Secgroup string `help:"Secgroup ID or Name"`
|
||||
Direction string `help:"filter Direction of rule" choices:"in|out"`
|
||||
Protocol string `help:"filter Protocol of rule" choices:"any|tcp|udp|icmp"`
|
||||
Action string `help:"filter Actin of rule" choices:"allow|deny"`
|
||||
}
|
||||
|
||||
R(&SecGroupRulesListOptions{}, "secgroup-rule-list", "List all security group", func(s *mcclient.ClientSession, args *SecGroupRulesListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
if len(args.Secgroup) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Secgroup), "secgroup")
|
||||
}
|
||||
if len(args.Direction) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Direction), "direction")
|
||||
}
|
||||
if len(args.Protocol) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Protocol), "protocol")
|
||||
}
|
||||
if len(args.Action) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Action), "action")
|
||||
}
|
||||
result, err := modules.SecGroupRules.List(s, params)
|
||||
if err != nil {
|
||||
@@ -60,7 +73,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&SecGroupRuleDetailOptions{}, "secgroup-rule-delete", "Delete a secgroup rule", func(s *mcclient.ClientSession, args *SecGroupRuleDetailOptions) error {
|
||||
R(&SecGroupRuleDetailOptions{}, "secgroup-rule-delete", "Delete a disk", func(s *mcclient.ClientSession, args *SecGroupRuleDetailOptions) error {
|
||||
if rule, e := modules.SecGroupRules.Delete(s, args.ID, nil); e != nil {
|
||||
return e
|
||||
} else {
|
||||
|
||||
@@ -29,15 +29,23 @@ func init() {
|
||||
Equals string `help:"Secgroup ID or Name, filter secgroups whose rules equals the specified one"`
|
||||
Server string `help:"Filter secgroups bound to specified server"`
|
||||
options.BaseListOptions
|
||||
Ip string `help:"Filter secgroup by ip"`
|
||||
Ports string `help:"Filter secgroup by ports"`
|
||||
Direction string `help:"Filter secgroup by ports" choices:"all|in|out"`
|
||||
}
|
||||
|
||||
R(&SecGroupsListOptions{}, "secgroup-list", "List all security group", func(s *mcclient.ClientSession, args *SecGroupsListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
if len(args.Equals) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Equals), "equals")
|
||||
}
|
||||
if len(args.Server) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Server), "server")
|
||||
}
|
||||
result, err := modules.SecGroups.List(s, params)
|
||||
if err != nil {
|
||||
|
||||
@@ -1146,7 +1146,6 @@ func init() {
|
||||
ID string `help:"ID or name of VM"`
|
||||
DisableIsaSerial string `help:"disable isa serial device" choices:"true|false"`
|
||||
DisablePvpanic string `help:"disable pvpanic device" choices:"true|false"`
|
||||
DisableUsbKbd string `help:"disable usb kbd" choices:"true|false"`
|
||||
}
|
||||
|
||||
R(&ServerQemuParams{}, "server-set-qemu-params", "config qemu params", func(s *mcclient.ClientSession,
|
||||
@@ -1158,9 +1157,6 @@ func init() {
|
||||
if len(opts.DisablePvpanic) > 0 {
|
||||
params.Set("disable_pvpanic", jsonutils.NewString(opts.DisablePvpanic))
|
||||
}
|
||||
if len(opts.DisableUsbKbd) > 0 {
|
||||
params.Set("disable_usb_kbd", jsonutils.NewString(opts.DisableUsbKbd))
|
||||
}
|
||||
result, err := modules.Servers.PerformAction(s, opts.ID, "set-qemu-params", params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1310,58 +1306,4 @@ func init() {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerPublicipToEip struct {
|
||||
ID string `help:"ID or name of VM" json:"-"`
|
||||
AutoStart bool `help:"Auto start new guest"`
|
||||
}
|
||||
|
||||
R(&ServerPublicipToEip{}, "server-publicip-to-eip", "Convert PublicIp to Eip for server", func(s *mcclient.ClientSession, opts *ServerPublicipToEip) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("auto_start", jsonutils.NewBool(opts.AutoStart))
|
||||
result, err := modules.Servers.PerformAction(s, opts.ID, "publicip-to-eip", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSetAutoRenew struct {
|
||||
ID string `help:"ID or name of VM" json:"-"`
|
||||
AutoRenew bool `help:"Set server auto renew or manual renew"`
|
||||
}
|
||||
|
||||
R(&ServerSetAutoRenew{}, "server-set-auto-renew", "Set autorenew for server", func(s *mcclient.ClientSession, opts *ServerSetAutoRenew) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("auto_renew", jsonutils.NewBool(opts.AutoRenew))
|
||||
result, err := modules.Servers.PerformAction(s, opts.ID, "set-auto-renew", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerConvertToKvmOptions{}, "server-convert-to-kvm", "Convert esxi server to kvm", func(s *mcclient.ClientSession, opts *options.ServerConvertToKvmOptions) error {
|
||||
params := jsonutils.Marshal(opts)
|
||||
dict := params.(*jsonutils.JSONDict)
|
||||
dict.Set("target_hypervisor", jsonutils.NewString("kvm"))
|
||||
result, err := modules.Servers.PerformAction(s, opts.ID, "convert", dict)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerShowOptions{}, "server-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *options.ServerShowOptions) error {
|
||||
result, err := modules.Servers.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type ServerSecgroupListOptions struct {
|
||||
options.BaseListOptions
|
||||
Server string `help:"ID or Name of Server"`
|
||||
Secgroup string `help:"Secgroup ID or name"`
|
||||
}
|
||||
R(&ServerSecgroupListOptions{}, "server-secgroup-list", "List server secgroup pairs", func(s *mcclient.ClientSession, args *ServerSecgroupListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
var result *modulebase.ListResult
|
||||
var err error
|
||||
if len(args.Server) > 0 {
|
||||
result, err = modules.Serversecgroups.ListDescendent(s, args.Server, params)
|
||||
} else if len(args.Secgroup) > 0 {
|
||||
result, err = modules.Serversecgroups.ListDescendent2(s, args.Secgroup, params)
|
||||
} else {
|
||||
result, err = modules.Serversecgroups.List(s, params)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Serversecgroups.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSecgroupDetailOptions struct {
|
||||
SERVER string `help:"ID or Name of Server"`
|
||||
SECGROUP string `help:"ID or Name of Security Group"`
|
||||
}
|
||||
R(&ServerSecgroupDetailOptions{}, "server-secgroup-show", "Show server security group details", func(s *mcclient.ClientSession, args *ServerSecgroupDetailOptions) error {
|
||||
query := jsonutils.NewDict()
|
||||
result, err := modules.Serversecgroups.Get(s, args.SERVER, args.SECGROUP, query)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
R(&options.ServiceCertificateCreateOptions{}, "service-cert-create", "Create service cert", func(s *mcclient.ClientSession, opts *options.ServiceCertificateCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cert, err := modules.ServiceCertificatesV3.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(cert)
|
||||
return nil
|
||||
})
|
||||
type ServiceCertificateGetOptions struct {
|
||||
ID string `json:"-"`
|
||||
}
|
||||
R(&ServiceCertificateGetOptions{}, "service-cert-show", "Show service cert", func(s *mcclient.ClientSession, opts *ServiceCertificateGetOptions) error {
|
||||
cert, err := modules.ServiceCertificatesV3.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(cert)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServiceCertificateListOptions struct {
|
||||
options.BaseListOptions
|
||||
}
|
||||
R(&ServiceCertificateListOptions{}, "service-cert-list", "List service certs", func(s *mcclient.ClientSession, opts *ServiceCertificateListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ServiceCertificatesV3.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.ServiceCertificatesV3.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
type ServiceCertificateDeleteOptions struct {
|
||||
ID string `json:"-"`
|
||||
}
|
||||
R(&ServiceCertificateDeleteOptions{}, "service-cert-delete", "Delete service cert", func(s *mcclient.ClientSession, opts *ServiceCertificateDeleteOptions) error {
|
||||
cert, err := modules.ServiceCertificatesV3.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(cert)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -43,10 +43,10 @@ func init() {
|
||||
query.Add(jsonutils.NewInt(args.Offset), "offset")
|
||||
}
|
||||
if len(args.Name) > 0 {
|
||||
query.Add(jsonutils.NewString(args.Name), "name")
|
||||
query.Add(jsonutils.NewString(args.Name), "name__icontains")
|
||||
}
|
||||
if len(args.Type) > 0 {
|
||||
query.Add(jsonutils.NewString(args.Type), "type")
|
||||
query.Add(jsonutils.NewString(args.Type), "type__icontains")
|
||||
}
|
||||
if len(args.Search) > 0 {
|
||||
query.Add(jsonutils.NewString(args.Search), "search")
|
||||
|
||||
@@ -25,15 +25,13 @@ import (
|
||||
func init() {
|
||||
type ServerSkusListOptions struct {
|
||||
options.BaseListOptions
|
||||
Cloudregion string `help:"region Id or name"`
|
||||
Usable bool `help:"Filter usable sku"`
|
||||
Zone string `help:"zone Id or name"`
|
||||
City *string `help:"city name,eg. BeiJing"`
|
||||
Cpu *int `help:"Cpu core count" json:"cpu_core_count"`
|
||||
Mem *int `help:"Memory size in MB" json:"memory_size_mb"`
|
||||
Name string `help:"Name of Sku"`
|
||||
PostpaidStatus string `help:"Postpaid status" choices:"soldout|available"`
|
||||
PrepaidStatus string `help:"Prepaid status" choices:"soldout|available"`
|
||||
Cloudregion string `help:"region Id or name"`
|
||||
Usable bool `help:"Filter usable sku"`
|
||||
Zone string `help:"zone Id or name"`
|
||||
City *string `help:"city name,eg. BeiJing"`
|
||||
Cpu *int `help:"Cpu core count" json:"cpu_core_count"`
|
||||
Mem *int `help:"Memory size in MB" json:"memory_size_mb"`
|
||||
Name string `help:"Name of Sku"`
|
||||
}
|
||||
|
||||
R(&ServerSkusListOptions{}, "server-sku-list", "List all avaiable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusListOptions) error {
|
||||
|
||||
@@ -66,10 +66,10 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
type SnapshotIdOptions struct {
|
||||
type SnapshotShowOptions struct {
|
||||
ID string `help:"ID or Name of snapshot"`
|
||||
}
|
||||
R(&SnapshotIdOptions{}, "snapshot-show", "Show snapshot details", func(s *mcclient.ClientSession, args *SnapshotIdOptions) error {
|
||||
R(&SnapshotShowOptions{}, "snapshot-show", "Show snapshot details", func(s *mcclient.ClientSession, args *SnapshotShowOptions) error {
|
||||
result, err := modules.Snapshots.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -78,16 +78,10 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&SnapshotIdOptions{}, "snapshot-syncstatus", "Sync snapshot status", func(s *mcclient.ClientSession, args *SnapshotIdOptions) error {
|
||||
result, err := modules.Snapshots.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&SnapshotIdOptions{}, "snapshot-purge", "Purge Snapshot db records", func(s *mcclient.ClientSession, args *SnapshotIdOptions) error {
|
||||
type SnapshotPurgeOptions struct {
|
||||
ID string `help:"ID or name of Snapshot"`
|
||||
}
|
||||
R(&SnapshotPurgeOptions{}, "snapshot-purge", "Purge Snapshot db records", func(s *mcclient.ClientSession, args *SnapshotPurgeOptions) error {
|
||||
result, err := modules.Snapshots.PerformAction(s, args.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -29,12 +29,11 @@ func init() {
|
||||
type StorageListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
Share *bool `help:"Share storage list"`
|
||||
Local *bool `help:"Local storage list"`
|
||||
Usable *bool `help:"Usable storage list"`
|
||||
Zone string `help:"List storages in zone" json:"-"`
|
||||
Region string `help:"List storages in region"`
|
||||
Schedtag string `help:"filter storage by schedtag"`
|
||||
Share *bool `help:"Share storage list"`
|
||||
Local *bool `help:"Local storage list"`
|
||||
Usable *bool `help:"Usable storage list"`
|
||||
Zone string `help:"List storages in zone" json:"-"`
|
||||
Region string `help:"List storages in region"`
|
||||
}
|
||||
R(&StorageListOptions{}, "storage-list", "List storages", func(s *mcclient.ClientSession, opts *StorageListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
@@ -216,63 +215,4 @@ func init() {
|
||||
printObject(storage)
|
||||
return nil
|
||||
})
|
||||
|
||||
type StorageChangeOwnerOptions struct {
|
||||
ID string `help:"ID or name of storage" json:"-"`
|
||||
ProjectDomain string `json:"project_domain" help:"target domain"`
|
||||
}
|
||||
R(&StorageChangeOwnerOptions{}, "storage-change-owner", "Change owner domain of storage", func(s *mcclient.ClientSession, args *StorageChangeOwnerOptions) error {
|
||||
if len(args.ProjectDomain) == 0 {
|
||||
return fmt.Errorf("empty project_domain")
|
||||
}
|
||||
params := jsonutils.Marshal(args)
|
||||
ret, err := modules.Storages.PerformAction(s, args.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
type StorageForceDetachHost struct {
|
||||
ID string `help:"ID or name of storage" json:"-"`
|
||||
Host string `help:"ID or name of host"`
|
||||
}
|
||||
R(&StorageForceDetachHost{}, "storage-public", "Force detach host", func(s *mcclient.ClientSession, args *StorageForceDetachHost) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Storages.PerformAction(s, args.ID, "force-detach-host", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type StoragePublicOptions struct {
|
||||
ID string `help:"ID or name of storage" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
SharedDomains []string `help:"share to domains"`
|
||||
}
|
||||
R(&StoragePublicOptions{}, "storage-public", "Make a storage public", func(s *mcclient.ClientSession, args *StoragePublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Storages.PerformAction(s, args.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type StoragePrivateOptions struct {
|
||||
ID string `help:"ID or name of storage" json:"-"`
|
||||
}
|
||||
R(&StoragePrivateOptions{}, "storage-private", "Make a storage private", func(s *mcclient.ClientSession, args *StoragePrivateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Storages.PerformAction(s, args.ID, "private", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,11 +40,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.ExportFile) > 0 {
|
||||
exportList(result, args.ExportFile, args.ExportKeys, args.ExportTexts, modules.UsersV3.GetColumns(s))
|
||||
} else {
|
||||
printList(result, modules.UsersV3.GetColumns(s))
|
||||
}
|
||||
printList(result, modules.UsersV3.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -49,11 +47,7 @@ func init() {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(opts.ExportFile) > 0 {
|
||||
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.Vpcs.GetColumns(s))
|
||||
} else {
|
||||
printList(result, modules.Vpcs.GetColumns(s))
|
||||
}
|
||||
printList(result, modules.Vpcs.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -174,67 +168,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&VpcUpdateStatusOptions{}, "vpc-syncstatus", "Sync the status of a vpc", func(s *mcclient.ClientSession, args *VpcUpdateStatusOptions) error {
|
||||
result, err := modules.Vpcs.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type VpcPublicOptions struct {
|
||||
ID string `help:"ID or name of vpc" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
SharedDomains []string `help:"share to domains"`
|
||||
}
|
||||
R(&VpcPublicOptions{}, "vpc-public", "Make vpc public", func(s *mcclient.ClientSession, args *VpcPublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Vpcs.PerformAction(s, args.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type VpcPrivateOptions struct {
|
||||
ID string `help:"ID or name of vpc" json:"-"`
|
||||
}
|
||||
R(&VpcPrivateOptions{}, "vpc-private", "Make vpc private", func(s *mcclient.ClientSession, args *VpcPrivateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Vpcs.PerformAction(s, args.ID, "private", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&VpcShowOptions{}, "vpc-change-owner-candidate-domains", "Show candiate domains of a vpc for changing owner", func(s *mcclient.ClientSession, args *VpcShowOptions) error {
|
||||
result, err := modules.Vpcs.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type VpcChangeOwnerOptions struct {
|
||||
ID string `help:"ID or name of vpc" json:"-"`
|
||||
ProjectDomain string `json:"project_domain" help:"target domain"`
|
||||
}
|
||||
R(&VpcChangeOwnerOptions{}, "vpc-change-owner", "Change owner domain of vpc", func(s *mcclient.ClientSession, args *VpcChangeOwnerOptions) error {
|
||||
if len(args.ProjectDomain) == 0 {
|
||||
return fmt.Errorf("empty project_domain")
|
||||
}
|
||||
params := jsonutils.Marshal(args)
|
||||
ret, err := modules.Vpcs.PerformAction(s, args.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
webconsole_api "yunion.io/x/onecloud/pkg/apis/webconsole"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
o "yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/webconsole/command"
|
||||
"yunion.io/x/onecloud/pkg/webconsole/session"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -61,8 +61,8 @@ func init() {
|
||||
}
|
||||
protocol := query.Get("protocol")
|
||||
if !utils.IsInStringArray(protocol, []string{
|
||||
command.PROTOCOL_TTY, webconsole_api.VNC,
|
||||
webconsole_api.SPICE, webconsole_api.WMKS,
|
||||
command.PROTOCOL_TTY, session.VNC,
|
||||
session.SPICE, session.WMKS,
|
||||
}) {
|
||||
fmt.Println(connParams)
|
||||
return nil
|
||||
|
||||
@@ -132,41 +132,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type WirePublicOptions struct {
|
||||
ID string `help:"ID or name of wire" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
SharedDomains []string `help:"share to domains"`
|
||||
}
|
||||
R(&WirePublicOptions{}, "wire-public", "Make wire public", func(s *mcclient.ClientSession, args *WirePublicOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Wires.PerformAction(s, args.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type WirePrivateOptions struct {
|
||||
ID string `help:"ID or name of wire" json:"-"`
|
||||
}
|
||||
R(&WirePrivateOptions{}, "wire-private", "Make wire private", func(s *mcclient.ClientSession, args *WirePrivateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Wires.PerformAction(s, args.ID, "private", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&WireShowOptions{}, "wire-change-owner-candidate-domains", "Show candiate domains of a wire for changing owner", func(s *mcclient.ClientSession, args *WireShowOptions) error {
|
||||
result, err := modules.Wires.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,21 +18,17 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/structarg"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/multicloud/google"
|
||||
_ "yunion.io/x/onecloud/pkg/multicloud/google/shell"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
type BaseOptions struct {
|
||||
Debug bool `help:"debug mode"`
|
||||
Help bool `help:"Show help"`
|
||||
AuthFile string `help:"google cloud auth json file path" default:"$GOOGLE_AUTH_FILE"`
|
||||
ClientEmail string `help:"Client email" default:"$GOOGLE_CLIENT_EMAIL"`
|
||||
ProjectID string `help:"Project ID" default:"$GOOGLE_PROJECT_ID"`
|
||||
PrivateKeyID string `help:"Private Key ID" default:"$GOOGLE_PRIVATE_KEY_ID"`
|
||||
@@ -82,20 +78,6 @@ func showErrorAndExit(e error) {
|
||||
}
|
||||
|
||||
func newClient(options *BaseOptions) (*google.SRegion, error) {
|
||||
if len(options.AuthFile) > 0 {
|
||||
jsonStr, err := fileutils2.FileGetContents(options.AuthFile)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "FileGetContents")
|
||||
}
|
||||
jsonCfg, err := jsonutils.ParseString(jsonStr)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "jsonutils.ParseString")
|
||||
}
|
||||
options.ClientEmail, _ = jsonCfg.GetString("client_email")
|
||||
options.PrivateKeyID, _ = jsonCfg.GetString("private_key_id")
|
||||
options.PrivateKey, _ = jsonCfg.GetString("private_key")
|
||||
options.ProjectID, _ = jsonCfg.GetString("project_id")
|
||||
}
|
||||
if len(options.ClientEmail) == 0 {
|
||||
return nil, fmt.Errorf("Missing ClientEmail")
|
||||
}
|
||||
|
||||
15
go.mod
15
go.mod
@@ -3,7 +3,6 @@ module yunion.io/x/onecloud
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
cloud.google.com/go/storage v1.5.0
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0
|
||||
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible
|
||||
github.com/Azure/go-autorest/autorest v0.9.3
|
||||
@@ -51,6 +50,7 @@ require (
|
||||
github.com/golang-plus/errors v1.0.0
|
||||
github.com/golang-plus/testing v1.0.0 // indirect
|
||||
github.com/golang-plus/uuid v1.0.0
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
|
||||
github.com/golang/protobuf v1.3.2
|
||||
github.com/google/gopacket v1.1.17
|
||||
github.com/googleapis/gnostic v0.2.0 // indirect
|
||||
@@ -114,10 +114,9 @@ require (
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987
|
||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb
|
||||
google.golang.org/grpc v1.26.0
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
|
||||
google.golang.org/grpc v1.23.1
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
|
||||
gopkg.in/fatih/set.v0 v0.2.1
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.44.0 // indirect
|
||||
gopkg.in/ldap.v3 v3.0.3
|
||||
@@ -128,12 +127,12 @@ require (
|
||||
k8s.io/cluster-bootstrap v0.17.3
|
||||
k8s.io/kubernetes v1.16.0
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
|
||||
yunion.io/x/jsonutils v0.0.0-20200814075449-927b118adbd8
|
||||
yunion.io/x/jsonutils v0.0.0-20200415132054-2bf8a5e94501
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6
|
||||
yunion.io/x/pkg v0.0.0-20200516092703-0a53bc9270aa
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v0.0.0-20200814052348-164f1f20f8a6
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
|
||||
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57
|
||||
yunion.io/x/structarg v0.0.0-20200423163001-168d0687be7e
|
||||
)
|
||||
|
||||
replace (
|
||||
|
||||
132
go.sum
132
go.sum
@@ -5,25 +5,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
||||
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
|
||||
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go v0.50.0 h1:0E3eE8MX426vUOs7aHfI7aN1BrIzzzf4ccKCSfSjGmc=
|
||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0 h1:sAbMqjY1PEQKZBWfbu6Y6bsupJ9c4QdHnzg/VvYTLcE=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0 h1:9/vpR43S4aJaROxqQHQ3nH9lfyKKV0dC3vOmnw8ebQQ=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
cloud.google.com/go/storage v1.5.0 h1:RPUcBvDeYgQFMfQu1eBMq6piD1SXmLH+vK3qjewZPus=
|
||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0 h1:43rak9uafmwSJpXfFO1heKQph8tP3nlfWJWFQQtW1R0=
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0/go.mod h1:R8KYLmGns0vDPe6/HyphW0mzW+MFexlGDafU0ykVEnU=
|
||||
github.com/Azure/azure-sdk-for-go v5.0.0-beta.0.20161118192335-3b1282355199+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
@@ -172,7 +153,6 @@ github.com/c-bata/go-prompt v0.2.1 h1:HTPxmnfY4y5x3Myo7Gq4ce989jfnvZIBgdBp6y8bjY
|
||||
github.com/c-bata/go-prompt v0.2.1/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
|
||||
github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ4uw0RzP1E=
|
||||
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
|
||||
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw=
|
||||
github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b/go.mod h1:TrMrLQfeENAPYPRsJuq3jsqdlRh3lvi6trTZJG8+tho=
|
||||
@@ -225,7 +205,6 @@ github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY=
|
||||
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
|
||||
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11 h1:m8nX8hsUghn853BJ5qB0lX+VvS6LTJPksWyILFZRYN4=
|
||||
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11/go.mod h1:s1PfVYYVmTMgCSPtho4LKBDecEHJWtiVDPNv78Z985U=
|
||||
github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
|
||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
|
||||
@@ -251,8 +230,6 @@ github.com/elgatito/upnp v0.0.0-20180711183757-2f244d205f9a h1:2Zw3pxDRTs4nX1WCL
|
||||
github.com/elgatito/upnp v0.0.0-20180711183757-2f244d205f9a/go.mod h1:afkYpY8JAIL4341N7Zj9xJ5yTovsg6BkWfBFlCzIoF4=
|
||||
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
|
||||
github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw=
|
||||
@@ -288,8 +265,6 @@ github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493 h1:OTanQnFt0bi5
|
||||
github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
|
||||
github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M=
|
||||
github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=
|
||||
@@ -358,12 +333,10 @@ github.com/golang-plus/uuid v1.0.0/go.mod h1:pBDDRrdgRHHqyYlj1d1i2gwyBq62Zc+sP2c
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
@@ -391,17 +364,13 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY=
|
||||
github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM=
|
||||
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
|
||||
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||
@@ -440,6 +409,7 @@ github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead/go.mod h1:5Scbynm8dF1
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/heketi/heketi v9.0.0+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o=
|
||||
@@ -472,8 +442,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
|
||||
github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
|
||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
@@ -646,9 +614,8 @@ github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw=
|
||||
@@ -774,10 +741,8 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738 h1:lWF4f9Nypl1ZqSb4gLeh/DGvBYVaUYHuiB93teOmwgc=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
|
||||
@@ -805,35 +770,19 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g=
|
||||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299 h1:zQpM52jfKHG6II1ISZY1ZcpygvuSFZpLwfluuF89XOg=
|
||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -853,13 +802,10 @@ golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn
|
||||
golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190419010253-1f3472d942ba/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
@@ -902,13 +848,9 @@ golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606122018-79a91cf218c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190830023255-19e00faab6ad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -922,9 +864,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20170824195420-5d2fd3ccab98/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
@@ -938,24 +879,10 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4 h1:Toz2IK7k8rbltAXwNAxKcn9OzqyNfMUhUNjz3sL0NMk=
|
||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.zx2c4.com/wireguard v0.0.20190908 h1:SUoXDdwSMtomLdvke+zz83/u9tNvl4hHmcTIWp38tow=
|
||||
@@ -968,42 +895,23 @@ gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmK
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.15.0 h1:yzlyyDW/J0w8yNFJIhiAJy4kq74S+1DOLdawELNxFMA=
|
||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4S5cnCrr5SwzvlrPRmqqCuJDB8UTs=
|
||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk=
|
||||
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
|
||||
@@ -1013,8 +921,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fatih/set.v0 v0.2.1 h1:Xvyyp7LXu34P0ROhCyfXkmQCAoOUKb1E2JS9I7SE5CY=
|
||||
gopkg.in/fatih/set.v0 v0.2.1/go.mod h1:5eLWEndGL4zGGemXWrKuts+wTJR0y+w+auqUJZbmyBg=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
|
||||
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
|
||||
@@ -1052,8 +958,6 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.2/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
k8s.io/api v0.0.0-20190918155943-95b840bb6a1f h1:8FRUST8oUkEI45WYKyD8ed7Ad0Kg5v11zHyPkEVb2xo=
|
||||
k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48=
|
||||
k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY=
|
||||
@@ -1098,7 +1002,6 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
|
||||
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
|
||||
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
|
||||
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA=
|
||||
@@ -1108,8 +1011,8 @@ vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74 h1:A15C6VdVRWvmQ9pAJHrUs9yan5qKlYH7uaRxHg1kRbk=
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v0.0.0-20200814075449-927b118adbd8 h1:KQVw5EmohJCqBDMdZ3fAcOQNNMIYgVuNCNWNwg4EM3A=
|
||||
yunion.io/x/jsonutils v0.0.0-20200814075449-927b118adbd8/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE=
|
||||
yunion.io/x/jsonutils v0.0.0-20200415132054-2bf8a5e94501 h1:i1r9XvbdxH3FgTCLmTaRi3MzQqhiQimXJRlUOPgrxnU=
|
||||
yunion.io/x/jsonutils v0.0.0-20200415132054-2bf8a5e94501/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
|
||||
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d h1:59zrDL7Ft+hDukguJRmLr/Gdu/9V75x+yX99ovZwfaA=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
@@ -1117,11 +1020,12 @@ yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3 h1:5Wc5hkB8PtMudmHuzCyok960Ru
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6 h1:UarEDTBGkgcgc+nc+PZ75uo9M9+jiOGd5P2B90TxDNw=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200516092703-0a53bc9270aa h1:VizPfW8+mLFEE7W/97zxQJbfdxchi2dn1M/Y7YBwTTc=
|
||||
yunion.io/x/pkg v0.0.0-20200516092703-0a53bc9270aa/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200814052348-164f1f20f8a6 h1:k7E8Zjwzyk/lo1dDO0jtLbODwYRNv+w/zsUJrKWCXvo=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200814052348-164f1f20f8a6/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce h1:kU8xE7O5uZ1GSJVMZHoJ+jrNL7csUQHYGyAPW9QfNpE=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57 h1:KtQAuLJ00RSUVqkiRmJ1DiDABiw0U3xxXnzD3lGavaY=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20200423163001-168d0687be7e h1:pctCe/EPel3F1B83pJ2q9b34Umd1NdbLW1Yd+Lzur2s=
|
||||
yunion.io/x/structarg v0.0.0-20200423163001-168d0687be7e/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
@@ -39,7 +39,6 @@ func InitHandlers(app *appsrv.Application) {
|
||||
db.InitAllManagers()
|
||||
|
||||
db.RegisterModelManager(db.OpsLog)
|
||||
db.RegisterModelManager(db.Metadata)
|
||||
db.RegisterModelManager(db.UserCacheManager)
|
||||
db.RegisterModelManager(db.TenantCacheManager)
|
||||
for _, manager := range []db.IModelManager{
|
||||
|
||||
@@ -16,7 +16,6 @@ package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
@@ -42,7 +41,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/httputils"
|
||||
"yunion.io/x/onecloud/pkg/util/netutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/rbacutils"
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
func AppContextToken(ctx context.Context) mcclient.TokenCredential {
|
||||
@@ -271,10 +269,6 @@ func (h *AuthHandlers) doCredentialLogin(ctx context.Context, req *http.Request,
|
||||
if err != nil {
|
||||
return nil, httperrors.NewInputParameterError("get password in body")
|
||||
}
|
||||
// try base64 decryption
|
||||
if decPasswd, err := base64.StdEncoding.DecodeString(passwd); err == nil && stringutils2.IsPrintableAsciiString(string(decPasswd)) {
|
||||
passwd = string(decPasswd)
|
||||
}
|
||||
if len(uname) == 0 || len(passwd) == 0 {
|
||||
return nil, httperrors.NewInputParameterError("username or password is empty")
|
||||
}
|
||||
@@ -295,7 +289,7 @@ func (h *AuthHandlers) doCredentialLogin(ctx context.Context, req *http.Request,
|
||||
if err != nil {
|
||||
switch httperr := err.(type) {
|
||||
case *httputils.JSONClientError:
|
||||
if httperr.Code == 409 || httperr.Code == 429 {
|
||||
if httperr.Code == 409 {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -320,35 +314,6 @@ func (h *AuthHandlers) doCredentialLogin(ctx context.Context, req *http.Request,
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(tenant) == 0 {
|
||||
token3, ok := token.(*mcclient.TokenCredentialV3)
|
||||
if ok {
|
||||
targetLevel := rbacutils.ScopeProject
|
||||
targetProjId := ""
|
||||
for _, r := range token3.Token.RoleAssignments {
|
||||
level := rbacutils.ScopeProject
|
||||
if len(r.Policies.System) > 0 {
|
||||
level = rbacutils.ScopeSystem
|
||||
} else if len(r.Policies.Domain) > 0 {
|
||||
level = rbacutils.ScopeDomain
|
||||
}
|
||||
if len(targetProjId) == 0 || level.HigherThan(targetLevel) {
|
||||
targetProjId = r.Scope.Project.Id
|
||||
targetLevel = level
|
||||
}
|
||||
}
|
||||
if len(targetProjId) > 0 {
|
||||
ntoken, e := auth.Client().SetProject(targetProjId, "", "", token)
|
||||
if e != nil {
|
||||
log.Errorf("fail to change to project %s(%s), reset to empty", targetProjId, e)
|
||||
} else {
|
||||
token = ntoken
|
||||
tenant = targetProjId
|
||||
body.(*jsonutils.JSONDict).Set("scope", jsonutils.NewString(string(targetLevel)))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(tenant) == 0 {
|
||||
s := auth.GetAdminSession(ctx, FetchRegion(req), "")
|
||||
projects, e := modules.UsersV3.GetProjects(s, token.GetUserId())
|
||||
@@ -402,7 +367,7 @@ func isUserAllowWebconsole(ctx context.Context, w http.ResponseWriter, req *http
|
||||
return true
|
||||
}
|
||||
|
||||
func saveCookie(w http.ResponseWriter, name, val, domain string, expire time.Time, base64 bool) {
|
||||
func saveCookie(w http.ResponseWriter, name, val string, expire time.Time, base64 bool) {
|
||||
diff := time.Until(expire)
|
||||
maxAge := int(diff.Seconds())
|
||||
// log.Println("Set cookie", name, expire, maxAge, val)
|
||||
@@ -414,11 +379,6 @@ func saveCookie(w http.ResponseWriter, name, val, domain string, expire time.Tim
|
||||
}
|
||||
// log.Printf("Set coookie: %s - %s\n", val, valenc)
|
||||
cookie := &http.Cookie{Name: name, Value: valenc, Path: "/", Expires: expire, MaxAge: maxAge, HttpOnly: false}
|
||||
|
||||
if len(domain) > 0 {
|
||||
cookie.Domain = domain
|
||||
}
|
||||
|
||||
http.SetCookie(w, cookie)
|
||||
}
|
||||
|
||||
@@ -440,12 +400,8 @@ func getCookie(r *http.Request, name string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func clearCookie(w http.ResponseWriter, name string, domain string) {
|
||||
func clearCookie(w http.ResponseWriter, name string) {
|
||||
cookie := &http.Cookie{Name: name, Expires: time.Now(), Path: "/", MaxAge: -1, HttpOnly: false}
|
||||
if len(domain) > 0 {
|
||||
cookie.Domain = domain
|
||||
}
|
||||
|
||||
http.SetCookie(w, cookie)
|
||||
}
|
||||
|
||||
@@ -502,7 +458,7 @@ func (h *AuthHandlers) postLoginHandler(ctx context.Context, w http.ResponseWrit
|
||||
httperrors.GeneralServerError(w, err)
|
||||
return
|
||||
}
|
||||
saveCookie(w, constants.YUNION_AUTH_COOKIE, authCookie, options.Options.CookieDomain, token.GetExpires(), true)
|
||||
saveCookie(w, constants.YUNION_AUTH_COOKIE, authCookie, token.GetExpires(), true)
|
||||
|
||||
if len(token.GetProjectId()) > 0 {
|
||||
if body.Contains("isadmin") {
|
||||
@@ -510,20 +466,20 @@ func (h *AuthHandlers) postLoginHandler(ctx context.Context, w http.ResponseWrit
|
||||
if policy.PolicyManager.IsScopeCapable(token, rbacutils.ScopeSystem) {
|
||||
adminVal, _ = body.GetString("isadmin")
|
||||
}
|
||||
saveCookie(w, "isadmin", adminVal, "", token.GetExpires(), false)
|
||||
saveCookie(w, "isadmin", adminVal, token.GetExpires(), false)
|
||||
}
|
||||
if body.Contains("scope") {
|
||||
scopeStr, _ := body.GetString("scope")
|
||||
if !policy.PolicyManager.IsScopeCapable(token, rbacutils.TRbacScope(scopeStr)) {
|
||||
scopeStr = string(rbacutils.ScopeProject)
|
||||
}
|
||||
saveCookie(w, "scope", scopeStr, "", token.GetExpires(), false)
|
||||
saveCookie(w, "scope", scopeStr, token.GetExpires(), false)
|
||||
}
|
||||
if body.Contains("domain") {
|
||||
domainStr, _ := body.GetString("domain")
|
||||
saveCookie(w, "domain", domainStr, "", token.GetExpires(), false)
|
||||
saveCookie(w, "domain", domainStr, token.GetExpires(), false)
|
||||
}
|
||||
saveCookie(w, "tenant", token.GetProjectId(), "", token.GetExpires(), false)
|
||||
saveCookie(w, "tenant", token.GetProjectId(), token.GetExpires(), false)
|
||||
}
|
||||
|
||||
setAuthHeader(w, tid)
|
||||
@@ -546,7 +502,7 @@ func (h *AuthHandlers) postLogoutHandler(ctx context.Context, w http.ResponseWri
|
||||
if len(tid) > 0 {
|
||||
clientman.TokenMan.Remove(tid)
|
||||
}
|
||||
clearCookie(w, constants.YUNION_AUTH_COOKIE, options.Options.CookieDomain)
|
||||
clearCookie(w, constants.YUNION_AUTH_COOKIE)
|
||||
appsrv.Send(w, "")
|
||||
}
|
||||
|
||||
@@ -577,6 +533,14 @@ func FetchRegion(req *http.Request) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func fetchDomain(req *http.Request) string {
|
||||
r, e := req.Cookie("domain")
|
||||
if e != nil {
|
||||
return ""
|
||||
}
|
||||
return r.Value
|
||||
}
|
||||
|
||||
type role struct {
|
||||
id string
|
||||
name string
|
||||
@@ -683,74 +647,26 @@ func getUserAuthCookie(ctx context.Context, s *mcclient.ClientSession, token mcc
|
||||
return info.String(), nil
|
||||
}
|
||||
|
||||
func isLBAgentExists(s *mcclient.ClientSession) (bool, error) {
|
||||
func getLBAgentInfo(s *mcclient.ClientSession, token mcclient.TokenCredential) (*jsonutils.JSONDict, error) {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString("hb_last_seen.isnotempty()"), "filter.0")
|
||||
params.Add(jsonutils.NewInt(1), "limit")
|
||||
params.Add(jsonutils.JSONFalse, "details")
|
||||
agents, err := modules.LoadbalancerAgents.List(s, params)
|
||||
lbagents, err := modules.LoadbalancerAgents.List(s, params)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "modules.LoadbalancerAgents.List")
|
||||
return nil, errors.Wrapf(err, "user %s get lbagent", token.GetUserName())
|
||||
}
|
||||
|
||||
if len(agents.Data) > 0 {
|
||||
return true, nil
|
||||
item := jsonutils.NewDict()
|
||||
item.Add(jsonutils.NewString(""), "name")
|
||||
item.Add(jsonutils.NewString("lbagent"), "type")
|
||||
item.Add(jsonutils.JSONTrue, "as_menu")
|
||||
if len(lbagents.Data) > 0 {
|
||||
item.Add(jsonutils.JSONTrue, "status")
|
||||
} else {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
func isBaremetalAgentExists(s *mcclient.ClientSession) (bool, error) {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString("agent_type.equals(baremetal)"), "filter.0")
|
||||
params.Add(jsonutils.NewInt(1), "limit")
|
||||
params.Add(jsonutils.JSONFalse, "details")
|
||||
agents, err := modules.Baremetalagents.List(s, params)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "modules.Baremetalagents.List")
|
||||
}
|
||||
|
||||
if len(agents.Data) > 0 {
|
||||
return true, nil
|
||||
} else {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
func isEsxiAgentExists(s *mcclient.ClientSession) (bool, error) {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString("agent_type.equals(esxiagent)"), "filter.0")
|
||||
params.Add(jsonutils.NewInt(1), "limit")
|
||||
params.Add(jsonutils.JSONFalse, "details")
|
||||
agents, err := modules.Baremetalagents.List(s, params)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "modules.Baremetalagents.List esxiagent")
|
||||
}
|
||||
|
||||
if len(agents.Data) > 0 {
|
||||
return true, nil
|
||||
} else {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
func isHostAgentExists(s *mcclient.ClientSession) (bool, error) {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.JSONFalse, "show_emulated")
|
||||
params.Add(jsonutils.JSONFalse, "baremetal")
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
params.Add(jsonutils.NewInt(1), "limit")
|
||||
params.Add(jsonutils.JSONFalse, "details")
|
||||
agents, err := modules.Hosts.List(s, params)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "modules.LoadbalancerAgents.List")
|
||||
}
|
||||
|
||||
if len(agents.Data) > 0 {
|
||||
return true, nil
|
||||
} else {
|
||||
return false, nil
|
||||
item.Add(jsonutils.JSONFalse, "status")
|
||||
}
|
||||
return item, nil
|
||||
}
|
||||
|
||||
func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.TokenCredential, req *http.Request) (*jsonutils.JSONDict, error) {
|
||||
@@ -841,57 +757,43 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
|
||||
menus := jsonutils.NewArray()
|
||||
k8s := jsonutils.NewArray()
|
||||
|
||||
adminToken := auth.AdminCredential()
|
||||
curReg := FetchRegion(req)
|
||||
srvCat := auth.Client().GetServiceCatalog()
|
||||
var allsrv []string
|
||||
var alleps []mcclient.ExternalService
|
||||
if srvCat != nil {
|
||||
allsrv = srvCat.GetInternalServices(curReg)
|
||||
alleps = srvCat.GetServicesByInterface(curReg, "console")
|
||||
}
|
||||
allsrv := adminToken.GetInternalServices(curReg)
|
||||
alleps := auth.Client().GetServiceCatalog().GetServicesByInterface(curReg, "console")
|
||||
|
||||
log.Infof("getUserInfo checkAgent exists")
|
||||
for _, cf := range []struct {
|
||||
existFunc func(*mcclient.ClientSession) (bool, error)
|
||||
srvName string
|
||||
}{
|
||||
{
|
||||
existFunc: isLBAgentExists,
|
||||
srvName: "lbagent",
|
||||
},
|
||||
{
|
||||
existFunc: isBaremetalAgentExists,
|
||||
srvName: "bmagent",
|
||||
},
|
||||
{
|
||||
existFunc: isHostAgentExists,
|
||||
srvName: "hostagent",
|
||||
},
|
||||
{
|
||||
existFunc: isEsxiAgentExists,
|
||||
srvName: "esxiagent",
|
||||
},
|
||||
} {
|
||||
exist, err := cf.existFunc(s)
|
||||
if err != nil {
|
||||
log.Errorf("isLBAgentExists fail %s", err)
|
||||
} else if exist {
|
||||
allsrv = append(allsrv, cf.srvName)
|
||||
if allsrv != nil && len(allsrv) > 0 {
|
||||
for _, srv := range allsrv {
|
||||
item := jsonutils.NewDict()
|
||||
item.Add(jsonutils.NewString(""), "name")
|
||||
item.Add(jsonutils.NewString(srv), "type")
|
||||
item.Add(jsonutils.JSONTrue, "status")
|
||||
if srv == "notify" {
|
||||
item.Add(jsonutils.JSONFalse, "as_menu")
|
||||
} else {
|
||||
item.Add(jsonutils.JSONTrue, "as_menu")
|
||||
}
|
||||
services.Add(item)
|
||||
}
|
||||
} else {
|
||||
log.Errorf("fail to find services????: %#v %s", adminToken, curReg)
|
||||
}
|
||||
|
||||
for _, srv := range allsrv {
|
||||
item := jsonutils.NewDict()
|
||||
item.Add(jsonutils.NewString(srv), "type")
|
||||
item.Add(jsonutils.JSONTrue, "status")
|
||||
services.Add(item)
|
||||
log.Infof("getUserInfo getLBAgentInfo")
|
||||
lb, err := getLBAgentInfo(s, adminToken)
|
||||
if err != nil {
|
||||
log.Errorf("getLBAgentInfo fail %s", err)
|
||||
} else {
|
||||
services.Add(lb)
|
||||
}
|
||||
|
||||
for _, ep := range alleps {
|
||||
item := jsonutils.NewDict()
|
||||
item.Add(jsonutils.NewString(ep.Url), "url")
|
||||
item.Add(jsonutils.NewString(ep.Name), "name")
|
||||
menus.Add(item)
|
||||
if alleps != nil {
|
||||
for _, ep := range alleps {
|
||||
item := jsonutils.NewDict()
|
||||
item.Add(jsonutils.NewString(ep.Url), "url")
|
||||
item.Add(jsonutils.NewString(ep.Name), "name")
|
||||
menus.Add(item)
|
||||
}
|
||||
}
|
||||
|
||||
log.Infof("getUserInfo modules.Hosts.Get")
|
||||
@@ -952,7 +854,7 @@ func (h *AuthHandlers) getPermissionDetails(ctx context.Context, w http.Response
|
||||
if query != nil {
|
||||
name, _ = query.GetString("policy")
|
||||
}
|
||||
result, err := policy.ExplainRpc(ctx, t, body, name)
|
||||
result, err := policy.PolicyManager.ExplainRpc(t, body, name)
|
||||
if err != nil {
|
||||
httperrors.GeneralServerError(w, err)
|
||||
return
|
||||
@@ -1086,14 +988,20 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
|
||||
confirmPwd, _ := body.GetString("password_confirm")
|
||||
passcode, _ := body.GetString("passcode")
|
||||
|
||||
// 1.验证新密码正确
|
||||
if len(newPwd) < 6 {
|
||||
httperrors.InputParameterError(w, "new password must have at least 6 characters")
|
||||
return
|
||||
}
|
||||
|
||||
if newPwd != confirmPwd {
|
||||
httperrors.InputParameterError(w, "new password mismatch")
|
||||
return
|
||||
}
|
||||
|
||||
// 1.验证原密码正确,且idp_driver为空
|
||||
// 2.验证原密码正确,且idp_driver为空
|
||||
if isLdapUser(user) {
|
||||
httperrors.ForbiddenError(w, "not support reset user password")
|
||||
httperrors.ForbiddenError(w, "not support reset ldap user password")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1111,7 +1019,7 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
|
||||
return
|
||||
}
|
||||
|
||||
// 2.如果已开启MFA,验证 随机密码正确
|
||||
// 3.如果已开启MFA,验证 随机密码正确
|
||||
tid := getAuthToken(req)
|
||||
if isMfaEnabled(user) {
|
||||
totp := clientman.TokenMan.GetTotp(tid)
|
||||
@@ -1122,7 +1030,7 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
|
||||
}
|
||||
}
|
||||
|
||||
// 3.重置密码,清除认证token
|
||||
// 4.重置密码,清除认证token
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("password", jsonutils.NewString(newPwd))
|
||||
ret, err := modules.UsersV3.Patch(s, uid, params)
|
||||
@@ -1137,7 +1045,7 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
|
||||
}
|
||||
|
||||
func isLdapUser(user jsonutils.JSONObject) bool {
|
||||
if driver, _ := user.GetString("idp_driver"); len(driver) > 0 {
|
||||
if driver, _ := user.GetString("idp_driver"); driver == "ldap" {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -59,12 +59,6 @@ const (
|
||||
BATCH_HOST_REGISTER_QUANTITY_LIMITATION = 1000
|
||||
)
|
||||
|
||||
var (
|
||||
BatchHostRegisterTemplate = []string{HOST_MAC, HOST_NAME, HOST_IPMI_ADDR_OPTIONAL, HOST_IPMI_USERNAME_OPTIONAL, HOST_IPMI_PASSWORD_OPTIONAL}
|
||||
BatchHostISORegisterTemplate = []string{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR}
|
||||
BatchHostPXERegisterTemplate = []string{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR_OPTIONAL}
|
||||
)
|
||||
|
||||
func FetchSession(ctx context.Context, r *http.Request, apiVersion string) *mcclient.ClientSession {
|
||||
token := AppContextToken(ctx)
|
||||
session := auth.GetSession(ctx, token, FetchRegion(r), apiVersion)
|
||||
@@ -178,25 +172,6 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
|
||||
return
|
||||
}
|
||||
|
||||
// check header line
|
||||
titlesOk := false
|
||||
for _, t := range [][]string{BatchHostRegisterTemplate, BatchHostISORegisterTemplate, BatchHostPXERegisterTemplate} {
|
||||
if len(t) == len(rows[0]) {
|
||||
for _, title := range rows[0] {
|
||||
if !utils.IsInStringArray(title, t) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
titlesOk = true
|
||||
}
|
||||
}
|
||||
|
||||
if !titlesOk {
|
||||
httperrors.InputParameterError(w, "template file is invalid.please check.")
|
||||
return
|
||||
}
|
||||
|
||||
paramKeys := []string{}
|
||||
i1 := -1
|
||||
i2 := -1
|
||||
@@ -353,6 +328,18 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
|
||||
return
|
||||
}
|
||||
|
||||
if _, ok := names[name]; ok {
|
||||
e := httperrors.NewClientError("row %d duplicate name %s", rowIdx, name)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
} else {
|
||||
names[name] = true
|
||||
_, err := modules.UsersV3.Get(s, name, nil)
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
domainId, ok := domains[domain]
|
||||
if !ok {
|
||||
if len(domain) == 0 {
|
||||
@@ -371,18 +358,6 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
|
||||
domains[domain] = id
|
||||
}
|
||||
|
||||
if _, ok := names[name+"/"+domainId]; ok {
|
||||
e := httperrors.NewClientError("row %d duplicate name %s", rowIdx, name)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
} else {
|
||||
names[name+"/"+domainId] = true
|
||||
_, err := modules.UsersV3.Get(s, name, nil)
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
user := jsonutils.NewDict()
|
||||
user.Add(jsonutils.NewString(name), "name")
|
||||
user.Add(jsonutils.NewString(domainId), "domain_id")
|
||||
@@ -431,21 +406,21 @@ func (mh *MiscHandler) getDownloadsHandler(ctx context.Context, w http.ResponseW
|
||||
var content bytes.Buffer
|
||||
switch template {
|
||||
case "BatchHostRegister":
|
||||
records := [][]string{BatchHostRegisterTemplate}
|
||||
records := [][]string{{HOST_MAC, HOST_NAME, HOST_IPMI_ADDR_OPTIONAL, HOST_IPMI_USERNAME_OPTIONAL, HOST_IPMI_PASSWORD_OPTIONAL}}
|
||||
content, err = writeXlsx("hosts", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
return
|
||||
}
|
||||
case "BatchHostISORegister":
|
||||
records := [][]string{BatchHostISORegisterTemplate}
|
||||
records := [][]string{{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR}}
|
||||
content, err = writeXlsx("hosts", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
return
|
||||
}
|
||||
case "BatchHostPXERegister":
|
||||
records := [][]string{BatchHostPXERegisterTemplate}
|
||||
records := [][]string{{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR_OPTIONAL}}
|
||||
content, err = writeXlsx("hosts", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
|
||||
@@ -20,13 +20,12 @@ import (
|
||||
|
||||
type GatewayOptions struct {
|
||||
DefaultRegion string `help:"Use default region while region not specific in api request"`
|
||||
CookieDomain string `help:"specific yunionauth cookie domain" default:""`
|
||||
|
||||
Timeout int `help:"Timeout in seconds, default is 300" default:"300"`
|
||||
|
||||
DisableModuleApiVersion bool `help:"Disable each modules default api version" default:"false"`
|
||||
|
||||
EnableTotp bool `help:"Enable two-factor authentication" default:"false"`
|
||||
EnableTotp bool `help:"Enable two-factor authentication" default:"false"`
|
||||
|
||||
SqlitePath string `help:"sqlite db path" default:"/etc/yunion/data/yunionapi.db"`
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 service
|
||||
|
||||
import (
|
||||
_ "yunion.io/x/onecloud/pkg/cloudevent/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/compute/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/image/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/keystone/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/logger/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/notify/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/yunionconf/policy"
|
||||
)
|
||||
@@ -1,20 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 baremetal
|
||||
|
||||
const (
|
||||
SERVICE_TYPE = "baremetal"
|
||||
SERVICE_VERSION = ""
|
||||
)
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 baremetal // import "yunion.io/x/onecloud/pkg/apis/baremetal"
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 billing
|
||||
|
||||
import "time"
|
||||
|
||||
type BillingDetailsInfo struct {
|
||||
}
|
||||
|
||||
type BillingResourceListInput struct {
|
||||
// 计费类型,按需计费和预付费
|
||||
// pattern:prepaid|postpaid
|
||||
BillingType string `json:"billing_type"`
|
||||
|
||||
// 计费过期时间的查询起始时间
|
||||
BillingExpireSince time.Time `json:"billing_expire_since"`
|
||||
// 计费过期时间的查询终止时间
|
||||
BillingExpireBefore time.Time `json:"billing_expire_before"`
|
||||
|
||||
// 计费周期
|
||||
// example:7d
|
||||
BillingCycle string `json:"billing_cycle"`
|
||||
}
|
||||
@@ -1,15 +1 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 proxy // import "yunion.io/x/onecloud/pkg/apis/cloudcommon/proxy"
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 proxy
|
||||
|
||||
import (
|
||||
@@ -25,13 +11,16 @@ const (
|
||||
)
|
||||
|
||||
type ProxySettingCreateInput struct {
|
||||
apis.InfrasResourceBaseCreateInput
|
||||
apis.StandaloneResourceCreateInput
|
||||
|
||||
ProxySetting
|
||||
}
|
||||
|
||||
type ProxySettingUpdateInput struct {
|
||||
apis.InfrasResourceBaseUpdateInput
|
||||
// 资源名称
|
||||
Name string `json:"name"`
|
||||
// 资源描述
|
||||
Description string `json:"description"`
|
||||
|
||||
ProxySetting
|
||||
}
|
||||
@@ -57,7 +46,7 @@ type ProxySettingResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
ProxySettingId string `json:"proxy_setting_id" yunion-deprecated-by:"proxy_setting"`
|
||||
ProxySettingId string `json:"proxy_setting_id" "yunion:deprecated-by":"proxy_setting"`
|
||||
}
|
||||
|
||||
type ProxySettingTestInput struct {
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 proxy
|
||||
|
||||
import (
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
// SProxySetting is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db/proxy.SProxySetting.
|
||||
type SProxySetting struct {
|
||||
apis.SInfrasResourceBase
|
||||
apis.SStandaloneResourceBase
|
||||
HTTPProxy string `json:"http_proxy"`
|
||||
HTTPSProxy string `json:"https_proxy"`
|
||||
NoProxy string `json:"no_proxy"`
|
||||
|
||||
@@ -18,13 +18,47 @@ import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
"yunion.io/x/onecloud/pkg/apis/compute"
|
||||
)
|
||||
|
||||
type CloudeventListInput struct {
|
||||
apis.ModelBaseListInput
|
||||
|
||||
compute.CloudenvResourceListInput
|
||||
// 列出指定云平台的资源,支持的云平台如下
|
||||
//
|
||||
// | Provider | 开始支持版本 | 平台 |
|
||||
// |-----------|------------|-------------------------------------|
|
||||
// | OneCloud | 0.0 | OneCloud内置私有云,包括KVM和裸金属管理 |
|
||||
// | VMware | 1.2 | VMware vCenter |
|
||||
// | OpenStack | 2.6 | OpenStack M版本以上私有云 |
|
||||
// | ZStack | 2.10 | ZStack私有云 |
|
||||
// | Aliyun | 2.0 | 阿里云 |
|
||||
// | Aws | 2.3 | Amazon AWS |
|
||||
// | Azure | 2.2 | Microsoft Azure |
|
||||
// | Google | 2.13 | Google Cloud Platform |
|
||||
// | Qcloud | 2.3 | 腾讯云 |
|
||||
// | Huawei | 2.5 | 华为公有云 |
|
||||
// | Ucloud | 2.7 | UCLOUD |
|
||||
// | Ctyun | 2.13 | 天翼云 |
|
||||
// | S3 | 2.11 | 通用s3对象存储 |
|
||||
// | Ceph | 2.11 | Ceph对象存储 |
|
||||
// | Xsky | 2.11 | XSKY启明星辰Ceph对象存储 |
|
||||
//
|
||||
// enum: OneCloud,VMware,Aliyun,Qcloud,Azure,Aws,Huawei,OpenStack,Ucloud,ZStack,Google,Ctyun,S3,Ceph,Xsky"
|
||||
Providers []string `json:"providers"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Provider []string `json:"provider" "yunion:deprecated-by":"providers"`
|
||||
|
||||
// 列出指定云平台品牌的资源,一般来说brand和provider相同,除了以上支持的provider之外,还支持以下band
|
||||
//
|
||||
// | Brand | Provider | 说明 |
|
||||
// |----------|----------|------------|
|
||||
// | DStack | ZStack | 滴滴云私有云 |
|
||||
//
|
||||
Brands []string `json:"brands"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Brand []string `json:"brand" "yunion:deprecated-by":"brands"`
|
||||
|
||||
// 服务类型
|
||||
Service []string `json:"service"`
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
package cloudevent
|
||||
|
||||
const (
|
||||
SERVICE_TYPE = "cloudevent"
|
||||
|
||||
CLOUD_EVENT_SERVICE_COMPUTE = "compute"
|
||||
CLOUD_EVENT_SERVICE_UNKNOWN = "unknown"
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 cloudnet
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type RouterUpdateInput struct {
|
||||
apis.StandaloneResourceBaseUpdateInput
|
||||
|
||||
User string `json:"user"`
|
||||
|
||||
Host string `json:"host"`
|
||||
|
||||
Port *int `json:"port"`
|
||||
|
||||
PrivateKey string `json:"private_key"`
|
||||
|
||||
RealizeWgIfaces *bool `json:"realize_wg_ifaces"`
|
||||
|
||||
RealizeRoutes *bool `json:"realize_routes"`
|
||||
|
||||
RealizeRules *bool `json:"realize_rules"`
|
||||
|
||||
OldEndpoint string `json:"_old_endpoint"`
|
||||
}
|
||||
|
||||
type RouteUpdateInput struct {
|
||||
apis.StandaloneResourceBaseUpdateInput
|
||||
|
||||
Network string `json:"network"`
|
||||
|
||||
Gateway string `json:"gateway"`
|
||||
}
|
||||
|
||||
type RuleUpdateInput struct {
|
||||
apis.StandaloneResourceBaseUpdateInput
|
||||
|
||||
Prio int `json:"prio"`
|
||||
|
||||
MatchSrcNet string `json:"match_src_net"`
|
||||
|
||||
MatchDestNet string `json:"match_dest_net"`
|
||||
|
||||
MatchProto string `json:"match_proto"`
|
||||
|
||||
MatchSrcPort int `json:"match_src_port"`
|
||||
|
||||
MatchDestPort int `json:"match_dest_port"`
|
||||
|
||||
MatchInIfname string `json:"match_in_ifname"`
|
||||
|
||||
MatchOutIfname string `json:"match_out_ifname"`
|
||||
|
||||
Action string `json:"action"`
|
||||
|
||||
ActionOptions string `json:"action_options"`
|
||||
}
|
||||
@@ -285,7 +285,7 @@ type ServerConfigs struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// alias for InstanceType
|
||||
Sku string `json:"sku" yunion-deprecated-by:"instance_type"`
|
||||
Sku string `json:"sku" "yunion:deprecated-by":"instance_type"`
|
||||
|
||||
// 虚拟机高可用(创建备机)
|
||||
// default: false
|
||||
@@ -357,9 +357,9 @@ type ServerCreateInput struct {
|
||||
// required: false
|
||||
UserData string `json:"user_data"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
KeypairId string `json:"keypair_id" yunion-deprecated-by:"keypair"`
|
||||
// swagger:ignore
|
||||
KeypairId string `json:"keypair_id" "yunion:deprecated-by":"keypair"`
|
||||
|
||||
// 秘钥对Id
|
||||
// required: false
|
||||
@@ -434,10 +434,6 @@ type ServerCreateInput struct {
|
||||
// |天翼云 |是 |
|
||||
Duration string `json:"duration"`
|
||||
|
||||
// 是否自动续费
|
||||
// default: false
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
|
||||
// swagger:ignore
|
||||
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
|
||||
|
||||
@@ -466,8 +462,7 @@ type ServerCreateInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
OsType string `json:"os_type"`
|
||||
// swagger:ignore
|
||||
DisableUsbKbd bool `json:"disable_usb_kbd"`
|
||||
|
||||
// swagger:ignore
|
||||
OsProfile jsonutils.JSONObject `json:"__os_profile__"`
|
||||
// swagger:ignore
|
||||
|
||||
@@ -18,29 +18,9 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type BaremetalagentDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
ZoneResourceInfo
|
||||
|
||||
SBaremetalagent
|
||||
}
|
||||
|
||||
type BaremetalagentCreateInput struct {
|
||||
apis.StandaloneResourceCreateInput
|
||||
|
||||
ZoneResourceInput
|
||||
|
||||
AccessIp string `json:"access_ip"`
|
||||
ManagerUri string `json:"manager_uri"`
|
||||
AgentType string `json:"agent_type"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type BaremetalagentUpdateInput struct {
|
||||
apis.StandaloneResourceBaseUpdateInput
|
||||
|
||||
ZoneResourceInput
|
||||
|
||||
AccessIp string `json:"access_ip"`
|
||||
ManagerUri string `json:"manager_uri"`
|
||||
AgentType string `json:"agent_type"`
|
||||
Version string `json:"version"`
|
||||
|
||||
// 裸金属代理程序所在的可用区
|
||||
// example: zone1
|
||||
Zone string `json:"zone"`
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ const (
|
||||
BUCKET_STATUS_DELETING = "deleting"
|
||||
BUCKET_STATUS_DELETED = "deleted"
|
||||
BUCKET_STATUS_DELETE_FAIL = "delete_fail"
|
||||
BUCKET_STATUS_UNKNOWN = "unknown"
|
||||
|
||||
BUCKET_UPLOAD_OBJECT_KEY_HEADER = "X-Yunion-Bucket-Upload-Key"
|
||||
BUCKET_UPLOAD_OBJECT_ACL_HEADER = "X-Yunion-Bucket-Upload-Acl"
|
||||
@@ -43,21 +42,19 @@ const (
|
||||
)
|
||||
|
||||
type BucketCreateInput struct {
|
||||
apis.SharableVirtualResourceCreateInput
|
||||
CloudregionResourceInput
|
||||
CloudproviderResourceInput
|
||||
apis.VirtualResourceCreateInput
|
||||
RegionalResourceCreateInput
|
||||
ManagedResourceCreateInput
|
||||
|
||||
StorageClass string `json:"storage_class"`
|
||||
}
|
||||
|
||||
type BucketDetails struct {
|
||||
apis.SharableVirtualResourceDetails
|
||||
ManagedResourceInfo
|
||||
CloudregionResourceInfo
|
||||
|
||||
apis.VirtualResourceDetails
|
||||
SBucket
|
||||
|
||||
// 访问URL列表
|
||||
CloudproviderInfo
|
||||
|
||||
AccessUrls []cloudprovider.SBucketAccessUrl `json:"access_urls"`
|
||||
}
|
||||
|
||||
@@ -98,25 +95,7 @@ func (input *BucketMetadataInput) Validate() error {
|
||||
}
|
||||
|
||||
type BucketListInput struct {
|
||||
apis.SharableVirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
apis.VirtualResourceListInput
|
||||
|
||||
ManagedResourceListInput
|
||||
RegionalFilterListInput
|
||||
|
||||
// STORAGE_CLASS
|
||||
StorageClass []string `json:"storage_class"`
|
||||
|
||||
// 位置
|
||||
Location []string `json:"location"`
|
||||
|
||||
// ACL
|
||||
Acl []string `json:"acl"`
|
||||
}
|
||||
|
||||
type BucketSyncstatusInput struct {
|
||||
}
|
||||
|
||||
type BucketUpdateInput struct {
|
||||
apis.SharableVirtualResourceBaseUpdateInput
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ type CachedImageUncacheImageInput struct {
|
||||
|
||||
type CachedimageDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
|
||||
SCachedimage
|
||||
|
||||
// 镜像状态, 和info里面的status一致
|
||||
|
||||
@@ -18,36 +18,7 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CachedLoadbalancerAclDetails struct {
|
||||
apis.SharableVirtualResourceDetails
|
||||
CloudregionResourceInfo
|
||||
ManagedResourceInfo
|
||||
|
||||
SCachedLoadbalancerAcl
|
||||
}
|
||||
|
||||
type CachedLoadbalancerAclListInput struct {
|
||||
apis.SharableVirtualResourceListInput
|
||||
RegionalFilterListInput
|
||||
ManagedResourceListInput
|
||||
LoadbalancerAclFilterListInput
|
||||
}
|
||||
|
||||
type LoadbalancerAclResourceInfo struct {
|
||||
// 负载均衡ACL名称
|
||||
Acl string `json:"acl"`
|
||||
}
|
||||
|
||||
type LoadbalancerAclResourceInput struct {
|
||||
// ACL名称或ID
|
||||
Acl string `json:"acl"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
AclId string `json:"acl_id" yunion-deprecated-by:"acl"`
|
||||
}
|
||||
|
||||
type LoadbalancerAclFilterListInput struct {
|
||||
LoadbalancerAclResourceInput
|
||||
|
||||
// 以ACL名称排序
|
||||
OrderByAcl string `json:"order_by_acl"`
|
||||
|
||||
CloudproviderInfo
|
||||
}
|
||||
|
||||
@@ -18,37 +18,7 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CachedLoadbalancerCertificateDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
ManagedResourceInfo
|
||||
CloudregionResourceInfo
|
||||
LoadbalancerCertificateResourceInfo
|
||||
|
||||
SCachedLoadbalancerCertificate
|
||||
}
|
||||
|
||||
type CachedLoadbalancerCertificateListInput struct {
|
||||
apis.VirtualResourceListInput
|
||||
ManagedResourceListInput
|
||||
RegionalFilterListInput
|
||||
LoadbalancerCertificateFilterListInput
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateResourceInfo struct {
|
||||
// 负载均衡证书名称
|
||||
Certificate string `json:"certificate"`
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateResourceInput struct {
|
||||
// 证书名称或ID
|
||||
Certificate string `json:"certificate"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
CertificateId string `json:"certificate_id" yunion-deprecated-by:"certificate"`
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateFilterListInput struct {
|
||||
LoadbalancerCertificateResourceInput
|
||||
|
||||
// 以证书名称排序
|
||||
OrderByCertificate string `json:"order_by_certificate"`
|
||||
|
||||
CloudproviderInfo
|
||||
}
|
||||
|
||||
@@ -24,114 +24,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
)
|
||||
|
||||
type CloudenvResourceInfo struct {
|
||||
// 云平台名称
|
||||
// example: Google
|
||||
Provider string `json:"provider,omitempty"`
|
||||
|
||||
// 云平台品牌
|
||||
// example: Google
|
||||
Brand string `json:"brand,omitempty"`
|
||||
|
||||
// 云环境
|
||||
// example: public
|
||||
CloudEnv string `json:"cloud_env,omitempty"`
|
||||
|
||||
// Environment
|
||||
Environment string `json:"environment,omitempty"`
|
||||
}
|
||||
|
||||
type CloudenvResourceListInput struct {
|
||||
// 列出指定云平台的资源,支持的云平台如下
|
||||
//
|
||||
// | Provider | 开始支持版本 | 平台 |
|
||||
// |-----------|------------|-------------------------------------|
|
||||
// | OneCloud | 0.0 | OneCloud内置私有云,包括KVM和裸金属管理 |
|
||||
// | VMware | 1.2 | VMware vCenter |
|
||||
// | OpenStack | 2.6 | OpenStack M版本以上私有云 |
|
||||
// | ZStack | 2.10 | ZStack私有云 |
|
||||
// | Aliyun | 2.0 | 阿里云 |
|
||||
// | Aws | 2.3 | Amazon AWS |
|
||||
// | Azure | 2.2 | Microsoft Azure |
|
||||
// | Google | 2.13 | Google Cloud Platform |
|
||||
// | Qcloud | 2.3 | 腾讯云 |
|
||||
// | Huawei | 2.5 | 华为公有云 |
|
||||
// | Ucloud | 2.7 | UCLOUD |
|
||||
// | Ctyun | 2.13 | 天翼云 |
|
||||
// | S3 | 2.11 | 通用s3对象存储 |
|
||||
// | Ceph | 2.11 | Ceph对象存储 |
|
||||
// | Xsky | 2.11 | XSKY启明星辰Ceph对象存储 |
|
||||
//
|
||||
// enum: OneCloud,VMware,Aliyun,Qcloud,Azure,Aws,Huawei,OpenStack,Ucloud,ZStack,Google,Ctyun,S3,Ceph,Xsky"
|
||||
Providers []string `json:"providers"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Provider []string `json:"provider" yunion-deprecated-by:"providers"`
|
||||
|
||||
// 列出指定云平台品牌的资源,一般来说brand和provider相同,除了以上支持的provider之外,还支持以下band
|
||||
//
|
||||
// | Brand | Provider | 说明 |
|
||||
// |----------|----------|------------|
|
||||
// | DStack | ZStack | 滴滴云私有云 |
|
||||
//
|
||||
Brands []string `json:"brands"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Brand []string `json:"brand" yunion-deprecated-by:"brands"`
|
||||
|
||||
// 列出指定云环境的资源,支持云环境如下:
|
||||
//
|
||||
// | CloudEnv | 说明 |
|
||||
// |-----------|--------|
|
||||
// | public | 公有云 |
|
||||
// | private | 私有云 |
|
||||
// | onpremise | 本地IDC |
|
||||
//
|
||||
// enum: public,private,onpremise
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
PublicCloud bool `json:"public_cloud"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsPublic bool `json:"is_public"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
PrivateCloud bool `json:"private_cloud"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsPrivate bool `json:"is_private"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsOnPremise bool `json:"is_on_premise"`
|
||||
|
||||
// 以平台名称排序
|
||||
// pattern:asc|desc
|
||||
OrderByProvider string `json:"order_by_provider"`
|
||||
|
||||
// 以平台品牌排序
|
||||
// pattern:asc|desc
|
||||
OrderByBrand string `json:"order_by_brand"`
|
||||
}
|
||||
|
||||
type CloudaccountResourceInfo struct {
|
||||
CloudenvResourceInfo
|
||||
|
||||
// 云账号名称
|
||||
// example: google-account
|
||||
Account string `json:"account,omitempty"`
|
||||
}
|
||||
|
||||
type CloudaccountCreateInput struct {
|
||||
apis.EnabledStatusInfrasResourceBaseCreateInput
|
||||
apis.EnabledStatusStandaloneResourceCreateInput
|
||||
|
||||
// 指定云平台
|
||||
// Qcloud: 腾讯云
|
||||
@@ -167,11 +61,10 @@ type CloudaccountCreateInput struct {
|
||||
IsOnPremise bool
|
||||
|
||||
// 指定云账号所属的项目
|
||||
// Tenant string `json:"tenant"`
|
||||
// swagger:ignore
|
||||
// TenantId string
|
||||
Tenant string `json:"tenant"`
|
||||
|
||||
apis.ProjectizedResourceInput
|
||||
// swagger:ignore
|
||||
TenantId string
|
||||
|
||||
// 启用自动同步
|
||||
// default: false
|
||||
@@ -180,12 +73,12 @@ type CloudaccountCreateInput struct {
|
||||
// 自动同步间隔时间
|
||||
SyncIntervalSeconds int `json:"sync_interval_seconds"`
|
||||
|
||||
// 自动根据云上项目或订阅创建本地项目, OpenStack此参数为true
|
||||
// 自动根据云上项目或订阅创建本地项目
|
||||
// default: false
|
||||
AutoCreateProject *bool `json:"auto_create_project"`
|
||||
AutoCreateProject bool `json:"auto_create_project"`
|
||||
|
||||
// 额外信息,例如账单的access key
|
||||
Options *jsonutils.JSONDict `json:"options"`
|
||||
Options *jsonutils.JSONObject `json:"options"`
|
||||
|
||||
proxyapi.ProxySettingResourceInput
|
||||
|
||||
@@ -210,24 +103,11 @@ func (i CloudaccountShareModeInput) Validate() error {
|
||||
}
|
||||
|
||||
type CloudaccountListInput struct {
|
||||
apis.EnabledStatusInfrasResourceBaseListInput
|
||||
apis.EnabledStatusStandaloneResourceListInput
|
||||
|
||||
ManagedResourceListInput
|
||||
|
||||
CapabilityListInput
|
||||
|
||||
SyncableBaseResourceListInput
|
||||
|
||||
// 账号健康状态
|
||||
HealthStatus []string `json:"health_status"`
|
||||
|
||||
// 共享模式
|
||||
ShareMode []string `json:"share_mode"`
|
||||
|
||||
// 代理
|
||||
ProxySetting string `json:"proxy_setting"`
|
||||
// swagger:ignore
|
||||
ProxySettingId string `json:"proxy_setting_id" yunion-deprecated-by:"proxy_setting"`
|
||||
}
|
||||
|
||||
type ProviderProject struct {
|
||||
@@ -241,7 +121,7 @@ type ProviderProject struct {
|
||||
}
|
||||
|
||||
type CloudaccountDetail struct {
|
||||
apis.EnabledStatusInfrasResourceBaseDetails
|
||||
apis.StandaloneResourceDetails
|
||||
SCloudaccount
|
||||
|
||||
// 子订阅项目信息
|
||||
@@ -303,25 +183,3 @@ type CloudaccountDetail struct {
|
||||
|
||||
ProxySetting proxyapi.SProxySetting `json:"proxy_setting"`
|
||||
}
|
||||
|
||||
type CloudaccountUpdateInput struct {
|
||||
apis.EnabledStatusInfrasResourceBaseUpdateInput
|
||||
|
||||
// 同步周期,单位为秒
|
||||
SyncIntervalSeconds *int64 `json:"sync_interval_seconds"`
|
||||
|
||||
// 待更新的options key/value
|
||||
Options *jsonutils.JSONDict `json:"options"`
|
||||
// 带删除的options key
|
||||
RemoveOptions []string `json:"remove_options"`
|
||||
|
||||
proxyapi.ProxySettingResourceInput
|
||||
}
|
||||
|
||||
type CloudaccountPerformPublicInput struct {
|
||||
apis.PerformPublicDomainInput
|
||||
|
||||
// 共享模式,可能值为provider_domain, system
|
||||
// example: provider_domain
|
||||
ShareMode string `json:"share_mode"`
|
||||
}
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
)
|
||||
|
||||
const (
|
||||
CLOUD_PROVIDER_INIT = "init"
|
||||
CLOUD_PROVIDER_CONNECTED = "connected"
|
||||
@@ -96,17 +91,17 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
CLOUD_ENV_PUBLIC_CLOUD = cloudprovider.CLOUD_ENV_PUBLIC_CLOUD
|
||||
CLOUD_ENV_PRIVATE_CLOUD = cloudprovider.CLOUD_ENV_PRIVATE_CLOUD
|
||||
CLOUD_ENV_ON_PREMISE = cloudprovider.CLOUD_ENV_ON_PREMISE
|
||||
CLOUD_ENV_PUBLIC_CLOUD = "public"
|
||||
CLOUD_ENV_PRIVATE_CLOUD = "private"
|
||||
CLOUD_ENV_ON_PREMISE = "onpremise"
|
||||
|
||||
CLOUD_ENV_PRIVATE_ON_PREMISE = cloudprovider.CLOUD_ENV_PRIVATE_ON_PREMISE
|
||||
CLOUD_ENV_PRIVATE_ON_PREMISE = "private_or_onpremise"
|
||||
)
|
||||
|
||||
const (
|
||||
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN = apis.CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN
|
||||
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM = apis.CLOUD_ACCOUNT_SHARE_MODE_SYSTEM
|
||||
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN = apis.CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN
|
||||
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN = "account_domain"
|
||||
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM = "system"
|
||||
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN = "provider_domain"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -22,17 +22,31 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
)
|
||||
|
||||
type ManagedResourceInfo struct {
|
||||
CloudaccountResourceInfo
|
||||
type CloudproviderInfo struct {
|
||||
// 云平台
|
||||
// example: Google
|
||||
Provider string `json:"provider,omitempty"`
|
||||
|
||||
// 云平台品牌
|
||||
// example: Google
|
||||
Brand string `json:"brand,omitempty"`
|
||||
|
||||
// 云账号名称
|
||||
// example: google-account
|
||||
Account string `json:"account,omitempty"`
|
||||
|
||||
// 云账号Id
|
||||
// example: 4d3c8979-9dd0-439b-8d78-36fe1ab1666c
|
||||
AccountId string `json:"account_id,omitempty"`
|
||||
|
||||
// 云订阅名称
|
||||
// 子订阅名称
|
||||
// example: google-account
|
||||
Manager string `json:"manager,omitempty"`
|
||||
|
||||
// 子订阅Id
|
||||
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
|
||||
ManagerId string `json:"manager_id,omitempty"`
|
||||
|
||||
// 子订阅所在项目名称
|
||||
// example: system
|
||||
ManagerProject string `json:"manager_project,omitempty"`
|
||||
@@ -47,9 +61,52 @@ type ManagedResourceInfo struct {
|
||||
// 子订阅所在域Id
|
||||
// example: default
|
||||
ManagerDomainId string `json:"manager_domain_id,omitempty"`
|
||||
|
||||
// 区域名称
|
||||
// example: 腾讯云 华南地区(广州)
|
||||
Region string `json:"region,omitempty"`
|
||||
// 区域Id
|
||||
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
|
||||
RegionId string `json:"region_id,omitempty"`
|
||||
// 区域Id
|
||||
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
|
||||
CloudregionId string `json:"cloudregion_id,omitempty"`
|
||||
// 区域外部Id
|
||||
// Qcloud/ap-guangzhou
|
||||
RegionExternalId string `json:"region_external_id,omitempty"`
|
||||
// 区域外部Id(不携带平台信息)
|
||||
// example: ap-guangzhou
|
||||
RegionExtId string `json:"region_ext_id,omitempty"`
|
||||
|
||||
// 可用区名称
|
||||
// example: 腾讯云 广州四区
|
||||
Zone string `json:"zone,omitempty"`
|
||||
// 可用区Id
|
||||
// example: 336ac6d2-b80d-43bb-86d5-1ebf474da8d4
|
||||
ZoneId string `json:"zone_id,omitempty"`
|
||||
// 可用区外部Id
|
||||
// example: ap-guangzhou-4
|
||||
ZoneExtId string `json:"zone_ext_id,omitempty"`
|
||||
|
||||
// 云环境
|
||||
// example: public
|
||||
CloudEnv string `json:"cloud_env,omitempty"`
|
||||
}
|
||||
|
||||
type SCloudproviderUsage struct {
|
||||
type CloudproviderDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SCloudprovider
|
||||
|
||||
ProxySetting proxyapi.SProxySetting `json:"proxy_setting"`
|
||||
|
||||
// 云账号名称
|
||||
// example: google-account
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
// 子订阅同步状态
|
||||
SyncStatus2 string `json:"sync_status2"`
|
||||
// 支持服务列表
|
||||
Capabilities []string `json:"capabilities"`
|
||||
|
||||
// 云主机数量
|
||||
// example: 1
|
||||
GuestCount int `json:"guest_count"`
|
||||
@@ -74,122 +131,121 @@ type SCloudproviderUsage struct {
|
||||
// 负载均衡器数量
|
||||
// example: 2
|
||||
LoadbalancerCount int `json:"loadbalancer_count"`
|
||||
// 数据库实例数量
|
||||
// example: 2
|
||||
DBInstanceCount int `json:"dbinstance_count"`
|
||||
// 弹性缓存实例数量
|
||||
// example: 2
|
||||
ElasticcacheCount int `json:"elasticcache_count"`
|
||||
// 项目数量
|
||||
ProjectCount int `json:"project_count"`
|
||||
// 同步区域数量
|
||||
SyncRegionCount int `json:"sync_region_count"`
|
||||
}
|
||||
|
||||
func (usage *SCloudproviderUsage) IsEmpty() bool {
|
||||
if usage.HostCount > 0 {
|
||||
return false
|
||||
}
|
||||
if usage.VpcCount > 0 {
|
||||
return false
|
||||
}
|
||||
if usage.StorageCount > 0 {
|
||||
return false
|
||||
}
|
||||
if usage.StorageCacheCount > 0 {
|
||||
return false
|
||||
}
|
||||
if usage.EipCount > 0 {
|
||||
return false
|
||||
}
|
||||
if usage.SnapshotCount > 0 {
|
||||
return false
|
||||
}
|
||||
if usage.LoadbalancerCount > 0 {
|
||||
return false
|
||||
}
|
||||
/*if usage.ProjectCount > 0 {
|
||||
return false
|
||||
}
|
||||
if usage.SyncRegionCount > 0 {
|
||||
return false
|
||||
}*/
|
||||
return true
|
||||
}
|
||||
|
||||
type CloudproviderDetails struct {
|
||||
apis.EnabledStatusStandaloneResourceDetails
|
||||
apis.ProjectizedResourceInfo
|
||||
|
||||
ProxySetting proxyapi.SProxySetting `json:"proxy_setting"`
|
||||
|
||||
SCloudprovider
|
||||
|
||||
// 云账号名称
|
||||
// example: google-account
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
// 子订阅同步状态
|
||||
SyncStatus2 string `json:"sync_status2"`
|
||||
// 支持服务列表
|
||||
Capabilities []string `json:"capabilities"`
|
||||
|
||||
SCloudproviderUsage
|
||||
|
||||
// 子订阅品牌信息
|
||||
Brand string `json:"brand"`
|
||||
}
|
||||
|
||||
// 云订阅输入参数
|
||||
type CloudproviderResourceInput struct {
|
||||
type ManagedResourceListInput struct {
|
||||
// 列出关联指定云订阅(ID或Name)的资源
|
||||
Cloudprovider string `json:"cloudprovider"`
|
||||
// List objects belonging to the cloud provider
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
Manager string `json:"manager" yunion-deprecated-by:"cloudprovider"`
|
||||
Manager string `json:"manager" "yunion:deprecated-by":"cloudprovider"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
ManagerId string `json:"manager_id" yunion-deprecated-by:"cloudprovider"`
|
||||
ManagerId string `json:"manager_id" "yunion:deprecated-by":"cloudprovider"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudproviderId string `json:"cloudprovider_id" yunion-deprecated-by:"cloudprovider"`
|
||||
}
|
||||
|
||||
type ManagedResourceListInput struct {
|
||||
apis.DomainizedResourceListInput
|
||||
CloudenvResourceListInput
|
||||
|
||||
CloudproviderResourceInput
|
||||
CloudproviderId string `json:"cloudprovider_id" "yunion:deprecated-by":"cloudprovider"`
|
||||
|
||||
// 列出关联指定云账号(ID或Name)的资源
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudaccountId string `json:"cloudaccount_id" yunion-deprecated-by:"cloudaccount"`
|
||||
CloudaccountId string `json:"cloudaccount_id" "yunion:deprecated-by":"cloudaccount"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
Account string `json:"account" yunion-deprecated-by:"cloudaccount"`
|
||||
Account string `json:"account" "yunion:deprecated-by":"cloudaccount"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
AccountId string `json:"account_id" yunion-deprecated-by:"cloudaccount"`
|
||||
AccountId string `json:"account_id" "yunion:deprecated-by":"cloudaccount"`
|
||||
|
||||
// 列出指定云平台的资源,支持的云平台如下
|
||||
//
|
||||
// | Provider | 开始支持版本 | 平台 |
|
||||
// |-----------|------------|-------------------------------------|
|
||||
// | OneCloud | 0.0 | OneCloud内置私有云,包括KVM和裸金属管理 |
|
||||
// | VMware | 1.2 | VMware vCenter |
|
||||
// | OpenStack | 2.6 | OpenStack M版本以上私有云 |
|
||||
// | ZStack | 2.10 | ZStack私有云 |
|
||||
// | Aliyun | 2.0 | 阿里云 |
|
||||
// | Aws | 2.3 | Amazon AWS |
|
||||
// | Azure | 2.2 | Microsoft Azure |
|
||||
// | Google | 2.13 | Google Cloud Platform |
|
||||
// | Qcloud | 2.3 | 腾讯云 |
|
||||
// | Huawei | 2.5 | 华为公有云 |
|
||||
// | Ucloud | 2.7 | UCLOUD |
|
||||
// | Ctyun | 2.13 | 天翼云 |
|
||||
// | S3 | 2.11 | 通用s3对象存储 |
|
||||
// | Ceph | 2.11 | Ceph对象存储 |
|
||||
// | Xsky | 2.11 | XSKY启明星辰Ceph对象存储 |
|
||||
//
|
||||
// enum: OneCloud,VMware,Aliyun,Qcloud,Azure,Aws,Huawei,OpenStack,Ucloud,ZStack,Google,Ctyun,S3,Ceph,Xsky"
|
||||
Providers []string `json:"providers"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Provider []string `json:"provider" "yunion:deprecated-by":"providers"`
|
||||
|
||||
// 列出指定云平台品牌的资源,一般来说brand和provider相同,除了以上支持的provider之外,还支持以下band
|
||||
//
|
||||
// | Brand | Provider | 说明 |
|
||||
// |----------|----------|------------|
|
||||
// | DStack | ZStack | 滴滴云私有云 |
|
||||
//
|
||||
Brands []string `json:"brands"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Brand []string `json:"brand" "yunion:deprecated-by":"brands"`
|
||||
|
||||
// 列出指定云环境的资源,支持云环境如下:
|
||||
//
|
||||
// | CloudEnv | 说明 |
|
||||
// |-----------|--------|
|
||||
// | public | 公有云 |
|
||||
// | private | 私有云 |
|
||||
// | onpremise | 本地IDC |
|
||||
//
|
||||
// enum: public,private,onpremise
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
PublicCloud bool `json:"public_cloud"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsPublic bool `json:"is_public"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
PrivateCloud bool `json:"private_cloud"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsPrivate bool `json:"is_private"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsOnPremise bool `json:"is_on_premise"`
|
||||
|
||||
// 过滤资源,是否为非OneCloud内置私有云管理的资源
|
||||
// default: false
|
||||
IsManaged *bool `json:"is_managed"`
|
||||
|
||||
// 以云账号名称排序
|
||||
// pattern:asc|desc
|
||||
OrderByAccount string `json:"order_by_account"`
|
||||
|
||||
// 以云订阅名称排序
|
||||
// pattern:asc|desc
|
||||
OrderByManager string `json:"order_by_manager"`
|
||||
IsManaged bool `json:"is_managed"`
|
||||
}
|
||||
|
||||
func (input *ManagedResourceListInput) AfterUnmarshal() {
|
||||
@@ -218,20 +274,10 @@ type CloudproviderListInput struct {
|
||||
apis.EnabledStatusStandaloneResourceListInput
|
||||
|
||||
ManagedResourceListInput
|
||||
apis.ProjectizedResourceListInput
|
||||
|
||||
UsableResourceListInput
|
||||
|
||||
CloudregionResourceInput
|
||||
|
||||
ZoneResourceInput
|
||||
|
||||
CapabilityListInput
|
||||
|
||||
SyncableBaseResourceListInput
|
||||
|
||||
// 账号健康状态
|
||||
HealthStatus []string `json:"health_status"`
|
||||
}
|
||||
|
||||
func (input *CapabilityListInput) AfterUnmarshal() {
|
||||
@@ -239,35 +285,3 @@ func (input *CapabilityListInput) AfterUnmarshal() {
|
||||
input.Capability = append(input.Capability, cloudprovider.CLOUD_CAPABILITY_OBJECTSTORE)
|
||||
}
|
||||
}
|
||||
|
||||
type SyncableBaseResourceListInput struct {
|
||||
// 同步状态
|
||||
SyncStatus []string `json:"sync_status"`
|
||||
}
|
||||
|
||||
type CloudproviderUpdateInput struct {
|
||||
apis.EnabledStatusStandaloneResourceBaseUpdateInput
|
||||
}
|
||||
|
||||
type CloudproviderCreateInput struct {
|
||||
}
|
||||
|
||||
type CloudproviderGetStorageClassInput struct {
|
||||
CloudregionResourceInput
|
||||
}
|
||||
|
||||
type CloudproviderGetStorageClassOutput struct {
|
||||
// 对象存储存储类型
|
||||
StorageClasses []string `json:"storage_classes"`
|
||||
}
|
||||
|
||||
type CloudproviderGetCannedAclInput struct {
|
||||
CloudregionResourceInput
|
||||
}
|
||||
|
||||
type CloudproviderGetCannedAclOutput struct {
|
||||
// Bucket支持的预置ACL列表
|
||||
BucketCannedAcls []string `json:"bucket_canned_acls"`
|
||||
// Object支持的预置ACL列表
|
||||
ObjectCannedAcls []string `json:"object_canned_acls"`
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
CLOUD_PROVIDER_QUOTA_RANGE_CLOUDREGION = "cloudregion"
|
||||
CLOUD_PROVIDER_QUOTA_RANGE_CLOUDPROVIDER = "cloudprovider"
|
||||
)
|
||||
|
||||
type CloudproviderQuotaListInput struct {
|
||||
apis.StandaloneResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
ManagedResourceListInput
|
||||
RegionalFilterListInput
|
||||
|
||||
// 配额类型
|
||||
QuotaType string `json:"quota_type"`
|
||||
|
||||
// 配额范围
|
||||
QuotaRange string `json:"quota_range"`
|
||||
}
|
||||
|
||||
type CloudproviderQuotaDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
CloudregionResourceInfo
|
||||
ManagedResourceInfo
|
||||
|
||||
SCloudproviderQuota
|
||||
}
|
||||
@@ -17,10 +17,10 @@ package compute
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CloudproviderregionDetails struct {
|
||||
apis.JointResourceBaseDetails
|
||||
CloudregionResourceInfo
|
||||
apis.JoinModelBaseDetails
|
||||
|
||||
Cloudprovider string `json:"cloudprovider"`
|
||||
Cloudprovider string
|
||||
Cloudregion string
|
||||
|
||||
// 云账号Id
|
||||
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
|
||||
@@ -38,18 +38,4 @@ type CloudproviderregionDetails struct {
|
||||
// 自动同步周期
|
||||
// example: 300
|
||||
SyncIntervalSeconds int `json:"sync_interval_seconds"`
|
||||
|
||||
// 支持服务列表
|
||||
Capabilities []string `json:"capabilities"`
|
||||
}
|
||||
|
||||
type CloudproviderregionListInput struct {
|
||||
apis.JointResourceBaseListInput
|
||||
SyncableBaseResourceListInput
|
||||
RegionalFilterListInput
|
||||
ManagedResourceListInput
|
||||
CapabilityListInput
|
||||
|
||||
// 是否启用
|
||||
Enabled *bool `json:"enabled"`
|
||||
}
|
||||
|
||||
@@ -16,7 +16,10 @@ package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type SCloudregionUsage struct {
|
||||
type CloudregionDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SCloudregion
|
||||
|
||||
// 虚拟私有网络数量
|
||||
// example: 2
|
||||
VpcCount int `json:"vpc_count,allowempty"`
|
||||
@@ -34,26 +37,11 @@ type SCloudregionUsage struct {
|
||||
GuestIncrementCount int `json:"guest_increment_count,allowempty"`
|
||||
}
|
||||
|
||||
type CloudregionDetails struct {
|
||||
apis.EnabledStatusStandaloneResourceDetails
|
||||
|
||||
SCloudregionUsage
|
||||
|
||||
SCloudregion
|
||||
|
||||
// 云类型, public, private or onpremise
|
||||
// example: public
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
}
|
||||
|
||||
type CloudregionResourceInfo struct {
|
||||
type CloudregionInfo struct {
|
||||
// 区域的名称
|
||||
// example: Default
|
||||
Region string `json:"region"`
|
||||
|
||||
// 区域的名称
|
||||
Cloudregion string `json:"cloudregion"`
|
||||
|
||||
// 区域的Id
|
||||
// example: default
|
||||
RegionId string `json:"region_id"`
|
||||
|
||||
@@ -21,7 +21,6 @@ type DBInstanceCreateInput struct {
|
||||
DeletePreventableCreateInput
|
||||
|
||||
// Ip子网名称或Id,建议使用Id
|
||||
// 谷歌云并不实际使用Ip子网,仅仅通过Ip子网确定Vpc
|
||||
// required: true
|
||||
Network string `json:"network"`
|
||||
// swagger:ignore
|
||||
@@ -97,11 +96,10 @@ type DBInstanceCreateInput struct {
|
||||
//
|
||||
//
|
||||
//
|
||||
// | 平台 | 支持类型 | 说明 |
|
||||
// | ----- | ------ | --- |
|
||||
// | 华为云 |ha, single, replica| |
|
||||
// | 阿里云 |basic, high_availability, always_on, finance||
|
||||
// | Google |Zonal, Regional | |
|
||||
// | 平台 | 支持类型 |
|
||||
// | ----- | ------ |
|
||||
// | 华为云 |ha, single, replica|
|
||||
// | 阿里云 |basic, high_availability, always_on, finance|
|
||||
// 翻译:
|
||||
// basic: 基础版
|
||||
// high_availability: 高可用
|
||||
@@ -110,8 +108,6 @@ type DBInstanceCreateInput struct {
|
||||
// ha: 高可用
|
||||
// single: 单机
|
||||
// replica: 只读
|
||||
// Zonal: 单区域
|
||||
// Regional: 区域级
|
||||
// required: true
|
||||
Category string `json:"category"`
|
||||
|
||||
@@ -122,10 +118,6 @@ type DBInstanceCreateInput struct {
|
||||
// | 平台 | 支持类型 |
|
||||
// | 华为云 |SSD, SAS, SATA|
|
||||
// | 阿里云 |local_ssd, cloud_essd, cloud_ssd|
|
||||
// | Google |PD_SSD, PD_HDD|
|
||||
// 翻译:
|
||||
// PD_SSD: SSD
|
||||
// PD_HDD: HDD
|
||||
// required: true
|
||||
StorageType string `json:"storage_type"`
|
||||
|
||||
@@ -137,14 +129,8 @@ type DBInstanceCreateInput struct {
|
||||
// rds初始化密码
|
||||
// 阿里云不需要此参数
|
||||
// 华为云会默认创建一个用户,若不传此参数, 则为随机密码
|
||||
// 谷歌云会默认创建一个用户,若不传此参数, 则为随机密码
|
||||
Password string `json:"password"`
|
||||
|
||||
// 是否不设置初始密码
|
||||
// 华为云不支持此参数
|
||||
// 谷歌云仅mysql支持此参数
|
||||
ResetPassword *bool `json:"reset_password"`
|
||||
|
||||
// rds实例cpu大小
|
||||
// 若指定实例套餐,此参数将根据套餐设置
|
||||
VcpuCount int `json:"vcpu_count"`
|
||||
@@ -171,124 +157,72 @@ type SDBInstanceChangeConfigInput struct {
|
||||
type SDBInstanceRecoveryConfigInput struct {
|
||||
apis.Meta
|
||||
|
||||
// swagger:ignore
|
||||
DBInstancebackup string `json:"dbinstancebackup" yunion-deprecated-by:"dbinstancebackup_id"`
|
||||
|
||||
// 备份Id
|
||||
//
|
||||
//
|
||||
// | 平台 | 支持引擎 | 说明 |
|
||||
// | ----- | ------ | --- |
|
||||
// | 华为云 |MySQL, SQL Server | 仅SQL Server支持恢复到当前实例 |
|
||||
// | 阿里云 |MySQL, SQL Server | MySQL要求必须开启单库单表恢复功能 并且只能是MySQL 8.0 高可用版(本地SSD盘)MySQL 5.7 高可用版(本地SSD盘)或MySQL 5.6 高可用版, MySQL仅支持恢复到当前实例|
|
||||
// | Google |MySQL, PostgreSQL, SQL Server | PostgreSQL备份恢复时,要求实例不能有副本 |
|
||||
DBInstancebackupId string `json:"dbinstancebackup_id"`
|
||||
|
||||
// 数据库信息, 例如 {"src":"dest"} 是将备份中的src数据库恢复到目标实例的dest数据库中, 阿里云此参数为必传
|
||||
// example: {"sdb1":"ddb1"}
|
||||
Databases map[string]string `json:"databases,allowempty"`
|
||||
DBInstancebackup string
|
||||
DBInstancebackupId string `json:"dbinstancebackup_id"`
|
||||
Databases map[string]string `json:"databases,allowempty"`
|
||||
}
|
||||
|
||||
type DBInstanceListInput struct {
|
||||
apis.VirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
apis.DeletePreventableResourceBaseListInput
|
||||
|
||||
ZonalFilterListInput
|
||||
ManagedResourceListInput
|
||||
VpcFilterListInput
|
||||
|
||||
ZoneResourceInput
|
||||
|
||||
MasterInstance string `json:"master_instance"`
|
||||
|
||||
VcpuCount int `json:"vcpu_count"`
|
||||
|
||||
VmemSizeMb int `json:"vmem_size_mb"`
|
||||
|
||||
StorageType string `json:"storage_type"`
|
||||
|
||||
Category string `json:"category"`
|
||||
|
||||
Engine string `json:"engine"`
|
||||
|
||||
EngineVersion string `json:"engine_version"`
|
||||
|
||||
InstanceType string `json:"instance_type"`
|
||||
}
|
||||
|
||||
type DBInstanceBackupListInput struct {
|
||||
apis.VirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
ManagedResourceListInput
|
||||
RegionalFilterListInput
|
||||
|
||||
DBInstanceFilterListInputBase
|
||||
|
||||
// RDS引擎
|
||||
// example: MySQL
|
||||
Engine []string `json:"engine"`
|
||||
|
||||
// RDS引擎版本
|
||||
// example: 5.7
|
||||
EngineVersion []string `json:"engine_version"`
|
||||
|
||||
// 备份模式
|
||||
BackupMode []string `json:"backup_mode"`
|
||||
|
||||
// 数据库名称
|
||||
DBNames string `json:"db_names"`
|
||||
DbinstanceFilterListInput
|
||||
}
|
||||
|
||||
type DBInstancePrivilegeListInput struct {
|
||||
apis.ResourceBaseListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
// filter by dbinstanceaccount
|
||||
Dbinstanceaccount string `json:"dbinstanceaccount"`
|
||||
// filter by dbinstancedatabase
|
||||
Dbinstancedatabase string `json:"dbinstancedatabase"`
|
||||
|
||||
// 权限
|
||||
Privilege []string `json:"privilege"`
|
||||
}
|
||||
|
||||
type DBInstanceParameterListInput struct {
|
||||
apis.StandaloneResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
DBInstanceFilterListInput
|
||||
|
||||
// 参数名称
|
||||
Key []string `json:"key"`
|
||||
|
||||
// 参数值
|
||||
Value []string `json:"value"`
|
||||
DbinstanceFilterListInput
|
||||
}
|
||||
|
||||
type DBInstanceDatabaseListInput struct {
|
||||
apis.StatusStandaloneResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
DBInstanceFilterListInput
|
||||
|
||||
// 数据库字符集
|
||||
CharacterSet []string `json:"character_set"`
|
||||
DbinstanceFilterListInput
|
||||
}
|
||||
|
||||
type DBInstanceAccountListInput struct {
|
||||
apis.StatusStandaloneResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
DBInstanceFilterListInput
|
||||
DbinstanceFilterListInput
|
||||
}
|
||||
|
||||
type DbinstanceFilterListInput struct {
|
||||
// filter by dbinstance
|
||||
Dbinstance string `json:"dbinstance"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by dbinstance_id
|
||||
DbinstanceId string `json:"dbinstance_id" "yunion:deprecated-by":"dbinstance"`
|
||||
}
|
||||
|
||||
type DBInstanceDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
CloudregionResourceInfo
|
||||
ManagedResourceInfo
|
||||
|
||||
VpcResourceInfoBase
|
||||
|
||||
SDBInstance
|
||||
|
||||
CloudproviderInfo
|
||||
// 虚拟私有网络名称
|
||||
// example: test-vpc
|
||||
Vpc string `json:"vpc"`
|
||||
// 安全组名称
|
||||
// example: Default
|
||||
Secgroup string `json:"secgroup"`
|
||||
@@ -298,47 +232,6 @@ type DBInstanceDetails struct {
|
||||
// IP子网名称
|
||||
// example: test-network
|
||||
Network string `json:"network"`
|
||||
|
||||
// Zone1名称
|
||||
Zone1Name string `json:"zone1_name"`
|
||||
// Zone2名称
|
||||
Zone2Name string `json:"zone2_name"`
|
||||
// Zone3名称
|
||||
Zone3Name string `json:"zone3_name"`
|
||||
}
|
||||
|
||||
type DBInstanceResourceInfoBase struct {
|
||||
// RDS实例名称
|
||||
DBInstance string `json:"dbinstance"`
|
||||
}
|
||||
|
||||
type DBInstanceResourceInfo struct {
|
||||
DBInstanceResourceInfoBase
|
||||
|
||||
// 归属VPC ID
|
||||
VpcId string `json:"vpc_id"`
|
||||
|
||||
VpcResourceInfo
|
||||
}
|
||||
|
||||
type DBInstanceResourceInput struct {
|
||||
// RDS实例(ID or Name)
|
||||
DBInstance string `json:"dbinstance"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
DBInstanceId string `json:"dbinstance_id" yunion-deprecated-by:"dbinstance"`
|
||||
}
|
||||
|
||||
type DBInstanceFilterListInputBase struct {
|
||||
DBInstanceResourceInput
|
||||
|
||||
// 以RDS实例名字排序
|
||||
OrderByDBInstance string `json:"order_by_dbinstance"`
|
||||
}
|
||||
|
||||
type DBInstanceFilterListInput struct {
|
||||
DBInstanceFilterListInputBase
|
||||
|
||||
VpcFilterListInput
|
||||
// 标签信息
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
}
|
||||
|
||||
@@ -70,24 +70,19 @@ type SDBInstanceSetPrivilegesInput struct {
|
||||
|
||||
type DBInstancePrivilege struct {
|
||||
// 数据库名称
|
||||
Database string `json:"database"`
|
||||
Database string
|
||||
// 账号名称
|
||||
Account string `json:"account"`
|
||||
Account string
|
||||
// 数据库Id
|
||||
DBInstancedatabaseId string `json:"dbinstancedatabase_id"`
|
||||
DBInstancedatabaseId string
|
||||
// 权限
|
||||
Privileges string `json:"privileges"`
|
||||
Privileges string
|
||||
}
|
||||
|
||||
type DBInstanceAccountDetails struct {
|
||||
apis.StatusStandaloneResourceDetails
|
||||
apis.ProjectizedResourceInfo
|
||||
DBInstanceResourceInfo
|
||||
|
||||
apis.StandaloneResourceDetails
|
||||
SDBInstanceAccount
|
||||
|
||||
// 账号权限列表
|
||||
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges,allowempty"`
|
||||
|
||||
ProjectId string `json:"tenant_id"`
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user