mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
Compare commits
833 Commits
v4.0.4-rc.
...
v3.11.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73c30aa8ae | ||
|
|
5b4013114e | ||
|
|
6bef36bcac | ||
|
|
19e064d887 | ||
|
|
d5eed29ac1 | ||
|
|
5de92baa9d | ||
|
|
12668a71cb | ||
|
|
526b3f55d1 | ||
|
|
db48b7519b | ||
|
|
03494857be | ||
|
|
ecad5735c5 | ||
|
|
bbed855100 | ||
|
|
55e04f3ba6 | ||
|
|
a7b5f47ac7 | ||
|
|
8545faf413 | ||
|
|
8c9357ac99 | ||
|
|
ab9f65fed2 | ||
|
|
cb01f13b53 | ||
|
|
913169f7c4 | ||
|
|
c75c77e405 | ||
|
|
6b53d47253 | ||
|
|
ec11fc7b59 | ||
|
|
fb39f7c3a1 | ||
|
|
dabf9b4f49 | ||
|
|
f5cf42a511 | ||
|
|
78a18320d1 | ||
|
|
f91ceb84b1 | ||
|
|
b0ff819b22 | ||
|
|
dece32cbe8 | ||
|
|
a21dba1d17 | ||
|
|
24ac759245 | ||
|
|
b8b48b4d6e | ||
|
|
a9c166d8fd | ||
|
|
6546056fbf | ||
|
|
b65abfe76a | ||
|
|
cafb619a9f | ||
|
|
cdde2bafa1 | ||
|
|
7f11f43f0f | ||
|
|
422c3aeaba | ||
|
|
fb5da2667a | ||
|
|
84b8111341 | ||
|
|
c432a59298 | ||
|
|
f7b227274b | ||
|
|
b13b0725e1 | ||
|
|
641410bf35 | ||
|
|
242b87f395 | ||
|
|
7b376aa537 | ||
|
|
da16872cfd | ||
|
|
98367e7f47 | ||
|
|
5366526d0e | ||
|
|
547680a6e2 | ||
|
|
fff5cd1a23 | ||
|
|
4765550813 | ||
|
|
a981235aed | ||
|
|
7996cce2e9 | ||
|
|
a81ca98f1d | ||
|
|
b40122f9d3 | ||
|
|
3c977a1f4a | ||
|
|
e556efa8b0 | ||
|
|
795ebbd5e9 | ||
|
|
7ce25f00bd | ||
|
|
b49c22b749 | ||
|
|
a21370c96a | ||
|
|
3ffea07d31 | ||
|
|
9b13891c13 | ||
|
|
dd4095630d | ||
|
|
aa2c39202a | ||
|
|
ecba5d4546 | ||
|
|
3eb713bffe | ||
|
|
386fadb407 | ||
|
|
7674b9fafa | ||
|
|
698cc2f99a | ||
|
|
acfa5e3634 | ||
|
|
b08bb79f0b | ||
|
|
081886c9c6 | ||
|
|
733a684671 | ||
|
|
6336c5858f | ||
|
|
c0822a43d6 | ||
|
|
7a2c092548 | ||
|
|
d8fe2ce5dd | ||
|
|
6415beac2b | ||
|
|
a14b932208 | ||
|
|
b0351bc879 | ||
|
|
bb876962f6 | ||
|
|
5a580cbe54 | ||
|
|
86d4b45ea6 | ||
|
|
3c5f09fdab | ||
|
|
53ae0e2f02 | ||
|
|
7be62a8e88 | ||
|
|
6c4532e581 | ||
|
|
5c42f663eb | ||
|
|
32e1d6cdd1 | ||
|
|
fec1c01cec | ||
|
|
725d952f83 | ||
|
|
c71e819280 | ||
|
|
bedb0c0a6a | ||
|
|
365de1be8b | ||
|
|
0ebd7370d1 | ||
|
|
f7dc234099 | ||
|
|
2338fd1e34 | ||
|
|
66b58af9bc | ||
|
|
027f5749fa | ||
|
|
b7ddcc7ba4 | ||
|
|
42428ecd60 | ||
|
|
72ece6d698 | ||
|
|
2258c9e15f | ||
|
|
d5ac3657e8 | ||
|
|
bb3f183872 | ||
|
|
75fd08aef0 | ||
|
|
9963ef5684 | ||
|
|
eaed04d940 | ||
|
|
aeab217763 | ||
|
|
141b03667b | ||
|
|
9e5b1a681c | ||
|
|
5664981943 | ||
|
|
121e048a26 | ||
|
|
c3e5304a6b | ||
|
|
8159a6d86c | ||
|
|
2de0bf27f5 | ||
|
|
9e9a45d986 | ||
|
|
cc475e663c | ||
|
|
832c5ada8d | ||
|
|
a6f1402b94 | ||
|
|
cbada729be | ||
|
|
a764ddedfa | ||
|
|
f935d2a62d | ||
|
|
4dd874e0be | ||
|
|
beeae3c163 | ||
|
|
9eae3cf564 | ||
|
|
f2f78a10ed | ||
|
|
164ea30840 | ||
|
|
036aca1569 | ||
|
|
0b82fcf60d | ||
|
|
9ec9f3e14f | ||
|
|
4f43e6d121 | ||
|
|
f57e69e6b3 | ||
|
|
0f0fd934e7 | ||
|
|
b065b2b77d | ||
|
|
e27dbf1266 | ||
|
|
501f0c9393 | ||
|
|
7b78f77b99 | ||
|
|
a220222d17 | ||
|
|
8508b8551a | ||
|
|
895e46256b | ||
|
|
7d0bcfbea2 | ||
|
|
ade927c9dd | ||
|
|
ffac25beb0 | ||
|
|
2e78621401 | ||
|
|
efbcaf5532 | ||
|
|
d440a57f6e | ||
|
|
5841593a55 | ||
|
|
e918d6d0f1 | ||
|
|
6f73da08b7 | ||
|
|
9e10ad4e21 | ||
|
|
d690f923ed | ||
|
|
87e5add5e8 | ||
|
|
ff1ea0f7ef | ||
|
|
719fd389e3 | ||
|
|
85dac7d7cd | ||
|
|
85416d828d | ||
|
|
059d3273b2 | ||
|
|
bf417ce9f0 | ||
|
|
def5478dda | ||
|
|
0bc7f8f80a | ||
|
|
8b7ab5cff2 | ||
|
|
8685f3b17b | ||
|
|
a976931ea5 | ||
|
|
68eeb1ba12 | ||
|
|
3eed5b59c4 | ||
|
|
10e7e8cf22 | ||
|
|
68c47b4ee9 | ||
|
|
ce876e9ab2 | ||
|
|
dd580c9af1 | ||
|
|
87c8461960 | ||
|
|
bc478687a9 | ||
|
|
84174f58f0 | ||
|
|
e4ab58f7eb | ||
|
|
41db55345b | ||
|
|
ebf5e3cf90 | ||
|
|
9c303a1795 | ||
|
|
70fb9a76b2 | ||
|
|
25a2f3a3ed | ||
|
|
299846783d | ||
|
|
5cf7946b33 | ||
|
|
153ea3a1d2 | ||
|
|
47baaf6297 | ||
|
|
69202744a2 | ||
|
|
b4039038a4 | ||
|
|
54925e8de4 | ||
|
|
31b3432189 | ||
|
|
5bc8219e56 | ||
|
|
69ec88a05f | ||
|
|
be449a610a | ||
|
|
d4d8028dea | ||
|
|
0504084f25 | ||
|
|
9d0380c5de | ||
|
|
6b26413077 | ||
|
|
7156c24d68 | ||
|
|
70f666d262 | ||
|
|
87c001b0b8 | ||
|
|
3b8acbc2e2 | ||
|
|
c180066c95 | ||
|
|
73c3683529 | ||
|
|
0fbd11fa07 | ||
|
|
8d5c516540 | ||
|
|
7c6616d1dc | ||
|
|
d3017e5ca3 | ||
|
|
89307a4ae9 | ||
|
|
2818e47d90 | ||
|
|
55d966bca9 | ||
|
|
ed2dd1f548 | ||
|
|
23ab9b6cd6 | ||
|
|
7cf03d7a7e | ||
|
|
6e820b1945 | ||
|
|
7467c6de6a | ||
|
|
e79a81eb0a | ||
|
|
d522db3f8c | ||
|
|
5ab009f7e9 | ||
|
|
a35243f26c | ||
|
|
ed67e20b04 | ||
|
|
147af900c6 | ||
|
|
cf4e1fd15d | ||
|
|
45c399066f | ||
|
|
cb77c0e21f | ||
|
|
b8db3e5f09 | ||
|
|
6581ab2202 | ||
|
|
2fa97cd09a | ||
|
|
cd47b45f57 | ||
|
|
8888107741 | ||
|
|
6282060ab2 | ||
|
|
103ec2220e | ||
|
|
926b389f4e | ||
|
|
7cbff93e0d | ||
|
|
52b08e6e3e | ||
|
|
629c9982ab | ||
|
|
e62b5c1fc2 | ||
|
|
4513e4beb6 | ||
|
|
9228a973a8 | ||
|
|
abe226008a | ||
|
|
341fe8d5a5 | ||
|
|
3a357b343d | ||
|
|
6186e73608 | ||
|
|
5cab69547a | ||
|
|
bac856527d | ||
|
|
98a8d28e09 | ||
|
|
1c94dac7b6 | ||
|
|
e2149d01b6 | ||
|
|
c51150e756 | ||
|
|
ca7621cfb0 | ||
|
|
8321100c51 | ||
|
|
af3daeafb1 | ||
|
|
b240047cce | ||
|
|
092eaf6870 | ||
|
|
85efe57b22 | ||
|
|
797f2cc6d9 | ||
|
|
dffd27e2bc | ||
|
|
579cba8b6f | ||
|
|
bbf5c4afb3 | ||
|
|
d0304058b2 | ||
|
|
97fc5258df | ||
|
|
0f2e11591f | ||
|
|
5bef00a3a8 | ||
|
|
38834f3b1f | ||
|
|
52404a26d9 | ||
|
|
31bade24e7 | ||
|
|
f6a9b77698 | ||
|
|
85b6ad8a34 | ||
|
|
2069906d7b | ||
|
|
eef9e48e02 | ||
|
|
1bd5f73365 | ||
|
|
70c280af77 | ||
|
|
08f92a8d89 | ||
|
|
0c4b30335b | ||
|
|
f3f9fa9886 | ||
|
|
bf320a5b32 | ||
|
|
c5dcc6fa1d | ||
|
|
317b8b7a3b | ||
|
|
1456f31d45 | ||
|
|
b2de0282f6 | ||
|
|
9efb34f7c7 | ||
|
|
b03650d97f | ||
|
|
31f6a4026d | ||
|
|
74932360b5 | ||
|
|
629ca22509 | ||
|
|
1e5d988346 | ||
|
|
7662f88edc | ||
|
|
a4758fbd15 | ||
|
|
c7d6b053e5 | ||
|
|
59dcb4260d | ||
|
|
483a97e6ad | ||
|
|
9e61ae2c63 | ||
|
|
d6925ac5a9 | ||
|
|
84f88b705b | ||
|
|
d3ec086f9c | ||
|
|
6d3551745b | ||
|
|
f56e34ce77 | ||
|
|
5d55f60453 | ||
|
|
681a43d160 | ||
|
|
0dbaba06d4 | ||
|
|
c7c6477798 | ||
|
|
cd45fd7e6b | ||
|
|
afbd0f922f | ||
|
|
5c61e4c46c | ||
|
|
de25515eb0 | ||
|
|
0464bf5239 | ||
|
|
9eec520567 | ||
|
|
56869281c4 | ||
|
|
78123d0335 | ||
|
|
9442b445d0 | ||
|
|
08fdf688d4 | ||
|
|
775d70be15 | ||
|
|
ab29fa4c70 | ||
|
|
21876d631c | ||
|
|
ed2a412ed2 | ||
|
|
9c2dd4b0ea | ||
|
|
a605f69560 | ||
|
|
c8aed17eb2 | ||
|
|
6a708c2c6a | ||
|
|
fb91b1e3eb | ||
|
|
45ee4b1b89 | ||
|
|
22e7a3383a | ||
|
|
fdf0c40119 | ||
|
|
af4c02c0f1 | ||
|
|
e18ad59800 | ||
|
|
3ad45a3cf9 | ||
|
|
6f22beca3c | ||
|
|
826532c5f9 | ||
|
|
dc8c06a037 | ||
|
|
c0909bdd53 | ||
|
|
0cafaf7445 | ||
|
|
c132ae0cd6 | ||
|
|
bf6a035b53 | ||
|
|
4187111862 | ||
|
|
d01474470c | ||
|
|
36254142a9 | ||
|
|
15425550ef | ||
|
|
cc1a5bcd2c | ||
|
|
e2e357f89c | ||
|
|
a42ce1792e | ||
|
|
8c50a52fe0 | ||
|
|
72cd6e3e32 | ||
|
|
c58a3fd48a | ||
|
|
c1606f751d | ||
|
|
8bea62e5b9 | ||
|
|
4b2509d72b | ||
|
|
e5829292e9 | ||
|
|
e8f3e390ba | ||
|
|
cef7656187 | ||
|
|
3c6da1faac | ||
|
|
3b313f11ab | ||
|
|
3d703b9ed9 | ||
|
|
05fda8da59 | ||
|
|
27a9fab7cb | ||
|
|
d95380c6d1 | ||
|
|
f543323b51 | ||
|
|
845123b1b0 | ||
|
|
533b240a28 | ||
|
|
416a26d12e | ||
|
|
53dc58dc69 | ||
|
|
f40c4e0644 | ||
|
|
270c2ff5fd | ||
|
|
cff4a7adac | ||
|
|
7149904806 | ||
|
|
e941f84ce2 | ||
|
|
8cf0b0e216 | ||
|
|
9cce3064b3 | ||
|
|
3a9aab679e | ||
|
|
541464f035 | ||
|
|
abd0409f88 | ||
|
|
00283e54d2 | ||
|
|
28f58bca71 | ||
|
|
449937a7ce | ||
|
|
a845b12294 | ||
|
|
c958e588b9 | ||
|
|
d19cd2ab53 | ||
|
|
4f3948b6e5 | ||
|
|
c4ebe1d2e4 | ||
|
|
4f6ffac66d | ||
|
|
3b8549d8c7 | ||
|
|
bdd9953199 | ||
|
|
9f40a68157 | ||
|
|
486aa4edf4 | ||
|
|
5511fd7652 | ||
|
|
7e8d6ee4b0 | ||
|
|
9f7f0f7caa | ||
|
|
28a25ebade | ||
|
|
5593f125db | ||
|
|
3f71995205 | ||
|
|
c381cbde23 | ||
|
|
3a52563646 | ||
|
|
b8625cb2ab | ||
|
|
182662d5d1 | ||
|
|
b55a39cc84 | ||
|
|
382d8f6f39 | ||
|
|
0fa95647d5 | ||
|
|
b4f6c11538 | ||
|
|
aa210a77f6 | ||
|
|
0bfc248ecc | ||
|
|
a1ab937ef7 | ||
|
|
8415fee8c4 | ||
|
|
84d692dbad | ||
|
|
d839af0a58 | ||
|
|
97425a471a | ||
|
|
bb3f48a374 | ||
|
|
21132195a9 | ||
|
|
1c2e36a40b | ||
|
|
c6401d7694 | ||
|
|
e7f446047c | ||
|
|
7a922aeede | ||
|
|
9b0648fca8 | ||
|
|
62103bd7dd | ||
|
|
d37a437e0d | ||
|
|
e11af2d012 | ||
|
|
40681ccf44 | ||
|
|
8955cd8e1d | ||
|
|
a9285aff4b | ||
|
|
f5e837ec75 | ||
|
|
83d9774ed6 | ||
|
|
fc235cbb88 | ||
|
|
b288cda5c7 | ||
|
|
8b4d4bbb3a | ||
|
|
c31d40d31e | ||
|
|
20d18137a5 | ||
|
|
9ce5fa6290 | ||
|
|
5700b3555d | ||
|
|
fd1910480e | ||
|
|
727390d6d5 | ||
|
|
01f38f9f3e | ||
|
|
724fbac416 | ||
|
|
4823e1b471 | ||
|
|
004cedc130 | ||
|
|
2292a08364 | ||
|
|
fff91b8eca | ||
|
|
644b2a20ab | ||
|
|
0e5a31c41e | ||
|
|
7103249d75 | ||
|
|
b9c7c59188 | ||
|
|
746a96722c | ||
|
|
b66c3efd27 | ||
|
|
ec08fce85a | ||
|
|
ef5fee6c8b | ||
|
|
1f25fc17b8 | ||
|
|
d811d64fce | ||
|
|
c19596176c | ||
|
|
f7db51b504 | ||
|
|
f4d9166c79 | ||
|
|
aef50a49a6 | ||
|
|
a5f2194afc | ||
|
|
796bea5d7c | ||
|
|
d2bf8c44ad | ||
|
|
3258a85236 | ||
|
|
ee102ca0c6 | ||
|
|
afd5a1f716 | ||
|
|
34a1f623ef | ||
|
|
4e8cea612a | ||
|
|
e9cea00f2d | ||
|
|
b81d367f95 | ||
|
|
91ced9d0f4 | ||
|
|
22b68fe2d4 | ||
|
|
d0e8273b51 | ||
|
|
4959215d7a | ||
|
|
cc1c57155c | ||
|
|
5d886e304d | ||
|
|
100f41bdd9 | ||
|
|
590cba97bb | ||
|
|
a8f985a188 | ||
|
|
8eaa742333 | ||
|
|
ed990bd55f | ||
|
|
837c29e34f | ||
|
|
7cadeea34f | ||
|
|
9da12b090a | ||
|
|
5ae6751ad3 | ||
|
|
1570a14746 | ||
|
|
8bfb666129 | ||
|
|
df3571f972 | ||
|
|
0060fce771 | ||
|
|
db7808a683 | ||
|
|
4cbd9fcdfd | ||
|
|
fb86463bbf | ||
|
|
887132e297 | ||
|
|
370c405684 | ||
|
|
92c23a245b | ||
|
|
bd54efcd2e | ||
|
|
f212295104 | ||
|
|
bc5982907e | ||
|
|
01e764e62e | ||
|
|
5698d47252 | ||
|
|
3ec0372159 | ||
|
|
76b81e33d4 | ||
|
|
19378997ee | ||
|
|
b20ec7bdb3 | ||
|
|
32f2bc5821 | ||
|
|
ffafcdb7c1 | ||
|
|
7a87d00304 | ||
|
|
d6fd14c39a | ||
|
|
f65d175990 | ||
|
|
3bc094e9d7 | ||
|
|
45bec04fde | ||
|
|
973ef23b42 | ||
|
|
4c9e7e1ddd | ||
|
|
673d67f586 | ||
|
|
f243c3d66f | ||
|
|
c31ace6222 | ||
|
|
e17ace8c64 | ||
|
|
9079f4c8bb | ||
|
|
f4e0db5c11 | ||
|
|
fe78f19e14 | ||
|
|
e333fb6f36 | ||
|
|
3739da2114 | ||
|
|
7bc08d6dfe | ||
|
|
5aeb7eabcb | ||
|
|
1647a7dd00 | ||
|
|
d259d7adc9 | ||
|
|
a76d8fc4f3 | ||
|
|
13d26f7b43 | ||
|
|
362e5467c8 | ||
|
|
8472fe65b6 | ||
|
|
0b8c6a0255 | ||
|
|
75435de8a8 | ||
|
|
a3270d53e9 | ||
|
|
dc7a451a4d | ||
|
|
12aaad6cd9 | ||
|
|
22b098b4a2 | ||
|
|
731af95698 | ||
|
|
32a7f70edd | ||
|
|
9e42caa08b | ||
|
|
98e818b182 | ||
|
|
3aa27eaad5 | ||
|
|
283a6fa5aa | ||
|
|
3a9b11c57d | ||
|
|
2dec7a3726 | ||
|
|
f8284d8bc1 | ||
|
|
20167c2afd | ||
|
|
8adf5abf86 | ||
|
|
06dc39a591 | ||
|
|
6bef6a1cb6 | ||
|
|
04c6ee73a8 | ||
|
|
f7c83468ea | ||
|
|
39f3c7a1e4 | ||
|
|
7fd56f1baa | ||
|
|
c6f6329bcd | ||
|
|
fef1b4a578 | ||
|
|
c309fdd3c1 | ||
|
|
7504c2eb5b | ||
|
|
ffb8ff3df8 | ||
|
|
ece44e0698 | ||
|
|
d0f045b65f | ||
|
|
bd7319daf7 | ||
|
|
7461a25508 | ||
|
|
16d6212c45 | ||
|
|
8fb19b87d2 | ||
|
|
c763fc68dc | ||
|
|
46b435ca5b | ||
|
|
cd9ee7bc9a | ||
|
|
acac041bec | ||
|
|
950a02183b | ||
|
|
440a7fa5fc | ||
|
|
1abb1086ed | ||
|
|
4c84f1cbe1 | ||
|
|
28644d3da4 | ||
|
|
5bf44a67ac | ||
|
|
340f458ff4 | ||
|
|
89efdbc642 | ||
|
|
885f4ebcd8 | ||
|
|
7783546754 | ||
|
|
b3580ab64f | ||
|
|
a757ea3dd8 | ||
|
|
b2b60ff660 | ||
|
|
30ee89a390 | ||
|
|
9706339eac | ||
|
|
aa6e34e98d | ||
|
|
e99c7bed63 | ||
|
|
c810a3b144 | ||
|
|
77ff5fcd44 | ||
|
|
64027a3280 | ||
|
|
8606e6cfbd | ||
|
|
0ad56aa42f | ||
|
|
4c2d42a79f | ||
|
|
9b8094c9a5 | ||
|
|
7702776d8f | ||
|
|
65d66edbc7 | ||
|
|
b3180bd87a | ||
|
|
aad04d9cdc | ||
|
|
845eecc217 | ||
|
|
59f5c5beea | ||
|
|
1a2c830a76 | ||
|
|
55707f159a | ||
|
|
a6928cfa67 | ||
|
|
d9e8372d90 | ||
|
|
550bfc53b4 | ||
|
|
6ee1dbedb0 | ||
|
|
2de131eb27 | ||
|
|
c43f0cedf6 | ||
|
|
5183678684 | ||
|
|
08288b2d75 | ||
|
|
de19868d32 | ||
|
|
6a7c109c83 | ||
|
|
cacb1e3c6f | ||
|
|
54ec8acbeb | ||
|
|
4f96f2e5fa | ||
|
|
889e9577ef | ||
|
|
698937280a | ||
|
|
bac8ecf432 | ||
|
|
853855d174 | ||
|
|
0450883be1 | ||
|
|
b6247630f9 | ||
|
|
4c8fd267a8 | ||
|
|
82be65ecaf | ||
|
|
ffcc092089 | ||
|
|
7ca7bf48ab | ||
|
|
fc4cc7d0b1 | ||
|
|
0fd0284051 | ||
|
|
5b930df74f | ||
|
|
c0db929d4c | ||
|
|
3f74e94e8f | ||
|
|
2ea7da3746 | ||
|
|
1e196b1a9d | ||
|
|
07b6906d30 | ||
|
|
1b6c3aa20a | ||
|
|
1a1d941d30 | ||
|
|
9ff75d4656 | ||
|
|
181c99868e | ||
|
|
634e52142a | ||
|
|
af80f0d82c | ||
|
|
eaa5c52456 | ||
|
|
f7a17d64d6 | ||
|
|
422ae1e511 | ||
|
|
4e44ae2932 | ||
|
|
38e11808df | ||
|
|
c9d20e7a14 | ||
|
|
8282619b86 | ||
|
|
4178d46cd9 | ||
|
|
be5075a74b | ||
|
|
b9aadb704d | ||
|
|
0a78de3166 | ||
|
|
a84676af7c | ||
|
|
84c1c7d8d4 | ||
|
|
858af35887 | ||
|
|
ddc2b319ed | ||
|
|
d6b28d270f | ||
|
|
49c813659b | ||
|
|
9d0e545c66 | ||
|
|
2f7c4cd671 | ||
|
|
08dd95748c | ||
|
|
9b1622325f | ||
|
|
5480dfd1c8 | ||
|
|
da3167d3bc | ||
|
|
c5923cc4b9 | ||
|
|
732d70d6e5 | ||
|
|
d33e1f6371 | ||
|
|
8fddf20c68 | ||
|
|
9e2e2d6b8d | ||
|
|
304e520ce6 | ||
|
|
c895e5bc7c | ||
|
|
c24b0a4082 | ||
|
|
f4b74c790c | ||
|
|
30f2fda002 | ||
|
|
097237eb8c | ||
|
|
69e8ab1936 | ||
|
|
0f8443905a | ||
|
|
f58532081e | ||
|
|
335ff385c5 | ||
|
|
99563805ec | ||
|
|
03b9501ccb | ||
|
|
06f3ca8588 | ||
|
|
7f0fdc3739 | ||
|
|
6fb42c4d2c | ||
|
|
3b98af9628 | ||
|
|
3364a94082 | ||
|
|
0b3ae628c4 | ||
|
|
eb7eb8795b | ||
|
|
9064790c84 | ||
|
|
af70eec115 | ||
|
|
7a6a962790 | ||
|
|
fc8c45e2de | ||
|
|
d867fd0251 | ||
|
|
fb911b41ab | ||
|
|
756fd92a27 | ||
|
|
a3b080334c | ||
|
|
f03617c18f | ||
|
|
f547d6bc47 | ||
|
|
c1d148d4e3 | ||
|
|
ecc63f3501 | ||
|
|
9ce1f2322c | ||
|
|
f0ac779e55 | ||
|
|
835bdf2c15 | ||
|
|
0508225799 | ||
|
|
069a9a8eaf | ||
|
|
14300e2f91 | ||
|
|
204a059cae | ||
|
|
675468f48c | ||
|
|
6476cea4dc | ||
|
|
860109369d | ||
|
|
82f1952842 | ||
|
|
601d539bba | ||
|
|
e89c3a78da | ||
|
|
80b4caeeda | ||
|
|
f1394bed02 | ||
|
|
f4d34c8ee4 | ||
|
|
e2fb312311 | ||
|
|
e2af2f2602 | ||
|
|
6fadaec519 | ||
|
|
30746be01e | ||
|
|
b0ccc84260 | ||
|
|
b7db6d4535 | ||
|
|
bdaf659a28 | ||
|
|
6583094e85 | ||
|
|
631c255970 | ||
|
|
51f5b01c4e | ||
|
|
51ab18e0ba | ||
|
|
e0ab303771 | ||
|
|
e8f4e85943 | ||
|
|
6bf139297c | ||
|
|
6e679a88be | ||
|
|
e2a843f018 | ||
|
|
679ddfa3d0 | ||
|
|
50bd35b558 | ||
|
|
675d453f02 | ||
|
|
f5b1c828f1 | ||
|
|
e97408dca8 | ||
|
|
8a89981f79 | ||
|
|
5215a7baff | ||
|
|
dd2a61e9a6 | ||
|
|
b394e58ee4 | ||
|
|
7e7b6512f4 | ||
|
|
b7ec468b03 | ||
|
|
b6e1e9d226 | ||
|
|
64310bf4df | ||
|
|
99f671d567 | ||
|
|
d5a3913a1f | ||
|
|
a6bab03c85 | ||
|
|
2e761505bf | ||
|
|
ca89d83e4f | ||
|
|
aafab22bb7 | ||
|
|
6d49f8c5c8 | ||
|
|
c59daea668 | ||
|
|
dd151944ca | ||
|
|
0fa98f7b82 | ||
|
|
99afc444a7 | ||
|
|
847459f2a8 | ||
|
|
6ff9e75fb1 | ||
|
|
115eb587e3 | ||
|
|
1b74a9c6a0 | ||
|
|
b4b9485068 | ||
|
|
4e9957c3f2 | ||
|
|
afc77d0c7b | ||
|
|
05ab9311b3 | ||
|
|
0809d6ecfa | ||
|
|
d97ec1c7b5 | ||
|
|
2a5ba4d77f | ||
|
|
8bd9b78e21 | ||
|
|
7c836a4993 | ||
|
|
7423ca9726 | ||
|
|
a1e77ea061 | ||
|
|
accc92da16 | ||
|
|
0d85f41098 | ||
|
|
2881f82226 | ||
|
|
2b33c44d59 | ||
|
|
b32444047d | ||
|
|
560444bc25 | ||
|
|
0c0bc34e67 | ||
|
|
7104d73ba6 | ||
|
|
ff414105cb | ||
|
|
02db6f01e7 | ||
|
|
ca2ebb35f4 | ||
|
|
b21702417a | ||
|
|
83d02d2bf0 | ||
|
|
17733cdd80 | ||
|
|
37f2bc3fef | ||
|
|
c00028ccc6 | ||
|
|
45b744bc50 | ||
|
|
638c5130c6 | ||
|
|
5d59e54085 | ||
|
|
e319338460 | ||
|
|
f5d466e359 | ||
|
|
5bfa0e03ee | ||
|
|
27b6f8b8d6 | ||
|
|
27bbc9512f | ||
|
|
90566723a2 | ||
|
|
23a7b8f15f | ||
|
|
8f4fe468ec | ||
|
|
c3d782c358 | ||
|
|
9f7458b58f | ||
|
|
c811818017 | ||
|
|
1d1d93858a | ||
|
|
a2b17a5492 | ||
|
|
16d380813d | ||
|
|
7e44c015b3 | ||
|
|
5b066bfd8c | ||
|
|
28d541ba78 | ||
|
|
f27087867a | ||
|
|
f24cf2fdb0 | ||
|
|
7735720a5e | ||
|
|
e8a52c23be | ||
|
|
710905c1f2 | ||
|
|
475e698227 | ||
|
|
ea3e855655 | ||
|
|
76bd871ef8 | ||
|
|
b6446c8007 | ||
|
|
bd3c32b3a3 | ||
|
|
27b0b342b4 | ||
|
|
ef52ad5f25 | ||
|
|
efdb5beb71 | ||
|
|
7de4c55dfc | ||
|
|
6ee8be68cd | ||
|
|
f59d2bd256 | ||
|
|
1f6f9d6adc | ||
|
|
bac4faf202 | ||
|
|
c2546c31a7 | ||
|
|
ea50886aa1 | ||
|
|
1cf6a5d9db | ||
|
|
6cb3a055ae | ||
|
|
a5b782fdeb | ||
|
|
9d94a7355d | ||
|
|
4cb465ab35 | ||
|
|
00a1659ce8 | ||
|
|
3d329d7412 | ||
|
|
7c62173d3f | ||
|
|
3c14711346 | ||
|
|
a8ba3a4ec5 | ||
|
|
3daf38b6a0 | ||
|
|
fcc5b2eae1 | ||
|
|
9d7a49ebdf | ||
|
|
3d1507b0e4 | ||
|
|
e5be78e740 | ||
|
|
22d0608786 | ||
|
|
2e74e42bde | ||
|
|
260a9cbe87 | ||
|
|
1f4079a863 | ||
|
|
53d4b0c1b7 | ||
|
|
a538e215b8 | ||
|
|
00a1ddc508 | ||
|
|
a49148c7e4 |
38
.github/workflows/ci-pr-build-test.yml
vendored
Normal file
38
.github/workflows/ci-pr-build-test.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Building and test for PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build_and_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.18'
|
||||
|
||||
- name: Install check tools
|
||||
shell: bash
|
||||
run: |
|
||||
set -o xtrace
|
||||
git clone --branch yun --depth 4 https://github.com/yousong/tools && cd tools
|
||||
go build ./cmd/goimports && sudo cp goimports /usr/bin/ && cd .. && rm -rf tools
|
||||
git clone --depth 4 https://github.com/yousong/y18n && cd y18n
|
||||
go build . && sudo cp y18n /usr/bin && cd .. && rm -rf y18n
|
||||
|
||||
|
||||
- name: Test and build
|
||||
shell: bash
|
||||
run: |
|
||||
set -o xtrace
|
||||
export GO111MODULE=on
|
||||
make -j3 check
|
||||
make test
|
||||
targets="$(find cmd -mindepth 1 -maxdepth 1 -type d | grep -v cmd/host-image)"
|
||||
echo $targets | tr ' ' '\n'
|
||||
make $targets
|
||||
ls -lh _output/bin
|
||||
4
Makefile
4
Makefile
@@ -282,7 +282,7 @@ dep:
|
||||
@echo "$$depDeprecated"
|
||||
@$(MAKE) mod
|
||||
|
||||
RELEASE_BRANCH:=master
|
||||
RELEASE_BRANCH:=release/3.11
|
||||
GOPROXY ?= direct
|
||||
|
||||
mod:
|
||||
@@ -349,7 +349,7 @@ image:
|
||||
.PHONY: image
|
||||
|
||||
image-telegraf-raid-plugin:
|
||||
VERSION=release-1.6.4 ARCH=all make image telegraf-raid-plugin
|
||||
VERSION=release-1.6.5 ARCH=all make image telegraf-raid-plugin
|
||||
|
||||
%:
|
||||
@:
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
export PATH=/opt/yunion/bin:$PATH
|
||||
|
||||
if [ -f /etc/profile.d/bash_completion.sh ]; then
|
||||
source /etc/profile.d/bash_completion.sh
|
||||
fi
|
||||
|
||||
test -f /etc/yunion/rcadmin && source /etc/yunion/rcadmin
|
||||
|
||||
source <(climc --completion bash)
|
||||
source <(kubectl completion bash)
|
||||
|
||||
echo "Welcome to Cloud Shell :-) You may execute climc and other command tools in this shell."
|
||||
echo "Please exec 'climc' to get started"
|
||||
|
||||
@@ -47,6 +47,11 @@ do
|
||||
climc server-purge $i > /dev/null
|
||||
done
|
||||
|
||||
for i in $(climc server-list --admin --limit 2048 --system --filter "backup_host_id.equals($HOSTID)" | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc server-delete-backup $i > /dev/null
|
||||
done
|
||||
|
||||
echo "3. Clean disks on $HOSTNAME($HOSTID)"
|
||||
|
||||
for storageid in $(climc host-storage-list --host $HOSTID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $4}')
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
|
||||
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
|
||||
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityID="https://www.volcengine.com/">
|
||||
<SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" WantAssertionsSigned="true">
|
||||
<KeyDescriptor use="signing">
|
||||
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
||||
<ds:X509Data>
|
||||
<ds:X509Certificate>MIIDJjCCAg6gAwIBAgIUF3lH8/cdlQeyPBqt066RFnt3cI4wDQYJKoZIhvcNAQELBQAwJTEjMCEGA1UEAxMadXJuOnZvbGNlbmdpbmU6d2Vic2VydmljZXMwHhcNMjMwODA4MDIzNzI4WhcNMzMwODIxMTYwMDAwWjAlMSMwIQYDVQQDExp1cm46dm9sY2VuZ2luZTp3ZWJzZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPZ+nhODpFTe+A8PbuZYA5XDQ04WckV1A5U90tKaaUX5uKLUYfDtFA1TwMO/qG87LU/0Pxs4FhgZJkUOeBHkyYzzXZQvtfsJ9frcKkcTjX/WF4XJyitXCULSjhcclMS3gOqeI/Mo3P90KutfhNli/mAHQJaRsuPFG4ZwBusbUo8i5sqBqt/Sg8JapH7DjEU2mN1165o59gavPGSByPeEuu28EkivVFcI7Jox5ztwgMrOYY+pYP9GeSurzpyLq3CfvvahTsAJjuHDHTTnYNcq/I3VOap/y4cOU6vgxcQvBmgb+CBvGldjn0em3BIn5meQwuB6jfQ7kqBaO1PRD1nhDTMCAwEAAaNOMEwwSgYIKwYBBQUHAQEEPjA8MDoGCCsGAQUFBzABhi5odHRwOi8vbmV4dXMtcHJvZHVjdGlvbi5ieXRlZGFuY2UubmV0L3BjYS9vY3NwMA0GCSqGSIb3DQEBCwUAA4IBAQBxySDr9TPJxRN+otrFDaV8HSeFKUUSO3+r8bEVAXmS+xUsdUOZbaf2r/g+eKrW58dpn+iBWTAAKug9Jwe5KVGqB7G5r2r6k/eI5dvv5r/Fr5T7NppRCXKQTQiAhrrVlqttsagPztJ6LmVAcm4sh4Ckx99FgibQCbT/zui+c6IUyEQcVIwtmoPANl3K2Yn85t+G+Cu9xxXY0JPlZcUHntHg0R0PUWc3LuzLXnff7JWEzPyhMUBLpQk5BltxuD5cTGCA6WafJuBTAqkt48VN0MFTP5c5m3PJFz8Ro1GLY8hw1uhUEx28DKBkQSGpkZNx0oJXETIDpSBfD0dHWBvZQPd0</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
</KeyDescriptor>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</NameIDFormat>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName</NameIDFormat>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos</NameIDFormat>
|
||||
<NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:entity</NameIDFormat>
|
||||
<AssertionConsumerService index="1" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://signin.volcengine.com/saml/sso"/>
|
||||
<AttributeConsumingService index="1">
|
||||
<ServiceName xml:lang="en">Volcengine Single Sign-On</ServiceName>
|
||||
<RequestedAttribute isRequired="true" Name="https://www.volcengine.com/SAML/Attributes/Identity" FriendlyName="Identity"/>
|
||||
<RequestedAttribute isRequired="true" Name="https://www.volcengine.com/SAML/Attributes/SessionName" FriendlyName="SessionName"/>
|
||||
<RequestedAttribute isRequired="false" Name="https://www.volcengine.com/SAML/Attributes/SessionDuration" FriendlyName="SessionDuration"/>
|
||||
|
||||
</AttributeConsumingService>
|
||||
</SPSSODescriptor>
|
||||
<Organization>
|
||||
<OrganizationName xml:lang="en">Volcengine, Inc.</OrganizationName>
|
||||
<OrganizationDisplayName xml:lang="en">Volcengine</OrganizationDisplayName>
|
||||
<OrganizationURL xml:lang="en">https://www.volcengine.com</OrganizationURL>
|
||||
</Organization>
|
||||
</EntityDescriptor>
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:v1.1.1
|
||||
|
||||
# install playbook and telegraf install pkg
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.4.0 /opt/yunion/playbook /opt/yunion/playbook
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.4.0 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/playbook /opt/yunion/playbook
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
|
||||
|
||||
ADD ./_output/alpine-build/bin/ansibleserver /opt/yunion/bin/ansibleserver
|
||||
|
||||
@@ -9,12 +9,20 @@ RUN sed -i 's!https://dl-cdn.alpinelinux.org/!https://mirrors.ustc.edu.cn/!g' /e
|
||||
# openssh-client, for ansible ssh connection
|
||||
# git, ca-certificates, for fetching ansible roles
|
||||
RUN set -x \
|
||||
&& apk update \
|
||||
&& apk add openssh-client \
|
||||
&& apk add sshpass \
|
||||
&& apk add ansible \
|
||||
&& apk add py3-pip \
|
||||
&& apk add tzdata git ca-certificates \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
&& apk update \
|
||||
&& apk add openssh-client \
|
||||
&& apk add sshpass \
|
||||
&& apk add py3-pip \
|
||||
&& apk add tzdata git ca-certificates
|
||||
|
||||
RUN pip3 install pywinrm
|
||||
RUN apk add --no-cache openssh openssl curl rsync pv mariadb-client
|
||||
RUN apk add --no-cache --virtual .build-dependencies \
|
||||
libffi-dev openssl-dev python3-dev build-base py-setuptools rust cargo mariadb-dev
|
||||
|
||||
# ansible should be installed
|
||||
# after setuptools and wheel
|
||||
RUN pip3 install -U pip setuptools wheel \
|
||||
&& pip3 install paramiko mysqlclient pywinrm \
|
||||
&& pip3 install 'ansible<=9.0.0' \
|
||||
&& apk del --no-network .build-dependencies \
|
||||
&& rm -rf /root/.cache /root/.cargo /var/cache/apk/*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:v0.3.9-20230812.0
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:v0.3.9-20231219.0
|
||||
|
||||
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#FROM --platform=linux/amd64 registry.cn-beijing.aliyuncs.com/yunionio/centos-build:1.1-4 as build
|
||||
#RUN yum install -y https://iso.yunion.cn/vm-images/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
|
||||
#RUN yum install -y http://192.168.23.50:8083/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/yunionos:v0.1.8-20230812.0 as yunionos
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/yunionos:v3.10.8-20231215.0 as yunionos
|
||||
|
||||
FROM centos:8 as grub-stage
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.4.0 as file-repo
|
||||
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.2
|
||||
|
||||
MAINTAINER "Rain Zheng <zhengyu@yunion.com>"
|
||||
@@ -11,12 +13,13 @@ RUN set -x \
|
||||
|
||||
# install default playbook and install pkg
|
||||
Run mkdir -p /opt/yunion/ansible-install-pkg
|
||||
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf-0.x86_64.rpm -P /opt/yunion/ansible-install-pkg
|
||||
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf-0.aarch64.rpm -P /opt/yunion/ansible-install-pkg
|
||||
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf_1.19.2-yn~be742cbf-0_arm64.deb -P /opt/yunion/ansible-install-pkg
|
||||
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf_1.19.2-yn~be742cbf-0_amd64.deb -P /opt/yunion/ansible-install-pkg
|
||||
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf_windows_amd64.zip -P /opt/yunion/ansible-install-pkg
|
||||
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf_windows_i386.zip -P /opt/yunion/ansible-install-pkg
|
||||
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf-0.x86_64.rpm /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf-0.aarch64.rpm /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf_1.19.2-yn~be742cbf-0_arm64.deb /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf_1.19.2-yn~be742cbf-0_amd64.deb /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf_windows_amd64.zip /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf_windows_i386.zip /opt/yunion/ansible-install-pkg
|
||||
|
||||
Run mkdir -p /opt/yunion/playbook
|
||||
Run mkdir /opt/yunion/playbook/monitor-agent
|
||||
|
||||
214
build/docker/Dockerfile.guacd
Normal file
214
build/docker/Dockerfile.guacd
Normal file
@@ -0,0 +1,214 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Dockerfile for guacamole-server
|
||||
#
|
||||
|
||||
# The Alpine Linux image that should be used as the basis for the guacd image
|
||||
ARG ALPINE_BASE_IMAGE=latest
|
||||
FROM alpine:${ALPINE_BASE_IMAGE} AS builder
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
RUN sed -i 's!https://dl-cdn.alpinelinux.org/!https://mirrors.ustc.edu.cn/!g' /etc/apk/repositories
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache \
|
||||
autoconf \
|
||||
automake \
|
||||
build-base \
|
||||
cairo-dev \
|
||||
cmake \
|
||||
cunit-dev \
|
||||
git \
|
||||
grep \
|
||||
libjpeg-turbo-dev \
|
||||
libpng-dev \
|
||||
libtool \
|
||||
libwebp-dev \
|
||||
make \
|
||||
openssl1.1-compat-dev \
|
||||
pango-dev \
|
||||
pulseaudio-dev \
|
||||
util-linux-dev
|
||||
|
||||
# Copy source to container for sake of build
|
||||
ARG BUILD_DIR=/tmp/guacamole-server
|
||||
ARG GUAC_VER=1.5.3
|
||||
RUN git clone --branch=${GUAC_VER} https://github.com/apache/guacamole-server.git /tmp/guacamole-server
|
||||
|
||||
#
|
||||
# Base directory for installed build artifacts.
|
||||
#
|
||||
# NOTE: Due to limitations of the Docker image build process, this value is
|
||||
# duplicated in an ARG in the second stage of the build.
|
||||
#
|
||||
ARG PREFIX_DIR=/opt/guacamole
|
||||
|
||||
#
|
||||
# Automatically select the latest versions of each core protocol support
|
||||
# library (these can be overridden at build time if a specific version is
|
||||
# needed)
|
||||
#
|
||||
ARG WITH_FREERDP='2(\.\d+)+'
|
||||
ARG WITH_LIBSSH2='libssh2-\d+(\.\d+)+'
|
||||
ARG WITH_LIBTELNET='\d+(\.\d+)+'
|
||||
ARG WITH_LIBVNCCLIENT='LibVNCServer-\d+(\.\d+)+'
|
||||
ARG WITH_LIBWEBSOCKETS='v\d+(\.\d+)+'
|
||||
|
||||
#
|
||||
# Default build options for each core protocol support library, as well as
|
||||
# guacamole-server itself (these can be overridden at build time if different
|
||||
# options are needed)
|
||||
#
|
||||
|
||||
ARG FREERDP_OPTS="\
|
||||
-DBUILTIN_CHANNELS=OFF \
|
||||
-DCHANNEL_URBDRC=OFF \
|
||||
-DWITH_ALSA=OFF \
|
||||
-DWITH_CAIRO=ON \
|
||||
-DWITH_CHANNELS=ON \
|
||||
-DWITH_CLIENT=ON \
|
||||
-DWITH_CUPS=OFF \
|
||||
-DWITH_DIRECTFB=OFF \
|
||||
-DWITH_FFMPEG=OFF \
|
||||
-DWITH_GSM=OFF \
|
||||
-DWITH_GSSAPI=OFF \
|
||||
-DWITH_IPP=OFF \
|
||||
-DWITH_JPEG=ON \
|
||||
-DWITH_LIBSYSTEMD=OFF \
|
||||
-DWITH_MANPAGES=OFF \
|
||||
-DWITH_OPENH264=OFF \
|
||||
-DWITH_OPENSSL=ON \
|
||||
-DWITH_OSS=OFF \
|
||||
-DWITH_PCSC=OFF \
|
||||
-DWITH_PULSE=OFF \
|
||||
-DWITH_SERVER=OFF \
|
||||
-DWITH_SERVER_INTERFACE=OFF \
|
||||
-DWITH_SHADOW_MAC=OFF \
|
||||
-DWITH_SHADOW_X11=OFF \
|
||||
-DWITH_SSE2=ON \
|
||||
-DWITH_WAYLAND=OFF \
|
||||
-DWITH_X11=OFF \
|
||||
-DWITH_X264=OFF \
|
||||
-DWITH_XCURSOR=ON \
|
||||
-DWITH_XEXT=ON \
|
||||
-DWITH_XI=OFF \
|
||||
-DWITH_XINERAMA=OFF \
|
||||
-DWITH_XKBFILE=ON \
|
||||
-DWITH_XRENDER=OFF \
|
||||
-DWITH_XTEST=OFF \
|
||||
-DWITH_XV=OFF \
|
||||
-DWITH_ZLIB=ON"
|
||||
|
||||
ARG GUACAMOLE_SERVER_OPTS="\
|
||||
--disable-guaclog"
|
||||
|
||||
ARG LIBSSH2_OPTS="\
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON"
|
||||
|
||||
ARG LIBTELNET_OPTS="\
|
||||
--disable-static \
|
||||
--disable-util"
|
||||
|
||||
ARG LIBVNCCLIENT_OPTS=""
|
||||
|
||||
ARG LIBWEBSOCKETS_OPTS="\
|
||||
-DDISABLE_WERROR=ON \
|
||||
-DLWS_WITHOUT_SERVER=ON \
|
||||
-DLWS_WITHOUT_TESTAPPS=ON \
|
||||
-DLWS_WITHOUT_TEST_CLIENT=ON \
|
||||
-DLWS_WITHOUT_TEST_PING=ON \
|
||||
-DLWS_WITHOUT_TEST_SERVER=ON \
|
||||
-DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON \
|
||||
-DLWS_WITH_STATIC=OFF"
|
||||
|
||||
# Build guacamole-server and its core protocol library dependencies
|
||||
RUN echo "$TARGETPLATFORM"
|
||||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; \
|
||||
then FREERDP_OPTS="${FREERDP_OPTS} -DWITH_SSE2=ON" && echo "SSE2 active"; \
|
||||
else FREERDP_OPTS="${FREERDP_OPTS} -DWITH_SSE2=OFF" && echo "SSE2 disabled"; \
|
||||
fi && ${BUILD_DIR}/src/guacd-docker/bin/build-all.sh
|
||||
|
||||
|
||||
# Record the packages of all runtime library dependencies
|
||||
RUN ${BUILD_DIR}/src/guacd-docker/bin/list-dependencies.sh \
|
||||
${PREFIX_DIR}/sbin/guacd \
|
||||
${PREFIX_DIR}/lib/libguac-client-*.so \
|
||||
${PREFIX_DIR}/lib/freerdp2/*guac*.so \
|
||||
> ${PREFIX_DIR}/DEPENDENCIES
|
||||
|
||||
# Use same Alpine version as the base for the runtime image
|
||||
FROM alpine:${ALPINE_BASE_IMAGE}
|
||||
|
||||
RUN sed -i 's!https://dl-cdn.alpinelinux.org/!https://mirrors.ustc.edu.cn/!g' /etc/apk/repositories
|
||||
#
|
||||
# Base directory for installed build artifacts. See also the
|
||||
# CMD directive at the end of this build stage.
|
||||
#
|
||||
# NOTE: Due to limitations of the Docker image build process, this value is
|
||||
# duplicated in an ARG in the first stage of the build.
|
||||
#
|
||||
ARG PREFIX_DIR=/opt/guacamole
|
||||
|
||||
# Runtime environment
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LD_LIBRARY_PATH=${PREFIX_DIR}/lib
|
||||
ENV GUACD_LOG_LEVEL=info
|
||||
|
||||
# Copy build artifacts into this stage
|
||||
COPY --from=builder ${PREFIX_DIR} ${PREFIX_DIR}
|
||||
|
||||
# Bring runtime environment up to date and install runtime dependencies
|
||||
RUN apk add --no-cache \
|
||||
ca-certificates \
|
||||
ghostscript \
|
||||
netcat-openbsd \
|
||||
shadow \
|
||||
terminus-font \
|
||||
ttf-dejavu \
|
||||
ttf-liberation \
|
||||
util-linux-login && \
|
||||
xargs apk add --no-cache < ${PREFIX_DIR}/DEPENDENCIES
|
||||
|
||||
# Checks the operating status every 5 minutes with a timeout of 5 seconds
|
||||
HEALTHCHECK --interval=5m --timeout=5s CMD nc -z 127.0.0.1 4822 || exit 1
|
||||
|
||||
# Create a new user guacd
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
RUN groupadd --gid $GID guacd
|
||||
RUN useradd --system --create-home --shell /sbin/nologin --uid $UID --gid $GID guacd
|
||||
RUN mkdir -p /opt/cloudpods
|
||||
RUN chown -R guacd:guacd /opt/cloudpods
|
||||
|
||||
# Run with user guacd
|
||||
USER guacd
|
||||
|
||||
# Expose the default listener port
|
||||
EXPOSE 4822
|
||||
|
||||
# Start guacd, listening on port 0.0.0.0:4822
|
||||
#
|
||||
# Note the path here MUST correspond to the value specified in the
|
||||
# PREFIX_DIR build argument.
|
||||
#
|
||||
CMD /opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.4
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.4.6
|
||||
|
||||
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ onecloud-base:
|
||||
onecloud-base-3-15-4:
|
||||
$(DOCKER_BUILDX)/onecloud-base:$(ONECLOUD_BASE_VERSION_3-15-4) -f ./Dockerfile.onecloud-base-3-15-4 .
|
||||
|
||||
ANSIBLESERVER_BASE = v1.1.1
|
||||
ANSIBLESERVER_BASE = v1.1.2
|
||||
|
||||
ansibleserver-base:
|
||||
$(DOCKER_BUILDX)/ansibleserver-base:$(ANSIBLESERVER_BASE) -f ./Dockerfile.ansibleserver-base .
|
||||
@@ -30,7 +30,7 @@ WEBCONSOLE_BASE_VERSION = 20230731.2
|
||||
webconsole-base:
|
||||
$(DOCKER_BUILDX)/webconsole-base:$(WEBCONSOLE_BASE_VERSION) -f ./Dockerfile.webconsole-base .
|
||||
|
||||
BAREMETAL_BASE_VERSION = v0.3.9-20230812.0
|
||||
BAREMETAL_BASE_VERSION = v0.3.9-20231219.1
|
||||
|
||||
baremetal-base:
|
||||
$(DOCKER_BUILDX)/baremetal-base:$(BAREMETAL_BASE_VERSION) -f ./Dockerfile.baremetal-base .
|
||||
@@ -44,7 +44,7 @@ GLANCE_BASE_VERSION = v0.0.1
|
||||
glance-base:
|
||||
$(DOCKER_BUILDX)/glance-base:$(GLANCE_BASE_VERSION) -f ./Dockerfile.glance-base .
|
||||
|
||||
FILE_REPO_VERSION = v0.3.3
|
||||
FILE_REPO_VERSION = v0.5.2
|
||||
|
||||
file-repo:
|
||||
$(DOCKER_BUILDX)/file-repo:$(FILE_REPO_VERSION) -f ./Dockerfile.file-repo .
|
||||
@@ -64,3 +64,13 @@ host-image:
|
||||
LBAGENT_BASE_VERSION = v0.0.3
|
||||
lbagent-base:
|
||||
$(DOCKER_BUILDX)/lbagent-base:$(LBAGENT_BASE_VERSION) -f ./Dockerfile.lbagent-base .
|
||||
|
||||
GUACD_VERSION=1.5.3
|
||||
guacd:
|
||||
docker buildx build --platform linux/arm64 --push \
|
||||
-t registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-arm64 -f ./Dockerfile.guacd .
|
||||
docker buildx build --platform linux/amd64 --push \
|
||||
-t registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-amd64 -f ./Dockerfile.guacd .
|
||||
docker buildx imagetools create -t registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION) \
|
||||
registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-amd64 \
|
||||
registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-arm64
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
触发时间: {{.start_time}}
|
||||
报警级别: {{.level}}
|
||||
触发条件: {{.description | unescaped}}
|
||||
资源数量:{{len .matches}}
|
||||
报警数量:{{len .matches}}
|
||||
资源名称:{{.resource_name}}
|
||||
|
||||
详情地址: {{.web_url}}
|
||||
@@ -3,7 +3,7 @@ AlertName: {{.name}}
|
||||
Time: {{.start_time}}
|
||||
Level: {{.level}}
|
||||
TriggerCondition: {{.description | unescaped}}
|
||||
ResourceCount: {{len .matches}}
|
||||
AlertCount: {{len .matches}}
|
||||
ResourceName: {{.resource_name}}
|
||||
|
||||
WebUrl: {{.web_url}}
|
||||
|
||||
@@ -35,4 +35,5 @@ func init() {
|
||||
cmd.Perform("set-users", &cloudid.CloudgroupUserOptions{})
|
||||
cmd.Perform("public", &cloudid.CloudgroupPublicOptions{})
|
||||
cmd.Perform("private", &cloudid.CloudgroupIdOptions{})
|
||||
cmd.Get("saml", &cloudid.CloudgroupIdOptions{})
|
||||
}
|
||||
|
||||
@@ -1,29 +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 cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudgroupcaches).WithKeyword("cloud-group-cache")
|
||||
cmd.List(&cloudid.CloudgroupcacheListOptions{})
|
||||
cmd.Show(&cloudid.CloudgroupcacheIdOption{})
|
||||
cmd.Delete(&cloudid.CloudgroupcacheIdOption{})
|
||||
cmd.Perform("syncstatus", &cloudid.CloudgroupcacheIdOption{})
|
||||
}
|
||||
@@ -1,27 +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 cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudpolicycaches).WithKeyword("cloud-policy-cache")
|
||||
cmd.List(&cloudid.CloudpolicycacheListOptions{})
|
||||
cmd.Show(&cloudid.CloudpolicycacheIdOptions{})
|
||||
}
|
||||
@@ -25,5 +25,4 @@ func init() {
|
||||
cmd.List(&cloudid.CloudroleListOptions{})
|
||||
cmd.Delete(&cloudid.CloudroleIdOptions{})
|
||||
cmd.Show(&cloudid.CloudroleIdOptions{})
|
||||
cmd.Perform("purge", &cloudid.CloudroleIdOptions{})
|
||||
}
|
||||
|
||||
@@ -30,14 +30,13 @@ func init() {
|
||||
cmd.Show(&cloudid.ClouduserIdOption{})
|
||||
cmd.Custom(shell.CustomActionGet, "login-info", &cloudid.ClouduserIdOption{})
|
||||
cmd.Delete(&cloudid.ClouduserIdOption{})
|
||||
cmd.Perform("sync", &cloudid.ClouduserSyncOptions{})
|
||||
cmd.Perform("syncstatus", &cloudid.ClouduserIdOption{})
|
||||
cmd.Perform("attach-policy", &cloudid.ClouduserPolicyOptions{})
|
||||
cmd.Perform("detach-policy", &cloudid.ClouduserPolicyOptions{})
|
||||
cmd.Perform("change-owner", &cloudid.ClouduserChangeOwnerOptions{})
|
||||
cmd.Perform("reset-password", &cloudid.ClouduserResetPasswordOptions{})
|
||||
cmd.Perform("cloud-user-join-group", &cloudid.ClouduserGroupOptions{})
|
||||
cmd.Perform("cloud-user-leave-group", &cloudid.ClouduserGroupOptions{})
|
||||
cmd.Perform("join-group", &cloudid.ClouduserGroupOptions{})
|
||||
cmd.Perform("leave-group", &cloudid.ClouduserGroupOptions{})
|
||||
cmd.GetWithCustomShow("access-keys", func(result jsonutils.JSONObject) {
|
||||
ret := modulebase.JSON2ListResult(result)
|
||||
shell.PrintList(ret, nil)
|
||||
|
||||
@@ -25,6 +25,6 @@ func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.AccessGroups).WithKeyword("access-group")
|
||||
cmd.List(&compute.AccessGroupListOptions{})
|
||||
cmd.Delete(&options.BaseIdOptions{})
|
||||
cmd.Create(&options.BaseCreateOptions{})
|
||||
cmd.Create(&compute.AccessGroupCreateOptions{})
|
||||
cmd.Perform("syncstatus", &options.BaseIdOptions{})
|
||||
}
|
||||
|
||||
@@ -25,6 +25,10 @@ func init() {
|
||||
cmd.List(&compute.AppListOptions{})
|
||||
cmd.Show(&compute.AppIdOptions{})
|
||||
cmd.Perform("syncstatus", &compute.AppIdOptions{})
|
||||
cmd.Get("hybird-connections", &compute.AppIdOptions{})
|
||||
cmd.Get("certificates", &compute.AppIdOptions{})
|
||||
cmd.Get("backups", &compute.AppIdOptions{})
|
||||
cmd.Get("custom-domains", &compute.AppIdOptions{})
|
||||
|
||||
cmd1 := shell.NewResourceCmd(&modules.AppEnvironments)
|
||||
cmd1.List(&compute.AppEnvironmentListOptions{})
|
||||
|
||||
@@ -26,6 +26,7 @@ func init() {
|
||||
bsCmd.List(&compute.BackupStorageListOptions{})
|
||||
bsCmd.Show(&compute.BackupStorageIdOptions{})
|
||||
bsCmd.Create(&compute.BackupStorageCreateOptions{})
|
||||
bsCmd.Update(&compute.BackupStorageUpdateOptions{})
|
||||
bsCmd.Delete(&compute.BackupStorageIdOptions{})
|
||||
bsCmd.Perform("public", &options.BasePublicOptions{})
|
||||
bsCmd.Perform("private", &options.BaseIdOptions{})
|
||||
@@ -49,4 +50,10 @@ func init() {
|
||||
ibCmd.Create(&compute.InstanceBackupManagerCreateFromPackageOptions{})
|
||||
ibCmd.Perform("syncstatus", &compute.DiskBackupSyncstatusOptions{})
|
||||
ibCmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
|
||||
|
||||
hbsCmd := shell.NewJointCmd(&modules.HostBackupstorages)
|
||||
hbsCmd.List(&compute.HostBackupStorageListOptions{})
|
||||
hbsCmd.Show(&compute.HostBackupStorageJoinOptions{})
|
||||
hbsCmd.Attach(&compute.HostBackupStorageJoinOptions{})
|
||||
hbsCmd.Detach(&compute.HostBackupStorageJoinOptions{})
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ func init() {
|
||||
cmd.CreateWithKeyword("create-hcs", &options.SHCSAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-hcsop", &options.SHcsOpCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-ucloud", &options.SUcloudCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-volcengine", &options.SVolcengineCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-zstack", &options.SZStackCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-s3", &options.SS3CloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-ceph", &options.SCephCloudAccountCreateOptions{})
|
||||
@@ -59,6 +60,7 @@ func init() {
|
||||
cmd.CreateWithKeyword("create-baidu", &options.SBaiduCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-cucloud", &options.SCucloudCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-qingcloud", &options.SQingCloudCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-oracle", &options.SOracleCloudAccountCreateOptions{})
|
||||
|
||||
cmd.UpdateWithKeyword("update-vmware", &options.SVMwareCloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-aliyun", &options.SAliyunCloudAccountUpdateOptions{})
|
||||
@@ -71,6 +73,7 @@ func init() {
|
||||
cmd.UpdateWithKeyword("update-hcso", &options.SHCSOAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-hcs", &options.SHCSAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-ucloud", &options.SUcloudCloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-volcengine", &options.SVolcengineCloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-zstack", &options.SZStackCloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-s3", &options.SS3CloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-ctyun", &options.SCtyunCloudAccountUpdateOptions{})
|
||||
@@ -99,6 +102,7 @@ func init() {
|
||||
cmd.PerformWithKeyword("update-credential-hcso", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-hcs", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-ucloud", "update-credential", &options.SUcloudCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-volcengine", "update-credential", &options.SVolcengineCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-zstack", "update-credential", &options.SZStackCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-s3", "update-credential", &options.SS3CloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-ctyun", "update-credential", &options.SCtyunCloudAccountUpdateCredentialOptions{})
|
||||
@@ -122,6 +126,7 @@ func init() {
|
||||
cmd.PerformWithKeyword("test-connectivity-openstack", "test-connectivity", &options.SOpenStackCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-huawei", "test-connectivity", &options.SHuaweiCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-ucloud", "test-connectivity", &options.SUcloudCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-volcengine", "test-connectivity", &options.SVolcengineCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-zstack", "test-connectivity", &options.SZStackCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-s3", "test-connectivity", &options.SS3CloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-ctyun", "test-connectivity", &options.SCtyunCloudAccountUpdateCredentialOptions{})
|
||||
@@ -145,5 +150,4 @@ func init() {
|
||||
cmd.Get("change-owner-candidate-domains", &options.SCloudAccountIdOptions{})
|
||||
cmd.Get("enrollment-accounts", &options.SCloudAccountIdOptions{})
|
||||
cmd.Get("balance", &options.SCloudAccountIdOptions{})
|
||||
cmd.Get("saml", &options.SCloudAccountIdOptions{})
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func init() {
|
||||
|
||||
Usable *bool `help:"List regions where networks are usable"`
|
||||
UsableVpc *bool `help:"List regions where VPC are usable"`
|
||||
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers"`
|
||||
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers|elasticcaches"`
|
||||
|
||||
City string `help:"List regions in the specified city"`
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ import (
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Disks)
|
||||
cmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.Perform("rebuild", &options.ResourceIdOptions{})
|
||||
cmd.Perform("migrate", &compute_options.DiskMigrateOptions{})
|
||||
|
||||
type DiskListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/util/httputils"
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -69,13 +70,26 @@ func init() {
|
||||
cmd.Get("vnc", &options.BaseIdOptions{})
|
||||
cmd.Get("app-options", &options.BaseIdOptions{})
|
||||
cmd.Get("tap-config", &options.BaseIdOptions{})
|
||||
cmd.GetWithCustomShow("nics", func(data jsonutils.JSONObject) {
|
||||
results := printutils.ListResult{}
|
||||
err := data.Unmarshal(&results)
|
||||
if err == nil {
|
||||
printutils.PrintJSONList(&results, []string{
|
||||
"mac",
|
||||
"vlan_id",
|
||||
"interface",
|
||||
"bridge",
|
||||
"ip_addr",
|
||||
"net",
|
||||
"wire",
|
||||
})
|
||||
} else {
|
||||
fmt.Println("error", err)
|
||||
}
|
||||
}, &options.BaseIdOptions{})
|
||||
|
||||
R(&options.BaseIdOptions{}, "host-logininfo", "Get SSH login information of a host", func(s *mcclient.ClientSession, args *options.BaseIdOptions) error {
|
||||
srvid, e := modules.Hosts.GetId(s, args.ID, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
i, e := modules.Hosts.GetLoginInfo(s, srvid, nil)
|
||||
i, e := modules.Hosts.PerformAction(s, args.ID, "login-info", nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
@@ -168,8 +182,9 @@ func init() {
|
||||
CpuReserved int64 `help:"CPU reserved"`
|
||||
HostType string `help:"Change host type, CAUTION!!!!" choices:"hypervisor|kubelet|esxi|baremetal"`
|
||||
// AccessIp string `help:"Change access ip, CAUTION!!!!"`
|
||||
AccessMac string `help:"Change baremetal access MAC, CAUTION!!!!"`
|
||||
Uuid string `help:"Change baremetal UUID, CAUTION!!!!"`
|
||||
AccessMac string `help:"Change baremetal access MAC, CAUTION!!!!"`
|
||||
Uuid string `help:"Change baremetal UUID, CAUTION!!!!"`
|
||||
EnableNumaAllocate string `help:"Host enable numa allocate" choices:"True|False"`
|
||||
|
||||
IpmiUsername string `help:"IPMI user"`
|
||||
IpmiPassword string `help:"IPMI password"`
|
||||
@@ -220,6 +235,13 @@ func init() {
|
||||
if len(args.Sn) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Sn), "sn")
|
||||
}
|
||||
if len(args.EnableNumaAllocate) > 0 {
|
||||
enableNumaAllocate := false
|
||||
if args.EnableNumaAllocate == "True" {
|
||||
enableNumaAllocate = true
|
||||
}
|
||||
params.Add(jsonutils.NewBool(enableNumaAllocate), "enable_numa_allocate")
|
||||
}
|
||||
if params.Size() == 0 {
|
||||
return fmt.Errorf("Not data to update")
|
||||
}
|
||||
@@ -576,11 +598,7 @@ func init() {
|
||||
Port int `help:"SSH service port" default:"22"`
|
||||
}
|
||||
R(&HostSSHLoginOptions{}, "host-ssh", "SSH login of a host", func(s *mcclient.ClientSession, args *HostSSHLoginOptions) error {
|
||||
srvid, e := modules.Hosts.GetId(s, args.ID, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
i, e := modules.Hosts.GetLoginInfo(s, srvid, nil)
|
||||
i, e := modules.Hosts.PerformAction(s, args.ID, "login-info", nil)
|
||||
privateKey := ""
|
||||
if e != nil {
|
||||
if httputils.ErrorCode(e) == 404 || e.Error() == "ciphertext too short" {
|
||||
|
||||
@@ -15,8 +15,13 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
@@ -26,4 +31,71 @@ func init() {
|
||||
cmd.Create(new(options.IsolatedDeviceModelCreateOptions))
|
||||
cmd.Update(new(options.IsolatedDeviceModelUpdateOptions))
|
||||
cmd.Delete(new(options.IsolatedDeviceIdsOptions))
|
||||
cmd.Perform("set-hardware-info", new(options.IsolatedDeviceModelSetHardwareInfoOptions))
|
||||
cmd.Get("hardware-info", new(options.IsolatedDeviceIdsOptions))
|
||||
|
||||
type HostIsolatedDeviceModelListOptions struct {
|
||||
baseoptions.BaseListOptions
|
||||
Host string `help:"ID or Name of Host"`
|
||||
IsolatedDeviceModel string `help:"ID or Name of Isolated device model"`
|
||||
}
|
||||
R(&HostIsolatedDeviceModelListOptions{}, "host-isolated-device-model-list",
|
||||
"List host Isolated device model pairs", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
var result *printutils.ListResult
|
||||
var err error
|
||||
if len(args.Host) > 0 {
|
||||
result, err = modules.HostIsolatedDeviceModels.ListDescendent(s, args.Host, params)
|
||||
} else if len(args.IsolatedDeviceModel) > 0 {
|
||||
result, err = modules.HostIsolatedDeviceModels.ListDescendent2(s, args.IsolatedDeviceModel, params)
|
||||
} else {
|
||||
result, err = modules.HostIsolatedDeviceModels.List(s, params)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.HostIsolatedDeviceModels.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostIsolatedDeviceModelDetailOptions struct {
|
||||
HOST string `help:"ID or Name of Host"`
|
||||
IsolatedDeviceModel string `help:"ID or Name of Isolated device model"`
|
||||
}
|
||||
R(&HostIsolatedDeviceModelDetailOptions{}, "host-isolated-device-model-show", "Show host isolated-device-model details", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelDetailOptions) error {
|
||||
result, err := modules.HostIsolatedDeviceModels.Get(s, args.HOST, args.IsolatedDeviceModel, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&HostIsolatedDeviceModelDetailOptions{}, "host-isolated-device-model-detach", "Detach a isolated-device-model from a host", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelDetailOptions) error {
|
||||
result, err := modules.HostIsolatedDeviceModels.Detach(s, args.HOST, args.IsolatedDeviceModel, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&HostIsolatedDeviceModelDetailOptions{}, "host-isolated-device-model-attach", "Attach a isolated-device-model to a host", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelDetailOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
result, err := modules.HostIsolatedDeviceModels.Attach(s, args.HOST, args.IsolatedDeviceModel, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -15,144 +15,21 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
lbAclConvert := func(jd *jsonutils.JSONDict) error {
|
||||
jaeso, err := jd.Get("acl_entries")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
aclEntries := options.AclEntries{}
|
||||
err = jaeso.Unmarshal(&aclEntries)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
aclTextLines := aclEntries.String()
|
||||
jd.Set("acl_entries", jsonutils.NewString(aclTextLines))
|
||||
return nil
|
||||
}
|
||||
|
||||
printLbAcl := func(jsonObj jsonutils.JSONObject) {
|
||||
jd, ok := jsonObj.(*jsonutils.JSONDict)
|
||||
if !ok {
|
||||
printObject(jsonObj)
|
||||
return
|
||||
}
|
||||
err := lbAclConvert(jd)
|
||||
if err != nil {
|
||||
printObject(jsonObj)
|
||||
return
|
||||
}
|
||||
printObject(jd)
|
||||
}
|
||||
printLbAclList := func(list *printutils.ListResult, columns []string) {
|
||||
data := list.Data
|
||||
for _, jsonObj := range data {
|
||||
jd := jsonObj.(*jsonutils.JSONDict)
|
||||
err := lbAclConvert(jd)
|
||||
if err != nil {
|
||||
printList(list, columns)
|
||||
return
|
||||
}
|
||||
}
|
||||
printList(list, columns)
|
||||
}
|
||||
|
||||
R(&options.LoadbalancerAclCreateOptions{}, "lbacl-create", "Create lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lbacl, err := modules.LoadbalancerAcls.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclGetOptions{}, "lbacl-show", "Show lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclGetOptions) error {
|
||||
lbacl, err := modules.LoadbalancerAcls.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclListOptions{}, "lbacl-list", "List lbacls", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclListOptions) error {
|
||||
params, err := baseoptions.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.LoadbalancerAcls.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAclList(result, modules.LoadbalancerAcls.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclUpdateOptions{}, "lbacl-update", "Update lbacls", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclUpdateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lbacl, err := modules.LoadbalancerAcls.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclDeleteOptions{}, "lbacl-purge", "Purge lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclDeleteOptions) error {
|
||||
lbacl, err := modules.LoadbalancerAcls.PerformAction(s, opts.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclDeleteOptions{}, "lbacl-delete", "Show lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclDeleteOptions) error {
|
||||
lbacl, err := modules.LoadbalancerAcls.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclActionPatchOptions{}, "lbacl-patch", "Patch lbacls", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclActionPatchOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lbacl, err := modules.LoadbalancerAcls.PerformAction(s, opts.ID, "patch", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclPublicOptions{}, "lbacl-public", "Public lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclPublicOptions) error {
|
||||
params := jsonutils.Marshal(opts)
|
||||
lbacl, err := modules.LoadbalancerAcls.PerformAction(s, opts.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclPrivateOptions{}, "lbacl-private", "Private lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclPrivateOptions) error {
|
||||
lbacl, err := modules.LoadbalancerAcls.PerformAction(s, opts.ID, "private", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
cmd := shell.NewResourceCmd(&modules.LoadbalancerAcls).WithKeyword("lbacl")
|
||||
cmd.List(&options.LoadbalancerAclListOptions{})
|
||||
cmd.Show(&options.LoadbalancerAclIdOptions{})
|
||||
cmd.Create(&options.LoadbalancerAclCreateOptions{})
|
||||
cmd.Delete(&options.LoadbalancerAclIdOptions{})
|
||||
cmd.Update(&options.LoadbalancerAclUpdateOptions{})
|
||||
cmd.Perform("purge", &options.LoadbalancerAclIdOptions{})
|
||||
cmd.Perform("syncstatus", &options.LoadbalancerAclIdOptions{})
|
||||
cmd.Perform("private", &options.LoadbalancerAclIdOptions{})
|
||||
cmd.Perform("public", &options.LoadbalancerAclPublicOptions{})
|
||||
cmd.Perform("patch", &options.LoadbalancerAclActionPatchOptions{})
|
||||
}
|
||||
|
||||
@@ -1,121 +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/jsonutils"
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
lbAclConvert := func(jd *jsonutils.JSONDict) error {
|
||||
jaeso, err := jd.Get("acl_entries")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
aclEntries := options.AclEntries{}
|
||||
err = jaeso.Unmarshal(&aclEntries)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
aclTextLines := aclEntries.String()
|
||||
jd.Set("acl_entries", jsonutils.NewString(aclTextLines))
|
||||
return nil
|
||||
}
|
||||
|
||||
printLbAcl := func(jsonObj jsonutils.JSONObject) {
|
||||
jd, ok := jsonObj.(*jsonutils.JSONDict)
|
||||
if !ok {
|
||||
printObject(jsonObj)
|
||||
return
|
||||
}
|
||||
err := lbAclConvert(jd)
|
||||
if err != nil {
|
||||
printObject(jsonObj)
|
||||
return
|
||||
}
|
||||
printObject(jd)
|
||||
}
|
||||
printLbAclList := func(list *printutils.ListResult, columns []string) {
|
||||
data := list.Data
|
||||
for _, jsonObj := range data {
|
||||
jd := jsonObj.(*jsonutils.JSONDict)
|
||||
err := lbAclConvert(jd)
|
||||
if err != nil {
|
||||
printList(list, columns)
|
||||
return
|
||||
}
|
||||
}
|
||||
printList(list, columns)
|
||||
}
|
||||
|
||||
R(&options.LoadbalancerAclGetOptions{}, "lbacl-cache-show", "Show cached lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclGetOptions) error {
|
||||
lbacl, err := modules.LoadbalancerCachedAcls.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.CachedLoadbalancerAclListOptions{}, "lbacl-cache-list", "List cached lbacls", func(s *mcclient.ClientSession, opts *options.CachedLoadbalancerAclListOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.LoadbalancerCachedAcls.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAclList(result, modules.LoadbalancerCachedAcls.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.LoadbalancerCachedAclCreateOptions{}, "lbacl-cache-create", "Create cached lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerCachedAclCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
lbacl, err := modules.LoadbalancerCachedAcls.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printObject(lbacl)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.LoadbalancerAclDeleteOptions{}, "lbacl-cache-purge", "Purge cached lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclDeleteOptions) error {
|
||||
lbacl, err := modules.LoadbalancerCachedAcls.PerformAction(s, opts.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAclDeleteOptions{}, "lbacl-cache-delete", "Delete cached lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclDeleteOptions) error {
|
||||
lbacl, err := modules.LoadbalancerCachedAcls.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbAcl(lbacl)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -1,77 +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/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
R(&options.LoadbalancerCertificateGetOptions{}, "lbcert-cache-show", "Show cached lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateGetOptions) error {
|
||||
lbcert, err := modules.LoadbalancerCachedCertificates.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.LoadbalancerCachedCertificateListOptions{}, "lbcert-cache-list", "List cached lbcerts", func(s *mcclient.ClientSession, opts *options.LoadbalancerCachedCertificateListOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.LoadbalancerCachedCertificates.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.LoadbalancerCachedCertificates.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.LoadbalancerCachedCertificateCreateOptions{}, "lbcert-cache-create", "Create cached lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCachedCertificateCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
lbcert, err := modules.LoadbalancerCachedCertificates.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.LoadbalancerCertificateDeleteOptions{}, "lbcert-cache-delete", "Delete cached lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateDeleteOptions) error {
|
||||
lbcert, err := modules.LoadbalancerCachedCertificates.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerCertificateDeleteOptions{}, "lbcert-cache-purge", "Purge cached lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateDeleteOptions) error {
|
||||
lbcert, err := modules.LoadbalancerCachedCertificates.PerformAction(s, opts.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -15,81 +15,19 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
R(&options.LoadbalancerCertificateCreateOptions{}, "lbcert-create", "Create lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lbcert, err := modules.LoadbalancerCertificates.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerCertificateGetOptions{}, "lbcert-show", "Show lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateGetOptions) error {
|
||||
lbcert, err := modules.LoadbalancerCertificates.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerCertificateListOptions{}, "lbcert-list", "List lbcerts", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateListOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.LoadbalancerCertificates.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.LoadbalancerCertificates.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerCertificateUpdateOptions{}, "lbcert-update", "Update lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateUpdateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lbcert, err := modules.LoadbalancerCertificates.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerCertificateDeleteOptions{}, "lbcert-delete", "Delete lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificateDeleteOptions) error {
|
||||
lbcert, err := modules.LoadbalancerCertificates.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerCertificatePublicOptions{}, "lbcert-public", "Public lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificatePublicOptions) error {
|
||||
params := jsonutils.Marshal(opts)
|
||||
lbcert, err := modules.LoadbalancerCertificates.PerformAction(s, opts.ID, "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerCertificatePrivateOptions{}, "lbcert-private", "Private lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificatePrivateOptions) error {
|
||||
lbcert, err := modules.LoadbalancerCertificates.PerformAction(s, opts.ID, "private", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lbcert)
|
||||
return nil
|
||||
})
|
||||
cmd := shell.NewResourceCmd(&modules.LoadbalancerCertificates).WithKeyword("lbcert")
|
||||
cmd.Create(&options.LoadbalancerCertificateCreateOptions{})
|
||||
cmd.Show(&options.LoadbalancerCertificateIdOptions{})
|
||||
cmd.Delete(&options.LoadbalancerCertificateIdOptions{})
|
||||
cmd.List(&options.LoadbalancerCertificateListOptions{})
|
||||
cmd.Update(&options.LoadbalancerCertificateUpdateOptions{})
|
||||
cmd.Perform("public", &options.LoadbalancerCertificatePublicOptions{})
|
||||
cmd.Perform("private", &options.LoadbalancerCertificateIdOptions{})
|
||||
cmd.Perform("syncstatus", &options.LoadbalancerCertificateIdOptions{})
|
||||
}
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
// 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 (
|
||||
|
||||
@@ -32,6 +32,7 @@ func init() {
|
||||
|
||||
cmd := shell.NewResourceCmd(&modules.Networks).WithContextManager(&modules.Wires)
|
||||
cmd.List(&compute_options.NetworkListOptions{})
|
||||
cmd.Create(&compute_options.NetworkCreateOptions{})
|
||||
cmd.Update(&compute_options.NetworkUpdateOptions{})
|
||||
cmd.Show(&compute_options.NetworkIdOptions{})
|
||||
cmd.Delete(&compute_options.NetworkIdOptions{})
|
||||
@@ -43,6 +44,8 @@ func init() {
|
||||
cmd.Get("change-owner-candidate-domains", &compute_options.NetworkIdOptions{})
|
||||
cmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.Perform("switch-wire", &compute_options.NetworkSwitchWireOptions{})
|
||||
cmd.Perform("sync-additional-wires", &compute_options.NetworkSyncAdditionalWiresOptions{})
|
||||
cmd.Get("available-addresses", &compute_options.NetworkIdOptions{})
|
||||
|
||||
type NetworkShareOptions struct {
|
||||
ID string `help:"ID or Name of the zone to show"`
|
||||
@@ -60,65 +63,15 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkCreateOptions struct {
|
||||
WIRE string `help:"ID or Name of wire in which the network is created"`
|
||||
NETWORK string `help:"Name of new network"`
|
||||
STARTIP string `help:"Start of IPv4 address range"`
|
||||
ENDIP string `help:"End of IPv4 address rnage"`
|
||||
NETMASK int64 `help:"Length of network mask"`
|
||||
Gateway string `help:"Default gateway"`
|
||||
VlanId int64 `help:"Vlan ID" default:"1"`
|
||||
IfnameHint string `help:"Hint for ifname generation"`
|
||||
AllocPolicy string `help:"Address allocation policy" choices:"none|stepdown|stepup|random"`
|
||||
ServerType string `help:"Server type" choices:"baremetal|container|eip|guest|ipmi|pxe"`
|
||||
IsAutoAlloc *bool `help:"Auto allocation IP pool"`
|
||||
BgpType string `help:"Internet service provider name" positional:"false"`
|
||||
Desc string `help:"Description" metavar:"DESCRIPTION"`
|
||||
}
|
||||
R(&NetworkCreateOptions{}, "network-create", "Create a virtual network", func(s *mcclient.ClientSession, args *NetworkCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.NETWORK), "name")
|
||||
params.Add(jsonutils.NewString(args.STARTIP), "guest_ip_start")
|
||||
params.Add(jsonutils.NewString(args.ENDIP), "guest_ip_end")
|
||||
params.Add(jsonutils.NewInt(args.NETMASK), "guest_ip_mask")
|
||||
if len(args.Gateway) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Gateway), "guest_gateway")
|
||||
}
|
||||
if args.VlanId > 0 {
|
||||
params.Add(jsonutils.NewInt(args.VlanId), "vlan_id")
|
||||
}
|
||||
if len(args.ServerType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.ServerType), "server_type")
|
||||
}
|
||||
if len(args.IfnameHint) > 0 {
|
||||
params.Add(jsonutils.NewString(args.IfnameHint), "ifname_hint")
|
||||
}
|
||||
if len(args.AllocPolicy) > 0 {
|
||||
params.Add(jsonutils.NewString(args.AllocPolicy), "alloc_policy")
|
||||
}
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if len(args.BgpType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
|
||||
}
|
||||
if args.IsAutoAlloc != nil {
|
||||
params.Add(jsonutils.NewBool(*args.IsAutoAlloc), "is_auto_alloc")
|
||||
}
|
||||
net, e := modules.Networks.CreateInContext(s, params, &modules.Wires, args.WIRE)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(net)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkCreateOptions2 struct {
|
||||
Wire string `help:"ID or Name of wire in which the network is created"`
|
||||
Vpc string `help:"ID or Name of vpc in which the network is created"`
|
||||
Zone string `help:"ID or Name of zone in which the network is created"`
|
||||
NAME string `help:"Name of new network"`
|
||||
PREFIX string `help:"Start of IPv4 address range"`
|
||||
Wire string `help:"ID or Name of wire in which the network is created"`
|
||||
Vpc string `help:"ID or Name of vpc in which the network is created"`
|
||||
Zone string `help:"ID or Name of zone in which the network is created"`
|
||||
NAME string `help:"Name of new network"`
|
||||
PREFIX string `help:"IPv4 prefix"`
|
||||
|
||||
Prefix6 string `help:"IPv6 prefix"`
|
||||
|
||||
BgpType string `help:"Internet service provider name" positional:"false"`
|
||||
AssignPublicIp bool
|
||||
Desc string `help:"Description" metavar:"DESCRIPTION"`
|
||||
@@ -127,6 +80,11 @@ func init() {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.NAME), "name")
|
||||
params.Add(jsonutils.NewString(args.PREFIX), "guest_ip_prefix")
|
||||
|
||||
if len(args.Prefix6) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Prefix6), "guest_ip6_prefix")
|
||||
}
|
||||
|
||||
params.Set("assign_public_ip", jsonutils.NewBool(args.AssignPublicIp))
|
||||
if len(args.BgpType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
|
||||
|
||||
@@ -1,30 +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/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.SecGroupCaches).WithKeyword("secgroup-cache")
|
||||
cmd.List(&compute.SecGroupCacheListOptions{})
|
||||
cmd.Show(&compute.SecGroupCacheIdOptions{})
|
||||
cmd.Delete(&compute.SecGroupCacheIdOptions{})
|
||||
cmd.Perform("syncstatus", &compute.SecGroupCacheIdOptions{})
|
||||
cmd.Get("references", &compute.SecGroupCacheIdOptions{})
|
||||
}
|
||||
@@ -27,13 +27,10 @@ func init() {
|
||||
cmd.Show(&options.SecgroupIdOptions{})
|
||||
cmd.Update(&options.BaseUpdateOptions{})
|
||||
cmd.Delete(&options.SecgroupIdOptions{})
|
||||
cmd.Perform("merge", &options.SecgroupMergeOptions{})
|
||||
cmd.Perform("public", &options.SecgroupIdOptions{})
|
||||
cmd.Perform("syncstatus", &options.SecgroupIdOptions{})
|
||||
cmd.Perform("private", &options.SecgroupIdOptions{})
|
||||
cmd.Perform("add-rule", &options.SecgroupsAddRuleOptions{})
|
||||
cmd.Perform("cache-secgroup", &options.SecurityGroupCacheOptions{})
|
||||
cmd.Perform("uncache-secgroup", &options.SecurityGroupUncacheSecurityGroup{})
|
||||
cmd.Perform("purge", &options.SecgroupIdOptions{})
|
||||
cmd.Perform("change-owner", &options.SecgroupChangeOwnerOptions{})
|
||||
cmd.Perform("import-rules", &options.SecgroupImportRulesOptions{})
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ func init() {
|
||||
Driver string `help:"Driver model of vNIC" choices:"virtio|e1000|vmxnet3|rtl8139"`
|
||||
Index int64 `help:"Index of NIC" default:"-1"`
|
||||
Ifname string `help:"Interface name of vNIC on host"`
|
||||
Default bool `help:"is default nic?"`
|
||||
}
|
||||
R(&ServerNetworkUpdateOptions{}, "server-network-update", "Update server network settings", func(s *mcclient.ClientSession, args *ServerNetworkUpdateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -106,6 +107,9 @@ func init() {
|
||||
if len(args.Ifname) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Ifname), "ifname")
|
||||
}
|
||||
if args.Default {
|
||||
params.Add(jsonutils.JSONTrue, "is_default")
|
||||
}
|
||||
if params.Size() == 0 {
|
||||
return InvalidUpdateError()
|
||||
}
|
||||
|
||||
@@ -115,11 +115,17 @@ func init() {
|
||||
cmd.Perform("qga-set-password", &options.ServerQgaSetPassword{})
|
||||
cmd.Perform("qga-command", &options.ServerQgaCommand{})
|
||||
cmd.Perform("qga-ping", &options.ServerQgaPing{})
|
||||
cmd.Perform("qga-guest-info-task", &options.ServerQgaGuestInfoTask{})
|
||||
cmd.Perform("qga-get-network", &options.ServerQgaGetNetwork{})
|
||||
cmd.Perform("set-password", &options.ServerSetPasswordOptions{})
|
||||
cmd.Perform("set-boot-index", &options.ServerSetBootIndexOptions{})
|
||||
cmd.Perform("reset-nic-traffic-limit", &options.ServerNicTrafficLimitOptions{})
|
||||
cmd.Perform("set-nic-traffic-limit", &options.ServerNicTrafficLimitOptions{})
|
||||
cmd.Perform("add-sub-ips", &options.ServerAddSubIpsOptions{})
|
||||
cmd.BatchPerform("set-os-info", &options.ServerSetOSInfoOptions{})
|
||||
cmd.BatchPerform("start-rescue", &options.ServerStartOptions{})
|
||||
cmd.BatchPerform("stop-rescue", &options.ServerStartOptions{})
|
||||
cmd.BatchPerform("sync-os-info", &options.ServerIdsOptions{})
|
||||
|
||||
cmd.Get("vnc", new(options.ServerVncOptions))
|
||||
cmd.Get("desc", new(options.ServerIdOptions))
|
||||
@@ -133,6 +139,7 @@ func init() {
|
||||
cmd.Get("cpuset-cores", new(options.ServerIdOptions))
|
||||
cmd.Get("sshport", new(options.ServerIdOptions))
|
||||
cmd.Get("qemu-info", new(options.ServerIdOptions))
|
||||
cmd.Get("hardware-info", new(options.ServerIdOptions))
|
||||
|
||||
cmd.GetProperty(&options.ServerStatusStatisticsOptions{})
|
||||
cmd.GetProperty(&options.ServerProjectStatisticsOptions{})
|
||||
@@ -299,11 +306,6 @@ func init() {
|
||||
})
|
||||
|
||||
R(&options.ServerLoginInfoOptions{}, "server-logininfo", "Get login info of a server", func(s *mcclient.ClientSession, opts *options.ServerLoginInfoOptions) error {
|
||||
srvid, e := modules.Servers.GetId(s, opts.ID, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
if len(opts.Key) > 0 {
|
||||
privateKey, e := ioutil.ReadFile(opts.Key)
|
||||
@@ -313,7 +315,7 @@ func init() {
|
||||
params.Add(jsonutils.NewString(string(privateKey)), "private_key")
|
||||
}
|
||||
|
||||
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
|
||||
i, e := modules.Servers.PerformAction(s, opts.ID, "login-info", params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
@@ -865,7 +867,7 @@ func init() {
|
||||
privateKey = string(key)
|
||||
}
|
||||
|
||||
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
|
||||
i, e := modules.Servers.PerformAction(s, srvid, "login-info", params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
|
||||
@@ -15,112 +15,18 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type SnapshotPolicyListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
OrderByBindDiskCount string
|
||||
}
|
||||
R(&SnapshotPolicyListOptions{}, "snapshot-policy-list", "List snapshot policy", func(s *mcclient.ClientSession, args *SnapshotPolicyListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.SnapshotPoliciy.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.SnapshotPoliciy.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type SnapshotPolicyDeleteOptions struct {
|
||||
ID string `help:"Delete snapshot id"`
|
||||
}
|
||||
R(&SnapshotPolicyDeleteOptions{}, "snapshot-policy-delete", "Delete snapshot policy", func(s *mcclient.ClientSession, args *SnapshotPolicyDeleteOptions) error {
|
||||
result, err := modules.SnapshotPoliciy.Delete(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type SnapshotPolicyCreateOptions struct {
|
||||
NAME string
|
||||
|
||||
RetentionDays int `help:"snapshot retention days"`
|
||||
RepeatWeekdays []int `help:"snapshot create days on week"`
|
||||
TimePoints []int `help:"snapshot create time points on one day"`
|
||||
}
|
||||
|
||||
R(&SnapshotPolicyCreateOptions{}, "snapshot-policy-create", "Create snapshot policy", func(s *mcclient.ClientSession, args *SnapshotPolicyCreateOptions) error {
|
||||
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
|
||||
snapshot, err := modules.SnapshotPoliciy.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(snapshot)
|
||||
return nil
|
||||
})
|
||||
|
||||
type SnapshotPolicyBindDisksOptions struct {
|
||||
ID string `help:"ID"`
|
||||
Disk []string `help:"ids of disk"`
|
||||
}
|
||||
|
||||
R(&SnapshotPolicyBindDisksOptions{}, "snapshot-policy-bind-disk", "bind snapshotpolicy to disks",
|
||||
func(s *mcclient.ClientSession, opts *SnapshotPolicyBindDisksOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sp, err := modules.SnapshotPoliciy.PerformAction(s, opts.ID, "bind-disks", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(sp)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&SnapshotPolicyBindDisksOptions{}, "snapshot-policy-unbind-disk", "bind snapshotpolicy to disks",
|
||||
func(s *mcclient.ClientSession, opts *SnapshotPolicyBindDisksOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sp, err := modules.SnapshotPoliciy.PerformAction(s, opts.ID, "unbind-disks", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(sp)
|
||||
return nil
|
||||
})
|
||||
|
||||
type SnapshotPolicyCacheOptions struct {
|
||||
ID string `help:"SnasphotPolicy ID"`
|
||||
REGIONID string `help:"Region ID"`
|
||||
PROVIDER string `help:"Provider ID"`
|
||||
}
|
||||
R(&SnapshotPolicyCacheOptions{}, "snapshot-policy-cache", "upload local snapshotpolicy to cloud",
|
||||
func(s *mcclient.ClientSession, opts *SnapshotPolicyCacheOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sp, err := modules.SnapshotPoliciy.PerformAction(s, opts.ID, "cache", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(sp)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
cmd := shell.NewResourceCmd(&modules.SnapshotPoliciy).WithKeyword("snapshot-policy")
|
||||
cmd.List(&compute.SnapshotPolicyListOptions{})
|
||||
cmd.Delete(&options.BaseIdOptions{})
|
||||
cmd.Create(&compute.SnapshotPolicyCreateOptions{})
|
||||
cmd.Perform("bind-disks", &compute.SnapshotPolicyDisksOptions{})
|
||||
cmd.Perform("unbind-disks", &compute.SnapshotPolicyDisksOptions{})
|
||||
cmd.Perform("syncstatus", &options.BaseIdOptions{})
|
||||
}
|
||||
|
||||
@@ -1,80 +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/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type SSnapshotpolicyDiskListOfDiskOption struct {
|
||||
DISKID string `help:"disk id"`
|
||||
}
|
||||
R(&SSnapshotpolicyDiskListOfDiskOption{}, "disk-snapshot-policy-list", "List snapshot policy attached",
|
||||
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskListOfDiskOption) error {
|
||||
result, err := modules.SnapshotPolicyDisk.ListDescendent(s, opts.DISKID, jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.SnapshotPolicyDisk.GetColumns(s))
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type SSnapshotpolicyDiskListOfSnapshotpolicyOption struct {
|
||||
SNAPSHOTPOLICYID string `help:"snapshot policy id"`
|
||||
}
|
||||
R(&SSnapshotpolicyDiskListOfSnapshotpolicyOption{}, "snapshot-policy-disk-list", "List disk attached",
|
||||
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskListOfSnapshotpolicyOption) error {
|
||||
result, err := modules.SnapshotPolicyDisk.ListDescendent2(s, opts.SNAPSHOTPOLICYID, jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.SnapshotPolicyDisk.GetColumns(s))
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type SSnapshotpolicyDiskAttachOption struct {
|
||||
DISKID string `help:"disk id"`
|
||||
SNAPSHOTPOLICYID string `help:"snapshot policy id"`
|
||||
}
|
||||
R(&SSnapshotpolicyDiskAttachOption{}, "disk-snapshot-policy-attach", "attach snapshot policy to disk",
|
||||
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskAttachOption) error {
|
||||
_, err := modules.SnapshotPolicyDisk.Attach(s, opts.DISKID, opts.SNAPSHOTPOLICYID, jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type SSnapshotpolicyDiskDetachOption struct {
|
||||
DISKID string `help:"disk id"`
|
||||
SNAPSHOTPOLICYID string `help:"snapshot policy id"`
|
||||
}
|
||||
R(&SSnapshotpolicyDiskDetachOption{}, "disk-snapshot-policy-detach", "detach snapshot policy to disk",
|
||||
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskDetachOption) error {
|
||||
_, err := modules.SnapshotPolicyDisk.Detach(s, opts.DISKID, opts.SNAPSHOTPOLICYID, jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -102,7 +102,7 @@ func init() {
|
||||
oldKeys = string(output)
|
||||
}
|
||||
pubKeys := &deployapi.SSHKeys{AdminPublicKey: pubKey}
|
||||
newKeys := fsdriver.MergeAuthorizedKeys(oldKeys, pubKeys)
|
||||
newKeys := fsdriver.MergeAuthorizedKeys(oldKeys, pubKeys, true)
|
||||
if output, err := procutils.NewCommand(
|
||||
"sh", "-c", fmt.Sprintf("echo '%s' > %s", newKeys, authFile)).Output(); err != nil {
|
||||
return errors.Wrapf(err, "write public keys: %s", output)
|
||||
|
||||
@@ -15,92 +15,18 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type StoragecacheListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
CloudregionId string `help:"cloudregion id"`
|
||||
}
|
||||
R(&StoragecacheListOptions{}, "storage-cache-list", "List storage caches", func(s *mcclient.ClientSession, opts *StoragecacheListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Storagecaches.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Storagecaches.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type StoragecacheShowptions struct {
|
||||
ID string `help:"ID or Name of storagecache"`
|
||||
}
|
||||
R(&StoragecacheShowptions{}, "storage-cache-show", "Show details of storage caches", func(s *mcclient.ClientSession, args *StoragecacheShowptions) error {
|
||||
result, err := modules.Storagecaches.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&StoragecacheShowptions{}, "storage-cache-delete", "Delete storage cache", func(s *mcclient.ClientSession, args *StoragecacheShowptions) error {
|
||||
result, err := modules.Storagecaches.Delete(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type StorageCacheImageActionOptions struct {
|
||||
ID string `help:"ID or name of storage"`
|
||||
IMAGE string `help:"ID or name of image"`
|
||||
Force bool `help:"Force refresh cache, even if the image exists in cache"`
|
||||
Format string `help:"image format" choices:"iso|qcow2|vmdk|vhd"`
|
||||
}
|
||||
R(&StorageCacheImageActionOptions{}, "storagecache-cache-image", "Ask a storage cache to cache a image", func(s *mcclient.ClientSession, args *StorageCacheImageActionOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.IMAGE), "image")
|
||||
if args.Force {
|
||||
params.Add(jsonutils.JSONTrue, "is_force")
|
||||
}
|
||||
if len(args.Format) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Format), "format")
|
||||
}
|
||||
storage, err := modules.Storagecaches.PerformAction(s, args.ID, "cache-image", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(storage)
|
||||
return nil
|
||||
})
|
||||
|
||||
type StorageUncacheImageActionOptions struct {
|
||||
ID string `help:"ID or name of storage"`
|
||||
IMAGE string `help:"ID or name of image"`
|
||||
Force bool `help:"Force uncache, even if the image exists in cache is invalid"`
|
||||
}
|
||||
R(&StorageUncacheImageActionOptions{}, "storagecache-uncache-image", "Ask a storage cache to remove image from its cache", func(s *mcclient.ClientSession, args *StorageUncacheImageActionOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.IMAGE), "image")
|
||||
if args.Force {
|
||||
params.Add(jsonutils.JSONTrue, "is_force")
|
||||
}
|
||||
storage, err := modules.Storagecaches.PerformAction(s, args.ID, "uncache-image", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(storage)
|
||||
return nil
|
||||
})
|
||||
cmd := shell.NewResourceCmd(&modules.Storagecaches).WithKeyword("storage-cache")
|
||||
cmd.List(&compute.StoragecacheListOptions{})
|
||||
cmd.Show(&options.BaseIdOptions{})
|
||||
cmd.Delete(&options.BaseIdOptions{})
|
||||
cmd.Update(&options.BaseUpdateOptions{})
|
||||
cmd.Perform("cache-image", &compute.StorageCacheImageActionOptions{})
|
||||
cmd.Perform("uncache-image", &compute.StorageUncacheImageActionOptions{})
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ func init() {
|
||||
cmd.Perform("force-detach-host", &compute.StorageForceDetachHost{})
|
||||
cmd.Perform("public", &options.BasePublicOptions{})
|
||||
cmd.Perform("private", &options.BaseIdOptions{})
|
||||
cmd.Get("hardware-info", &options.BaseIdOptions{})
|
||||
cmd.Perform("set-hardware-info", &compute.StorageSetHardwareInfoOptions{})
|
||||
|
||||
type StorageCephRunOptions struct {
|
||||
ID string `help:"ID or name of ceph storage"`
|
||||
|
||||
@@ -15,19 +15,25 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/identity"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/image"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
type GeneralUsageOptions struct {
|
||||
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun"`
|
||||
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|Google|Ctyun"`
|
||||
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|DStack|Google|Ctyun"`
|
||||
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun"`
|
||||
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|DStack|Google|Ctyun"`
|
||||
Project string `help:"show usage of specified project"`
|
||||
|
||||
ProjectDomain string `help:"show usage of specified domain"`
|
||||
@@ -58,7 +64,50 @@ func fetchHostTypeOptions(args *GeneralUsageOptions) *jsonutils.JSONDict {
|
||||
return params
|
||||
}
|
||||
|
||||
type HistoryUsageListOptions struct {
|
||||
options.ExtraListOptions
|
||||
StartDate time.Time
|
||||
EndDate time.Time
|
||||
Interval string `choices:"hour|day|month|year" default:"day"`
|
||||
}
|
||||
|
||||
func (opts *HistoryUsageListOptions) Params() (jsonutils.JSONObject, error) {
|
||||
if opts.StartDate.IsZero() || opts.EndDate.IsZero() {
|
||||
opts.EndDate = time.Now()
|
||||
switch opts.Interval {
|
||||
case "hour":
|
||||
opts.StartDate = time.Now().Add(time.Hour * -24)
|
||||
case "day":
|
||||
opts.StartDate = time.Now().AddDate(0, 0, -30)
|
||||
case "month":
|
||||
opts.StartDate = time.Now().AddDate(0, -12, 0)
|
||||
case "year":
|
||||
opts.StartDate = time.Now().AddDate(-3, 0, 0)
|
||||
}
|
||||
}
|
||||
return jsonutils.Marshal(opts), nil
|
||||
}
|
||||
|
||||
func (o *HistoryUsageListOptions) GetExportKeys() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (o *HistoryUsageListOptions) GetId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
cmd := shell.NewResourceCmd(modules.HistoryUsages)
|
||||
cmd.GetWithCustomShow("list", func(data jsonutils.JSONObject) {
|
||||
ret := map[string][]jsonutils.JSONObject{}
|
||||
data.Unmarshal(&ret)
|
||||
for k, d := range ret {
|
||||
fmt.Println(k)
|
||||
printutils.PrintJSONList(&printutils.ListResult{Data: d}, nil)
|
||||
}
|
||||
}, &HistoryUsageListOptions{})
|
||||
|
||||
R(&GeneralUsageOptions{}, "usage", "Show general usage", func(s *mcclient.ClientSession, args *GeneralUsageOptions) error {
|
||||
params := fetchHostTypeOptions(args)
|
||||
if args.Project != "" {
|
||||
|
||||
@@ -1,29 +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/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.WafIPSetCaches)
|
||||
cmd.List(&compute.WafIPSetCacheListOptions{})
|
||||
cmd.Show(&options.BaseIdOptions{})
|
||||
cmd.Delete(&options.BaseIdOptions{})
|
||||
}
|
||||
@@ -32,6 +32,11 @@ import (
|
||||
|
||||
func init() {
|
||||
handleResult := func(s *mcclient.ClientSession, opt o.WebConsoleOptions, obj jsonutils.JSONObject) error {
|
||||
if obj.Contains("access_url") {
|
||||
accessUrl, _ := obj.GetString("access_url")
|
||||
fmt.Println("AccessURL:", accessUrl)
|
||||
return nil
|
||||
}
|
||||
if opt.WebconsoleUrl == "" {
|
||||
resp, err := identity.ServicesV3.GetSpecific(s, "common", "config", nil)
|
||||
if err != nil {
|
||||
@@ -117,7 +122,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := webconsole.WebConsole.DoSshConnect(s, args.IP, params)
|
||||
ret, err := webconsole.WebConsole.DoSshConnect(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -133,4 +138,14 @@ func init() {
|
||||
handleResult(s, args.WebConsoleOptions, ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.WebConsoleServerRdpOptions{}, "webconsole-server-rdp", "Connect server remote graphic console by rdp", func(s *mcclient.ClientSession, args *o.WebConsoleServerRdpOptions) error {
|
||||
ret, err := webconsole.WebConsole.DoServerRDPConnect(s, args.ID, jsonutils.Marshal(map[string]interface{}{"webconsole": args}))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
handleResult(s, args.WebConsoleOptions, ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ type IPropertyOpt interface {
|
||||
Property() string
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
|
||||
func (cmd ResourceCmd) GetPropertyWithShowFunc(args IPropertyOpt, showFunc func(jsonutils.JSONObject) error) {
|
||||
man := cmd.manager
|
||||
callback := func(s *mcclient.ClientSession, args IPropertyOpt) error {
|
||||
params, err := args.Params()
|
||||
@@ -240,6 +240,17 @@ func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = showFunc(ret)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
cmd.RunWithDesc(args.Property(), fmt.Sprintf("Get property of a %s", man.GetKeyword()), args, callback)
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
|
||||
cmd.GetPropertyWithShowFunc(args, func(ret jsonutils.JSONObject) error {
|
||||
if _, ok := ret.(*jsonutils.JSONArray); ok {
|
||||
data, _ := ret.GetArray()
|
||||
PrintList(&printutils.ListResult{
|
||||
@@ -249,8 +260,7 @@ func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
|
||||
PrintObject(ret)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
cmd.RunWithDesc(args.Property(), fmt.Sprintf("Get property of a %s", man.GetKeyword()), args, callback)
|
||||
})
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) Show(args IShowOpt) {
|
||||
@@ -657,15 +667,15 @@ func (cmd JointCmd) List(args IJointListOpt) {
|
||||
cmd.RunWithDesc("list", fmt.Sprintf("list %s %s pairs", man.MasterManager().KeyString(), man.SlaveManager().KeyString()), args, callback)
|
||||
}
|
||||
|
||||
type IJointShowOpt interface {
|
||||
type IJointOpt interface {
|
||||
IOpt
|
||||
GetMasterId() string
|
||||
GetSlaveId() string
|
||||
}
|
||||
|
||||
func (cmd JointCmd) Show(args IJointShowOpt) {
|
||||
func (cmd JointCmd) Show(args IJointOpt) {
|
||||
man := cmd.manager.(modulebase.JointManager)
|
||||
callback := func(s *mcclient.ClientSession, args IJointShowOpt) error {
|
||||
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -679,3 +689,54 @@ func (cmd JointCmd) Show(args IJointShowOpt) {
|
||||
}
|
||||
cmd.Run("show", args, callback)
|
||||
}
|
||||
|
||||
func (cmd JointCmd) Attach(args IJointOpt) {
|
||||
man := cmd.manager.(modulebase.JointManager)
|
||||
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := man.Attach(s, args.GetMasterId(), args.GetSlaveId(), params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
PrintObject(result)
|
||||
return nil
|
||||
}
|
||||
cmd.Run("attach", args, callback)
|
||||
}
|
||||
|
||||
func (cmd JointCmd) Detach(args IJointOpt) {
|
||||
man := cmd.manager.(modulebase.JointManager)
|
||||
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := man.Detach(s, args.GetMasterId(), args.GetSlaveId(), params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
PrintObject(result)
|
||||
return nil
|
||||
}
|
||||
cmd.Run("detach", args, callback)
|
||||
}
|
||||
|
||||
func (cmd JointCmd) Update(args IJointOpt) {
|
||||
man := cmd.manager.(modulebase.JointManager)
|
||||
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := man.Update(s, args.GetMasterId(), args.GetSlaveId(), nil, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
PrintObject(result)
|
||||
return nil
|
||||
}
|
||||
cmd.Run("update", args, callback)
|
||||
}
|
||||
|
||||
@@ -31,4 +31,5 @@ func init() {
|
||||
orgCmd.Delete(&identity_options.OrganizationIdOptions{})
|
||||
orgCmd.Perform("add-level", &identity_options.OrganizationAddLevelOptions{})
|
||||
orgCmd.Perform("add-node", &identity_options.OrganizationAddNodeOptions{})
|
||||
orgCmd.Perform("clean", &identity_options.OrganizationIdOptions{})
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/tagutils"
|
||||
)
|
||||
|
||||
func createPolicy(s *mcclient.ClientSession, name string, genName string, policy string, domain string, enabled bool, disabled bool, desc string, scope string, isSystem *bool, objectags, projecttags, domaintags tagutils.TTagSet) error {
|
||||
func createPolicy(s *mcclient.ClientSession, name string, genName string, policy string, domain string, enabled bool, disabled bool, desc string, scope string, isSystem *bool, objectags, projecttags, domaintags tagutils.TTagSet, orgNodeId []string) error {
|
||||
params := jsonutils.NewDict()
|
||||
if len(genName) > 0 {
|
||||
params.Add(jsonutils.NewString(genName), "generate_name")
|
||||
@@ -83,6 +83,10 @@ func createPolicy(s *mcclient.ClientSession, name string, genName string, policy
|
||||
params.Add(jsonutils.Marshal(domaintags), "domain_tags")
|
||||
}
|
||||
|
||||
if len(orgNodeId) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(orgNodeId), "org_node_id")
|
||||
}
|
||||
|
||||
result, err := modules.Policies.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -115,7 +119,12 @@ func createPolicyFromJson(s *mcclient.ClientSession, old jsonutils.JSONObject, a
|
||||
domainTags = make(tagutils.TTagSet, 0)
|
||||
old.Unmarshal(&domainTags, "domain_tags")
|
||||
}
|
||||
return createPolicy(s, argsName, genName, policy, argsDomain, enabled, !enabled, desc, scope, &isSystem, objectTags, projectTags, domainTags)
|
||||
var nodeIds []string
|
||||
if old.Contains("org_node_id") {
|
||||
nodeIds = make([]string, 0)
|
||||
old.Unmarshal(&nodeIds, "org_node_id")
|
||||
}
|
||||
return createPolicy(s, argsName, genName, policy, argsDomain, enabled, !enabled, desc, scope, &isSystem, objectTags, projectTags, domainTags, nodeIds)
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -141,6 +150,8 @@ func init() {
|
||||
ProjectTags string `help:"project tags"`
|
||||
DomainTags string `help:"domain tags"`
|
||||
ObjectTags string `help:"object tags"`
|
||||
|
||||
OrgNodeId []string `help:"node ids of organiazation tree node"`
|
||||
}
|
||||
R(&PolicyCreateOptions{}, "policy-create", "Create a new policy", func(s *mcclient.ClientSession, args *PolicyCreateOptions) error {
|
||||
policyBytes, err := ioutil.ReadFile(args.FILE)
|
||||
@@ -151,7 +162,7 @@ func init() {
|
||||
objectTags := baseoptions.SplitTag(args.ObjectTags)
|
||||
projectTags := baseoptions.SplitTag(args.ProjectTags)
|
||||
domainTags := baseoptions.SplitTag(args.DomainTags)
|
||||
return createPolicy(s, args.NAME, "", string(policyBytes), args.Domain, args.Enabled, args.Disabled, args.Desc, args.Scope, args.IsSystem, objectTags, projectTags, domainTags)
|
||||
return createPolicy(s, args.NAME, "", string(policyBytes), args.Domain, args.Enabled, args.Disabled, args.Desc, args.Scope, args.IsSystem, objectTags, projectTags, domainTags, args.OrgNodeId)
|
||||
})
|
||||
|
||||
type PolicyExportOptions struct {
|
||||
@@ -213,6 +224,8 @@ func init() {
|
||||
ProjectTags string `help:"project tags"`
|
||||
DomainTags string `help:"domain tags"`
|
||||
ObjectTags string `help:"object tags"`
|
||||
|
||||
OrgNodeId []string `help:"node ids of organiazation tree node"`
|
||||
}
|
||||
updateFunc := func(s *mcclient.ClientSession, args *PolicyPatchOptions) error {
|
||||
policyId, err := modules.Policies.GetId(s, args.ID, nil)
|
||||
@@ -262,6 +275,10 @@ func init() {
|
||||
params.Add(jsonutils.NewString(args.TagsAction), "tag_update_policy")
|
||||
}
|
||||
|
||||
if len(args.OrgNodeId) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(args.OrgNodeId), "org_node_id")
|
||||
}
|
||||
|
||||
result, err := modules.Policies.Update(s, policyId, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -40,6 +40,7 @@ func init() {
|
||||
cmd.GetProperty(&identity_options.ProjectGetPropertyTagValueTreeOptions{})
|
||||
cmd.GetProperty(&identity_options.ProjectGetPropertyDomainTagValuePairOptions{})
|
||||
cmd.GetProperty(&identity_options.ProjectGetPropertyDomainTagValueTreeOptions{})
|
||||
cmd.PerformClass("clean", &identity_options.ProjectCleanOptions{})
|
||||
|
||||
type ProjectShowOptions struct {
|
||||
ID string `help:"ID or Name of project"`
|
||||
@@ -387,16 +388,18 @@ func init() {
|
||||
})
|
||||
|
||||
type ProjectAddUserGroupOptions struct {
|
||||
Project string `help:"ID or name of project to add users/groups" positional:"true" optional:"false"`
|
||||
User []string `help:"ID of user to add"`
|
||||
Group []string `help:"ID of group to add"`
|
||||
Role []string `help:"ID of role to add"`
|
||||
Project string `help:"ID or name of project to add users/groups" positional:"true" optional:"false"`
|
||||
User []string `help:"ID of user to add"`
|
||||
Group []string `help:"ID of group to add"`
|
||||
Role []string `help:"ID of role to add"`
|
||||
EnableAllUsers bool
|
||||
}
|
||||
R(&ProjectAddUserGroupOptions{}, "project-add-user-group", "Batch add users/groups to project", func(s *mcclient.ClientSession, args *ProjectAddUserGroupOptions) error {
|
||||
input := api.SProjectAddUserGroupInput{}
|
||||
input.Users = args.User
|
||||
input.Groups = args.Group
|
||||
input.Roles = args.Role
|
||||
input.EnableAllUsers = args.EnableAllUsers
|
||||
err := input.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -162,6 +162,18 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServiceConfigShow2Options struct {
|
||||
TYPE string `help:"service type"`
|
||||
}
|
||||
R(&ServiceConfigShow2Options{}, "service-config-show2", "Show configs of a service", func(s *mcclient.ClientSession, args *ServiceConfigShow2Options) error {
|
||||
conf, err := modules.ServicesV3.GetConfig(s, args.TYPE)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(conf.PrettyString())
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServiceConfigOptions struct {
|
||||
SERVICE string `help:"service name or id"`
|
||||
Config []string `help:"config options, can be a JSON, a YAML or a key=value pair, e.g:\n * JSON\n '{\"default\":{\"password_expiration_seconds\":300}}'\n * YAML\n default:\n password_expiration_seconds: 300\n * A key=value pair (under default section)\n password_expiration_seconds=300\n"`
|
||||
|
||||
@@ -413,15 +413,32 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type UserGroupsOptions struct {
|
||||
USER string `help:"User ID or Name"`
|
||||
Gids []string `help:"group ID or Name"`
|
||||
Action string `default:"join" choices:"join|leave"`
|
||||
Enabled bool
|
||||
}
|
||||
|
||||
R(&UserGroupsOptions{}, "user-join-groups", "Add a user to groups", func(s *mcclient.ClientSession, args *UserGroupsOptions) error {
|
||||
_, err := modules.UsersV3.DoJoinGroups(s, args.USER, jsonutils.Marshal(args))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
type UserJoinProjectOptions struct {
|
||||
User string `help:"User Id or name" optional:"false" positional:"true"`
|
||||
Project []string `help:"Projects to join" nargs:"+"`
|
||||
Role []string `help:"User join project with roles" nargs:"+"`
|
||||
Enabled bool
|
||||
}
|
||||
R(&UserJoinProjectOptions{}, "user-join-project", "User join projects with roles", func(s *mcclient.ClientSession, args *UserJoinProjectOptions) error {
|
||||
input := api.SJoinProjectsInput{}
|
||||
input.Projects = args.Project
|
||||
input.Roles = args.Role
|
||||
input.Enabled = args.Enabled
|
||||
result, err := modules.UsersV3.PerformAction(s, args.User, "join", jsonutils.Marshal(input))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -50,4 +50,28 @@ func init() {
|
||||
fmt.Println(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DistinctFieldsOption struct {
|
||||
MODULE string `help:"module name"`
|
||||
Field []string `help:"distinct field name to query"`
|
||||
ExtraField []string `help:"distinct field name to query"`
|
||||
ExtraResource string
|
||||
}
|
||||
R(&DistinctFieldsOption{}, "distinct-fields", "Query values of a distinct fields for a module", func(s *mcclient.ClientSession, args *DistinctFieldsOption) 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.Marshal(args)
|
||||
result, err := mod.Get(s, "distinct-fields", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -19,12 +19,45 @@ import (
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/utils"
|
||||
"yunion.io/x/pkg/util/sets"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
)
|
||||
|
||||
type GlobalSettingsValue struct {
|
||||
SetupKeys []string `json:"setupKeys"`
|
||||
SetupKeysVersion string `json:"setupKeysVersion"`
|
||||
SetupOneStackInitialized bool `json:"setupOneStackInitialized"`
|
||||
ProductVersion string `json:"productVersion"`
|
||||
UserDefinedKeys map[string]bool `json:"userDefinedKeys"`
|
||||
}
|
||||
|
||||
func NewGlobalSettingsValue(setupKeys []string, setupOneStack bool) *GlobalSettingsValue {
|
||||
settings := &GlobalSettingsValue{
|
||||
SetupOneStackInitialized: setupOneStack,
|
||||
UserDefinedKeys: make(map[string]bool),
|
||||
}
|
||||
for _, key := range setupKeys {
|
||||
settings.Switch(key, true)
|
||||
}
|
||||
return settings
|
||||
}
|
||||
|
||||
func (g *GlobalSettingsValue) Switch(featureKey string, on bool) {
|
||||
if g.UserDefinedKeys == nil {
|
||||
g.UserDefinedKeys = map[string]bool{}
|
||||
}
|
||||
g.UserDefinedKeys[featureKey] = on
|
||||
ss := sets.NewString(g.SetupKeys...)
|
||||
if on {
|
||||
ss.Insert(featureKey)
|
||||
} else {
|
||||
ss.Delete(featureKey)
|
||||
}
|
||||
g.SetupKeys = ss.List()
|
||||
}
|
||||
|
||||
func init() {
|
||||
var features = []string{
|
||||
"onestack",
|
||||
@@ -66,6 +99,8 @@ func init() {
|
||||
"baidu",
|
||||
"cucloud",
|
||||
"qingcloud",
|
||||
"volcengine",
|
||||
"oraclecloud",
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -97,10 +132,7 @@ func init() {
|
||||
input := map[string]interface{}{
|
||||
"name": GlobalSettings,
|
||||
"service_id": YunionAgent,
|
||||
"value": map[string]interface{}{
|
||||
"setupKeys": []string{name},
|
||||
"setupOneStackInitialized": true,
|
||||
},
|
||||
"value": NewGlobalSettingsValue([]string{name}, true),
|
||||
}
|
||||
params := jsonutils.Marshal(input)
|
||||
if _, err := yunionconf.Parameters.Create(s, params); err != nil {
|
||||
@@ -122,33 +154,20 @@ func init() {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "get value")
|
||||
}
|
||||
setupKeys := []string{}
|
||||
if value.Contains("setupKeys") {
|
||||
if err := value.Unmarshal(&setupKeys, "setupKeys"); err != nil {
|
||||
return errors.Wrap(err, "unmarshal setupKeys")
|
||||
}
|
||||
curConf := new(GlobalSettingsValue)
|
||||
if err := value.Unmarshal(curConf); err != nil {
|
||||
return errors.Wrapf(err, "unmarshal to GlobalSettingsValue: %s", value)
|
||||
}
|
||||
if !enable {
|
||||
if utils.IsInStringArray(name, setupKeys) {
|
||||
newKeys := []string{}
|
||||
for _, key := range setupKeys {
|
||||
if key != name {
|
||||
newKeys = append(newKeys, key)
|
||||
}
|
||||
}
|
||||
setupKeys = newKeys
|
||||
}
|
||||
} else if enable {
|
||||
if !utils.IsInStringArray(name, setupKeys) {
|
||||
setupKeys = append(setupKeys, name)
|
||||
}
|
||||
curConf.Switch(name, false)
|
||||
} else {
|
||||
curConf.Switch(name, true)
|
||||
}
|
||||
value.(*jsonutils.JSONDict).Set("setupKeys", jsonutils.Marshal(setupKeys))
|
||||
id, err := ss.GetString("id")
|
||||
if err != nil {
|
||||
return errors.Errorf("get id from %s", ss)
|
||||
}
|
||||
ss.(*jsonutils.JSONDict).Set("value", value)
|
||||
ss.(*jsonutils.JSONDict).Set("value", jsonutils.Marshal(curConf))
|
||||
obj, err := yunionconf.Parameters.Update(s, id, ss)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "update %s(%s)", GlobalSettings, id)
|
||||
|
||||
@@ -96,6 +96,7 @@ func init() {
|
||||
apis.SERVICE_TYPE_OFFLINE_CLOUDMETA,
|
||||
apis.SERVICE_TYPE_CLOUDMETA,
|
||||
apis.SERVICE_TYPE_INFLUXDB,
|
||||
apis.SERVICE_TYPE_VICTORIA_METRICS,
|
||||
apis.SERVICE_TYPE_ETCD,
|
||||
"torrent-tracker",
|
||||
}) {
|
||||
|
||||
@@ -15,10 +15,136 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
monitorapi "yunion.io/x/onecloud/pkg/apis/monitor"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
|
||||
)
|
||||
|
||||
type CommonAlertTerm struct {
|
||||
Database string
|
||||
Measurement string
|
||||
Operator string // and / or
|
||||
Field []string
|
||||
FieldFunc string
|
||||
|
||||
Reduce string
|
||||
Comparator string
|
||||
Threshold float64
|
||||
Filters []monitorapi.MetricQueryTag
|
||||
FieldOpt string
|
||||
Name string
|
||||
ConditionType string
|
||||
From string
|
||||
Interval string
|
||||
GroupBy string
|
||||
Level string
|
||||
}
|
||||
|
||||
func newCommonAlertQuery(tem *CommonAlertTerm) *monitorapi.CommonAlertQuery {
|
||||
mq := monitorapi.MetricQuery{
|
||||
Alias: "",
|
||||
Tz: "",
|
||||
Database: tem.Database,
|
||||
Measurement: tem.Measurement,
|
||||
Tags: make([]monitorapi.MetricQueryTag, 0),
|
||||
GroupBy: make([]monitorapi.MetricQueryPart, 0),
|
||||
Selects: nil,
|
||||
Interval: "",
|
||||
Policy: "",
|
||||
ResultFormat: "",
|
||||
}
|
||||
|
||||
for _, field := range tem.Field {
|
||||
sel := monitorapi.MetricQueryPart{
|
||||
Type: "field",
|
||||
Params: []string{field},
|
||||
}
|
||||
selectPart := []monitorapi.MetricQueryPart{sel}
|
||||
if len(tem.FieldFunc) != 0 {
|
||||
selectPart = append(selectPart, monitorapi.MetricQueryPart{
|
||||
Type: tem.FieldFunc,
|
||||
Params: []string{},
|
||||
})
|
||||
} else {
|
||||
selectPart = append(selectPart, monitorapi.MetricQueryPart{
|
||||
Type: "mean",
|
||||
Params: []string{},
|
||||
})
|
||||
}
|
||||
mq.Selects = append(mq.Selects, selectPart)
|
||||
}
|
||||
if len(tem.Filters) != 0 {
|
||||
for _, filter := range tem.Filters {
|
||||
mq.Tags = append(mq.Tags, filter)
|
||||
}
|
||||
}
|
||||
|
||||
alertQ := new(monitorapi.AlertQuery)
|
||||
alertQ.Model = mq
|
||||
alertQ.From = "60m"
|
||||
|
||||
commonAlert := monitorapi.CommonAlertQuery{
|
||||
AlertQuery: alertQ,
|
||||
Reduce: tem.Reduce,
|
||||
Comparator: tem.Comparator,
|
||||
Threshold: tem.Threshold,
|
||||
Operator: tem.Operator,
|
||||
}
|
||||
if tem.FieldOpt != "" {
|
||||
commonAlert.FieldOpt = monitorapi.CommonAlertFieldOpt_Division
|
||||
}
|
||||
if len(tem.ConditionType) != 0 {
|
||||
commonAlert.ConditionType = tem.ConditionType
|
||||
}
|
||||
if len(tem.GroupBy) != 0 {
|
||||
commonAlert.Model.GroupBy = append(commonAlert.Model.GroupBy, monitorapi.MetricQueryPart{
|
||||
Type: "field",
|
||||
Params: []string{tem.GroupBy},
|
||||
})
|
||||
}
|
||||
return &commonAlert
|
||||
}
|
||||
|
||||
var (
|
||||
cpuTem = &CommonAlertTerm{
|
||||
Operator: "or",
|
||||
Database: "telegraf",
|
||||
Measurement: "vm_cpu",
|
||||
Field: []string{"usage_active"},
|
||||
Comparator: ">=",
|
||||
Reduce: "avg",
|
||||
Threshold: 50,
|
||||
Name: "lzx-test.cpu.usage_active",
|
||||
Filters: []monitorapi.MetricQueryTag{
|
||||
{
|
||||
Key: "id",
|
||||
Operator: "=",
|
||||
Value: "a0eee5dd-3cfe-4ab1-8c79-aee1a8cf4dab",
|
||||
},
|
||||
},
|
||||
}
|
||||
memTem = &CommonAlertTerm{
|
||||
Operator: "or",
|
||||
Database: "telegraf",
|
||||
Measurement: "vm_mem",
|
||||
Field: []string{"used_percent"},
|
||||
Comparator: ">=",
|
||||
Reduce: "avg",
|
||||
Threshold: 3,
|
||||
Name: "lzx-test.mem.avaiable",
|
||||
Filters: []monitorapi.MetricQueryTag{
|
||||
{
|
||||
Key: "id",
|
||||
Operator: "=",
|
||||
Value: "a0eee5dd-3cfe-4ab1-8c79-aee1a8cf4dab",
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := NewResourceCmd(modules.CommonAlerts)
|
||||
cmd.Create(new(options.CommonAlertCreateOptions))
|
||||
@@ -28,4 +154,34 @@ func init() {
|
||||
cmd.Perform("disable", &options.CommonAlertShowOptions{})
|
||||
cmd.BatchDelete(new(options.CommonAlertDeleteOptions))
|
||||
cmd.Perform("config", &options.CommonAlertUpdateOptions{})
|
||||
|
||||
type TestOpt struct {
|
||||
NAME string
|
||||
RobotIds []string
|
||||
Users []string
|
||||
}
|
||||
R(&TestOpt{}, "monitor-commonalert-create-mul-test", "create test monitor common alert", func(s *mcclient.ClientSession, opt *TestOpt) error {
|
||||
cpuQ := newCommonAlertQuery(cpuTem)
|
||||
memQ := newCommonAlertQuery(memTem)
|
||||
input := monitorapi.CommonAlertCreateInput{
|
||||
CommonMetricInputQuery: monitorapi.CommonMetricInputQuery{
|
||||
MetricQuery: []*monitorapi.CommonAlertQuery{
|
||||
cpuQ,
|
||||
memQ,
|
||||
},
|
||||
},
|
||||
AlertCreateInput: monitorapi.AlertCreateInput{
|
||||
Name: opt.NAME,
|
||||
},
|
||||
CommonAlertCreateBaseInput: monitorapi.CommonAlertCreateBaseInput{
|
||||
Recipients: opt.Users,
|
||||
RobotIds: opt.RobotIds,
|
||||
Channel: []string{"webconsole"},
|
||||
AlertType: monitorapi.CommonAlertNomalAlertType,
|
||||
Scope: "system",
|
||||
},
|
||||
}
|
||||
_, err := modules.CommonAlerts.Create(s, jsonutils.Marshal(input))
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/pkg/errors"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
|
||||
)
|
||||
@@ -24,5 +27,18 @@ func init() {
|
||||
cmd := shell.NewResourceCmd(monitor.UnifiedMonitorManager).SetPrefix("monitor")
|
||||
cmd.Show(&options.SimpleQueryOptions{})
|
||||
cmd.GetProperty(&options.MeasurementsQueryOptions{})
|
||||
cmd.GetProperty(&options.DatabasesQueryOptions{})
|
||||
// cmd.GetProperty(&options.DatabasesQueryOptions{})
|
||||
|
||||
R(new(options.MetricQueryOptions), "monitor-unifiedmonitor-query", "Perform metrics query", func(s *mcclient.ClientSession, opts *options.MetricQueryOptions) error {
|
||||
input, err := opts.GetQueryInput()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := monitor.UnifiedMonitorManager.PerformQuery(s, input)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "PerformQuery")
|
||||
}
|
||||
printObject(resp)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -27,4 +27,5 @@ func init() {
|
||||
cmd.Update(new(options.ConfigUpdateOptions))
|
||||
cmd.Show(new(options.ConfigOptions))
|
||||
cmd.Delete(new(options.ConfigOptions))
|
||||
cmd.GetProperty(new(options.ConfigCapabilityOptions))
|
||||
}
|
||||
|
||||
@@ -138,4 +138,28 @@ func init() {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
type NotificationContactInput struct {
|
||||
Subject string
|
||||
Body string
|
||||
ContactType []string
|
||||
ReceiverIds []string
|
||||
RobotIds []string
|
||||
RoleIds []string
|
||||
}
|
||||
|
||||
R(&NotificationContactInput{}, "notify-contact-send", "Send notify event message", func(s *mcclient.ClientSession, args *NotificationContactInput) error {
|
||||
params := api.NotificationManagerContactNotifyInput{
|
||||
Subject: args.Subject,
|
||||
Body: args.Body,
|
||||
ReceiverIds: args.ReceiverIds,
|
||||
ContactTypes: args.ContactType,
|
||||
RobotIds: args.RobotIds,
|
||||
RoleIds: args.RoleIds,
|
||||
}
|
||||
_, err := modules.Notification.PerformClassAction(s, "contact-notify", jsonutils.Marshal(params))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to ContactNotify: %s", err)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -35,4 +35,5 @@ func init() {
|
||||
cmd.PerformClass("intellij-get", new(options.ReceiverIntellijGetOptions))
|
||||
cmd.PerformClass("get-types", new(options.ReceiverGetTypeOptions))
|
||||
cmd.Perform("get-subscription", new(options.ReceiverGetSubscriptionOptions))
|
||||
cmd.GetProperty(new(options.SReceiverRoleContactType))
|
||||
}
|
||||
|
||||
@@ -73,9 +73,10 @@ func init() {
|
||||
}
|
||||
|
||||
type CycleTimer struct {
|
||||
CycleCycleType string `help:"Cycle type for cycle timer" json:"cycle_type" choices:"day|week|month"`
|
||||
CycleCycleType string `help:"Cycle type for cycle timer" json:"cycle_type" choices:"hour|day|week|month"`
|
||||
CycleMinute int `help:"Minute of cycle timer" json:"minute"`
|
||||
CycleHour int `help:"Hour of cycle timer" json:"hour"`
|
||||
CycleCycleNum int `help:"Cycle count of cycle timer" json:"cycle_num"`
|
||||
CycleWeekdays []int `help:"Weekdays for cycle timer" json:"weekdays"`
|
||||
CycleMonthDays []int `help:"Month days for cycle timer" json:"month_days"`
|
||||
CycleStartTime string `help:"Start time for cycle timer, format:'2006-01-02 15:04:05'" json:"start_time"`
|
||||
@@ -123,6 +124,7 @@ func init() {
|
||||
},
|
||||
CycleTimer: apis.CycleTimerCreateInput{
|
||||
CycleType: args.CycleCycleType,
|
||||
CycleNum: args.CycleCycleNum,
|
||||
Minute: args.CycleMinute,
|
||||
Hour: args.CycleHour,
|
||||
WeekDays: args.CycleWeekdays,
|
||||
|
||||
56
cmd/climc/shell/yunionconf/bugreport.go
Normal file
56
cmd/climc/shell/yunionconf/bugreport.go
Normal file
@@ -0,0 +1,56 @@
|
||||
// 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 yunionconf
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type BugReportStatusOptions struct {
|
||||
}
|
||||
|
||||
R(&BugReportStatusOptions{}, "bug-report-status", "Show bug report status", func(s *mcclient.ClientSession, args *BugReportStatusOptions) error {
|
||||
ret, err := yunionconf.BugReport.GetBugReportEnabled(s, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BugReportEnableOptions struct {
|
||||
}
|
||||
|
||||
R(&BugReportEnableOptions{}, "bug-report-enable", "Enable bug report", func(s *mcclient.ClientSession, args *BugReportEnableOptions) error {
|
||||
ret, err := yunionconf.BugReport.DoBugReportEnable(s, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&BugReportEnableOptions{}, "bug-report-disable", "Disable bug report", func(s *mcclient.ClientSession, args *BugReportEnableOptions) error {
|
||||
ret, err := yunionconf.BugReport.DoBugReportDisable(s, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -23,7 +23,9 @@ import (
|
||||
|
||||
"yunion.io/x/log"
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/cloudproxy"
|
||||
common_app "yunion.io/x/onecloud/pkg/cloudcommon/app"
|
||||
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
|
||||
"yunion.io/x/onecloud/pkg/cloudproxy/agent/worker"
|
||||
"yunion.io/x/onecloud/pkg/cloudproxy/options"
|
||||
"yunion.io/x/onecloud/pkg/cloudproxy/service"
|
||||
@@ -33,42 +35,35 @@ import (
|
||||
func main() {
|
||||
defer atexit.Handle()
|
||||
|
||||
nop := true
|
||||
wg := &sync.WaitGroup{}
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, "wg", wg)
|
||||
ctx, cancelFunc := context.WithCancel(ctx)
|
||||
|
||||
var (
|
||||
opts = options.Get()
|
||||
commonOpts = &opts.CommonOptions
|
||||
opts = options.Get()
|
||||
)
|
||||
if opts.EnableAPIServer || opts.EnableProxyAgent {
|
||||
common_app.InitAuth(commonOpts, func() {
|
||||
log.Infof("Auth complete")
|
||||
})
|
||||
}
|
||||
|
||||
if opts.EnableAPIServer {
|
||||
nop = false
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
service.StartService()
|
||||
}()
|
||||
}
|
||||
common_app.InitAuth(&opts.CommonOptions, func() {
|
||||
log.Infof("Auth complete")
|
||||
})
|
||||
|
||||
common_options.StartOptionManager(opts, opts.ConfigSyncPeriodSeconds, api.SERVICE_TYPE, api.SERVICE_VERSION, options.OnOptionsChange)
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
service.StartService()
|
||||
}()
|
||||
|
||||
if opts.EnableProxyAgent {
|
||||
if opts.EnableAPIServer {
|
||||
const d = "10m"
|
||||
log.Infof("set proxy_agent_init_wait to %s", d)
|
||||
opts.Options.ProxyAgentInitWait = d
|
||||
}
|
||||
const d = "10m"
|
||||
log.Infof("set proxy_agent_init_wait to %s", d)
|
||||
opts.Options.ProxyAgentInitWait = d
|
||||
if err := opts.Options.ValidateThenInit(); err != nil {
|
||||
log.Fatalf("proxy agent options validation: %v", err)
|
||||
}
|
||||
worker := worker.NewWorker(&opts.CommonOptions, &opts.Options)
|
||||
nop = false
|
||||
go func() {
|
||||
worker.Start(ctx)
|
||||
pid := os.Getpid()
|
||||
@@ -79,17 +74,13 @@ func main() {
|
||||
p.Signal(syscall.SIGTERM)
|
||||
}()
|
||||
}
|
||||
if nop {
|
||||
log.Warningln("nothing to do. Please check configuration")
|
||||
} else {
|
||||
go func() {
|
||||
sigChan := make(chan os.Signal)
|
||||
signal.Notify(sigChan, syscall.SIGINT)
|
||||
signal.Notify(sigChan, syscall.SIGTERM)
|
||||
sig := <-sigChan
|
||||
log.Infof("signal received: %s", sig)
|
||||
cancelFunc()
|
||||
}()
|
||||
wg.Wait()
|
||||
}
|
||||
go func() {
|
||||
sigChan := make(chan os.Signal)
|
||||
signal.Notify(sigChan, syscall.SIGINT)
|
||||
signal.Notify(sigChan, syscall.SIGTERM)
|
||||
sig := <-sigChan
|
||||
log.Infof("signal received: %s", sig)
|
||||
cancelFunc()
|
||||
}()
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
// 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 main
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
// 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 main
|
||||
|
||||
import (
|
||||
|
||||
@@ -44,6 +44,14 @@ const (
|
||||
// Failed, Offline, Degraded, Rebuilding, Out of Sync (OSY)
|
||||
|
||||
func main() {
|
||||
logLevel := "debug"
|
||||
logVerboseLevel := 5
|
||||
log.SetVerboseLevel(int32(logVerboseLevel))
|
||||
err := log.SetLogLevelByString(log.Logger(), logLevel)
|
||||
if err != nil {
|
||||
log.Fatalf("Set log level %q: %v", logLevel, err)
|
||||
}
|
||||
|
||||
// creates the in-cluster config
|
||||
config, err := rest.InClusterConfig()
|
||||
if err != nil {
|
||||
|
||||
38
go.mod
38
go.mod
@@ -24,13 +24,15 @@ require (
|
||||
github.com/golang-plus/uuid v1.0.0
|
||||
github.com/golang/mock v1.4.4
|
||||
github.com/google/gopacket v1.1.17
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/googollee/go-socket.io v0.0.0-20181214084611-0ad7206c347a
|
||||
github.com/gorilla/mux v1.7.0
|
||||
github.com/gorilla/websocket v1.4.1
|
||||
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282
|
||||
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead
|
||||
github.com/hugozhu/godingtalk v1.0.6
|
||||
github.com/influxdata/influxql v1.1.0
|
||||
github.com/influxdata/promql/v2 v2.12.0
|
||||
github.com/jaypipes/ghw v0.11.0
|
||||
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c
|
||||
github.com/lestrrat-go/jwx v1.0.2
|
||||
@@ -45,6 +47,7 @@ require (
|
||||
github.com/minio/minio-go v6.0.14+incompatible
|
||||
github.com/pierrec/lz4/v4 v4.1.15
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pkg/sftp v1.13.6
|
||||
github.com/pquerna/otp v1.2.0
|
||||
github.com/satori/go.uuid v1.2.0
|
||||
github.com/sergi/go-diff v1.2.0
|
||||
@@ -52,9 +55,10 @@ require (
|
||||
github.com/sevlyar/go-daemon v0.1.5
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible
|
||||
github.com/shirou/gopsutil/v3 v3.22.10
|
||||
github.com/sirupsen/logrus v1.9.0
|
||||
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9
|
||||
github.com/smartystreets/goconvey v1.7.2
|
||||
github.com/stretchr/testify v1.8.1
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e
|
||||
github.com/tjfoc/gmsm v1.4.1
|
||||
github.com/tredoe/osutil/v2 v2.0.0-rc.16
|
||||
@@ -62,6 +66,7 @@ require (
|
||||
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74
|
||||
github.com/vmihailenco/msgpack v4.0.4+incompatible
|
||||
github.com/xuri/excelize/v2 v2.7.1
|
||||
github.com/zexi/influxql-to-metricsql v0.0.6
|
||||
go.etcd.io/etcd/api/v3 v3.5.0
|
||||
go.etcd.io/etcd/client/v3 v3.5.0
|
||||
golang.org/x/crypto v0.8.0
|
||||
@@ -83,20 +88,21 @@ require (
|
||||
k8s.io/client-go v0.19.3
|
||||
k8s.io/cluster-bootstrap v0.19.3
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230919091951-01618b65262e
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072808-2fc75a83dad7
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
|
||||
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
|
||||
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
|
||||
yunion.io/x/pkg v1.0.1-0.20230912084455-1393f31347db
|
||||
yunion.io/x/pkg v1.10.1-0.20240601050854-9e3452bf4d47
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v1.1.2-0.20230823191329-dc02ac3a547c
|
||||
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240530085133-5058648977dd
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.65.0 // indirect
|
||||
cloud.google.com/go/storage v1.10.0 // indirect
|
||||
gitee.com/chunanyong/dm v1.8.14 // indirect
|
||||
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.9.6 // indirect
|
||||
@@ -132,6 +138,7 @@ require (
|
||||
github.com/boltdb/bolt v1.3.1 // indirect
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
|
||||
github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
@@ -164,7 +171,7 @@ require (
|
||||
github.com/golang-plus/errors v1.0.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
|
||||
github.com/golang/snappy v0.0.1 // indirect
|
||||
github.com/google/btree v1.0.1 // indirect
|
||||
github.com/google/go-querystring v1.0.0 // indirect
|
||||
github.com/google/gofuzz v1.1.0 // indirect
|
||||
@@ -182,6 +189,7 @@ require (
|
||||
github.com/jstemmer/go-junit-report v0.9.1 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/leodido/go-urn v1.2.0 // indirect
|
||||
github.com/lestrrat-go/iter v0.0.0-20200422075355-fc1769541911 // indirect
|
||||
github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d // indirect
|
||||
@@ -206,6 +214,7 @@ require (
|
||||
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
|
||||
github.com/opentracing/opentracing-go v1.0.2 // indirect
|
||||
github.com/openzipkin/zipkin-go-opentracing v0.3.4 // indirect
|
||||
github.com/oracle/oci-go-sdk v24.3.0+incompatible // indirect
|
||||
github.com/philhofer/fwd v1.0.0 // indirect
|
||||
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
|
||||
github.com/pkg/term v1.0.0 // indirect
|
||||
@@ -220,11 +229,10 @@ require (
|
||||
github.com/richardlehane/msoleps v1.0.3 // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
|
||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||
github.com/smartystreets/assertions v1.2.0 // indirect
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/stretchr/objx v0.5.0 // indirect
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.413 // indirect
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.24 // indirect
|
||||
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e // indirect
|
||||
@@ -232,7 +240,10 @@ require (
|
||||
github.com/tklauser/go-sysconf v0.3.10 // indirect
|
||||
github.com/tklauser/numcpus v0.4.0 // indirect
|
||||
github.com/ugorji/go/codec v1.1.7 // indirect
|
||||
github.com/vmware/govmomi v0.20.1 // indirect
|
||||
github.com/ulikunitz/xz v0.5.12 // indirect
|
||||
github.com/vmware/govmomi v0.37.1 // indirect
|
||||
github.com/volcengine/ve-tos-golang-sdk/v2 v2.6.2 // indirect
|
||||
github.com/volcengine/volc-sdk-golang v1.0.23 // indirect
|
||||
github.com/willf/bitset v1.1.9 // indirect
|
||||
github.com/willf/bloom v2.0.3+incompatible // indirect
|
||||
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
|
||||
@@ -244,7 +255,7 @@ require (
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
go.uber.org/zap v1.17.0 // indirect
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
|
||||
golang.org/x/mod v0.8.0 // indirect
|
||||
golang.org/x/mod v0.9.0 // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
|
||||
golang.org/x/term v0.7.0 // indirect
|
||||
golang.org/x/tools v0.6.0 // indirect
|
||||
@@ -253,7 +264,6 @@ require (
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
78
go.sum
78
go.sum
@@ -36,6 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
|
||||
cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gitee.com/chunanyong/dm v1.8.14 h1:1S9+aD0fY/HXkcm8dKh2HjYsDlcdXNG+4IOX9JtrSjA=
|
||||
gitee.com/chunanyong/dm v1.8.14/go.mod h1:EPRJnuPFgbyOFgJ0TRYCTGzhq+ZT4wdyaj/GW/LLcNg=
|
||||
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=
|
||||
@@ -81,6 +83,8 @@ github.com/LeeEirc/terminalparser v0.0.0-20220328021224-de16b7643ea4/go.mod h1:t
|
||||
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3 h1:gImoAO1xAcC1oDlYmD/X7dggsodGf2DFJOVE5m0ssms=
|
||||
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3/go.mod h1:u0H9gMieFLxkUy8RS0X8VbFWyPs2815qQAaitRbj6x0=
|
||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
|
||||
@@ -144,6 +148,7 @@ github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg=
|
||||
github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ=
|
||||
github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI=
|
||||
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
|
||||
github.com/aws/aws-sdk-go v1.39.0 h1:74BBwkEmiqBbi2CGflEh34l0YNtIibTjZsibGarkNjo=
|
||||
github.com/aws/aws-sdk-go v1.39.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
|
||||
@@ -172,6 +177,8 @@ github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2w
|
||||
github.com/c-bata/go-prompt v0.2.4 h1:7pKUJ3CUgzdu1HJeWhNRkpVyY/NnlJhM/7d6YgHNOao=
|
||||
github.com/c-bata/go-prompt v0.2.4/go.mod h1:PqlttLXp0E7bZcoDW+dmzyKqFbmQTFoNzGSuW/AQRmo=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
|
||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
@@ -335,8 +342,9 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
@@ -353,8 +361,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
@@ -377,8 +385,9 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/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=
|
||||
@@ -420,6 +429,10 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
|
||||
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
|
||||
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/influxdata/influxql v1.1.0 h1:sPsaumLFRPMwR5QtD3Up54HXpNND8Eu7G1vQFmi3quQ=
|
||||
github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo=
|
||||
github.com/influxdata/promql/v2 v2.12.0 h1:kXn3p0D7zPw16rOtfDR+wo6aaiH8tSMfhPwONTxrlEc=
|
||||
github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8=
|
||||
github.com/ipandtcp/godingtalk v0.0.0-20180410032244-ca3d6ac197fb/go.mod h1:3umLciE1jBnh2LgrL15R2zbEe+HVPRZXnlSjjb/dYiw=
|
||||
github.com/jaypipes/ghw v0.11.0 h1:i0pKvAM7eZk0KvLm9vzpcpDKTRnfR6AQ5pFkPVnYJXU=
|
||||
github.com/jaypipes/ghw v0.11.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g=
|
||||
@@ -457,6 +470,8 @@ github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c h1:N7A4JCA2G
|
||||
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c/go.mod h1:Nn5wlyECw3iJrzi0AhIWg+AJUb4PlRQVW4/3XHH1LZA=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
@@ -565,6 +580,8 @@ github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg
|
||||
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/openzipkin/zipkin-go-opentracing v0.3.4 h1:x/pBv/5VJNWkcHF1G9xqhug8Iw7X1y1zOMzDmyuvP2g=
|
||||
github.com/openzipkin/zipkin-go-opentracing v0.3.4/go.mod h1:js2AbwmHW0YD9DwIw2JhQWmbfFi/UnWyYwdVhqbCDOE=
|
||||
github.com/oracle/oci-go-sdk v24.3.0+incompatible h1:x4mcfb4agelf1O4/1/auGlZ1lr97jXRSSN5MxTgG/zU=
|
||||
github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
||||
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||
@@ -578,6 +595,8 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=
|
||||
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
|
||||
github.com/pkg/term v1.0.0 h1:raTSNJjic7X4n89hhPyLOsgRYczmr3MyezRierWCTa8=
|
||||
github.com/pkg/term v1.0.0/go.mod h1:6rk0zrj6TXf8MR5fdVFsZMeGM2lxe3tUFLNBRlwX+dk=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
@@ -598,6 +617,7 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
|
||||
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
|
||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||
github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4=
|
||||
@@ -620,8 +640,8 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8=
|
||||
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8=
|
||||
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||
@@ -664,8 +684,9 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
@@ -674,8 +695,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/syncthing/syncthing v0.14.48-rc.4/go.mod h1:nw3siZwHPA6M8iSfjDCWQ402eqvEIasMQOE8nFOxy7M=
|
||||
github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8=
|
||||
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e h1:nt2877sKfojlHCTOBXbpWjBkuWKritFaGIfgQwbQUls=
|
||||
@@ -700,6 +722,8 @@ github.com/tredoe/osutil/v2 v2.0.0-rc.16/go.mod h1:uLRVx/3pb7Y4RQhG8cQFbPE9ha5r8
|
||||
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
|
||||
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
|
||||
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
|
||||
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
|
||||
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
|
||||
@@ -707,8 +731,12 @@ github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695AP
|
||||
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
|
||||
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
|
||||
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
|
||||
github.com/vmware/govmomi v0.20.1 h1:7b/SeTUB3tER8ZLGLLLH3xcnB2xeuLULXmfPFqPSRZA=
|
||||
github.com/vmware/govmomi v0.20.1/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
|
||||
github.com/vmware/govmomi v0.37.1 h1:SpI+Ofq+lC1zsLcJ9szLSb7fL4TypReVvUoWIgk2b6U=
|
||||
github.com/vmware/govmomi v0.37.1/go.mod h1:mtGWtM+YhTADHlCgJBiskSRPOZRsN9MSjPzaZLte/oQ=
|
||||
github.com/volcengine/ve-tos-golang-sdk/v2 v2.6.2 h1:FZ7zrUf70YKVuES50mHO3z2VW0K+Arq4uGlDqb+1VA0=
|
||||
github.com/volcengine/ve-tos-golang-sdk/v2 v2.6.2/go.mod h1:IrjK84IJJTuOZOTMv/P18Ydjy/x+ow7fF7q11jAxXLM=
|
||||
github.com/volcengine/volc-sdk-golang v1.0.23 h1:anOslb2Qp6ywnsbyq9jqR0ljuO63kg9PY+4OehIk5R8=
|
||||
github.com/volcengine/volc-sdk-golang v1.0.23/go.mod h1:AfG/PZRUkHJ9inETvbjNifTDgut25Wbkm2QoYBTbvyU=
|
||||
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
|
||||
github.com/willf/bitset v1.1.9 h1:GBtFynGY9ZWZmEC9sWuu41/7VBXPFCOAbCbqTflOg9c=
|
||||
github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
|
||||
@@ -729,6 +757,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
|
||||
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
github.com/zexi/influxql-to-metricsql v0.0.6 h1:E16T4oqgjIJtSNVvhGGHnw+pmY3yGz2iRsmmmSVuOpY=
|
||||
github.com/zexi/influxql-to-metricsql v0.0.6/go.mod h1:PyRRM+3Zrzzig6J4okYLeSv+/d+5GaL5ccBaUKQABNs=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0 h1:2aQv6F436YnN7I4VbI8PPYrBhu+SmrTaADcf8Mi/6PU=
|
||||
@@ -760,6 +790,7 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
|
||||
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
@@ -799,8 +830,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
|
||||
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
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=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -842,6 +874,7 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
@@ -929,12 +962,14 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
|
||||
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
|
||||
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
||||
@@ -946,6 +981,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
@@ -1174,26 +1210,26 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230919091951-01618b65262e h1:ygcyhPHrwsuzJcCxDjZfGs9lU1UDstovyPLLte5oNpM=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230919091951-01618b65262e/go.mod h1:2sgCN7nRPQL3woLfdgqLDd92vwAHqtlz3KKiHxC5BAw=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072808-2fc75a83dad7 h1:61XiAkSLyvgKN024+WumxFJSx/VsVpHnW2Tuqa8NWnI=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072808-2fc75a83dad7/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19 h1:mZh6vuo7oOiOtE5HF4667+XBNnn7uYpmGN5eIgCVMLk=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401 h1:4l6ELFSQ0MBVInscZ8/yOtSWF0cwH5BT1ATN6dCtAqc=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
|
||||
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361 h1:c5LyNdhbvBe/92pXs9jgXOU/S+RgYh/DHe538LpT/Mo=
|
||||
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 h1:inY5o3LDa/zgsIZuPN0HmpzKIsu/lLgsBmMttuDPGj4=
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 h1:Hu/4ERvoWaN6aiFs4h4/yvVBMeVzb3eDaYTxkVx9Kdo=
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
|
||||
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 v1.0.1-0.20230912084455-1393f31347db h1:yxiqu3C7wDnL3M8Nn54QmBp+rRgT4k5+/E6kJPVPlco=
|
||||
yunion.io/x/pkg v1.0.1-0.20230912084455-1393f31347db/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
|
||||
yunion.io/x/pkg v1.10.1-0.20240601050854-9e3452bf4d47 h1:uh8OUgdycVKVORSoWNj2w9gMBEaOPgRePSlGqyKYa9s=
|
||||
yunion.io/x/pkg v1.10.1-0.20240601050854-9e3452bf4d47/go.mod h1:+3nFKJt+O4xWboiDAv2EqvMM0rmm3tPJaOuQSHFkcY8=
|
||||
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 v1.1.2-0.20230823191329-dc02ac3a547c h1:9R2cTcmPBUno1P2YI321nztK1Jpu7QRBNbnHsI1uX1Q=
|
||||
yunion.io/x/sqlchemy v1.1.2-0.20230823191329-dc02ac3a547c/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
|
||||
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6 h1:WuWXhY3DvhdRTzWCJ/kwt3Ss6KIq7+KqJwb+esvNGwU=
|
||||
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240530085133-5058648977dd h1:5y2pHZ4+cDIuh5MTI853yulkgdADRLWKeyYaaFGArcQ=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240530085133-5058648977dd/go.mod h1:5W8ghvJ4TNt/r2yDjjD3i4QsZgIiJX45dhRQBGWPHsQ=
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ=
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
8057
locales/locales.go
8057
locales/locales.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -75,7 +75,7 @@ func init() {
|
||||
|
||||
func (man *SAnsiblePlaybookManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
|
||||
pbV := NewAnsiblePlaybookValidator("playbook", userCred)
|
||||
if err := pbV.Validate(data); err != nil {
|
||||
if err := pbV.Validate(ctx, data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data.Set("status", jsonutils.NewString(api.AnsiblePlaybookStatusInit))
|
||||
@@ -137,7 +137,7 @@ func (apb *SAnsiblePlaybook) ValidateUpdateCondition(ctx context.Context) error
|
||||
|
||||
func (apb *SAnsiblePlaybook) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
|
||||
pbV := NewAnsiblePlaybookValidator("playbook", userCred)
|
||||
if err := pbV.Validate(data); err != nil {
|
||||
if err := pbV.Validate(ctx, data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
apb.Playbook = pbV.Playbook // Update as a whole
|
||||
|
||||
@@ -46,7 +46,7 @@ func NewAnsiblePlaybookValidator(key string, userCred mcclient.TokenCredential)
|
||||
return v
|
||||
}
|
||||
|
||||
func (v *ValidatorAnsiblePlaybook) Validate(data *jsonutils.JSONDict) error {
|
||||
func (v *ValidatorAnsiblePlaybook) Validate(ctx context.Context, data *jsonutils.JSONDict) error {
|
||||
pb := ansible.NewPlaybook()
|
||||
err := data.Unmarshal(pb, "playbook")
|
||||
if err != nil {
|
||||
|
||||
@@ -656,8 +656,14 @@ func doLogout(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
token, _, _ := fetchAuthInfo(ctx, req)
|
||||
if token != nil {
|
||||
// valid login, log the event
|
||||
user := logclient.NewSimpleObject(token.GetUserId(), token.GetUserName(), "user")
|
||||
logclient.AddActionLogWithContext(ctx, user, logclient.ACT_LOGOUT, "", token, true)
|
||||
err := auth.Remove(ctx, token.GetTokenString())
|
||||
if err != nil {
|
||||
log.Errorf("remove token fail %s", err)
|
||||
return
|
||||
} else {
|
||||
user := logclient.NewSimpleObject(token.GetUserId(), token.GetUserName(), "user")
|
||||
logclient.AddActionLogWithContext(ctx, user, logclient.ACT_LOGOUT, "", token, true)
|
||||
}
|
||||
}
|
||||
clearAuthCookie(w)
|
||||
appsrv.DisableClientCache(w)
|
||||
|
||||
@@ -250,7 +250,12 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
|
||||
|
||||
ips := []string{}
|
||||
hosts := bytes.Buffer{}
|
||||
for _, row := range rows[1:] {
|
||||
for idx, row := range rows[1:] {
|
||||
rowStr := strings.Join(row, "")
|
||||
if len(rowStr) == 0 {
|
||||
log.Warningf("empty row: %d, skipping it", idx+1)
|
||||
continue
|
||||
}
|
||||
var e *httputils.JSONClientError
|
||||
if i1 >= 0 && len(row[i1]) > 0 {
|
||||
i1Ip := fmt.Sprintf("%d-%s", i1, row[i1])
|
||||
|
||||
@@ -644,12 +644,13 @@ func (f *ResourceHandlers) updateJointHandler(ctx context.Context, w http.Respon
|
||||
session := req.Session()
|
||||
module := req.Mod1()
|
||||
module2 := req.Mod2()
|
||||
query := req.Query()
|
||||
body := req.Body()
|
||||
|
||||
jmod, e := modulebase.GetJointModule2(session, module, module2)
|
||||
var obj jsonutils.JSONObject
|
||||
if e == nil { // update joint
|
||||
obj, e = jmod.Update(session, req.ResID(), req.ResID2(), nil, body)
|
||||
obj, e = jmod.Update(session, req.ResID(), req.ResID2(), query, body)
|
||||
} else { // update in context
|
||||
obj, e = module2.PutInContext(session, req.ResID2(), body, module, req.ResID())
|
||||
}
|
||||
@@ -669,12 +670,13 @@ func (f *ResourceHandlers) patchJointHandler(ctx context.Context, w http.Respons
|
||||
session := req.Session()
|
||||
module := req.Mod1()
|
||||
module2 := req.Mod2()
|
||||
query := req.Query()
|
||||
body := req.Body()
|
||||
|
||||
jmod, e := modulebase.GetJointModule2(session, module, module2)
|
||||
var obj jsonutils.JSONObject
|
||||
if e == nil { // update joint
|
||||
obj, e = jmod.Patch(session, req.ResID(), req.ResID2(), nil, body)
|
||||
obj, e = jmod.Patch(session, req.ResID(), req.ResID2(), query, body)
|
||||
} else { // update in context
|
||||
obj, e = module2.PatchInContext(session, req.ResID2(), body, module, req.ResID())
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ func RpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
token := AppContextToken(ctx)
|
||||
// pathParams := appctx.AppContextParams(ctx)
|
||||
s := auth.GetSession(ctx, token, FetchRegion(req))
|
||||
funcname := verb + utils.Kebab2Camel(callName, "-")
|
||||
mod, e := modulebase.GetModule(s, resType)
|
||||
@@ -114,13 +113,14 @@ func RpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
retobj := retValue[0]
|
||||
reterr := retValue[1]
|
||||
if reterr.IsNil() {
|
||||
v, ok := retobj.Interface().(jsonutils.JSONObject)
|
||||
addr := retobj.Interface()
|
||||
v, ok := addr.(jsonutils.JSONObject)
|
||||
if ok {
|
||||
appsrv.SendJSON(w, v)
|
||||
return
|
||||
}
|
||||
|
||||
v2, ok := retobj.Interface().([]printutils.SubmitResult)
|
||||
v2, ok := addr.([]printutils.SubmitResult)
|
||||
if ok {
|
||||
w.WriteHeader(207)
|
||||
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(v2))
|
||||
@@ -128,13 +128,14 @@ func RpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
httperrors.BadGatewayError(ctx, w, "recv invalid data")
|
||||
} else {
|
||||
ge, ok := reterr.Interface().(error)
|
||||
if ok {
|
||||
je := httperrors.NewGeneralError(ge)
|
||||
httperrors.GeneralServerError(ctx, w, je)
|
||||
return
|
||||
}
|
||||
httperrors.BadGatewayError(ctx, w, fmt.Sprintf("%s", reterr.Interface()))
|
||||
return
|
||||
}
|
||||
errAddr := reterr.Interface()
|
||||
ge, ok := errAddr.(error)
|
||||
if ok {
|
||||
je := httperrors.NewGeneralError(ge)
|
||||
httperrors.GeneralServerError(ctx, w, je)
|
||||
return
|
||||
}
|
||||
httperrors.BadGatewayError(ctx, w, fmt.Sprintf("%s", reterr.Interface()))
|
||||
}
|
||||
|
||||
@@ -16,12 +16,15 @@ package report
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/util/httputils"
|
||||
"yunion.io/x/pkg/util/version"
|
||||
"yunion.io/x/pkg/utils"
|
||||
@@ -36,33 +39,93 @@ import (
|
||||
)
|
||||
|
||||
type sReport struct {
|
||||
GenerateName string
|
||||
UUID string
|
||||
Version string
|
||||
OsDist string
|
||||
OsVersion string
|
||||
QemuVersion string
|
||||
CpuArchitecture string
|
||||
Brands string
|
||||
HostCnt int64
|
||||
KvmHostCnt int64
|
||||
HostCpuCnt int64
|
||||
HostMemSizeMb int64
|
||||
BaremetalCnt int64
|
||||
BaremetalCpuCnt int64
|
||||
BaremetalMemSizeMb int64
|
||||
ServerCnt int64
|
||||
ServerCpuCnt int64
|
||||
ServerMemSizeMb int64
|
||||
DiskCnt int64
|
||||
DiskSizeMb int64
|
||||
BucketCnt int64
|
||||
RdsCnt int64
|
||||
MongoDBCnt int64
|
||||
KafkaCnt int64
|
||||
UserCnt int64
|
||||
ProjectCnt int64
|
||||
DomainCnt int64
|
||||
GenerateName string
|
||||
UUID string
|
||||
Version string
|
||||
OsDist string
|
||||
OsVersion string
|
||||
QemuVersion string
|
||||
CpuArchitecture string
|
||||
Brands string
|
||||
HostCnt int64
|
||||
KvmHostCnt int64
|
||||
VmwareHostCnt int64
|
||||
HostCpuCnt int64
|
||||
HostMemSizeMb int64
|
||||
BaremetalCnt int64
|
||||
BaremetalCpuCnt int64
|
||||
BaremetalMemSizeMb int64
|
||||
BaremetalStorageSizeGb int64
|
||||
ServerCnt int64
|
||||
ServerCpuCnt int64
|
||||
ServerMemSizeMb int64
|
||||
KvmServerCnt int64
|
||||
KvmServerCpuCnt int64
|
||||
KvmServerMemSizeMb int64
|
||||
DiskCnt int64
|
||||
DiskSizeMb int64
|
||||
BucketCnt int64
|
||||
RdsCnt int64
|
||||
MongoDBCnt int64
|
||||
KafkaCnt int64
|
||||
UserCnt int64
|
||||
ProjectCnt int64
|
||||
DomainCnt int64
|
||||
RunningEnv string
|
||||
}
|
||||
|
||||
const (
|
||||
RUNNING_ENV_KUBERNETES = "kubernetes"
|
||||
RUNNING_ENV_DOCKER_COMPOSE = "docker-compose"
|
||||
RUNNING_ENV_UNKNOWN = "unknown"
|
||||
)
|
||||
|
||||
func isInsideDockerCompose() bool {
|
||||
// hostname likes: c1577eee2aed
|
||||
DOCKER_HOSTNAME_LEN := 12
|
||||
hostname := os.Getenv("HOSTNAME")
|
||||
if len(hostname) != DOCKER_HOSTNAME_LEN {
|
||||
return false
|
||||
}
|
||||
// resolv mysql and keystone host
|
||||
resolvTimeout := 500 * time.Millisecond
|
||||
ctx, cancel := context.WithTimeout(context.Background(), resolvTimeout)
|
||||
defer cancel()
|
||||
var r net.Resolver
|
||||
hosts := []string{"mysql", "keystone", "region"}
|
||||
|
||||
for _, host := range hosts {
|
||||
_, err := r.LookupIPAddr(ctx, host)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func isInsideKubernetes() bool {
|
||||
k8sHost := os.Getenv("KUBERNETES_SERVICE_HOST")
|
||||
if len(k8sHost) == 0 {
|
||||
return false
|
||||
}
|
||||
// check /var/run/secrets/kubernetes.io/serviceaccount/ directory
|
||||
k8sSecDir := "/var/run/secrets/kubernetes.io/serviceaccount/"
|
||||
if _, err := os.Stat(k8sSecDir); err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func getRunningEnv() string {
|
||||
if isInsideKubernetes() {
|
||||
return RUNNING_ENV_KUBERNETES
|
||||
}
|
||||
|
||||
if isInsideDockerCompose() {
|
||||
return RUNNING_ENV_DOCKER_COMPOSE
|
||||
}
|
||||
return RUNNING_ENV_UNKNOWN
|
||||
}
|
||||
|
||||
func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool) {
|
||||
@@ -83,12 +146,37 @@ func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool
|
||||
resp, err := compute.Hosts.List(s, jsonutils.Marshal(map[string]interface{}{
|
||||
"scope": "system",
|
||||
"hypervisor": api.HYPERVISOR_KVM,
|
||||
"limit": 20,
|
||||
"limit": 1,
|
||||
}))
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "Hosts.List")
|
||||
}
|
||||
ret.KvmHostCnt = int64(resp.Total)
|
||||
|
||||
resp, err = compute.Hosts.List(s, jsonutils.Marshal(map[string]interface{}{
|
||||
"scope": "system",
|
||||
"hypervisor": api.HYPERVISOR_ESXI,
|
||||
"limit": 1,
|
||||
}))
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "Hosts.List")
|
||||
}
|
||||
ret.VmwareHostCnt = int64(resp.Total)
|
||||
|
||||
resp, err = compute.Servers.List(s, jsonutils.Marshal(map[string]interface{}{
|
||||
"scope": "system",
|
||||
"hypervisor": api.HYPERVISOR_KVM,
|
||||
"limit": 1,
|
||||
}))
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "Server.List")
|
||||
}
|
||||
ret.KvmServerCnt = int64(resp.Total)
|
||||
if !gotypes.IsNil(resp.Totals) {
|
||||
ret.KvmServerCpuCnt, _ = resp.Totals.Int("cpu_count")
|
||||
ret.KvmServerMemSizeMb, _ = resp.Totals.Int("mem_mb")
|
||||
}
|
||||
|
||||
osDists, osVersions, qemuVersions, archs := []string{}, []string{}, []string{}, []string{}
|
||||
hosts := []api.HostDetails{}
|
||||
jsonutils.Update(&hosts, resp.Data)
|
||||
@@ -147,6 +235,10 @@ func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool
|
||||
ret.RdsCnt, _ = usage.Int("all.rds")
|
||||
ret.MongoDBCnt, _ = usage.Int("all.mongodb")
|
||||
ret.KafkaCnt, _ = usage.Int("all.kafka")
|
||||
ret.BaremetalCnt, _ = usage.Int("baremetals")
|
||||
ret.BaremetalCpuCnt, _ = usage.Int("baremetals.cpu")
|
||||
ret.BaremetalMemSizeMb, _ = usage.Int("baremetals.memory")
|
||||
ret.BaremetalStorageSizeGb, _ = usage.Int("baremetals.storage_gb")
|
||||
usage, err = identity.IdentityUsages.GetUsage(s, system)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "IdentityUsages.GetUsage")
|
||||
@@ -154,6 +246,7 @@ func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool
|
||||
ret.UserCnt, _ = usage.Int("users")
|
||||
ret.DomainCnt, _ = usage.Int("domains")
|
||||
ret.ProjectCnt, _ = usage.Int("projects")
|
||||
ret.RunningEnv = getRunningEnv()
|
||||
return ret, nil
|
||||
}
|
||||
rp, err := func() (*sReport, error) {
|
||||
|
||||
@@ -17,7 +17,6 @@ package apihelper
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
@@ -40,10 +39,6 @@ func (o GetDBModelsOptions) GetModelSet() IModelSet {
|
||||
return o.modelOptions.ModelSet
|
||||
}
|
||||
|
||||
func (o GetDBModelsOptions) GetMinUpdatedAt() time.Time {
|
||||
return o.modelOptions.MinUpdatedAt
|
||||
}
|
||||
|
||||
func (o GetDBModelsOptions) IncludeDetails() bool {
|
||||
return o.modelOptions.IncludeDetails
|
||||
}
|
||||
@@ -78,10 +73,11 @@ func GetDBModels(opts *GetDBModelsOptions) error {
|
||||
}
|
||||
if !opts.InCludeOtherCloudEnv() {
|
||||
listOptions.Filter = append(listOptions.Filter,
|
||||
"manager_id.isnullorempty()", // len(manager_id) > 0 is for pubcloud objects
|
||||
"external_id.isnullorempty()", // len(external_id) > 0 is for pubcloud objects
|
||||
"manager_id.isnullorempty()", // len(manager_id) > 0 is for pubcloud objects
|
||||
// "external_id.isnullorempty()", // len(external_id) > 0 is for pubcloud objects
|
||||
)
|
||||
listOptions.CloudEnv = "onpremise"
|
||||
// listOptions.Provider = []string{"OneCloud"}
|
||||
}
|
||||
if inter, ok := opts.GetModelSet().(IModelSetFilter); ok {
|
||||
filter := inter.ModelFilter()
|
||||
|
||||
@@ -90,11 +90,11 @@ func SyncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (
|
||||
}
|
||||
|
||||
func syncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (IModelSets, error) {
|
||||
mss := mssOld.ModelSetList()
|
||||
// mss := mssOld.ModelSetList()
|
||||
mssNews := mssOld.NewEmpty()
|
||||
for i, msNew := range mssNews.ModelSetList() {
|
||||
for _, msNew := range mssNews.ModelSetList() {
|
||||
var (
|
||||
minUpdatedAt = ModelSetMaxUpdatedAt(mss[i])
|
||||
// minUpdatedAt = ModelSetMaxUpdatedAt(mss[i])
|
||||
includeEmulated = false
|
||||
)
|
||||
if optProvider, ok := msNew.(IModelSetEmulatedIncluder); ok {
|
||||
@@ -103,7 +103,7 @@ func syncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (
|
||||
err := GetModels(&GetModelsOptions{
|
||||
ClientSession: s,
|
||||
ModelManager: msNew.ModelManager(),
|
||||
MinUpdatedAt: minUpdatedAt,
|
||||
// MinUpdatedAt: minUpdatedAt,
|
||||
ModelSet: msNew,
|
||||
BatchListSize: opt.ListBatchSize,
|
||||
|
||||
@@ -119,11 +119,9 @@ func syncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (
|
||||
}
|
||||
|
||||
func SyncDBModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (r ModelSetsUpdateResult, err error) {
|
||||
mss := mssOld.ModelSetList()
|
||||
mssNews := mssOld.NewEmpty()
|
||||
for i, msNew := range mssNews.ModelSetList() {
|
||||
for _, msNew := range mssNews.ModelSetList() {
|
||||
var (
|
||||
minUpdatedAt = ModelSetMaxUpdatedAt(mss[i])
|
||||
includeEmulated = false
|
||||
)
|
||||
if optProvider, ok := msNew.(IModelSetEmulatedIncluder); ok {
|
||||
@@ -133,7 +131,6 @@ func SyncDBModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options)
|
||||
opts := &GetModelsOptions{
|
||||
ClientSession: s,
|
||||
ModelManager: msNew.ModelManager(),
|
||||
MinUpdatedAt: minUpdatedAt,
|
||||
ModelSet: msNew,
|
||||
BatchListSize: opt.ListBatchSize,
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import (
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
"yunion.io/x/pkg/util/timeutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
mcclient "yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -41,7 +40,6 @@ type GetModelsOptions struct {
|
||||
ModelSet IModelSet
|
||||
|
||||
BatchListSize int
|
||||
MinUpdatedAt time.Time
|
||||
IncludeDetails bool
|
||||
IncludeEmulated bool
|
||||
InCludeOtherCloudEnv bool
|
||||
@@ -51,56 +49,12 @@ func GetModels(opts *GetModelsOptions) error {
|
||||
man := opts.ModelManager
|
||||
manKeyPlural := man.KeyString()
|
||||
|
||||
minUpdatedAt := opts.MinUpdatedAt
|
||||
minUpdatedAtFilter := func(time time.Time) string {
|
||||
// TODO add GE
|
||||
tstr := timeutils.MysqlTime(time)
|
||||
return fmt.Sprintf("updated_at.ge('%s')", tstr)
|
||||
}
|
||||
setNextListParams := func(params *jsonutils.JSONDict, lastUpdatedAt time.Time, lastResult *printutils.ListResult) (time.Time, error) {
|
||||
minUpdatedAt := PseudoZeroTime
|
||||
setNextListParams := func(params *jsonutils.JSONDict, lastResult *printutils.ListResult) error {
|
||||
// NOTE: the updated_at field has second-level resolution.
|
||||
// If they all have the same date...
|
||||
var max time.Time
|
||||
nmax := 0
|
||||
n := len(lastResult.Data)
|
||||
|
||||
// find out the max updated_at date in the result set, and how
|
||||
// many in the set has this date
|
||||
for i := n - 1; i >= 0; i-- {
|
||||
j := lastResult.Data[i]
|
||||
updatedAt, err := j.GetTime("updated_at")
|
||||
if err != nil {
|
||||
log.Warningf("%s: updated_at field: %s, %s",
|
||||
manKeyPlural, err, j.String())
|
||||
continue
|
||||
}
|
||||
if max.IsZero() {
|
||||
max = updatedAt
|
||||
}
|
||||
if max.Equal(updatedAt) {
|
||||
nmax += 1
|
||||
}
|
||||
}
|
||||
// error if we do not have valid date
|
||||
if max.IsZero() {
|
||||
return time.Time{}, fmt.Errorf("%s: cannot find next updated_at after '%q'",
|
||||
manKeyPlural, lastUpdatedAt)
|
||||
}
|
||||
|
||||
var newTime time.Time
|
||||
var newOffset int
|
||||
// if not all updated_at date are the same, then we can
|
||||
// continue to the next age.
|
||||
if nmax < n || (!max.Equal(lastUpdatedAt) && !max.Equal(PseudoZeroTime)) {
|
||||
newTime = max
|
||||
newOffset = nmax
|
||||
} else {
|
||||
newTime = lastUpdatedAt
|
||||
newOffset = lastResult.Offset + n
|
||||
}
|
||||
params.Set("filter.0", jsonutils.NewString(minUpdatedAtFilter(newTime)))
|
||||
params.Set("offset", jsonutils.NewInt(int64(newOffset)))
|
||||
return newTime, nil
|
||||
params.Set("offset", jsonutils.NewInt(int64(lastResult.Offset+len(lastResult.Data))))
|
||||
return nil
|
||||
}
|
||||
|
||||
listOptions := options.BaseListOptions{
|
||||
@@ -109,13 +63,11 @@ func GetModels(opts *GetModelsOptions) error {
|
||||
Scope: "system",
|
||||
Details: options.Bool(opts.IncludeDetails),
|
||||
ShowEmulated: options.Bool(opts.IncludeEmulated),
|
||||
Filter: []string{
|
||||
minUpdatedAtFilter(minUpdatedAt), // order matters, filter.0
|
||||
},
|
||||
OrderBy: []string{"updated_at"},
|
||||
Order: "asc",
|
||||
Limit: options.Int(opts.BatchListSize),
|
||||
Offset: options.Int(0),
|
||||
Filter: []string{},
|
||||
OrderBy: []string{"updated_at", "created_at", "id"},
|
||||
Order: "asc",
|
||||
Limit: options.Int(opts.BatchListSize),
|
||||
Offset: options.Int(0),
|
||||
}
|
||||
if !opts.InCludeOtherCloudEnv {
|
||||
listOptions.Filter = append(listOptions.Filter,
|
||||
@@ -123,6 +75,7 @@ func GetModels(opts *GetModelsOptions) error {
|
||||
// "external_id.isnullorempty()", // len(external_id) > 0 is for pubcloud objects
|
||||
)
|
||||
listOptions.CloudEnv = "onpremise"
|
||||
// listOptions.Provider = []string{"OneCloud"}
|
||||
}
|
||||
if inter, ok := opts.ModelSet.(IModelSetFilter); ok {
|
||||
filter := inter.ModelFilter()
|
||||
@@ -150,6 +103,7 @@ func GetModels(opts *GetModelsOptions) error {
|
||||
entriesJson := []jsonutils.JSONObject{}
|
||||
for {
|
||||
var err error
|
||||
log.Debugf("fetch %s with params %s", manKeyPlural, jsonutils.Marshal(params))
|
||||
listResult, err := opts.ModelManager.List(opts.ClientSession, params)
|
||||
if err != nil {
|
||||
log.Errorf("%s: list failed with updated_at.gt('%s'): %s", manKeyPlural, minUpdatedAt, err)
|
||||
@@ -159,7 +113,7 @@ func GetModels(opts *GetModelsOptions) error {
|
||||
if listResult.Offset+len(listResult.Data) >= listResult.Total {
|
||||
break
|
||||
}
|
||||
minUpdatedAt, err = setNextListParams(params, minUpdatedAt, listResult)
|
||||
err = setNextListParams(params, listResult)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %s", manKeyPlural, err)
|
||||
}
|
||||
@@ -183,8 +137,7 @@ func InitializeModelSetFromJSON(set IModelSet, entriesJson []jsonutils.JSONObjec
|
||||
manKeyPlural := set.ModelManager().KeyString()
|
||||
for _, entryJson := range entriesJson {
|
||||
m := set.NewModel()
|
||||
var err error
|
||||
err = entryJson.Unmarshal(m)
|
||||
err := entryJson.Unmarshal(m)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: unmarshal: %v: %s", manKeyPlural, err, entryJson.String())
|
||||
}
|
||||
@@ -284,5 +237,12 @@ func ModelSetApplyUpdates(aSet, bSet IModelSet) *ModelSetUpdateResult {
|
||||
r.Changed = true
|
||||
}
|
||||
}
|
||||
for _, kRv := range aSetRv.MapKeys() {
|
||||
bMRv := bSetRv.MapIndex(kRv)
|
||||
if !bMRv.IsValid() { // alread deleted
|
||||
aSetRv.SetMapIndex(kRv, reflect.Value{})
|
||||
r.Changed = true
|
||||
}
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -16,21 +16,21 @@ package cloudid
|
||||
|
||||
type CloudaccountResourceListInput struct {
|
||||
// 根据云账号名称过滤资源
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
Cloudaccount string `json:"cloudaccount" yunion-deprecated-by:"cloudaccount_id"`
|
||||
|
||||
// 根据平台过滤
|
||||
Provider []string `json:"provider"`
|
||||
|
||||
// swagger:ignore
|
||||
CloudaccountId string `json:"cloudaccount_id" yunion-deprecated-by:"cloudaccount"`
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
}
|
||||
|
||||
type CloudproviderResourceListInput struct {
|
||||
// 根据云订阅过滤资源
|
||||
Cloudprovider string `json:"cloudprovider"`
|
||||
ManagerId string `json:"manager_id"`
|
||||
|
||||
// swagger:ignore
|
||||
CloudproviderId string `json:"cloudprovider_id" yunion-deprecated-by:"cloudprovider"`
|
||||
CloudproviderId string `json:"cloudprovider_id" yunion-deprecated-by:"manager_id"`
|
||||
}
|
||||
|
||||
type CloudaccountResourceDetails struct {
|
||||
@@ -47,5 +47,5 @@ type CloudaccountResourceDetails struct {
|
||||
|
||||
type CloudproviderResourceDetails struct {
|
||||
// 云订阅名称
|
||||
Cloudprovider string `json:"cloudprovider"`
|
||||
Manager string `json:"manager"`
|
||||
}
|
||||
|
||||
@@ -16,17 +16,6 @@ package cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
CLOUD_GROUP_STATUS_AVAILABLE = "available" // 可用
|
||||
CLOUD_GROUP_STATUS_DELETING = "deleting" // 删除中
|
||||
CLOUD_GROUP_STATUS_DELETE_FAILED = "delete_failed" // 删除失败
|
||||
CLOUD_GROUP_STATUS_SYNC_POLICIES = "sync_policies" // 同步权限中
|
||||
CLOUD_GROUP_STATUS_SYNC_POLICIES_FAILED = "sync_policies_failed" // 同步权限失败
|
||||
CLOUD_GROUP_STATUS_SYNC_USERS = "sync_users" // 同步用户中
|
||||
CLOUD_GROUP_STATUS_SYNC_USERS_FAILED = "sync_users_failed" // 同步用户失败
|
||||
CLOUD_GROUP_STATUS_SYNC_STATUS = "sync_status" // 同步状态
|
||||
)
|
||||
|
||||
type CloudgroupJointResourceDetails struct {
|
||||
apis.JointResourceBaseDetails
|
||||
|
||||
@@ -74,18 +63,14 @@ type CloudgroupPolicyListInput struct {
|
||||
|
||||
type CloudgroupListInput struct {
|
||||
apis.StatusInfrasResourceBaseListInput
|
||||
|
||||
// 根据平台过滤
|
||||
Provider []string `json:"provider"`
|
||||
CloudaccountResourceListInput
|
||||
CloudproviderResourceListInput
|
||||
|
||||
// 过滤子账号所在的权限组
|
||||
ClouduserId string `json:"clouduser_id"`
|
||||
|
||||
// 根据权限过滤权限组
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
|
||||
// 是否可用
|
||||
Usable *bool `json:"usable"`
|
||||
}
|
||||
|
||||
type SCloudIdBaseResource struct {
|
||||
@@ -95,14 +80,15 @@ type SCloudIdBaseResource struct {
|
||||
|
||||
type CloudgroupDetails struct {
|
||||
apis.StatusInfrasResourceBaseDetails
|
||||
CloudaccountResourceDetails
|
||||
CloudproviderResourceDetails
|
||||
|
||||
SCloudgroup
|
||||
|
||||
// 公有云子用户数量
|
||||
ClouduserCount int `json:"clouduser_count"`
|
||||
// 权限数量
|
||||
CloudpolicyCount int `json:"cloudpolicy_count"`
|
||||
// 公有云权限组缓存数量
|
||||
CloudgroupcacheCount int `json:"cloudgroupcache_count"`
|
||||
|
||||
Cloudpolicies []SCloudIdBaseResource `json:"cloudpolicies"`
|
||||
Cloudusers []SCloudIdBaseResource `json:"cloudusers"`
|
||||
@@ -111,8 +97,10 @@ type CloudgroupDetails struct {
|
||||
type CloudgroupCreateInput struct {
|
||||
apis.StatusInfrasResourceBaseCreateInput
|
||||
|
||||
// 平台, 目前支持Qcloud,Google,Azure,Aliyun,Huawei,Aws
|
||||
Provider string `json:"provider"`
|
||||
// 子账号Id
|
||||
ManagerId string `json:"manager_id"`
|
||||
// swagger: ignore
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
|
||||
// 权限Id列表, 权限provider必须和权限组provider一致
|
||||
CloudpolicyIds []string `json:"cloudpolicy_ids"`
|
||||
@@ -172,3 +160,32 @@ type CloudgroupResourceDetails struct {
|
||||
// 公有云用户名称
|
||||
Cloudgroup string `json:"cloudgroup"`
|
||||
}
|
||||
|
||||
type SPolicy struct {
|
||||
Name string
|
||||
ExternalId string
|
||||
PolicyType string
|
||||
}
|
||||
|
||||
type GroupUser struct {
|
||||
Name string
|
||||
ExternalId string
|
||||
}
|
||||
|
||||
type SGroup struct {
|
||||
Id string
|
||||
Name string
|
||||
}
|
||||
|
||||
type GetCloudaccountSamlOutput struct {
|
||||
// cloudaccount SAML ServiceProvider entity ID
|
||||
EntityId string `json:"entity_id,allowempty"`
|
||||
// redirect login URL for this cloudaccount
|
||||
RedirectLoginUrl string `json:"redirect_login_url,allowempty"`
|
||||
// redirect logout URL for this cloudaccount
|
||||
RedirectLogoutUrl string `json:"redirect_logout_url,allowempty"`
|
||||
// metadata URL for this cloudaccount
|
||||
MetadataUrl string `json:"metadata_url,allowempty"`
|
||||
// initial SAML SSO login URL for this cloudaccount
|
||||
InitLoginUrl string `json:"init_login_url,allowempty"`
|
||||
}
|
||||
|
||||
@@ -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 cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
CLOUD_GROUP_CACHE_STATUS_AVAILABLE = "available" // 正常
|
||||
CLOUD_GROUP_CACHE_STATUS_CREATING = "creating" // 创建中
|
||||
CLOUD_GROUP_CACHE_STATUS_CREATE_FAILED = "create_failed" // 创建失败
|
||||
CLOUD_GROUP_CACHE_STATUS_DELETING = "deleting" // 删除中
|
||||
CLOUD_GROUP_CACHE_STATUS_DELETE_FAILED = "delete_failed" // 删除失败
|
||||
CLOUD_GROUP_CACHE_STATUS_SYNC_STATUS = "sync_status" // 同步状态中
|
||||
CLOUD_GROUP_CACHE_STATUS_UNKNOWN = "unknown" // 未知
|
||||
)
|
||||
|
||||
type CloudgroupcacheListInput struct {
|
||||
apis.StatusStandaloneResourceListInput
|
||||
CloudaccountResourceListInput
|
||||
|
||||
// 根据权限组过滤
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
}
|
||||
|
||||
type CloudgroupcacheCreateInput struct {
|
||||
}
|
||||
|
||||
type CloudgroupcacheSyncstatusInput struct {
|
||||
}
|
||||
|
||||
type CloudgroupcacheDetails struct {
|
||||
apis.StatusStandaloneResourceDetails
|
||||
SCloudgroupcache
|
||||
|
||||
CloudaccountResourceDetails
|
||||
}
|
||||
@@ -22,19 +22,16 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
CLOUD_POLICY_STATUS_AVAILABLE = cloudid.CLOUD_POLICY_STATUS_AVAILABLE
|
||||
CLOUD_POLICY_STATUS_SYNCING = "syncing"
|
||||
CLOUD_POLICY_STATUS_SYNC_FAILE = "sync_failed"
|
||||
CLOUD_POLICY_STATUS_DELETING = "deleting"
|
||||
CLOUD_POLICY_STATUS_DELETE_FAILED = "delete_failed"
|
||||
|
||||
CLOUD_POLICY_TYPE_SYSTEM = cloudid.CLOUD_POLICY_TYPE_SYSTEM
|
||||
CLOUD_POLICY_TYPE_CUSTOM = cloudid.CLOUD_POLICY_TYPE_CUSTOM
|
||||
CLOUD_POLICY_TYPE_SYSTEM = string(cloudid.PolicyTypeSystem)
|
||||
CLOUD_POLICY_TYPE_CUSTOM = string(cloudid.PolicyTypeCustom)
|
||||
)
|
||||
|
||||
type CloudpolicyListInput struct {
|
||||
apis.StatusInfrasResourceBaseListInput
|
||||
|
||||
CloudaccountResourceListInput
|
||||
CloudproviderResourceListInput
|
||||
|
||||
// 根据平台过滤
|
||||
Provider []string `json:"provider"`
|
||||
|
||||
@@ -45,7 +42,7 @@ type CloudpolicyListInput struct {
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
|
||||
// 根据订阅过滤权限
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
ManagerId string `json:"manager_id"`
|
||||
|
||||
// 权限类型
|
||||
//
|
||||
@@ -55,27 +52,30 @@ type CloudpolicyListInput struct {
|
||||
// | system | 过滤系统权限 |
|
||||
// | custom | 过滤自定义权限 |
|
||||
PolicyType string `json:"policy_type"`
|
||||
}
|
||||
|
||||
// 是否显示Locked的权限
|
||||
Locked *bool `json:"locked"`
|
||||
type PolicyUsage struct {
|
||||
CloudgroupCount int
|
||||
ClouduserCount int
|
||||
}
|
||||
|
||||
type CloudpolicyDetails struct {
|
||||
apis.StatusInfrasResourceBaseDetails
|
||||
|
||||
CloudaccountResourceDetails
|
||||
CloudproviderResourceDetails
|
||||
|
||||
SCloudpolicy
|
||||
|
||||
PolicyUsage
|
||||
}
|
||||
|
||||
type CloudpolicyCreateInput struct {
|
||||
apis.StatusInfrasResourceBaseCreateInput
|
||||
|
||||
// 平台
|
||||
Provider string `json:"provider"`
|
||||
|
||||
// default: custom
|
||||
PolicyType string `json:"policy_type"`
|
||||
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
|
||||
// 策略详情
|
||||
Document *jsonutils.JSONDict `json:"document"`
|
||||
}
|
||||
@@ -113,14 +113,3 @@ type CloudpolicyRevokeGroupInput struct {
|
||||
// 权限组Id
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
}
|
||||
|
||||
type CloudpolicyLockInput struct {
|
||||
}
|
||||
|
||||
type CloudpolicyUnLockInput struct {
|
||||
}
|
||||
|
||||
type CloudpolicyCacheInput struct {
|
||||
// 云订阅Id
|
||||
ManagerId string `json:"manager_id"`
|
||||
}
|
||||
|
||||
@@ -16,23 +16,19 @@ package cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
CLOUD_ROLE_STATUS_CREATING = "creating" // 创建中
|
||||
CLOUD_ROLE_STATUS_AVAILABLE = "available" // 正常
|
||||
CLOUD_ROLE_STATUS_DELETING = "deleting" // 删除中
|
||||
CLOUD_ROLE_STATUS_DELETE_FAILED = "delete_failed" // 删除失败
|
||||
)
|
||||
|
||||
type CloudroleListInput struct {
|
||||
apis.StatusInfrasResourceBaseListInput
|
||||
|
||||
CloudaccountResourceListInput
|
||||
CloudproviderResourceListInput
|
||||
|
||||
CloudgroupResourceListInput
|
||||
}
|
||||
|
||||
type CloudroleDetails struct {
|
||||
apis.StatusInfrasResourceBaseDetails
|
||||
CloudaccountResourceDetails
|
||||
CloudproviderResourceDetails
|
||||
|
||||
SCloudrole
|
||||
}
|
||||
|
||||
@@ -17,19 +17,6 @@ package cloudid
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
CLOUD_USER_STATUS_CREATING = "creating" // 创建中
|
||||
CLOUD_USER_STATUS_CREATE_FAILED = "create_failed" //创建失败
|
||||
CLOUD_USER_STATUS_AVAILABLE = "available" // 可用
|
||||
CLOUD_USER_STATUS_UNKNOWN = "unknown" // 未知
|
||||
CLOUD_USER_STATUS_DELETING = "deleting" // 删除中
|
||||
CLOUD_USER_STATUS_DELETE_FAILED = "delete_failed" // 删除失败
|
||||
CLOUD_USER_STATUS_SYNC_STATUS = "sync_status" // 同步状态中
|
||||
CLOUD_USER_STATUS_SYNC = "sync" // 同步配置中
|
||||
CLOUD_USER_STATUS_SYNC_FAILED = "sync_failed" // 同步配置失败
|
||||
CLOUD_USER_STATUS_SYNC_POLICIES = "sync_policies" // 同步权限中
|
||||
CLOUD_USER_STATUS_SYNC_POLICIES_FAILED = "sync_policies_failed" // 同步权限失败
|
||||
CLOUD_USER_STATUS_SYNC_GROUPS = "sync_groups" // 同步权限组中
|
||||
CLOUD_USER_STATUS_SYNC_GROUPS_FAILED = "sync_groups_failed" // 同步权限组失败
|
||||
CLOUD_USER_STATUS_RESET_PASSWORD = "reset_password" // 重置密码中
|
||||
CLOUD_USER_STATUS_RESET_PASSWORD_FAILED = "reset_password_failed" // 重置密码失败
|
||||
)
|
||||
@@ -38,9 +25,8 @@ type ClouduserCreateInput struct {
|
||||
apis.StatusDomainLevelUserResourceCreateInput
|
||||
apis.StatusBaseResourceCreateInput
|
||||
|
||||
// 云订阅ID, 若此参数为空, 则cloudpolicy_ids的权限会绑定到此账号的所有订阅, 若不为空则cloudpolicy_ids仅绑定的指定的订阅
|
||||
// 此参数仅对Google,Azure生效
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
// 云订阅ID
|
||||
ManagerId string `json:"manager_id"`
|
||||
// 云账号ID
|
||||
// Azure云账号需要有User administrator权限,否则删操作会出现Insufficient privileges to complete the operation错误信息
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
@@ -96,6 +82,7 @@ type ClouduserListInput struct {
|
||||
apis.StatusDomainLevelUserResourceListInput
|
||||
|
||||
CloudaccountResourceListInput
|
||||
CloudproviderResourceListInput
|
||||
|
||||
// 过滤绑定权限的子账号
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
@@ -104,18 +91,6 @@ type ClouduserListInput struct {
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
}
|
||||
|
||||
type ClouduserpolicyDetails struct {
|
||||
// 权限Id
|
||||
Id string `json:"id"`
|
||||
// 权限名称
|
||||
Name string `json:"name"`
|
||||
|
||||
// 子订阅Id
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
// 子订阅名称
|
||||
Manager string `json:"manager"`
|
||||
}
|
||||
|
||||
type ClouduserDetails struct {
|
||||
apis.StatusDomainLevelUserResourceDetails
|
||||
SClouduser
|
||||
@@ -129,8 +104,8 @@ type ClouduserDetails struct {
|
||||
// 权限组数量
|
||||
CloudgroupCount int `json:"cloudgroup_count"`
|
||||
|
||||
Cloudgroups []SCloudIdBaseResource `json:"cloudgroups"`
|
||||
Cloudpolicies []ClouduserpolicyDetails `json:"cloudpolicies"`
|
||||
Cloudgroups []SCloudIdBaseResource `json:"cloudgroups"`
|
||||
Cloudpolicies []SCloudIdBaseResource `json:"cloudpolicies"`
|
||||
}
|
||||
|
||||
type ClouduserJointResourceDetails struct {
|
||||
@@ -181,9 +156,6 @@ type ClouduserResourceDetails struct {
|
||||
}
|
||||
|
||||
type ClouduserAttachPolicyInput struct {
|
||||
// 订阅Id, 向云账号赋予某个订阅的权限, 目前仅Google,Azure平台此参数生效
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
|
||||
// 权限Id
|
||||
//
|
||||
//
|
||||
@@ -199,9 +171,6 @@ type ClouduserAttachPolicyInput struct {
|
||||
}
|
||||
|
||||
type ClouduserSetPoliciesInput struct {
|
||||
// 订阅Id, 设置云账号赋予某个订阅的权限, 目前仅Google,Azure平台此参数生效
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
|
||||
// 权限Ids
|
||||
CloudpolicyIds []string `json:"cloudpolicy_ids"`
|
||||
}
|
||||
@@ -223,8 +192,6 @@ type ClouduserLeaveGroupInput struct {
|
||||
}
|
||||
|
||||
type ClouduserDetachPolicyInput struct {
|
||||
// 订阅Id, 解绑云账号赋予某个订阅的权限, 目前仅Google,Azure平台此参数生效
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
// 权限Id
|
||||
//
|
||||
//
|
||||
|
||||
@@ -15,28 +15,14 @@
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/cloudmux/pkg/apis/cloudid"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
const (
|
||||
SAML_PROVIDER_STATUS_AVAILABLE = cloudid.SAML_PROVIDER_STATUS_AVAILABLE
|
||||
SAML_PROVIDER_STATUS_NOT_MATCH = "not_match"
|
||||
SAML_PROVIDER_STATUS_DELETING = "deleting"
|
||||
SAML_PROVIDER_STATUS_DELETE_FAILED = "delete_failed"
|
||||
SAML_PROVIDER_STATUS_UNKNOWN = "unknown"
|
||||
SAML_PROVIDER_STATUS_CREATING = "creating"
|
||||
SAML_PROVIDER_STATUS_CREATE_FAILED = "create_failed"
|
||||
SAML_PROVIDER_STATUS_UNVALIABLE = cloudid.SAML_PROVIDER_STATUS_UNVALIABLE
|
||||
SAML_PROVIDER_STATUS_UPDATE_METADATA = "update_metadata"
|
||||
SAML_PROVIDER_STATUS_UPDATE_METADATA_FAILED = "update_metadata_failed"
|
||||
SAML_PROVIDER_STATUS_SYNC = "sync"
|
||||
)
|
||||
|
||||
type SAMLProviderListInput struct {
|
||||
apis.StatusInfrasResourceBaseListInput
|
||||
|
||||
CloudaccountResourceListInput
|
||||
CloudproviderResourceListInput
|
||||
}
|
||||
|
||||
type SAMLProviderDetails struct {
|
||||
|
||||
@@ -16,10 +16,6 @@ package cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
SAML_USER_STATUS_AVAILABLE = "available"
|
||||
)
|
||||
|
||||
type SamluserCreateInput struct {
|
||||
apis.StatusDomainLevelUserResourceCreateInput
|
||||
|
||||
@@ -41,7 +37,15 @@ type SamluserListInput struct {
|
||||
type SamluserDetails struct {
|
||||
apis.StatusDomainLevelUserResourceDetails
|
||||
CloudgroupResourceDetails
|
||||
CloudaccountResourceDetails
|
||||
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
|
||||
ManagerId string
|
||||
Manager string
|
||||
|
||||
Provider string
|
||||
Brand string
|
||||
|
||||
SSamluser
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@ type SCloudaccountResourceBase struct {
|
||||
// SCloudgroup is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudgroup.
|
||||
type SCloudgroup struct {
|
||||
apis.SStatusInfrasResourceBase
|
||||
Provider string `json:"provider"`
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
SCloudproviderResourceBase
|
||||
}
|
||||
|
||||
// SCloudgroupJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudgroupJointsBase.
|
||||
@@ -74,39 +76,20 @@ type SCloudgroupUser struct {
|
||||
SClouduserResourceBase
|
||||
}
|
||||
|
||||
// SCloudgroupcache is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudgroupcache.
|
||||
type SCloudgroupcache struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
// 用户组Id
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
}
|
||||
|
||||
// SCloudpolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudpolicy.
|
||||
type SCloudpolicy struct {
|
||||
apis.SStatusInfrasResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
SCloudproviderResourceBase
|
||||
// 权限类型
|
||||
// | 权限类型 | 说明 |
|
||||
// |---------------|----------------------|
|
||||
// | system | 平台内置权限 |
|
||||
// | custom | 用户自定义权限 |
|
||||
PolicyType string `json:"policy_type"`
|
||||
// 平台
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
Provider string `json:"provider"`
|
||||
// 策略内容
|
||||
Document *jsonutils.JSONDict `json:"document"`
|
||||
// 是否锁定, 若锁定后, 此策略不允许被绑定到用户或权限组, 仅管理员可以设置是否锁定
|
||||
Locked *bool `json:"locked,omitempty"`
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
}
|
||||
|
||||
// SCloudpolicyResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudpolicyResourceBase.
|
||||
@@ -115,16 +98,6 @@ type SCloudpolicyResourceBase struct {
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
}
|
||||
|
||||
// SCloudpolicycache is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudpolicycache.
|
||||
type SCloudpolicycache struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
SCloudproviderResourceBase
|
||||
// 权限Id
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
}
|
||||
|
||||
// SCloudprovider is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudprovider.
|
||||
type SCloudprovider struct {
|
||||
apis.SStandaloneResourceBase
|
||||
@@ -135,7 +108,7 @@ type SCloudprovider struct {
|
||||
// SCloudproviderResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudproviderResourceBase.
|
||||
type SCloudproviderResourceBase struct {
|
||||
// 子订阅Id
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
ManagerId string `json:"manager_id"`
|
||||
}
|
||||
|
||||
// SCloudrole is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudrole.
|
||||
@@ -143,10 +116,10 @@ type SCloudrole struct {
|
||||
apis.SEnabledStatusInfrasResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
SCloudproviderResourceBase
|
||||
SAMLProviderResourceBase
|
||||
SCloudgroupResourceBase
|
||||
Document *jsonutils.JSONDict `json:"document"`
|
||||
OwnerId string `json:"owner_id"`
|
||||
}
|
||||
|
||||
// SClouduser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SClouduser.
|
||||
@@ -154,6 +127,7 @@ type SClouduser struct {
|
||||
apis.SStatusDomainLevelUserResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
SCloudproviderResourceBase
|
||||
Secret string `json:"secret"`
|
||||
// 是否可以控制台登录
|
||||
IsConsoleLogin *bool `json:"is_console_login,omitempty"`
|
||||
@@ -172,7 +146,6 @@ type SClouduserJointsBase struct {
|
||||
// SClouduserPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SClouduserPolicy.
|
||||
type SClouduserPolicy struct {
|
||||
SClouduserJointsBase
|
||||
SCloudproviderResourceBase
|
||||
SCloudpolicyResourceBase
|
||||
}
|
||||
|
||||
@@ -186,6 +159,7 @@ type SSAMLProvider struct {
|
||||
apis.SStatusInfrasResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
SCloudproviderResourceBase
|
||||
EntityId string `json:"entity_id"`
|
||||
MetadataDocument string `json:"metadata_document"`
|
||||
AuthUrl string `json:"auth_url"`
|
||||
@@ -194,9 +168,8 @@ type SSAMLProvider struct {
|
||||
// SSamluser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SSamluser.
|
||||
type SSamluser struct {
|
||||
apis.SStatusDomainLevelUserResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudgroupResourceBase
|
||||
SCloudaccountResourceBase
|
||||
// 邮箱地址
|
||||
Email string `json:"email"`
|
||||
Email string `json:"email"`
|
||||
CloudroleId string `json:"cloudrole_id"`
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
// 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
|
||||
@@ -12,4 +13,28 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cloudprovider // import "yunion.io/x/onecloud/pkg/apis/cloudprovider"
|
||||
// Code generated by swagger-gen. DO NOT EDIT.
|
||||
|
||||
// Cloudprovider API
|
||||
//
|
||||
// Schemes: https, http
|
||||
// BasePath: /
|
||||
// Version: 1.0
|
||||
// Host: "127.0.0.1:8889"
|
||||
// Contact: Zexi Li<lizexi@yunion.cn>
|
||||
// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
// Consumes:
|
||||
// - application/json
|
||||
//
|
||||
// Produces:
|
||||
// - application/json
|
||||
//
|
||||
// SecurityDefinitions:
|
||||
// keystone:
|
||||
// name: X-Auth-Token
|
||||
// type: apiKey
|
||||
// in: header
|
||||
//
|
||||
// swagger:meta
|
||||
package cloudprovider
|
||||
|
||||
@@ -14,7 +14,22 @@
|
||||
|
||||
package cloudprovider
|
||||
|
||||
import "yunion.io/x/cloudmux/pkg/cloudprovider"
|
||||
// CacheKeyRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.CacheKeyRule.
|
||||
type CacheKeyRule struct {
|
||||
RulePaths []string `json:"rule_paths"`
|
||||
RuleType string `json:"rule_type"`
|
||||
FullUrlCache bool `json:"full_url_cache"`
|
||||
IgnoreCase bool `json:"ignore_case"`
|
||||
QueryString CacheKeyRuleQueryString `json:"query_string"`
|
||||
RuleTag string `json:"rule_tag"`
|
||||
}
|
||||
|
||||
// CacheKeyRuleQueryString is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.CacheKeyRuleQueryString.
|
||||
type CacheKeyRuleQueryString struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Action string `json:"action"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// DefaultAction is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.DefaultAction.
|
||||
type DefaultAction struct {
|
||||
@@ -30,6 +45,115 @@ type DefaultAction struct {
|
||||
ResponseHeaders map[string]string `json:"response_headers"`
|
||||
}
|
||||
|
||||
// ElasticSearchAccessInfo is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.ElasticSearchAccessInfo.
|
||||
type ElasticSearchAccessInfo struct {
|
||||
Domain string `json:"domain"`
|
||||
PrivateDomain string `json:"private_domain"`
|
||||
Vip string `json:"vip"`
|
||||
Port int `json:"port"`
|
||||
PrivatePort int `json:"private_port"`
|
||||
KibanaUrl string `json:"kibana_url"`
|
||||
KibanaPrivateUrl string `json:"kibana_private_url"`
|
||||
}
|
||||
|
||||
// RefererRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.RefererRule.
|
||||
type RefererRule struct {
|
||||
// 规则类型:
|
||||
// all:所有文件生效
|
||||
// file:指定文件后缀生效
|
||||
// directory:指定路径生效
|
||||
// path:指定绝对路径生效
|
||||
RuleType string `json:"rule_type"`
|
||||
RulePaths []string `json:"rule_paths"`
|
||||
RefererType string `json:"referer_type"`
|
||||
Referers []string `json:"referers"`
|
||||
AllowEmpty *bool `json:"allow_empty"`
|
||||
}
|
||||
|
||||
// RuleCacheConfig is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.RuleCacheConfig.
|
||||
type RuleCacheConfig struct {
|
||||
Cache *struct {
|
||||
Enabled bool
|
||||
CacheTime int
|
||||
CompareMaxAge bool
|
||||
IgnoreCacheControl bool
|
||||
IgnoreSetCookie bool
|
||||
} `json:"cache"`
|
||||
NoCache *struct {
|
||||
Enabled bool
|
||||
Revalidate bool
|
||||
} `json:"no_cache"`
|
||||
FollowOrigin *struct {
|
||||
Enabled bool
|
||||
HeuristicCache struct {
|
||||
Enabled bool
|
||||
CacheConfig struct {
|
||||
HeuristicCacheTimeSwitch bool
|
||||
HeuristicCacheTime int
|
||||
}
|
||||
}
|
||||
} `json:"follow_origin"`
|
||||
}
|
||||
|
||||
// SCDNCache is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNCache.
|
||||
type SCDNCache struct {
|
||||
RuleCache []SCacheRuleCache `json:"rule_cache"`
|
||||
}
|
||||
|
||||
// SCDNCacheKeys is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNCacheKeys.
|
||||
type SCDNCacheKeys struct {
|
||||
// 开启关闭忽略参数
|
||||
Enabled *bool `json:"enabled"`
|
||||
// 是否忽略大小
|
||||
IgnoreCase *bool `json:"ignore_case"`
|
||||
// 分路径缓存键配置
|
||||
KeyRules []CacheKeyRule `json:"key_rules"`
|
||||
}
|
||||
|
||||
// SCDNForceRedirect is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNForceRedirect.
|
||||
type SCDNForceRedirect struct {
|
||||
// 访问强制跳转配置开关
|
||||
Enabled *bool `json:"enabled"`
|
||||
// 访问强制跳转类型
|
||||
// enmu: http, https
|
||||
RedirectType string `json:"redirect_type"`
|
||||
}
|
||||
|
||||
// SCDNHttps is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNHttps.
|
||||
type SCDNHttps struct {
|
||||
// https 配置开关
|
||||
Enabled *bool `json:"enabled"`
|
||||
// http2 配置开关
|
||||
Http2 *bool `json:"http2"`
|
||||
}
|
||||
|
||||
// SCDNMaxAge is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNMaxAge.
|
||||
type SCDNMaxAge struct {
|
||||
Enabled *bool `json:"enabled"`
|
||||
MaxAgeRules []SMaxAgeRule `json:"max_age_rules"`
|
||||
}
|
||||
|
||||
// SCDNRangeOriginPull is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNRangeOriginPull.
|
||||
type SCDNRangeOriginPull struct {
|
||||
Enabled *bool `json:"enabled"`
|
||||
RangeOriginPullRules []SRangeOriginPullRule `json:"range_origin_pull_rules"`
|
||||
}
|
||||
|
||||
// SCDNReferer is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNReferer.
|
||||
type SCDNReferer struct {
|
||||
// 是否开启防盗链
|
||||
Enabled *bool `json:"enabled"`
|
||||
RefererRules []RefererRule `json:"referer_rules"`
|
||||
}
|
||||
|
||||
// SCacheRuleCache is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCacheRuleCache.
|
||||
type SCacheRuleCache struct {
|
||||
RulePaths []string `json:"rule_paths"`
|
||||
RuleType string `json:"rule_type"`
|
||||
Priority int `json:"priority"`
|
||||
CacheConfig *RuleCacheConfig `json:"cache_config"`
|
||||
}
|
||||
|
||||
// SCdnDomain is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnDomain.
|
||||
type SCdnDomain struct {
|
||||
// cdn加速域名
|
||||
@@ -48,14 +172,22 @@ type SCdnDomain struct {
|
||||
|
||||
// SCdnOrigin is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnOrigin.
|
||||
type SCdnOrigin struct {
|
||||
Type string `json:"type"`
|
||||
Origin string `json:"origin"`
|
||||
// 源站类型
|
||||
// domain: 域名类型, cos:对象存储源站, ip:IP 列表作为源站
|
||||
// enmu: domain, cos, ip
|
||||
// required: true
|
||||
Type string `json:"type"`
|
||||
// 源站地址
|
||||
Origin string `json:"origin"`
|
||||
// 回主源站时 Host 头部
|
||||
ServerName string `json:"server_name"`
|
||||
Protocol string `json:"protocol"`
|
||||
Path string `json:"path"`
|
||||
Port int `json:"port"`
|
||||
Enabled string `json:"enabled"`
|
||||
Priority int `json:"priority"`
|
||||
// 回源协议
|
||||
// enmu: http, follow, https
|
||||
Protocol string `json:"protocol"`
|
||||
Path string `json:"path"`
|
||||
Port int `json:"port"`
|
||||
Enabled string `json:"enabled"`
|
||||
Priority int `json:"priority"`
|
||||
}
|
||||
|
||||
// SCdnOrigins is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnOrigins.
|
||||
@@ -85,10 +217,28 @@ type SGeographicInfo struct {
|
||||
CountryCode string `json:"country_code"`
|
||||
}
|
||||
|
||||
// SMaxAgeRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SMaxAgeRule.
|
||||
type SMaxAgeRule struct {
|
||||
MaxAgeType string `json:"max_age_type"`
|
||||
MaxAgeContents []string `json:"max_age_contents"`
|
||||
MaxAgeTime int `json:"max_age_time"`
|
||||
FollowOrigin bool `json:"follow_origin"`
|
||||
}
|
||||
|
||||
// SRangeOriginPullRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SRangeOriginPullRule.
|
||||
type SRangeOriginPullRule struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
RuleType string `json:"rule_type"`
|
||||
RulePaths []string `json:"rule_paths"`
|
||||
}
|
||||
|
||||
// SSubAccount is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SSubAccount.
|
||||
type SSubAccount struct {
|
||||
Id string `json:"id"`
|
||||
// 若Account不为空,可不传
|
||||
Name string `json:"name"`
|
||||
// 描述信息
|
||||
Desc string `json:"desc"`
|
||||
// 输入必填,若为空,需要指定子账号名称
|
||||
Account string `json:"account"`
|
||||
HealthStatus string `json:"health_status"`
|
||||
@@ -144,9 +294,11 @@ type ServerVncOutput struct {
|
||||
HostId string `json:"host_id"`
|
||||
Zone string `json:"zone"`
|
||||
// kvm host ip
|
||||
Host string `json:"host"`
|
||||
Protocol string `json:"protocol"`
|
||||
Port int64 `json:"port"`
|
||||
Host string `json:"host"`
|
||||
Protocol string `json:"protocol"`
|
||||
Port int64 `json:"port"`
|
||||
// volcengine
|
||||
Region string `json:"region"`
|
||||
Url string `json:"url"`
|
||||
InstanceId string `json:"instance_id"`
|
||||
InstanceName string `json:"instance_name"`
|
||||
@@ -163,7 +315,7 @@ type ServerVncOutput struct {
|
||||
// SubAccounts is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SubAccounts.
|
||||
type SubAccounts struct {
|
||||
// 若输出则是全量子账号列表,若输入,代表允许同步的子账号
|
||||
Accounts []cloudprovider.SSubAccount `json:"accounts"`
|
||||
Accounts []SSubAccount `json:"accounts"`
|
||||
// 若输出是云账号查询到的区域列表,若输入,代表允许同步的区域
|
||||
Cloudregions []struct {
|
||||
Id string
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
// 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
|
||||
@@ -12,4 +13,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package credentials // import "yunion.io/x/cloudmux/pkg/multicloud/huawei/client/auth/credentials"
|
||||
// Code generated by swagger-gen. DO NOT EDIT.
|
||||
|
||||
package cloudprovider
|
||||
@@ -18,6 +18,11 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/choices"
|
||||
)
|
||||
|
||||
const (
|
||||
SERVICE_TYPE = "cloudproxy"
|
||||
SERVICE_VERSION = ""
|
||||
)
|
||||
|
||||
const (
|
||||
PM_SCOPE_VPC = "vpc"
|
||||
PM_SCOPE_NETWORK = "network"
|
||||
|
||||
@@ -17,8 +17,6 @@ package compute
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
DEFAULT_ACCESS_GROUP = "default"
|
||||
|
||||
ACCESS_GROUP_STATUS_AVAILABLE = "available"
|
||||
ACCESS_GROUP_STATUS_DELETING = "deleting"
|
||||
ACCESS_GROUP_STATUS_DELETE_FAILED = "delete_failed"
|
||||
@@ -30,10 +28,15 @@ const (
|
||||
|
||||
type AccessGroupListInput struct {
|
||||
apis.StatusInfrasResourceBaseListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
ManagedResourceListInput
|
||||
RegionalFilterListInput
|
||||
}
|
||||
|
||||
type AccessGroupDetails struct {
|
||||
apis.StatusInfrasResourceBaseDetails
|
||||
ManagedResourceInfo
|
||||
CloudregionResourceInfo
|
||||
}
|
||||
|
||||
type AccessGroupResourceInfo struct {
|
||||
@@ -51,4 +54,7 @@ type AccessGroupFilterListInput struct {
|
||||
|
||||
type AccessGroupCreateInput struct {
|
||||
apis.StatusInfrasResourceBaseCreateInput
|
||||
|
||||
CloudproviderResourceInput
|
||||
CloudregionResourceInput
|
||||
}
|
||||
|
||||
@@ -78,13 +78,16 @@ type NetworkConfig struct {
|
||||
|
||||
// 子网内的IPv6地址
|
||||
// required: false
|
||||
// swagger:ignore
|
||||
Address6 string `json:"address6"`
|
||||
|
||||
// 如果是批量创建,指定每台主机子网内的IPv4地址
|
||||
// required: false
|
||||
Addresses6 []string `json:"addresses6"`
|
||||
|
||||
// 是否要求分配IPv6地址
|
||||
// required: false
|
||||
RequireIPv6 bool `json:"require_ipv6"`
|
||||
|
||||
// 驱动方式
|
||||
// 若指定镜像的网络驱动方式,此参数会被覆盖
|
||||
Driver string `json:"driver"`
|
||||
@@ -96,6 +99,8 @@ type NetworkConfig struct {
|
||||
RxTrafficLimit int64 `json:"rx_traffic_limit"`
|
||||
TxTrafficLimit int64 `json:"tx_traffic_limit"`
|
||||
|
||||
IsDefault bool `json:"is_default"`
|
||||
|
||||
// sriov nic
|
||||
SriovDevice *IsolatedDeviceConfig `json:"sriov_device"`
|
||||
|
||||
@@ -118,8 +123,15 @@ type NetworkConfig struct {
|
||||
|
||||
type AttachNetworkInput struct {
|
||||
// 添加的网卡的配置
|
||||
// required: true
|
||||
// required: false
|
||||
Nets []*NetworkConfig `json:"nets"`
|
||||
|
||||
// 添加的网卡的配置
|
||||
// required: false
|
||||
NetDesc []string `json:"net_desc"`
|
||||
|
||||
// 添加后不立即同步配置
|
||||
DisableSyncConfig *bool `json:"disable_sync_config"`
|
||||
}
|
||||
|
||||
type DiskConfig struct {
|
||||
@@ -256,6 +268,14 @@ type DiskConfig struct {
|
||||
|
||||
// NVNe device
|
||||
NVMEDevice *IsolatedDeviceConfig `json:"nvme_device"`
|
||||
|
||||
// 预分配策略:
|
||||
// off: 关闭预分配,默认关闭
|
||||
// metadata: 精简置备
|
||||
// falloc: 厚置备延迟置零
|
||||
// full: 厚置备快速置零
|
||||
// default: off
|
||||
Preallocation string `json:"preallocation"`
|
||||
}
|
||||
|
||||
type IsolatedDeviceConfig struct {
|
||||
@@ -264,7 +284,7 @@ type IsolatedDeviceConfig struct {
|
||||
DevType string `json:"dev_type"`
|
||||
Model string `json:"model"`
|
||||
Vendor string `json:"vendor"`
|
||||
NetworkIndex *int8 `json:"network_index"`
|
||||
NetworkIndex *int `json:"network_index"`
|
||||
WireId string `json:"wire_id"`
|
||||
DiskIndex *int8 `json:"disk_index"`
|
||||
}
|
||||
@@ -421,6 +441,11 @@ type ServerCreateInput struct {
|
||||
// default: 1
|
||||
VcpuCount int `json:"vcpu_count"`
|
||||
|
||||
// cpu卡槽数
|
||||
// 目前仅vmware支持此参数
|
||||
// default: 1
|
||||
CpuSockets int `json:"cpu_sockets"`
|
||||
|
||||
// 用户自定义启动脚本
|
||||
// 支持 #cloud-config yaml 格式及shell脚本
|
||||
// 支持特殊user data平台: Aliyun, Qcloud, Azure, Apsara, Ucloud
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
|
||||
package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
const (
|
||||
APP_TYPE_WEB = "web"
|
||||
@@ -38,6 +42,9 @@ type AppDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
ManagedResourceInfo
|
||||
CloudregionResourceInfo
|
||||
Network string
|
||||
VpcId string
|
||||
Vpc string
|
||||
}
|
||||
|
||||
type AppEnvironmentListInput struct {
|
||||
@@ -51,3 +58,56 @@ type AppEnvironmentListInput struct {
|
||||
type AppEnvironmentDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
}
|
||||
|
||||
type AppHybirdConnection struct {
|
||||
Id string
|
||||
Name string
|
||||
Hostname string
|
||||
Namespace string
|
||||
Port int
|
||||
}
|
||||
|
||||
type AppHybirdConnectionOutput struct {
|
||||
Data []AppHybirdConnection
|
||||
}
|
||||
|
||||
type AppBackup struct {
|
||||
Id string
|
||||
Name string
|
||||
Type string
|
||||
}
|
||||
|
||||
type AppBackupOutput struct {
|
||||
Data []AppBackup
|
||||
BackupConfig struct {
|
||||
Enabled bool
|
||||
FrequencyInterval int
|
||||
FrequencyUnit string
|
||||
RetentionPeriodInDays int
|
||||
}
|
||||
}
|
||||
|
||||
type AppCertificate struct {
|
||||
Id string
|
||||
Name string
|
||||
SubjectName string
|
||||
Issuer string
|
||||
IssueDate time.Time
|
||||
Thumbprint string
|
||||
ExpireTime time.Time
|
||||
}
|
||||
|
||||
type AppCertificateOutput struct {
|
||||
Data []AppCertificate
|
||||
}
|
||||
|
||||
type AppDomain struct {
|
||||
Id string
|
||||
Name string
|
||||
Status string
|
||||
SslState string
|
||||
}
|
||||
|
||||
type AppDomainOutput struct {
|
||||
Data []AppDomain
|
||||
}
|
||||
|
||||
@@ -20,8 +20,12 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type TBackupStorageType string
|
||||
|
||||
const (
|
||||
BACKUPSTORAGE_TYPE_NFS = "nfs"
|
||||
BACKUPSTORAGE_TYPE_NFS = TBackupStorageType("nfs")
|
||||
BACKUPSTORAGE_TYPE_OBJECT_STORAGE = TBackupStorageType("object")
|
||||
|
||||
BACKUPSTORAGE_STATUS_ONLINE = "online"
|
||||
BACKUPSTORAGE_STATUS_OFFLINE = "offline"
|
||||
|
||||
@@ -55,31 +59,35 @@ type BackupStorageCreateInput struct {
|
||||
// enum: nfs
|
||||
StorageType string `json:"storage_type"`
|
||||
|
||||
// description: host of nfs, storage_type 为 nfs 时, 此参数必传
|
||||
// example: 192.168.222.2
|
||||
NfsHost string `json:"nfs_host"`
|
||||
|
||||
// description: shared dir of nfs, storage_type 为 nfs 时, 此参数必传
|
||||
// example: /nfs_root/
|
||||
NfsSharedDir string `json:"nfs_shared_dir"`
|
||||
SBackupStorageAccessInfo
|
||||
|
||||
// description: Capacity size in MB
|
||||
CapacityMb int `json:"capacity_mb"`
|
||||
}
|
||||
|
||||
type BackupStorageAccessInfo struct {
|
||||
AccessUrl string
|
||||
type BackupStorageUpdateInput struct {
|
||||
apis.EnabledStatusInfrasResourceBaseUpdateInput
|
||||
|
||||
SBackupStorageAccessInfo
|
||||
}
|
||||
|
||||
/*type BackupStorageAccessInfo struct {
|
||||
AccessUrl string
|
||||
}*/
|
||||
|
||||
type BackupStorageDetails struct {
|
||||
apis.EnabledStatusInfrasResourceBaseDetails
|
||||
|
||||
NfsHost string
|
||||
NfsSharedDir string
|
||||
SBackupStorageAccessInfo
|
||||
}
|
||||
|
||||
type BackupStorageListInput struct {
|
||||
apis.EnabledStatusInfrasResourceBaseListInput
|
||||
|
||||
// filter by server_id
|
||||
ServerId string `json:"server_id"`
|
||||
// filter by disk_id
|
||||
DiskId string `json:"disk_id"`
|
||||
}
|
||||
|
||||
type DiskBackupListInput struct {
|
||||
@@ -162,3 +170,38 @@ type InstanceBackupPackMetadata struct {
|
||||
|
||||
type InstanceBackupManagerSyncstatusInput struct {
|
||||
}
|
||||
|
||||
type SBackupStorageAccessInfo struct {
|
||||
// description: host of nfs, storage_type 为 nfs 时, 此参数必传
|
||||
// example: 192.168.222.2
|
||||
NfsHost string `json:"nfs_host"`
|
||||
|
||||
// description: shared dir of nfs, storage_type 为 nfs 时, 此参数必传
|
||||
// example: /nfs_root/
|
||||
NfsSharedDir string `json:"nfs_shared_dir"`
|
||||
|
||||
// description: access url of object storage bucket
|
||||
// example: https://qxxxxxo.tos-cn-beijing.volces.com
|
||||
ObjectBucketUrl string `json:"object_bucket_url"`
|
||||
// description: access key of object storage
|
||||
ObjectAccessKey string `json:"object_access_key"`
|
||||
// description: secret of object storage
|
||||
ObjectSecret string `json:"object_secret"`
|
||||
}
|
||||
|
||||
func (ba *SBackupStorageAccessInfo) String() string {
|
||||
return jsonutils.Marshal(ba).String()
|
||||
}
|
||||
|
||||
func (ba *SBackupStorageAccessInfo) IsZero() bool {
|
||||
return ba == nil
|
||||
}
|
||||
|
||||
type ServerCreateInstanceBackupInput struct {
|
||||
// 主机备份名称
|
||||
Name string `json:"name"`
|
||||
// 主机备份的生成名称
|
||||
GenerateName string `json:"generate_name"`
|
||||
// 备份存储ID
|
||||
BackupStorageId string `json:"backup_storage_id"`
|
||||
}
|
||||
|
||||
47
pkg/apis/compute/backup_storages.go
Normal file
47
pkg/apis/compute/backup_storages.go
Normal file
@@ -0,0 +1,47 @@
|
||||
// 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
|
||||
|
||||
type BackupstorageResourceInput struct {
|
||||
// 备份存储(ID或Name)
|
||||
BackupstorageId string `json:"backupstorage_id"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by backupstorage_id
|
||||
Backupstorage string `json:"backupstorage" yunion-deprecated-by:"backupstorage_id"`
|
||||
}
|
||||
|
||||
type BackupstorageFilterListInputBase struct {
|
||||
BackupstorageResourceInput
|
||||
|
||||
// 以备份存储名称排序
|
||||
// pattern:asc|desc
|
||||
OrderByBackupstorage string `json:"order_by_backupstorage"`
|
||||
}
|
||||
|
||||
type BackupstorageResourceInfo struct {
|
||||
// 备份存储名称
|
||||
Backupstorage string `json:"backupstorage"`
|
||||
|
||||
// 备份存储类型
|
||||
BackupstorageType TBackupStorageType `json:"backupstorage_type"`
|
||||
|
||||
// 备份存储状态
|
||||
BackupstorageStatus string `json:"backupstorage_status"`
|
||||
}
|
||||
|
||||
type BackupstorageFilterListInput struct {
|
||||
BackupstorageFilterListInputBase
|
||||
}
|
||||
@@ -16,10 +16,12 @@ package compute
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"yunion.io/x/cloudmux/pkg/apis/compute"
|
||||
"yunion.io/x/cloudmux/pkg/cloudprovider"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/util/regutils"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
@@ -80,7 +82,7 @@ func (self BucketDetails) GetMetricTags() map[string]string {
|
||||
"tenant_id": self.ProjectId,
|
||||
"external_id": self.ExternalId,
|
||||
}
|
||||
return ret
|
||||
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
|
||||
}
|
||||
|
||||
func (self BucketDetails) GetMetricPairs() map[string]string {
|
||||
@@ -360,3 +362,9 @@ type BucketRefererConf struct {
|
||||
func (input *BucketRefererConf) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
gotypes.RegisterSerializable(reflect.TypeOf(&SBackupStorageAccessInfo{}), func() gotypes.ISerializable {
|
||||
return &SBackupStorageAccessInfo{}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -68,3 +68,22 @@ type CachedimageDetails struct {
|
||||
type CachedImageSetClassMetadataInput struct {
|
||||
ClassMetadata map[string]string `json:"class_metadata"`
|
||||
}
|
||||
|
||||
type CachedimageListInput struct {
|
||||
apis.SharableVirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
CloudproviderResourceListInput
|
||||
CloudregionResourceListInput
|
||||
ZoneResourceInput
|
||||
|
||||
// 镜像类型,可能值为: system(公有云公共镜像), customized(自定义镜像)
|
||||
// example: system
|
||||
ImageType []string `json:"image_type"`
|
||||
|
||||
// filter by host schedtag
|
||||
HostSchedtagId string `json:"host_schedtag_id"`
|
||||
|
||||
// valid cachedimage
|
||||
Valid bool `json:"valid"`
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user