mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-21 00:24:07 +08:00
Compare commits
1080 Commits
release/2.
...
v2.13.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2ad8450b6 | ||
|
|
f7da35a988 | ||
|
|
f1014690e3 | ||
|
|
dcf56e0463 | ||
|
|
5063616d07 | ||
|
|
dce0ab2c8f | ||
|
|
30121d55e7 | ||
|
|
6f96fdda74 | ||
|
|
19806776e8 | ||
|
|
47b52c8aec | ||
|
|
456f7d5bb4 | ||
|
|
cba14b5dd0 | ||
|
|
309f31025a | ||
|
|
3512c9214a | ||
|
|
80c09912f0 | ||
|
|
d447bfe11c | ||
|
|
ca54219b96 | ||
|
|
3bd63e71de | ||
|
|
ad632dd76f | ||
|
|
3fa388afaa | ||
|
|
ff59f3d71c | ||
|
|
e6b22a8a59 | ||
|
|
f42d378082 | ||
|
|
01e6fb4851 | ||
|
|
f694040ee2 | ||
|
|
3a5de36189 | ||
|
|
54424146e8 | ||
|
|
8114e15fe2 | ||
|
|
2666b9a4db | ||
|
|
628b78f898 | ||
|
|
156aab4167 | ||
|
|
7c8dd38429 | ||
|
|
2bd7fa1d15 | ||
|
|
fd8e92634a | ||
|
|
681032273c | ||
|
|
a42ccd5e8c | ||
|
|
055b290f10 | ||
|
|
31eb7385d2 | ||
|
|
a9a7e66de2 | ||
|
|
4f1f7f4715 | ||
|
|
a6a50d65ee | ||
|
|
7e06512fda | ||
|
|
5f54d711c0 | ||
|
|
0e484e2a2f | ||
|
|
c35ed2f8b3 | ||
|
|
44c12f7ca3 | ||
|
|
6acb41989a | ||
|
|
a08531e694 | ||
|
|
dce8e65e0d | ||
|
|
1e4339e87b | ||
|
|
3b41cb91b5 | ||
|
|
52eca7a37c | ||
|
|
7554c634f7 | ||
|
|
fbe4f48fb0 | ||
|
|
b80742d7ef | ||
|
|
c4829e2836 | ||
|
|
6d9845ece9 | ||
|
|
b4fb07864b | ||
|
|
98d5f438de | ||
|
|
f48d7ce87e | ||
|
|
a4de17108d | ||
|
|
59ee548f80 | ||
|
|
9dcf00664e | ||
|
|
114708d93b | ||
|
|
6280c0dfc6 | ||
|
|
43e0935799 | ||
|
|
3008803b69 | ||
|
|
e841ccf4c6 | ||
|
|
01abfe9b13 | ||
|
|
f10e16a697 | ||
|
|
02c50a26cf | ||
|
|
02f760c4b0 | ||
|
|
821b103495 | ||
|
|
d63ca1e5d9 | ||
|
|
a721ccd489 | ||
|
|
1c6ebbf149 | ||
|
|
9d6779734c | ||
|
|
82aa74f949 | ||
|
|
cffd216351 | ||
|
|
d99dd1652a | ||
|
|
9d61ccc09f | ||
|
|
d4b52b89aa | ||
|
|
1320c7a915 | ||
|
|
6006bb8b45 | ||
|
|
e65dbf4926 | ||
|
|
b73f544f89 | ||
|
|
91eda17b88 | ||
|
|
63c0b5dc62 | ||
|
|
d328b165c1 | ||
|
|
66db3ed11b | ||
|
|
784f21871d | ||
|
|
54d67ad010 | ||
|
|
88deeae622 | ||
|
|
0274e73a47 | ||
|
|
9b64b43dcd | ||
|
|
162eb94fa8 | ||
|
|
57075ebb56 | ||
|
|
f82d8c93e0 | ||
|
|
4d7a68efca | ||
|
|
7a0e6cd04c | ||
|
|
aebc9df97f | ||
|
|
be6fbe1f6e | ||
|
|
e3976c86ec | ||
|
|
95de6acd2b | ||
|
|
aca89a3818 | ||
|
|
3b390ab4b6 | ||
|
|
6522b8642d | ||
|
|
05f5cc96a8 | ||
|
|
8a59f35ae3 | ||
|
|
ec2eef8138 | ||
|
|
4b32d4054b | ||
|
|
8907c87a22 | ||
|
|
f5c26548ab | ||
|
|
97f56884d5 | ||
|
|
9fff1c2123 | ||
|
|
6349adb35b | ||
|
|
e1b8c5f13a | ||
|
|
86c672082a | ||
|
|
3e3120ef87 | ||
|
|
73ec39100a | ||
|
|
9351330a2e | ||
|
|
ad50d6033d | ||
|
|
15d5e4db92 | ||
|
|
594c1d5b3a | ||
|
|
a8c0e53902 | ||
|
|
663d3062bd | ||
|
|
d4db5ef360 | ||
|
|
9e1cb659f9 | ||
|
|
7d252c2efc | ||
|
|
02191c04f8 | ||
|
|
a659f27087 | ||
|
|
2aca328104 | ||
|
|
b65a1dfe3b | ||
|
|
bc41899969 | ||
|
|
7a4e16ac82 | ||
|
|
af444e1886 | ||
|
|
a7835a71da | ||
|
|
4d89685bba | ||
|
|
a245385da8 | ||
|
|
614c31f26e | ||
|
|
16bbd77e8b | ||
|
|
1cc788e684 | ||
|
|
54adabbde8 | ||
|
|
65c1b3effb | ||
|
|
cc33efbbc9 | ||
|
|
6771b64b6f | ||
|
|
706af7bf54 | ||
|
|
f4d218209c | ||
|
|
e5534c7d3a | ||
|
|
99e51d679b | ||
|
|
a997303df9 | ||
|
|
dee404451b | ||
|
|
5bad638411 | ||
|
|
9e8b2eb017 | ||
|
|
7337198f9e | ||
|
|
305caea1d5 | ||
|
|
61657c6afc | ||
|
|
f08be6b820 | ||
|
|
3c18eae779 | ||
|
|
20d79e2c5c | ||
|
|
254e1ce7ed | ||
|
|
b3bd5f6dcf | ||
|
|
b3f30e2522 | ||
|
|
dc01dedb68 | ||
|
|
252a5f2537 | ||
|
|
a7a77fc4be | ||
|
|
65da02614e | ||
|
|
b21b514af3 | ||
|
|
4e64dc1dca | ||
|
|
2870c7acfa | ||
|
|
699859f409 | ||
|
|
ef0a88293b | ||
|
|
f5261205cd | ||
|
|
2afb33adc5 | ||
|
|
06e10a8dbb | ||
|
|
66e23b7b85 | ||
|
|
865d53cddf | ||
|
|
d0eb89bc55 | ||
|
|
9fa4dfa4cd | ||
|
|
0392b27b10 | ||
|
|
efc216afe5 | ||
|
|
42426d71e8 | ||
|
|
90f4095297 | ||
|
|
af7d67c5ac | ||
|
|
16b0df3075 | ||
|
|
680d50ed3a | ||
|
|
7c13b80119 | ||
|
|
be20ad19d8 | ||
|
|
27d9fc4879 | ||
|
|
49af630a5b | ||
|
|
b95fc4dfe9 | ||
|
|
237748a6e1 | ||
|
|
c240062b36 | ||
|
|
081c439243 | ||
|
|
f95e017ce3 | ||
|
|
c14202db03 | ||
|
|
d71f0ce952 | ||
|
|
ccddbd96a2 | ||
|
|
f728f3c325 | ||
|
|
03a8b0b7f0 | ||
|
|
a42926a9d7 | ||
|
|
f60e3d0894 | ||
|
|
779aa13dd1 | ||
|
|
9aaaf319e0 | ||
|
|
151d081fb3 | ||
|
|
ed31437bb0 | ||
|
|
245349ac91 | ||
|
|
e9d04fd3fa | ||
|
|
df930fbd65 | ||
|
|
4811160707 | ||
|
|
ebf7b1d421 | ||
|
|
793f0ab4c1 | ||
|
|
07302e17d1 | ||
|
|
e06ebe8992 | ||
|
|
e0f341e07d | ||
|
|
2206c7eb5c | ||
|
|
5fc0b073a9 | ||
|
|
68bb6c1d09 | ||
|
|
56d2236513 | ||
|
|
97e05fc4b6 | ||
|
|
cb9ff42407 | ||
|
|
bccefab721 | ||
|
|
51201eede3 | ||
|
|
5e7aa130ea | ||
|
|
3edd51c1dd | ||
|
|
382309fff4 | ||
|
|
5aad93deab | ||
|
|
d55bbf6d6e | ||
|
|
d4cbaff1bc | ||
|
|
e93cbb6e58 | ||
|
|
87a6aedae6 | ||
|
|
7178f56c26 | ||
|
|
18f2e230d9 | ||
|
|
2c3b8df036 | ||
|
|
7f015f562a | ||
|
|
cd580b07b6 | ||
|
|
3e1f7239dc | ||
|
|
9d94bc5503 | ||
|
|
fe5e1b1321 | ||
|
|
648f0af3e8 | ||
|
|
f47d98e382 | ||
|
|
f81a14f85a | ||
|
|
ce0eb0272a | ||
|
|
349b8c246b | ||
|
|
9c28054105 | ||
|
|
e8dd5a40d0 | ||
|
|
18035d0689 | ||
|
|
ed66f7a238 | ||
|
|
000a04a67d | ||
|
|
5e164baf80 | ||
|
|
15fb3e364d | ||
|
|
1d65b27bef | ||
|
|
11343fa652 | ||
|
|
56c53712e0 | ||
|
|
4f6c70f5fb | ||
|
|
8c0086a140 | ||
|
|
8db7d00c82 | ||
|
|
8aa6aa3719 | ||
|
|
b422d70dd0 | ||
|
|
e497eb70e8 | ||
|
|
1e79fc1318 | ||
|
|
c4dff69959 | ||
|
|
b760d9aa9d | ||
|
|
454e94e2ff | ||
|
|
14e4ef8043 | ||
|
|
cc0319f531 | ||
|
|
397ce71431 | ||
|
|
c368111984 | ||
|
|
d8fb7a4759 | ||
|
|
15d3eb7f32 | ||
|
|
00703aeeb1 | ||
|
|
9d23392bc3 | ||
|
|
c9d070aa74 | ||
|
|
22f600bb20 | ||
|
|
49e2cff8fd | ||
|
|
10f0d0ab35 | ||
|
|
840eb4dc47 | ||
|
|
6eaf6d3147 | ||
|
|
acb46f42bc | ||
|
|
2982d6f718 | ||
|
|
0245df37fc | ||
|
|
81c90c045b | ||
|
|
c1b1aedb0a | ||
|
|
ef74e82f78 | ||
|
|
159c67e088 | ||
|
|
ffa907ad14 | ||
|
|
b6acaad75e | ||
|
|
cdc6a07586 | ||
|
|
1efdffe097 | ||
|
|
59e3d4bd3e | ||
|
|
4bcd50a8a8 | ||
|
|
79dbde03c1 | ||
|
|
869e1146cf | ||
|
|
72764183b6 | ||
|
|
48a288a603 | ||
|
|
d327a96c66 | ||
|
|
fb9566b9a2 | ||
|
|
45271e04fd | ||
|
|
854b20fac6 | ||
|
|
36c50d17bc | ||
|
|
da498950a7 | ||
|
|
ac71787261 | ||
|
|
b71d450563 | ||
|
|
c61d571295 | ||
|
|
d44fdcc36a | ||
|
|
48e3d1e016 | ||
|
|
bb5b3a29d3 | ||
|
|
761edb91a8 | ||
|
|
59b496f67d | ||
|
|
a42ba5f728 | ||
|
|
fb2dbdb9b6 | ||
|
|
4d58595223 | ||
|
|
b5900e6ac6 | ||
|
|
0acfe911f2 | ||
|
|
bf30a53252 | ||
|
|
32468981f4 | ||
|
|
73c9871545 | ||
|
|
e3a4aabad8 | ||
|
|
4710a7a19a | ||
|
|
0741c7d039 | ||
|
|
b9b43e58b8 | ||
|
|
9f4a2b6b2f | ||
|
|
c6c232f11b | ||
|
|
a1b8c053ef | ||
|
|
c953edc3b2 | ||
|
|
504e251c3b | ||
|
|
4edcd85f07 | ||
|
|
0bcee9e529 | ||
|
|
f3c16ace78 | ||
|
|
cf69029250 | ||
|
|
d1a848ce28 | ||
|
|
8e5f7dc5b3 | ||
|
|
3685860bbd | ||
|
|
c0a6045710 | ||
|
|
c847db56c1 | ||
|
|
2e64a90823 | ||
|
|
6d3fa65c7b | ||
|
|
4e3f902fa7 | ||
|
|
aa491b084b | ||
|
|
efcd66f6cf | ||
|
|
496bf0729d | ||
|
|
5c9f3ecde5 | ||
|
|
3ca01a11af | ||
|
|
88d0580b4f | ||
|
|
219af8dee4 | ||
|
|
6fd90257f5 | ||
|
|
104310bab6 | ||
|
|
a1d123bfb9 | ||
|
|
1979effd78 | ||
|
|
93fe16bba6 | ||
|
|
dc029452d0 | ||
|
|
5ecc0bd1ec | ||
|
|
02b24d1894 | ||
|
|
6a87e3e8df | ||
|
|
3609f2d921 | ||
|
|
176fbb305a | ||
|
|
09a660d039 | ||
|
|
708089ec7a | ||
|
|
3ce7cbd191 | ||
|
|
b9babd6d28 | ||
|
|
bdd9fe8c57 | ||
|
|
bf707f87f9 | ||
|
|
fbbfdb5cc7 | ||
|
|
d3b8770ae3 | ||
|
|
7434e5688f | ||
|
|
35f5553b14 | ||
|
|
b1b76e88a2 | ||
|
|
c61d9dd73e | ||
|
|
0f51f70324 | ||
|
|
97e516bc3b | ||
|
|
c44dccb370 | ||
|
|
54919edf5f | ||
|
|
51a09a8a44 | ||
|
|
b2ffe40386 | ||
|
|
a4eacf1d85 | ||
|
|
024f9bdcdd | ||
|
|
d93297785b | ||
|
|
661f16efe0 | ||
|
|
b91ec54883 | ||
|
|
83a20552af | ||
|
|
29e1705d6b | ||
|
|
d2520e67b8 | ||
|
|
4a6e410d6f | ||
|
|
612eff6314 | ||
|
|
b00d06eb61 | ||
|
|
70934b6b4d | ||
|
|
d2b6234eab | ||
|
|
f91c337ae4 | ||
|
|
77c6f51c87 | ||
|
|
8f66dcfc96 | ||
|
|
4a327e795d | ||
|
|
4097dc8e68 | ||
|
|
5944c9c20e | ||
|
|
d7de603fe5 | ||
|
|
238230491d | ||
|
|
1a32a15ddd | ||
|
|
852ed4590e | ||
|
|
e7b1dfff42 | ||
|
|
3e7cf49674 | ||
|
|
8c74cff65b | ||
|
|
4cb7d03474 | ||
|
|
cdc446f773 | ||
|
|
6ddd8c0df6 | ||
|
|
f1e1949e14 | ||
|
|
d2c2362435 | ||
|
|
bb5e557c70 | ||
|
|
c5bbd936cf | ||
|
|
d740109d0e | ||
|
|
1e4975abb4 | ||
|
|
1d0129bca7 | ||
|
|
be57b97bb4 | ||
|
|
0d7355cde7 | ||
|
|
8af9889f5f | ||
|
|
a16a1489f7 | ||
|
|
8fd0c9fb66 | ||
|
|
fa5e58f047 | ||
|
|
5d300e5e4d | ||
|
|
7e0c79ee66 | ||
|
|
d65e459284 | ||
|
|
b1407c1ea1 | ||
|
|
614eb3a45c | ||
|
|
c330655912 | ||
|
|
1172a86955 | ||
|
|
6606c7fd27 | ||
|
|
49eac5f4c4 | ||
|
|
960eee4974 | ||
|
|
feaad53279 | ||
|
|
67d547e5f7 | ||
|
|
f77357969f | ||
|
|
57a09c5682 | ||
|
|
18eb373389 | ||
|
|
f13a185045 | ||
|
|
ad04b24487 | ||
|
|
0acc601d31 | ||
|
|
586e8c7714 | ||
|
|
70e43e7c94 | ||
|
|
1d475533e9 | ||
|
|
bd7ba7de8e | ||
|
|
c912ee6c3c | ||
|
|
046dc63be7 | ||
|
|
25fbfad3c5 | ||
|
|
b34792e667 | ||
|
|
a241b2dd79 | ||
|
|
0902b4330d | ||
|
|
7757381008 | ||
|
|
8b253f68b4 | ||
|
|
8f68c3067f | ||
|
|
403f82314b | ||
|
|
c47a529daa | ||
|
|
affed9af90 | ||
|
|
5293e3f02a | ||
|
|
eb1f2e0665 | ||
|
|
9e714f603e | ||
|
|
27b1aff669 | ||
|
|
48993ad92a | ||
|
|
3c0a012b5c | ||
|
|
78378248ce | ||
|
|
2a578f8fef | ||
|
|
e3ecfa9dc1 | ||
|
|
c9964db983 | ||
|
|
f64fc69ef8 | ||
|
|
43b5518b0c | ||
|
|
9dc72687d5 | ||
|
|
1c0c64830d | ||
|
|
cc52759a2a | ||
|
|
e8e5822d76 | ||
|
|
50506d8daf | ||
|
|
0bc8114f45 | ||
|
|
7fac5ed1de | ||
|
|
429e065deb | ||
|
|
6c68873a72 | ||
|
|
4a43b71a67 | ||
|
|
c16df82138 | ||
|
|
9f53dadd0b | ||
|
|
37c78928f9 | ||
|
|
d7ab4dd931 | ||
|
|
f7662b4f5f | ||
|
|
1a7134f3df | ||
|
|
92cadee8f0 | ||
|
|
7aaad852a4 | ||
|
|
ee10ff1fa4 | ||
|
|
037ebf3b5a | ||
|
|
5ac9d6e278 | ||
|
|
fe9100ef2a | ||
|
|
4541d56925 | ||
|
|
edf733d689 | ||
|
|
6831d8713d | ||
|
|
aec34a9440 | ||
|
|
6f1e187260 | ||
|
|
451a6e936e | ||
|
|
16544f53b5 | ||
|
|
93bd654630 | ||
|
|
4f47746ab6 | ||
|
|
0310274310 | ||
|
|
b9b3309348 | ||
|
|
3d38fa76fa | ||
|
|
224d384863 | ||
|
|
381f7df822 | ||
|
|
15773ccb63 | ||
|
|
157f49d84a | ||
|
|
1e09a2e11a | ||
|
|
0160103054 | ||
|
|
757c3502fb | ||
|
|
721321b54f | ||
|
|
1bfc55b6c2 | ||
|
|
15cd5675df | ||
|
|
954ae03297 | ||
|
|
f77b6a68a4 | ||
|
|
55e4d09fef | ||
|
|
79a7685cac | ||
|
|
6611ee78f0 | ||
|
|
8c19d1d456 | ||
|
|
f3a2ee50e5 | ||
|
|
aabc7a0a15 | ||
|
|
b282a676c7 | ||
|
|
ffc7a1ce11 | ||
|
|
76a121113c | ||
|
|
981ce91f2d | ||
|
|
8738df67cd | ||
|
|
af9a66906a | ||
|
|
f039bc6316 | ||
|
|
8c42bf4b14 | ||
|
|
283037a724 | ||
|
|
992a84dd04 | ||
|
|
970e00b176 | ||
|
|
4b17d16531 | ||
|
|
2d6823c8b9 | ||
|
|
60b458ab77 | ||
|
|
c1b9c0a9a9 | ||
|
|
0dfb2a1965 | ||
|
|
c6fb41cf9c | ||
|
|
ba6ff394bd | ||
|
|
790878c743 | ||
|
|
5bcd013622 | ||
|
|
1079614d6e | ||
|
|
c28bf2bd81 | ||
|
|
fbe17f2f1e | ||
|
|
2a347aa5fc | ||
|
|
45084a31b6 | ||
|
|
f5971c650e | ||
|
|
593a6a4a76 | ||
|
|
7fed6b1a2a | ||
|
|
e5fd0bc7b8 | ||
|
|
a1b7ac1bf3 | ||
|
|
5390e81c77 | ||
|
|
c6597d71e3 | ||
|
|
3532b8a261 | ||
|
|
954799f512 | ||
|
|
183f2f5b7d | ||
|
|
cd7b0d2c40 | ||
|
|
de14557be2 | ||
|
|
c796f76fd7 | ||
|
|
2eceb9ca4b | ||
|
|
396957312d | ||
|
|
5281ea243c | ||
|
|
8fddcd7775 | ||
|
|
dab9cb0fe6 | ||
|
|
65c080dff7 | ||
|
|
5c14041446 | ||
|
|
db01178432 | ||
|
|
10bc25769e | ||
|
|
77e43330ab | ||
|
|
b49b189883 | ||
|
|
c6f04dea16 | ||
|
|
8ce3885265 | ||
|
|
ef1b1af6e7 | ||
|
|
c2d2c86f30 | ||
|
|
7545d78937 | ||
|
|
c09b1d6832 | ||
|
|
2ed863940c | ||
|
|
053f1a5a7d | ||
|
|
98ad1ad428 | ||
|
|
34a4c356d3 | ||
|
|
329b4d6d62 | ||
|
|
92389a8c5f | ||
|
|
0b3f5ce583 | ||
|
|
7b4aae71cd | ||
|
|
918d883cf9 | ||
|
|
1b4bb62f83 | ||
|
|
cbc970a2d6 | ||
|
|
de68feba9b | ||
|
|
98174b4354 | ||
|
|
1441b70e8a | ||
|
|
9e11b683a5 | ||
|
|
17e897cf93 | ||
|
|
a54adccadf | ||
|
|
586ac8c9fd | ||
|
|
b601ec6932 | ||
|
|
4074dde7b4 | ||
|
|
77922d9f56 | ||
|
|
e904e68313 | ||
|
|
c2b6ffc492 | ||
|
|
ce88fd3693 | ||
|
|
40a400700f | ||
|
|
da1a9b33af | ||
|
|
97c2ee9e68 | ||
|
|
05417fbbb4 | ||
|
|
ffd71ce2ab | ||
|
|
e212407b76 | ||
|
|
c3355e2312 | ||
|
|
d4c5d37fc2 | ||
|
|
e75eae74a9 | ||
|
|
d260fbb185 | ||
|
|
9541eccd38 | ||
|
|
b74b94f5c9 | ||
|
|
11423e574c | ||
|
|
36bfb48a9a | ||
|
|
607c05acda | ||
|
|
e089287970 | ||
|
|
f4a6277c31 | ||
|
|
41206abdd1 | ||
|
|
fd74845797 | ||
|
|
40a922ac58 | ||
|
|
b113ab24ab | ||
|
|
94dc3ca2fb | ||
|
|
f26431fc0c | ||
|
|
e645ab22ce | ||
|
|
1f96aecf71 | ||
|
|
6d5493004b | ||
|
|
61bbbc5610 | ||
|
|
01941f3637 | ||
|
|
2f31be5a00 | ||
|
|
d01ec224d1 | ||
|
|
5c2f97e40b | ||
|
|
7993845bfa | ||
|
|
3b7e97cc33 | ||
|
|
aca3da0b69 | ||
|
|
69f969875e | ||
|
|
9aae793665 | ||
|
|
1912170eb4 | ||
|
|
d7c300f861 | ||
|
|
99fbe4f228 | ||
|
|
ce71be7fed | ||
|
|
c0c3d98871 | ||
|
|
799f033e8c | ||
|
|
90f89c499f | ||
|
|
3ff13c81a1 | ||
|
|
9bd93f96a4 | ||
|
|
e3c1eb7e7e | ||
|
|
985111168c | ||
|
|
dccf867805 | ||
|
|
9cecc6ac59 | ||
|
|
a3af11bacf | ||
|
|
eb584c4d01 | ||
|
|
a66c25521f | ||
|
|
f337ec244d | ||
|
|
d321458803 | ||
|
|
ce0257126f | ||
|
|
9cca89e7ec | ||
|
|
d42e67c2e8 | ||
|
|
d130afb143 | ||
|
|
9e1e51abf8 | ||
|
|
e1ed02f525 | ||
|
|
0565813764 | ||
|
|
862c2c27ee | ||
|
|
0416d3fd1e | ||
|
|
b86fdbba43 | ||
|
|
692b1ce3c3 | ||
|
|
d0bf533d4a | ||
|
|
d89d4dcb86 | ||
|
|
7956b0db38 | ||
|
|
3a9a7b67ce | ||
|
|
af2d8900c2 | ||
|
|
bc0bf4f772 | ||
|
|
cb995d844d | ||
|
|
00979ab3b2 | ||
|
|
9adf57ec18 | ||
|
|
d00e95dadb | ||
|
|
40199d787e | ||
|
|
bb4c3fda21 | ||
|
|
0a6c248887 | ||
|
|
06d35542a1 | ||
|
|
b19fcf4487 | ||
|
|
caa82c0917 | ||
|
|
8aa88657c2 | ||
|
|
f3370a5824 | ||
|
|
02229d970e | ||
|
|
4ac77b61df | ||
|
|
633eecef22 | ||
|
|
d0f8dd6607 | ||
|
|
33fc89dca1 | ||
|
|
68d474b88d | ||
|
|
bbf66c6e28 | ||
|
|
e972ac160c | ||
|
|
80262325ec | ||
|
|
da5e9effdb | ||
|
|
f3d113a813 | ||
|
|
cfaf7cf36e | ||
|
|
7fb69981f7 | ||
|
|
98f990d838 | ||
|
|
61974fba54 | ||
|
|
4d5585c5d7 | ||
|
|
de7d38cc6e | ||
|
|
a20d617362 | ||
|
|
ea2e57cbfd | ||
|
|
2bcacdb180 | ||
|
|
0babb71bbb | ||
|
|
97643f5f49 | ||
|
|
c0a0008416 | ||
|
|
fc95701f80 | ||
|
|
9423d614d1 | ||
|
|
dc2a2ec887 | ||
|
|
8d6bf39768 | ||
|
|
5037c33a80 | ||
|
|
88eca31e22 | ||
|
|
92a0b8878a | ||
|
|
0f3a12898a | ||
|
|
484f56db9b | ||
|
|
6963837f2f | ||
|
|
aa61c4bd97 | ||
|
|
aa6e968413 | ||
|
|
1fb48cd0db | ||
|
|
e3889f6075 | ||
|
|
0dbf30588f | ||
|
|
aea8c3929c | ||
|
|
f8a3c08771 | ||
|
|
8b3c3f4e5e | ||
|
|
bf4c2eef0c | ||
|
|
defe9225c7 | ||
|
|
9ce19acb4a | ||
|
|
d1174be6f7 | ||
|
|
07569221dd | ||
|
|
4c9136819f | ||
|
|
11cd13d52d | ||
|
|
351fbf4411 | ||
|
|
bbb6f5d175 | ||
|
|
2c7a1a2b8a | ||
|
|
9611f04c31 | ||
|
|
3795da080b | ||
|
|
3139734254 | ||
|
|
b52f7c21e9 | ||
|
|
8dde22f789 | ||
|
|
319f531f01 | ||
|
|
0d887b247a | ||
|
|
21ca0a46ee | ||
|
|
96d721586e | ||
|
|
d625556278 | ||
|
|
eb413e11f9 | ||
|
|
284a7f3b70 | ||
|
|
6b2a0e0412 | ||
|
|
08471d9330 | ||
|
|
6c515fc4f2 | ||
|
|
f7acf5d7f5 | ||
|
|
844c1064cc | ||
|
|
ebeb22a18e | ||
|
|
bcf76063ec | ||
|
|
7fea44015c | ||
|
|
a3098f2893 | ||
|
|
25cce356a5 | ||
|
|
b01f469e93 | ||
|
|
f1f2eff680 | ||
|
|
1f42c3cbc9 | ||
|
|
455964acd3 | ||
|
|
0d82847868 | ||
|
|
2fa5ac147a | ||
|
|
edc8de5aa1 | ||
|
|
e6b7e21f58 | ||
|
|
8136012312 | ||
|
|
9979be1284 | ||
|
|
40de4cb1d0 | ||
|
|
c8269e35ad | ||
|
|
bba9af2abe | ||
|
|
168c730e7d | ||
|
|
21425ee184 | ||
|
|
33ee2dd3dd | ||
|
|
0620840fee | ||
|
|
093d386057 | ||
|
|
3836bf37f1 | ||
|
|
4c0bc843f8 | ||
|
|
72fd0c9540 | ||
|
|
4d1d11b6fd | ||
|
|
015d9a2de7 | ||
|
|
e2b131457a | ||
|
|
fdf3f23589 | ||
|
|
a747edbd1b | ||
|
|
48681849b5 | ||
|
|
6cdb2cd12a | ||
|
|
98c9e82f60 | ||
|
|
e905226b5e | ||
|
|
1a7ee1bfba | ||
|
|
c2a547c522 | ||
|
|
c2ca54a1ae | ||
|
|
1394187742 | ||
|
|
eff6c42a67 | ||
|
|
e218ee3b12 | ||
|
|
6298a76035 | ||
|
|
96894a0e7c | ||
|
|
e3b0dcce79 | ||
|
|
3718641068 | ||
|
|
76d3f4ee69 | ||
|
|
771b603c7b | ||
|
|
6f4b0802e6 | ||
|
|
94402436b4 | ||
|
|
0576b8fab1 | ||
|
|
1483a44689 | ||
|
|
64f9ec3859 | ||
|
|
240cb31ba3 | ||
|
|
602d1ec4c1 | ||
|
|
7129c46789 | ||
|
|
c22780a020 | ||
|
|
653de43d3f | ||
|
|
4b36eedff5 | ||
|
|
51612e3288 | ||
|
|
0aacf04bb0 | ||
|
|
fff22188f3 | ||
|
|
baaccf7846 | ||
|
|
a8bb9e4b03 | ||
|
|
0b478b9881 | ||
|
|
efad765d4f | ||
|
|
fa6d8ca384 | ||
|
|
4c67224b27 | ||
|
|
fdca02cb2f | ||
|
|
de754c3c9b | ||
|
|
4d1ae243e8 | ||
|
|
f6afbab10c | ||
|
|
eaa22bb965 | ||
|
|
78766f7a6f | ||
|
|
c9d7f1a89b | ||
|
|
73a892abf4 | ||
|
|
7d9aea7ab3 | ||
|
|
9296c03cb0 | ||
|
|
880249c533 | ||
|
|
79e67b97e0 | ||
|
|
7fc73a6a74 | ||
|
|
f3ef3c76ee | ||
|
|
e068e895b1 | ||
|
|
f9ef8fb861 | ||
|
|
f2d9bb50f8 | ||
|
|
e88cb216e1 | ||
|
|
2eb6ec5e5e | ||
|
|
5c93c55ebe | ||
|
|
81c03f123d | ||
|
|
725d831203 | ||
|
|
01e20ce277 | ||
|
|
52812836ab | ||
|
|
9482bc0a64 | ||
|
|
8c806a95e1 | ||
|
|
8a3173cbd7 | ||
|
|
cd8b984374 | ||
|
|
38eb0b0a5e | ||
|
|
95d71ffa42 | ||
|
|
097137d573 | ||
|
|
675d4524b8 | ||
|
|
07f2ff6260 | ||
|
|
41c00f235c | ||
|
|
4593aa48bf | ||
|
|
2c6b85f57f | ||
|
|
db373dbf5f | ||
|
|
d4f91f35a0 | ||
|
|
1c6206d1b3 | ||
|
|
475f752067 | ||
|
|
17b4f46f4c | ||
|
|
8b90e84f98 | ||
|
|
831c1b737f | ||
|
|
bcdac6216e | ||
|
|
743f65a2fe | ||
|
|
7f20fe4c06 | ||
|
|
8454e8c8bc | ||
|
|
daf8f96839 | ||
|
|
eadbec7427 | ||
|
|
ac75cc040a | ||
|
|
d7484a9078 | ||
|
|
73b2bf9c50 | ||
|
|
830641b0e9 | ||
|
|
8eece2a22c | ||
|
|
42a3f70073 | ||
|
|
cfa6fc4cfe | ||
|
|
ec97345c31 | ||
|
|
d950fb038d | ||
|
|
39c670bed3 | ||
|
|
e58ffa2c6e | ||
|
|
1846988499 | ||
|
|
999996ab67 | ||
|
|
7150b3f46c | ||
|
|
c82b4d0c4d | ||
|
|
2e6189e09e | ||
|
|
0a97dd7112 | ||
|
|
1c69b5a349 | ||
|
|
37654d0307 | ||
|
|
e953e81017 | ||
|
|
595ca416e9 | ||
|
|
976456fb40 | ||
|
|
4eceed308c | ||
|
|
3d37d97bf7 | ||
|
|
7ec00235c7 | ||
|
|
9457994332 | ||
|
|
cce697ec76 | ||
|
|
81a819117c | ||
|
|
814b1f4ac6 | ||
|
|
afc88419c3 | ||
|
|
7a67432b47 | ||
|
|
ab3556a6d2 | ||
|
|
57eabfe429 | ||
|
|
ae5658ca2b | ||
|
|
ff2e839fd6 | ||
|
|
2409fa30bc | ||
|
|
6e5574d5d3 | ||
|
|
a08aab1a83 | ||
|
|
627df99f99 | ||
|
|
f3c71765b6 | ||
|
|
2e3023f82d | ||
|
|
4e6e8ee79a | ||
|
|
c755471cce | ||
|
|
2ecabd9bde | ||
|
|
8f166908d1 | ||
|
|
3dce48fc46 | ||
|
|
78177505e2 | ||
|
|
5df9aba9d7 | ||
|
|
0e4cb3d272 | ||
|
|
da138e8ec9 | ||
|
|
7a79dd62a5 | ||
|
|
7c352011ce | ||
|
|
83158493bf | ||
|
|
a824dad7cd | ||
|
|
4deaf1bc07 | ||
|
|
121ff1f73a | ||
|
|
884b47c1a9 | ||
|
|
c943fa0c6a | ||
|
|
87a952e3bc | ||
|
|
960b876f0d | ||
|
|
20db1645d7 | ||
|
|
1cf36daf3b | ||
|
|
3fa59c2cc3 | ||
|
|
42892dcc0c | ||
|
|
39145006be | ||
|
|
ce5bc2e4d0 | ||
|
|
fe2871c9b9 | ||
|
|
f2fdbec692 | ||
|
|
27d205e00b | ||
|
|
dd6ee059cf | ||
|
|
74a60405c2 | ||
|
|
ca3b7b3e8a | ||
|
|
88f19a3f73 | ||
|
|
68d5e0ab08 | ||
|
|
194f6cefd4 | ||
|
|
c24108b8a6 | ||
|
|
5155558cf0 | ||
|
|
e6d48fda84 | ||
|
|
ee83b205e7 | ||
|
|
de3918ec11 | ||
|
|
5a6bea4916 | ||
|
|
d03e85de9e | ||
|
|
bf6fe91cf7 | ||
|
|
3330864aaf | ||
|
|
5e26ac8ab9 | ||
|
|
7983ad12dc | ||
|
|
a8444a87ed | ||
|
|
f649590132 | ||
|
|
39ca790650 | ||
|
|
f11ff9a40d | ||
|
|
b322e6c950 | ||
|
|
e2b44b1093 | ||
|
|
67f1d7d083 | ||
|
|
c1e9886c62 | ||
|
|
88ccad2624 | ||
|
|
472213a9f9 | ||
|
|
2cb854fd32 | ||
|
|
3cbf9af9c0 | ||
|
|
c1887bbec9 | ||
|
|
b4552dd87a | ||
|
|
22d6ddb38a | ||
|
|
f7571ecbae | ||
|
|
cbdc3e4cfb | ||
|
|
b0674cf65c | ||
|
|
45ba29cb80 | ||
|
|
4af17d61a5 | ||
|
|
aeff331773 | ||
|
|
3aa9a0ddf3 | ||
|
|
121a1b1d20 | ||
|
|
ccd9ab1fbd | ||
|
|
662ca533ed | ||
|
|
81950f0eb9 | ||
|
|
760b18cb48 | ||
|
|
4939849cf9 | ||
|
|
de3cf85957 | ||
|
|
aca5c46a8c | ||
|
|
3e2934e61b | ||
|
|
e2df7c9307 | ||
|
|
a567892605 | ||
|
|
1f3dedf4b5 | ||
|
|
ecaffe2295 | ||
|
|
379911fd07 | ||
|
|
ecec6b0417 | ||
|
|
e3ca0ffdce | ||
|
|
2c4069b272 | ||
|
|
7cf08555df | ||
|
|
0ad03159e4 | ||
|
|
4a3ecb8371 | ||
|
|
b927ea8db0 | ||
|
|
8ebf6bfe30 | ||
|
|
663616c518 | ||
|
|
91d8ba9355 | ||
|
|
77fdcd17d5 | ||
|
|
0cb3308f81 | ||
|
|
b2f7b321ce | ||
|
|
3dc6cca493 | ||
|
|
94608fcb42 | ||
|
|
13631a8c53 | ||
|
|
ec7f3308a2 | ||
|
|
ac8fa280a1 | ||
|
|
22201b65f0 | ||
|
|
d11bcc6863 | ||
|
|
42dd5a8de6 | ||
|
|
4c14c4c514 | ||
|
|
a428188d9c | ||
|
|
9a1f90b0cc | ||
|
|
adc58a3be0 | ||
|
|
0b1a38da9a | ||
|
|
665f52608b | ||
|
|
30c8c68959 | ||
|
|
775a6a61af | ||
|
|
d6cb216531 | ||
|
|
2247b7111e | ||
|
|
60ce26c1dd | ||
|
|
4bb9685a2f | ||
|
|
1f51836bf9 | ||
|
|
5830db6f4f | ||
|
|
d96750c86c | ||
|
|
2cff53caca | ||
|
|
ba271c64ce | ||
|
|
84314bbdbf | ||
|
|
3c7daad157 | ||
|
|
1c5afe7743 | ||
|
|
a77688f243 | ||
|
|
36db90f3bb | ||
|
|
8a87d2b366 | ||
|
|
e16a0210e2 | ||
|
|
2df33ed471 | ||
|
|
f571986ab6 | ||
|
|
2e614d2cea | ||
|
|
8437c9ce53 | ||
|
|
8909d8d1f9 | ||
|
|
952fa51087 | ||
|
|
4553ee70bb | ||
|
|
9bdfa178f6 | ||
|
|
2d4e97d7f4 | ||
|
|
fafafcedac | ||
|
|
fc55536bbd | ||
|
|
bf063d5c37 | ||
|
|
2be0424703 | ||
|
|
4d394eb3dd | ||
|
|
3197801d00 | ||
|
|
63cb1194c5 | ||
|
|
e3d69c00f1 | ||
|
|
53eb2cdb05 | ||
|
|
ba89129e82 | ||
|
|
3f694430a9 | ||
|
|
c5103ca6af | ||
|
|
007400fa65 | ||
|
|
198ef3add0 | ||
|
|
ece60f8379 | ||
|
|
6e6626d019 | ||
|
|
ef6ae357c7 | ||
|
|
5dcb8fbbb7 | ||
|
|
0f54f14fb0 | ||
|
|
27b8773391 | ||
|
|
ec5970301f | ||
|
|
51df386fd3 | ||
|
|
b92a7c2979 | ||
|
|
a998e71c74 | ||
|
|
7e5aedebe2 | ||
|
|
067532d78e | ||
|
|
9a6054819a | ||
|
|
7708ee1536 | ||
|
|
d8bbf372c5 | ||
|
|
99e2d93373 | ||
|
|
71feb3d0e3 | ||
|
|
bb980c1860 | ||
|
|
832543fe52 | ||
|
|
36d596b038 | ||
|
|
6a2d074823 | ||
|
|
cecf95011d | ||
|
|
720d258e40 | ||
|
|
c7dd31807f | ||
|
|
550269592a | ||
|
|
64b5fbbb45 | ||
|
|
3bf464506e | ||
|
|
5379b1de8a | ||
|
|
f01722e960 | ||
|
|
24fa32cd69 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -33,3 +33,4 @@ _output
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
pkg/generated
|
||||
|
||||
19
Makefile
19
Makefile
@@ -182,7 +182,6 @@ dep:
|
||||
|
||||
mod:
|
||||
go get $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p'))
|
||||
go get github.com/Azure/azure-sdk-for-go@latest
|
||||
go mod tidy
|
||||
go mod vendor -v
|
||||
|
||||
@@ -233,3 +232,21 @@ endef
|
||||
help: export helpText:=$(helpText)
|
||||
help:
|
||||
@echo "$$helpText"
|
||||
|
||||
gen-model-api-check:
|
||||
which model-api-gen || (GO111MODULE=off go get -u yunion.io/x/code-generator/cmd/model-api-gen)
|
||||
|
||||
gen-model-api: gen-model-api-check
|
||||
./scripts/codegen.py model-api
|
||||
|
||||
gen-swagger-check:
|
||||
which swagger || (GO111MODULE=off go get -u github.com/go-swagger/go-swagger/cmd/swagger)
|
||||
which swagger-gen || (GO111MODULE=off go get -u yunion.io/x/code-generator/cmd/swagger-gen)
|
||||
which swagger-serve || (GO111MODULE=off go get -u yunion.io/x/code-generator/cmd/swagger-serve)
|
||||
|
||||
gen-swagger: gen-swagger-check
|
||||
./scripts/codegen.py swagger-code
|
||||
./scripts/codegen.py swagger-yaml
|
||||
|
||||
swagger-serve: gen-swagger
|
||||
./scripts/codegen.py swagger-serve
|
||||
|
||||
@@ -134,7 +134,11 @@ fi
|
||||
|
||||
rpmbuild --define "_topdir $BUILDROOT" -bb $SPEC_FILE
|
||||
|
||||
mkdir -p $OUTPUT_DIR
|
||||
cp -fr $RPM_DIR/* $OUTPUT_DIR/
|
||||
find $RPM_DIR -type f | while read f; do
|
||||
d="$(dirname "$f")"
|
||||
d="$OUTPUT_DIR/${d#$RPM_DIR}"
|
||||
mkdir -p "$d"
|
||||
cp $f $d
|
||||
done
|
||||
|
||||
rm -fr $BUILDROOT
|
||||
|
||||
1
build/cloudevent/vars
Normal file
1
build/cloudevent/vars
Normal file
@@ -0,0 +1 @@
|
||||
DESCRIPTION="Yunion Cloudevent"
|
||||
1
build/devtool/vars
Normal file
1
build/devtool/vars
Normal file
@@ -0,0 +1 @@
|
||||
DESCRIPTION="Yunion DevTools Server"
|
||||
File diff suppressed because one or more lines are too long
@@ -15,9 +15,6 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
//"fmt"
|
||||
//"strings"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
|
||||
44
cmd/climc/shell/associated_bills.go
Normal file
44
cmd/climc/shell/associated_bills.go
Normal file
@@ -0,0 +1,44 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type AssociatedBillListOptions struct {
|
||||
options.BaseListOptions
|
||||
StartDay int `help:"time range of the associated bills, example: 20060102" required:"true"`
|
||||
EndDay int `help:"time range of the associated bills, example: 20060102" required:"true"`
|
||||
|
||||
ResourceId string `help:"resource id"`
|
||||
}
|
||||
R(&AssociatedBillListOptions{}, "associated-bill-list", "List associated bills",
|
||||
func(s *mcclient.ClientSession, args *AssociatedBillListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.AssociatedBills.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.AssociatedBills.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
46
cmd/climc/shell/bucket_options.go
Normal file
46
cmd/climc/shell/bucket_options.go
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type BucketOptionsVerifyOptions struct {
|
||||
options.BaseListOptions
|
||||
CloudaccountId string `help:"cloudaccount Id" required:"true"`
|
||||
BillingReportBucket string `help:"S3 bucket that stores account billing report"`
|
||||
BillingFilePrefix string `help:"prefix of billing file name"`
|
||||
BillingBucketAccount string `help:"Id of cloudaccount that can access billing bucket"`
|
||||
UsageReportBucket string `help:"S3 bucket that stores account usage report"`
|
||||
UsageFilePrefix string `help:"prefix of usage file name"`
|
||||
UsageBucketAccount string `help:"Id of cloudaccount that can access usage bucket"`
|
||||
}
|
||||
R(&BucketOptionsVerifyOptions{}, "bucket-options-verify", "billing bucket connection test",
|
||||
func(s *mcclient.ClientSession, args *BucketOptionsVerifyOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.BucketOptions.PerformAction(s, args.CloudaccountId, "verify", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -21,10 +21,12 @@ import (
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
objectshell "yunion.io/x/onecloud/pkg/multicloud/objectstore"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -105,9 +107,11 @@ func init() {
|
||||
})
|
||||
|
||||
type BucketListObjectsOptions struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
Prefix string `help:"List objects with prefix"`
|
||||
Recursive bool `help:"List objects recursively"`
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
Prefix string `help:"List objects with prefix"`
|
||||
Recursive bool `help:"List objects recursively"`
|
||||
Limit int `help:"maximal items per request"`
|
||||
PagingMarker string `help:"paging marker"`
|
||||
}
|
||||
R(&BucketListObjectsOptions{}, "bucket-object-list", "List objects in a bucket", func(s *mcclient.ClientSession, args *BucketListObjectsOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
@@ -119,8 +123,11 @@ func init() {
|
||||
return err
|
||||
}
|
||||
|
||||
arrays, _ := result.GetArray("objects")
|
||||
listResult := modulebase.ListResult{Data: arrays}
|
||||
listResult := modulebase.ListResult{}
|
||||
err = result.Unmarshal(&listResult)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(&listResult, []string{})
|
||||
return nil
|
||||
})
|
||||
@@ -159,9 +166,10 @@ func init() {
|
||||
Path string `help:"Path to file to upload" required:"true"`
|
||||
|
||||
ContentLength int64 `help:"Content lenght (bytes)" default:"-1"`
|
||||
ContentType string `help:"Content type"`
|
||||
StorageClass string `help:"storage CLass"`
|
||||
Acl string `help:"object acl." choices:"private|public-read|public-read-write"`
|
||||
|
||||
objectshell.ObjectHeaderOptions
|
||||
}
|
||||
R(&BucketUploadObjectsOptions{}, "bucket-object-upload", "Upload an object into a bucket", func(s *mcclient.ClientSession, args *BucketUploadObjectsOptions) error {
|
||||
var body io.Reader
|
||||
@@ -187,7 +195,9 @@ func init() {
|
||||
return fmt.Errorf("required content-length")
|
||||
}
|
||||
|
||||
err := modules.Buckets.Upload(s, args.ID, args.KEY, body, args.ContentLength, args.ContentType, args.StorageClass, args.Acl)
|
||||
meta := args.ObjectHeaderOptions.Options2Header()
|
||||
|
||||
err := modules.Buckets.Upload(s, args.ID, args.KEY, body, args.ContentLength, args.StorageClass, args.Acl, meta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -290,4 +300,27 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketSetMetadataOptions struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
|
||||
Key []string `help:"Optional object key" json:"key"`
|
||||
|
||||
objectshell.ObjectHeaderOptions
|
||||
}
|
||||
R(&BucketSetMetadataOptions{}, "bucket-set-metadata", "Set metadata of object", func(s *mcclient.ClientSession, args *BucketSetMetadataOptions) error {
|
||||
input := api.BucketMetadataInput{}
|
||||
input.Key = args.Key
|
||||
input.Metadata = args.ObjectHeaderOptions.Options2Header()
|
||||
err := input.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "metadata", jsonutils.Marshal(input))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -16,9 +16,11 @@ package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
@@ -86,6 +88,19 @@ func init() {
|
||||
R(&options.SAliyunCloudAccountCreateOptions{}, "cloud-account-create-aliyun", "Create an Aliyun cloud account", func(s *mcclient.ClientSession, args *options.SAliyunCloudAccountCreateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("Aliyun"), "provider")
|
||||
options := jsonutils.NewDict()
|
||||
if len(args.OptionsBillingReportBucket) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
|
||||
}
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.(*jsonutils.JSONDict).Add(options, "options")
|
||||
}
|
||||
result, err := modules.Cloudaccounts.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -116,12 +131,41 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SGoogleCloudAccountCreateOptions{}, "cloud-account-create-google", "Create a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountCreateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("Google"), "provider")
|
||||
data, err := ioutil.ReadFile(args.GoogleJsonFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
authParams, err := jsonutils.Parse(data)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = jsonutils.Update(params, authParams)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Cloudaccounts.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SAWSCloudAccountCreateOptions{}, "cloud-account-create-aws", "Create an AWS cloud account", func(s *mcclient.ClientSession, args *options.SAWSCloudAccountCreateOptions) error {
|
||||
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
|
||||
options := jsonutils.NewDict()
|
||||
if len(args.OptionsBillingReportBucket) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
|
||||
}
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.Add(options, "options")
|
||||
}
|
||||
@@ -211,6 +255,17 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SCtyunCloudAccountCreateOptions{}, "cloud-account-create-ctyun", "Create a Ctyun cloud account", func(s *mcclient.ClientSession, args *options.SCtyunCloudAccountCreateOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("Ctyun"), "provider")
|
||||
result, err := modules.Cloudaccounts.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudaccountUpdateOptions struct {
|
||||
ID string `help:"ID or Name of cloud account"`
|
||||
Name string `help:"New name to update"`
|
||||
@@ -244,6 +299,34 @@ func init() {
|
||||
if params.Size() == 0 {
|
||||
return InvalidUpdateError()
|
||||
}
|
||||
|
||||
options := jsonutils.NewDict()
|
||||
if len(args.OptionsBillingReportBucket) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
|
||||
}
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.Add(options, "options")
|
||||
}
|
||||
removeOptions := make([]string, 0)
|
||||
if args.RemoveOptionsBillingReportBucket {
|
||||
removeOptions = append(removeOptions, "billing_report_bucket")
|
||||
}
|
||||
if args.RemoveOptionsBillingBucketAccount {
|
||||
removeOptions = append(removeOptions, "billing_bucket_account")
|
||||
}
|
||||
if args.RemoveOptionsBillingFilePrefix {
|
||||
removeOptions = append(removeOptions, "billing_file_prefix")
|
||||
}
|
||||
if len(removeOptions) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(removeOptions), "remove_options")
|
||||
}
|
||||
|
||||
result, err := modules.Cloudaccounts.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -301,6 +384,12 @@ func init() {
|
||||
if len(args.OptionsBillingReportBucket) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
|
||||
}
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.Add(options, "options")
|
||||
}
|
||||
@@ -308,6 +397,12 @@ func init() {
|
||||
if args.RemoveOptionsBillingReportBucket {
|
||||
removeOptions = append(removeOptions, "billing_report_bucket")
|
||||
}
|
||||
if args.RemoveOptionsBillingBucketAccount {
|
||||
removeOptions = append(removeOptions, "billing_bucket_account")
|
||||
}
|
||||
if args.RemoveOptionsBillingFilePrefix {
|
||||
removeOptions = append(removeOptions, "billing_file_prefix")
|
||||
}
|
||||
if len(removeOptions) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(removeOptions), "remove_options")
|
||||
}
|
||||
@@ -388,6 +483,19 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SCtyunCloudAccountUpdateOptions{}, "cloud-account-update-ctyun", "update a Ctyun cloud account", func(s *mcclient.ClientSession, args *options.SCtyunCloudAccountUpdateOptions) error {
|
||||
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
|
||||
if params.Size() == 0 {
|
||||
return InvalidUpdateError()
|
||||
}
|
||||
result, err := modules.Cloudaccounts.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudaccountShowOptions struct {
|
||||
ID string `help:"ID or Name of cloud account"`
|
||||
}
|
||||
@@ -572,6 +680,16 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SCtyunCloudAccountUpdateCredentialOptions{}, "cloud-account-update-credential-ctyun", "Update credential of an Ctyun cloud account", func(s *mcclient.ClientSession, args *options.SCtyunCloudAccountUpdateCredentialOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "update-credential", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudaccountSyncOptions struct {
|
||||
ID string `help:"ID or Name of cloud account"`
|
||||
Force bool `help:"Force sync no matter what"`
|
||||
@@ -653,4 +771,49 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudaccountShareModeOptions struct {
|
||||
ID string `help:"ID or name of cloud account"`
|
||||
MODE string `help:"cloud account share mode" choices:"account_domain|system|provider_domain"`
|
||||
}
|
||||
R(&CloudaccountShareModeOptions{}, "cloud-account-share-mode", "Set share_mode of a cloud account", func(s *mcclient.ClientSession, args *CloudaccountShareModeOptions) error {
|
||||
input := api.CloudaccountShareModeInput{}
|
||||
input.ShareMode = args.MODE
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "share-mode", jsonutils.Marshal(input))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudaccountSyncSkusOptions struct {
|
||||
ID string `help:"ID or Name of cloud account"`
|
||||
RESOURCE string `help:"Resource of skus" choices:"serversku|elasticcachesku|dbinstance_sku"`
|
||||
Force bool `help:"Force sync no matter what"`
|
||||
Provider string `help:"provider to sync"`
|
||||
Region string `help:"region to sync"`
|
||||
}
|
||||
R(&CloudaccountSyncSkusOptions{}, "cloud-account-sync-skus", "Sync skus of a cloud account", func(s *mcclient.ClientSession, args *CloudaccountSyncSkusOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("resource", jsonutils.NewString(args.RESOURCE))
|
||||
if args.Force {
|
||||
params.Add(jsonutils.JSONTrue, "force")
|
||||
}
|
||||
|
||||
if len(args.Provider) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Provider), "cloudprovider")
|
||||
}
|
||||
|
||||
if len(args.Region) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Region), "cloudregion")
|
||||
}
|
||||
|
||||
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "sync-skus", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
43
cmd/climc/shell/cloudevents.go
Normal file
43
cmd/climc/shell/cloudevents.go
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
type CloudeventListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
Since string `help:"since time"`
|
||||
Until string `hlep:"until time"`
|
||||
}
|
||||
R(&CloudeventListOptions{}, "cloud-event-list", "List cloud events", func(s *mcclient.ClientSession, opts *CloudeventListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Cloudevents.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Cloudevents.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -49,7 +49,7 @@ func init() {
|
||||
type CloudregionCityListOptions struct {
|
||||
Manager string `help:"List objects belonging to the cloud provider"`
|
||||
Account string `help:"List objects belonging to the cloud account"`
|
||||
Provider string `help:"List objects from the provider" choices:"VMware|Aliyun|Qcloud|Azure|Aws|Huawei|Openstack|Ucloud|ZStack"`
|
||||
Provider string `help:"List objects from the provider" choices:"VMware|Aliyun|Qcloud|Azure|Aws|Huawei|Openstack|Ucloud|ZStack|Google|Ctyun"`
|
||||
City string `help:"List regions in the specified city"`
|
||||
|
||||
PublicCloud *bool `help:"List objects belonging to public cloud" json:"public_cloud"`
|
||||
|
||||
@@ -29,11 +29,11 @@ func init() {
|
||||
* 操作用户的通信地址(如果用户的通信地址不存在则进行添加;如果已存在则进行修改;如果设置空则进行删除。)
|
||||
*/
|
||||
type ContactsUpdateOptions struct {
|
||||
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
|
||||
CONTACTTYPE string `help:"The contact type email|mobile" choices:"email|mobile|dingtalk"`
|
||||
CONTACT string `help:"The contacts details mobile number or email address or dingtalk's userid, if set it the empty str means delete"`
|
||||
Status string `help:"Enabled or disabled contact status" choices:"enable|disable"`
|
||||
UpdateDingtalk bool `help:"if update dingtalk"`
|
||||
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
|
||||
CONTACTTYPE string `help:"The contact type email|mobile" choices:"email|mobile|dingtalk"`
|
||||
CONTACT string `help:"The contacts details mobile number or email address or dingtalk's userid, if set it the empty str means delete"`
|
||||
Status string `help:"Enabled or disabled contact status" choices:"enable|disable"`
|
||||
Pull []string `help:"pull some subcontacts(e.g., dingtalk, feishu, etc) related to mobile"`
|
||||
}
|
||||
R(&ContactsUpdateOptions{}, "contact-update", "Create, delete or update contact for user", func(s *mcclient.ClientSession, args *ContactsUpdateOptions) error {
|
||||
arr := jsonutils.NewArray()
|
||||
@@ -52,12 +52,14 @@ func init() {
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(arr, "contacts")
|
||||
if args.UpdateDingtalk {
|
||||
params.Add(jsonutils.JSONTrue, "update_dingtalk")
|
||||
|
||||
pulls := jsonutils.NewArray()
|
||||
for _, pull := range args.Pull {
|
||||
pulls.Add(jsonutils.NewString(pull))
|
||||
}
|
||||
params.Add(pulls, "pull")
|
||||
|
||||
contact, err := modules.Contacts.PerformAction(s, args.UID, "update-contact", params)
|
||||
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -66,6 +68,22 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type ContactsPullOptions struct {
|
||||
UID string `help:"The user you wanna pull contact"`
|
||||
CONTACTTYPE string `help:"The contact type"`
|
||||
}
|
||||
R(&ContactsPullOptions{}, "contact-pull", "Pull contact", func(s *mcclient.ClientSession, args *ContactsPullOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("contacts", jsonutils.NewArray())
|
||||
params.Set("pull", jsonutils.NewArray(jsonutils.NewString(args.CONTACTTYPE)))
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(contact)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ContactsDeleteOptions struct {
|
||||
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
|
||||
CONTACTTYPE string `help:"The contact type email|mobile|dingtalk" choices:"email|mobile|dingtalk"`
|
||||
@@ -78,7 +96,7 @@ func init() {
|
||||
arr.Add(tmpObj)
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(arr, "contacts")
|
||||
contact, err := modules.Contacts.PerformAction(s, args.UID, "update-contact", params)
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -133,7 +151,7 @@ func init() {
|
||||
|
||||
params.Add(jsonutils.JSONTrue, "details")
|
||||
|
||||
result, err := modules.Contacts.Get(s, args.UID, params)
|
||||
result, err := modules.Contacts.CustomizedGet(s, args.UID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -166,19 +184,10 @@ func init() {
|
||||
CONTACT string `help:"The contacts details mobile number or email address"`
|
||||
}
|
||||
R(&ContactsVerifyOptions{}, "contact-verify-trigger", "Trigger contact verify", func(s *mcclient.ClientSession, args *ContactsVerifyOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.CONTACT_TYPE), "contact_type")
|
||||
params.Add(jsonutils.NewString(args.CONTACT), "contact")
|
||||
/*
|
||||
if len(args.Email) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Email), "email")
|
||||
}
|
||||
if len(args.Mobile) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Mobile), "mobile")
|
||||
}
|
||||
*/
|
||||
|
||||
_, err := modules.Contacts.PerformAction(s, args.UID, "verify", params)
|
||||
tmpDict := jsonutils.NewDict()
|
||||
tmpDict.Add(jsonutils.NewString(args.CONTACT_TYPE), "contact_type")
|
||||
tmpDict.Add(jsonutils.NewString(args.CONTACT), "contact")
|
||||
_, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "verify", tmpDict)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
64
cmd/climc/shell/dbinstance_accounts.go
Normal file
64
cmd/climc/shell/dbinstance_accounts.go
Normal file
@@ -0,0 +1,64 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type DBInstanceAccountListOptions struct {
|
||||
options.BaseListOptions
|
||||
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
|
||||
}
|
||||
R(&DBInstanceAccountListOptions{}, "dbinstance-account-list", "List DB instance accounts", func(s *mcclient.ClientSession, opts *DBInstanceAccountListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.DBInstanceAccounts.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.DBInstanceAccounts.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceAccountIdOptions struct {
|
||||
ID string `help:"ID or Name of DBInstanceaccount"`
|
||||
}
|
||||
|
||||
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-show", "Show DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
|
||||
account, err := modules.DBInstanceAccounts.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(account)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-delete", "Delete DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
|
||||
account, err := modules.DBInstanceAccounts.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(account)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -312,37 +312,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceAccountListOptions struct {
|
||||
options.BaseListOptions
|
||||
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
|
||||
}
|
||||
R(&DBInstanceAccountListOptions{}, "dbinstance-account-list", "List DB instance accounts", func(s *mcclient.ClientSession, opts *DBInstanceAccountListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.DBInstanceAccounts.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.DBInstanceAccounts.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceAccountIdOptions struct {
|
||||
ID string `help:"ID or Name of DBInstanceaccount"`
|
||||
}
|
||||
|
||||
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-show", "Show DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
|
||||
account, err := modules.DBInstanceAccounts.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(account)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstancePrivilegeListOptions struct {
|
||||
options.BaseListOptions
|
||||
DBInstanceaccount string `help:"ID or Name of DBInstanceaccount" json:"dbinstanceaccount"`
|
||||
@@ -362,4 +331,21 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceChangeOwnerOptions struct {
|
||||
ID string `help:"DBInstance to change owner" json:"-"`
|
||||
PROJECT string `help:"Project ID or change" json:"tenant"`
|
||||
}
|
||||
R(&DBInstanceChangeOwnerOptions{}, "dbinstance-change-owner", "Change owner porject of a dbinstance", func(s *mcclient.ClientSession, opts *DBInstanceChangeOwnerOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
222
cmd/climc/shell/devtoolcronjob.go
Normal file
222
cmd/climc/shell/devtoolcronjob.go
Normal file
@@ -0,0 +1,222 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func paramValidator(param jsonutils.JSONObject) (bool, error) {
|
||||
// TODO 移到 server 端
|
||||
log.Infof("paramValidator: param: %+v", param)
|
||||
interval, err := param.Int("interval")
|
||||
if err != nil {
|
||||
return true, nil
|
||||
}
|
||||
day, err := param.Int("day")
|
||||
if err != nil {
|
||||
return true, nil
|
||||
}
|
||||
if interval == 0 && day == 0 {
|
||||
return false, fmt.Errorf("interval and day can not be 0 at the same time")
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
type CronjobListOptions struct {
|
||||
options.BaseListOptions
|
||||
Name string `help:"cloud region ID or Name" json:"-"`
|
||||
}
|
||||
|
||||
R(&CronjobListOptions{}, "devtoolcronjob-list", "List Devtool Cronjobs", func(s *mcclient.ClientSession, args *CronjobListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var result *modulebase.ListResult
|
||||
result, err = modules.DevToolCronjobs.List(s, params)
|
||||
printList(result, modules.DevToolCronjobs.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type CronjobCreateOptions struct {
|
||||
NAME string `help:"Ansible Playbook ID or Name" json:"-"`
|
||||
Day int `help:"Cronjob runs at given day" default:"0"`
|
||||
Hour int `help:"Cronjob runs at given hour" default:"0"`
|
||||
Min int `help:"Cronjob runs at given min" default:"0"`
|
||||
Sec int `help:"Cronjob runs at given sec" default:"0"`
|
||||
Interval int64 `help:"Cronjob runs at given interval" default:"0"`
|
||||
Start bool `help:"start job when created" default:"false"`
|
||||
Enabled bool `help:"Set job status enabled" default:"false"`
|
||||
}
|
||||
R(
|
||||
&CronjobCreateOptions{},
|
||||
"devtoolcronjob-create",
|
||||
"Create a cronjob repo component",
|
||||
func(s *mcclient.ClientSession, args *CronjobCreateOptions) error {
|
||||
result, err := modules.AnsiblePlaybooks.Get(s, args.NAME, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ansiblePlaybookName, err := result.GetString("name")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ansiblePlaybookID, err := result.GetString("id")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(ansiblePlaybookName), "name")
|
||||
|
||||
params.Add(jsonutils.NewString(ansiblePlaybookID), "ansible_playbook_id")
|
||||
|
||||
if args.Start {
|
||||
params.Add(jsonutils.JSONTrue, "start")
|
||||
|
||||
}
|
||||
if args.Enabled {
|
||||
params.Add(jsonutils.JSONTrue, "enabled")
|
||||
} else if args.Interval > 0 {
|
||||
params.Add(jsonutils.NewInt(int64(args.Interval)), "interval")
|
||||
} else {
|
||||
params.Add(jsonutils.NewInt(int64(0)), "interval")
|
||||
params.Add(jsonutils.NewInt(int64(args.Day)), "day")
|
||||
params.Add(jsonutils.NewInt(int64(args.Hour)), "hour")
|
||||
params.Add(jsonutils.NewInt(int64(args.Min)), "min")
|
||||
params.Add(jsonutils.NewInt(int64(args.Sec)), "sec")
|
||||
}
|
||||
ok, err := paramValidator(params)
|
||||
if err != nil || !ok {
|
||||
log.Infof("paramValidator error %s", err)
|
||||
return err
|
||||
}
|
||||
cronjob, err := modules.DevToolCronjobs.Create(s, params)
|
||||
if err != nil {
|
||||
log.Errorf("modules.DevToolCronjobs.Create error %s", err)
|
||||
return err
|
||||
}
|
||||
printObject(cronjob)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type DevToolCronjobShowOptions struct {
|
||||
ID string `help:"ID or Name of the DevToolCronjob to show"`
|
||||
}
|
||||
R(&DevToolCronjobShowOptions{}, "devtoolcronjob-show", "Show cronjob details", func(s *mcclient.ClientSession, args *DevToolCronjobShowOptions) error {
|
||||
result, err := modules.DevToolCronjobs.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DevToolCronjobUpdateOptions struct {
|
||||
ID string `help:"ID or Name of DevToolCronjob to update"`
|
||||
Day int `help:"Cronjob runs at given day" json:"-" default:"-1"`
|
||||
Hour int `help:"Cronjob runs at given hour" json:"-" default:"-1"`
|
||||
Min int `help:"Cronjob runs at given min" default:"-1"`
|
||||
Sec int `help:"Cronjob runs at given sec" default:"-1"`
|
||||
Interval int `help:"Cronjob runs at given interval" default:"-1"`
|
||||
Start bool `help:"start job when created"`
|
||||
Stop bool `help:"start job when created"`
|
||||
Enable bool `help:"Set job status enabled"`
|
||||
Disable bool `help:"Set job status enabled"`
|
||||
}
|
||||
R(&DevToolCronjobUpdateOptions{}, "devtoolcronjob-update", "Update DevToolCronjob", func(s *mcclient.ClientSession, args *DevToolCronjobUpdateOptions) error {
|
||||
result, err := modules.DevToolCronjobs.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
interval, _ := result.Int("interval")
|
||||
day, _ := result.Int("day")
|
||||
params.Add(jsonutils.NewString(args.ID), "id")
|
||||
params.Add(jsonutils.NewInt(int64(interval)), "interval")
|
||||
params.Add(jsonutils.NewInt(int64(day)), "day")
|
||||
|
||||
log.Infof("DevToolCronjobUpdateOptions args: %+v", args)
|
||||
if args.Interval >= 0 {
|
||||
params.Add(jsonutils.NewInt(int64(args.Interval)), "interval")
|
||||
if args.Interval > 0 {
|
||||
params.Add(jsonutils.NewInt(0), "day")
|
||||
}
|
||||
} else if args.Day >= 0 {
|
||||
params.Add(jsonutils.NewInt(int64(args.Day)), "day")
|
||||
if args.Day > 0 {
|
||||
params.Add(jsonutils.NewInt(0), "interval")
|
||||
}
|
||||
}
|
||||
if args.Hour >= 0 {
|
||||
params.Add(jsonutils.NewInt(int64(args.Hour)), "hour")
|
||||
}
|
||||
if args.Min >= 0 {
|
||||
params.Add(jsonutils.NewInt(int64(args.Min)), "min")
|
||||
}
|
||||
if args.Sec >= 0 {
|
||||
params.Add(jsonutils.NewInt(int64(args.Sec)), "sec")
|
||||
}
|
||||
|
||||
ok, err := paramValidator(params)
|
||||
if err != nil || !ok {
|
||||
return err
|
||||
}
|
||||
|
||||
if args.Start && args.Stop {
|
||||
return fmt.Errorf("can not set job start and stop at the same time")
|
||||
} else if args.Start {
|
||||
params.Add(jsonutils.JSONTrue, "start")
|
||||
} else if args.Stop {
|
||||
params.Add(jsonutils.JSONFalse, "start")
|
||||
}
|
||||
if args.Enable && args.Disable {
|
||||
return fmt.Errorf("can not set job enabled and disabled at the same time")
|
||||
} else if args.Enable {
|
||||
params.Add(jsonutils.JSONTrue, "enabled")
|
||||
} else if args.Disable {
|
||||
params.Add(jsonutils.JSONFalse, "enabled")
|
||||
}
|
||||
|
||||
result, err = modules.DevToolCronjobs.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DevToolCronjobShowOptions{}, "devtoolcronjob-delete", "Delete DevToolCronjob", func(s *mcclient.ClientSession, args *DevToolCronjobShowOptions) error {
|
||||
result, err := modules.DevToolCronjobs.Delete(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
154
cmd/climc/shell/devtooltemplate.go
Normal file
154
cmd/climc/shell/devtooltemplate.go
Normal file
@@ -0,0 +1,154 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
printAnsiblePlaybookObject := func(obj jsonutils.JSONObject) {
|
||||
dict := obj.(*jsonutils.JSONDict)
|
||||
pbJson, err := dict.Get("playbook")
|
||||
if err != nil {
|
||||
printObject(obj)
|
||||
return
|
||||
}
|
||||
pbStr := pbJson.YAMLString()
|
||||
dict.Set("playbook", jsonutils.NewString(pbStr))
|
||||
printObject(obj)
|
||||
}
|
||||
|
||||
type TemplateListOptions struct {
|
||||
options.BaseListOptions
|
||||
Name string `help:"cloud region ID or Name" json:"-"`
|
||||
}
|
||||
|
||||
R(&TemplateListOptions{}, "devtooltemplate-list", "List Devtool Templates", func(s *mcclient.ClientSession, args *TemplateListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var result *modulebase.ListResult
|
||||
result, err = modules.DevToolTemplates.List(s, params)
|
||||
printList(result, modules.DevToolTemplates.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(
|
||||
&options.DevtoolTemplateCreateOptions{},
|
||||
"devtooltemplate-create",
|
||||
"Create a template repo component",
|
||||
func(s *mcclient.ClientSession, opts *options.DevtoolTemplateCreateOptions) error {
|
||||
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("devtool playbook create opts: %+v", params)
|
||||
apb, err := modules.DevToolTemplates.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printAnsiblePlaybookObject(apb)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
R(
|
||||
&options.DevtoolTemplateIdOptions{},
|
||||
"devtooltemplate-show",
|
||||
"Show devtool template",
|
||||
func(s *mcclient.ClientSession, opts *options.DevtoolTemplateIdOptions) error {
|
||||
apb, err := modules.DevToolTemplates.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printAnsiblePlaybookObject(apb)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
R(
|
||||
&options.DevtoolTemplateBindingOptions{},
|
||||
"devtooltemplate-bind",
|
||||
"Binding devtool template to a host/vm",
|
||||
func(s *mcclient.ClientSession, opts *options.DevtoolTemplateBindingOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("server_id", jsonutils.NewString(opts.ServerID))
|
||||
apb, err := modules.DevToolTemplates.PerformAction(s, opts.ID, "bind", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printAnsiblePlaybookObject(apb)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
R(
|
||||
&options.DevtoolTemplateBindingOptions{},
|
||||
"devtooltemplate-unbind",
|
||||
"Binding devtool template to a host/vm",
|
||||
func(s *mcclient.ClientSession, opts *options.DevtoolTemplateBindingOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("server_id", jsonutils.NewString(opts.ServerID))
|
||||
apb, err := modules.DevToolTemplates.PerformAction(s, opts.ID, "unbind", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printAnsiblePlaybookObject(apb)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
R(
|
||||
&options.DevtoolTemplateIdOptions{},
|
||||
"devtooltemplate-delete",
|
||||
"Delete devtool template",
|
||||
func(s *mcclient.ClientSession, opts *options.DevtoolTemplateIdOptions) error {
|
||||
apb, err := modules.DevToolTemplates.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printAnsiblePlaybookObject(apb)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
R(
|
||||
&options.DevtoolTemplateUpdateOptions{},
|
||||
"devtooltemplate-update",
|
||||
"Update ansible playbook",
|
||||
func(s *mcclient.ClientSession, opts *options.DevtoolTemplateUpdateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
apb, err := modules.DevToolTemplates.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printAnsiblePlaybookObject(apb)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
51
cmd/climc/shell/globalvpcs.go
Normal file
51
cmd/climc/shell/globalvpcs.go
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type GlobalVpcListOptions struct {
|
||||
options.BaseListOptions
|
||||
}
|
||||
R(&GlobalVpcListOptions{}, "global-vpc-list", "List global vpcs", func(s *mcclient.ClientSession, args *GlobalVpcListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.GlobalVpcs.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.GlobalVpcs.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type GlobalVpcShowOptions struct {
|
||||
ID string `help:"ID or Name of globalvpc"`
|
||||
}
|
||||
R(&GlobalVpcShowOptions{}, "global-vpc-show", "Show details of a global vpc", func(s *mcclient.ClientSession, args *GlobalVpcShowOptions) error {
|
||||
result, err := modules.GlobalVpcs.GetById(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -79,7 +79,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
users, err := modules.Groups.GetUsers(s, grpId)
|
||||
users, err := modules.Groups.GetUsers(s, grpId, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
168
cmd/climc/shell/guest_template.go
Normal file
168
cmd/climc/shell/guest_template.go
Normal file
@@ -0,0 +1,168 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
type GuestTemplateListOptions struct {
|
||||
options.BaseListOptions
|
||||
}
|
||||
|
||||
R(&GuestTemplateListOptions{}, "server-template-list", "List server template", func(s *mcclient.ClientSession,
|
||||
opts *GuestTemplateListOptions) error {
|
||||
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.GuestTemplate.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.GuestTemplate.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type GuestTemplateCreateOptions struct {
|
||||
options.ServerCreateOptionalOptions
|
||||
NAME string `help:"Name of server template" json:"-"`
|
||||
}
|
||||
|
||||
R(&GuestTemplateCreateOptions{}, "server-template-create", "Create a server template",
|
||||
func(s *mcclient.ClientSession,
|
||||
opts *GuestTemplateCreateOptions) error {
|
||||
|
||||
params, err := opts.OptionalParams()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if options.BoolV(opts.DryRun) {
|
||||
fmt.Println("no support operator")
|
||||
return nil
|
||||
}
|
||||
|
||||
dict := jsonutils.NewDict()
|
||||
if opts.GenerateName {
|
||||
dict.Add(jsonutils.NewString(opts.NAME), "generate_name")
|
||||
} else {
|
||||
dict.Add(jsonutils.NewString(opts.NAME), "name")
|
||||
}
|
||||
dict.Add(params.JSON(params), "content")
|
||||
tem, err := modules.GuestTemplate.Create(s, dict)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(tem)
|
||||
return nil
|
||||
})
|
||||
|
||||
type GuestTemplateUpdateOptions struct {
|
||||
options.ServerCreateOptionalOptions
|
||||
ID string `help:"ID of server template"`
|
||||
name string `help:"name of server template"`
|
||||
}
|
||||
|
||||
R(&GuestTemplateUpdateOptions{}, "server-template-update", "Update a server template",
|
||||
func(s *mcclient.ClientSession, opts *GuestTemplateUpdateOptions) error {
|
||||
|
||||
params, err := opts.OptionalParams()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if options.BoolV(opts.DryRun) {
|
||||
fmt.Println("no support operator")
|
||||
return nil
|
||||
}
|
||||
dict := jsonutils.NewDict()
|
||||
if len(opts.name) != 0 {
|
||||
dict.Add(jsonutils.NewString(opts.name), "name")
|
||||
}
|
||||
dict.Add(params.JSON(params), "content")
|
||||
tem, err := modules.GuestTemplate.Update(s, opts.ID, dict)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(tem)
|
||||
return nil
|
||||
})
|
||||
|
||||
type GuestTemplateOptions struct {
|
||||
ID string `help:"ID or Name of server template"`
|
||||
}
|
||||
|
||||
R(&GuestTemplateOptions{}, "server-template-show", "Show a server template",
|
||||
func(s *mcclient.ClientSession, opts *GuestTemplateOptions) error {
|
||||
tem, err := modules.GuestTemplate.Get(s, opts.ID, jsonutils.JSONNull)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(tem)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&GuestTemplateOptions{}, "server-tempalte-delete", "Delete a server template",
|
||||
func(s *mcclient.ClientSession, opts *GuestTemplateOptions) error {
|
||||
|
||||
tem, err := modules.GuestTemplate.Delete(s, opts.ID, jsonutils.JSONNull)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(tem)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
R(&GuestTemplateOptions{}, "server-template-private", "Private server template",
|
||||
func(s *mcclient.ClientSession, opts *GuestTemplateOptions) error {
|
||||
tem, err := modules.GuestTemplate.PerformAction(s, opts.ID, "private", jsonutils.JSONNull)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(tem)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type GuestTemplatePublicOptions struct {
|
||||
ID string `help:"ID or Name of server template"`
|
||||
PublicScope string `help:"public scope"`
|
||||
}
|
||||
|
||||
R(&GuestTemplatePublicOptions{}, "server-template-public", "Public server template",
|
||||
func(s *mcclient.ClientSession, opts *GuestTemplatePublicOptions) error {
|
||||
|
||||
dict := jsonutils.NewDict()
|
||||
if len(opts.PublicScope) != 0 {
|
||||
dict.Add(jsonutils.NewString(opts.PublicScope), "public_scope")
|
||||
}
|
||||
tem, err := modules.GuestTemplate.PerformAction(s, opts.ID, "public", dict)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(tem)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -38,7 +38,7 @@ func init() {
|
||||
Occupied bool `help:"show occupid host" json:"-"`
|
||||
Enabled bool `help:"Show enabled host only" json:"-"`
|
||||
Disabled bool `help:"Show disabled host only" json:"-"`
|
||||
HostType string `help:"Host type filter" choices:"baremetal|hypervisor|esxi|kubelet|hyperv|aliyun|azure|qcloud|aws|huawei|ucloud"`
|
||||
HostType string `help:"Host type filter" choices:"baremetal|hypervisor|esxi|kubelet|hyperv|aliyun|azure|qcloud|aws|huawei|ucloud|google|ctyun"`
|
||||
AnyMac string `help:"Mac matches one of the host's interface"`
|
||||
|
||||
IsBaremetal *bool `help:"filter host list by is_baremetal=true|false"`
|
||||
@@ -53,6 +53,10 @@ func init() {
|
||||
|
||||
Uuid string `help:"find host with given system uuid"`
|
||||
|
||||
CdromBoot *bool `help:"filter hosts list by cdrom_boot=true|false"`
|
||||
|
||||
Sn string `help:"find host by sn"`
|
||||
|
||||
options.BaseListOptions
|
||||
}
|
||||
R(&HostListOptions{}, "host-list", "List hosts", func(s *mcclient.ClientSession, opts *HostListOptions) error {
|
||||
@@ -74,6 +78,9 @@ func init() {
|
||||
if len(opts.Uuid) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Uuid), "uuid")
|
||||
}
|
||||
if len(opts.Sn) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Sn), "sn")
|
||||
}
|
||||
result, err := modules.Hosts.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -133,6 +140,12 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&HostOpsOptions{}, "host-sync-config", "Synchronize config of a host", func(s *mcclient.ClientSession, args *HostOpsOptions) error {
|
||||
results := modules.Hosts.BatchPerformAction(s, args.ID, "sync-config", nil)
|
||||
printBatchResults(results, modules.Hosts.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&HostOpsOptions{}, "host-prepare", "Prepare a host for installation", func(s *mcclient.ClientSession, args *HostOpsOptions) error {
|
||||
results := modules.Hosts.BatchPerformAction(s, args.ID, "prepare", nil)
|
||||
printBatchResults(results, modules.Hosts.GetColumns(s))
|
||||
@@ -200,6 +213,10 @@ func init() {
|
||||
// AccessIp string `help:"Change access ip, CAUTION!!!!"`
|
||||
AccessMac string `help:"Change baremetal access MAC, CAUTION!!!!"`
|
||||
Uuid string `help:"Change baremetal UUID, CAUTION!!!!"`
|
||||
|
||||
IpmiUsername string `help:"IPMI user"`
|
||||
IpmiPassword string `help:"IPMI password"`
|
||||
IpmiIpAddr string `help:"IPMI ip_addr"`
|
||||
}
|
||||
R(&HostUpdateOptions{}, "host-update", "Update information of a host", func(s *mcclient.ClientSession, args *HostUpdateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -230,6 +247,15 @@ func init() {
|
||||
if len(args.Uuid) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Uuid), "uuid")
|
||||
}
|
||||
if len(args.IpmiUsername) > 0 {
|
||||
params.Add(jsonutils.NewString(args.IpmiUsername), "ipmi_username")
|
||||
}
|
||||
if len(args.IpmiPassword) > 0 {
|
||||
params.Add(jsonutils.NewString(args.IpmiPassword), "ipmi_password")
|
||||
}
|
||||
if len(args.IpmiIpAddr) > 0 {
|
||||
params.Add(jsonutils.NewString(args.IpmiIpAddr), "ipmi_ip_addr")
|
||||
}
|
||||
if params.Size() == 0 {
|
||||
return fmt.Errorf("Not data to update")
|
||||
}
|
||||
@@ -352,16 +378,16 @@ func init() {
|
||||
ID string `help:"ID or Name of host"`
|
||||
WIRE string `help:"ID or Name of wire to attach"`
|
||||
MAC string `help:"Mac address of NIC"`
|
||||
INDEX int64 `help:"nic index"`
|
||||
Type string `help:"Nic type" choices:"admin|ipmi"`
|
||||
IpAddr string `help:"IP address"`
|
||||
Index int64 `help:"nic index" default:"-1"`
|
||||
}
|
||||
R(&HostAddNetIfOptions{}, "host-add-netif", "Host add a NIC", func(s *mcclient.ClientSession, args *HostAddNetIfOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.WIRE), "wire")
|
||||
params.Add(jsonutils.NewString(args.MAC), "mac")
|
||||
params.Add(jsonutils.JSONTrue, "link_up")
|
||||
params.Add(jsonutils.NewInt(args.Index), "index")
|
||||
params.Add(jsonutils.NewInt(args.INDEX), "index")
|
||||
if len(args.Type) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Type), "nic_type")
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/errors"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
@@ -165,8 +166,8 @@ func init() {
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
R(&GuestImageOptions{}, "guest-image-mark-unprotected", "Mark image protected", func(s *mcclient.ClientSession,
|
||||
args *GuestImageOptions) error {
|
||||
|
||||
@@ -178,7 +179,55 @@ func init() {
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
type GuestImageOperationOptions struct {
|
||||
ID []string `help:"Guest Image ID or Name"`
|
||||
}
|
||||
|
||||
type GuestImagePublicOptions struct {
|
||||
GuestImageOperationOptions
|
||||
Scope string `help:"sharing scope" choices:"system|domain"`
|
||||
ShareToProject []string `help:"Share to prject"`
|
||||
}
|
||||
|
||||
R(&GuestImageOperationOptions{}, "guest-image-private", "Make a guest image private",
|
||||
func(s *mcclient.ClientSession, args *GuestImageOperationOptions) error {
|
||||
if len(args.ID) == 0 {
|
||||
return errors.Error("No guest image ID provided")
|
||||
} else if len(args.ID) == 1 {
|
||||
result, err := modules.GuestImages.PerformAction(s, args.ID[0], "private", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
} else {
|
||||
results := modules.GuestImages.BatchPerformAction(s, args.ID, "private", nil)
|
||||
printBatchResults(results, modules.GuestImages.GetColumns(s))
|
||||
}
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
R(&GuestImagePublicOptions{}, "guest-image-public", "Make a guest image public",
|
||||
func(s *mcclient.ClientSession, args *GuestImagePublicOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.ID) == 0 {
|
||||
return errors.Error("No guest image ID provided")
|
||||
} else if len(args.ID) == 1 {
|
||||
result, err := modules.GuestImages.PerformAction(s, args.ID[0], "public", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
} else {
|
||||
results := modules.GuestImages.BatchPerformAction(s, args.ID, "public", params)
|
||||
printBatchResults(results, modules.GuestImages.GetColumns(s))
|
||||
}
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ type ImageOptionalOptions struct {
|
||||
OsDist string `help:"Distribution name of OS" metavar:"OS_DISTRIBUTION"`
|
||||
OsVersion string `help:"Version of OS"`
|
||||
OsCodename string `help:"Codename of OS"`
|
||||
OsArch string `help:"Os hardware architecture" choices:"x86|x86_64"`
|
||||
OsArch string `help:"Os hardware architecture" choices:"x86|x86_64|aarch32|aarch64"`
|
||||
OsLang string `help:"OS Language" choices:"zh_CN|en_US"`
|
||||
Preference int64 `help:"Disk preferences"`
|
||||
Notes string `help:"Notes about the image"`
|
||||
@@ -138,6 +138,7 @@ func init() {
|
||||
IsPublic string `help:"filter images public or not(True, False or None)" choices:"true|false"`
|
||||
IsStandard string `help:"filter images standard or non-standard" choices:"true|false"`
|
||||
Protected string `help:"filter images by protected" choices:"true|false"`
|
||||
IsUefi bool `help:"list uefi image"`
|
||||
Format []string `help:"Disk formats"`
|
||||
Name string `help:"Name filter"`
|
||||
}
|
||||
@@ -155,6 +156,9 @@ func init() {
|
||||
if len(args.Protected) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Protected), "protected")
|
||||
}
|
||||
if args.IsUefi {
|
||||
params.Add(jsonutils.JSONTrue, "uefi")
|
||||
}
|
||||
if len(args.Tenant) > 0 {
|
||||
tid, e := modules.Projects.GetId(s, args.Tenant, nil)
|
||||
if e != nil {
|
||||
@@ -217,9 +221,9 @@ func init() {
|
||||
})
|
||||
|
||||
type ImageUpdateOptions struct {
|
||||
ID string `help:"ID or Name of Image"`
|
||||
Name string `help:"New name of the image"`
|
||||
Description string `help:"Description of image"`
|
||||
ID []string `help:"ID or Name of Image"`
|
||||
Name string `help:"New name of the image"`
|
||||
Description string `help:"Description of image"`
|
||||
ImageOptionalOptions
|
||||
}
|
||||
|
||||
@@ -235,11 +239,8 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
img, err := modules.Images.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(img)
|
||||
result := modules.Images.BatchUpdate(s, args.ID, params)
|
||||
printBatchResults(result, modules.Images.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ func init() {
|
||||
ServiceType string `help:"Service Type"`
|
||||
ParentId string `help:"Parent ID"`
|
||||
ZoneId string `help:"Zone ID"`
|
||||
Guest string `help:"Guest ID or Name"`
|
||||
Server string `help:"Guest ID or Name"`
|
||||
}
|
||||
|
||||
R(&InstanceGroupListOptions{}, "instance-group-list", "List instance group", func(s *mcclient.ClientSession,
|
||||
|
||||
@@ -205,4 +205,70 @@ func initKubeCluster() {
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.IdentOptions{}, cmdN("components-status"), "Get cluster component status", func(s *mcclient.ClientSession, args *o.IdentOptions) error {
|
||||
ret, err := k8s.KubeClusters.GetSpecific(s, args.ID, "components-status", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.ClusterComponentTypeOptions{}, cmdN("component-setting"), "Get cluster component setting", func(s *mcclient.ClientSession, args *o.ClusterComponentTypeOptions) error {
|
||||
q := jsonutils.NewDict()
|
||||
q.Add(jsonutils.NewString(args.TYPE), "type")
|
||||
ret, err := k8s.KubeClusters.GetSpecific(s, args.ID, "component-setting", q)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.ClusterEnableComponentCephCSIOpt{}, cmdN("component-enable-ceph-csi"), "Enable cluster component", func(s *mcclient.ClientSession, args *o.ClusterEnableComponentCephCSIOpt) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "enable-component", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.ClusterDisableComponent{}, cmdN("component-disable"), "Enable cluster component", func(s *mcclient.ClientSession, args *o.ClusterDisableComponent) error {
|
||||
params := args.Params()
|
||||
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "disable-component", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.ClusterDisableComponent{}, cmdN("component-delete"), "Delete cluster component", func(s *mcclient.ClientSession, args *o.ClusterDisableComponent) error {
|
||||
params := args.Params()
|
||||
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "delete-component", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.ClusterUpdateComponentCephCSIOpt{}, cmdN("component-update-ceph-csi"), "Update cluster component", func(s *mcclient.ClientSession, args *o.ClusterUpdateComponentCephCSIOpt) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "update-component", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
9
cmd/climc/shell/k8s/event.go
Normal file
9
cmd/climc/shell/k8s/event.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package k8s
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
|
||||
)
|
||||
|
||||
func initEvent() {
|
||||
initK8sNamespaceResource("event", k8s.Events)
|
||||
}
|
||||
@@ -16,6 +16,11 @@ package k8s
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/ghodss/yaml"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
@@ -57,7 +62,7 @@ func init() {
|
||||
initPVC()
|
||||
initJob()
|
||||
initCronJob()
|
||||
|
||||
initEvent()
|
||||
initRbac()
|
||||
|
||||
initApp()
|
||||
@@ -217,6 +222,71 @@ func NewK8sNsResourceGetCmd(cmdN CmdNameFactory, manager modulebase.Manager) *Cm
|
||||
)
|
||||
}
|
||||
|
||||
func NewK8sNsResourceGetRawCmd(cmdN CmdNameFactory, manager k8s.IClusterResourceManager) *Cmd {
|
||||
return NewCommand(
|
||||
&o.NamespaceResourceGetOptions{},
|
||||
cmdN.Do("show-raw"),
|
||||
fmt.Sprintf("Show k8s %s raw data", cmdN.Kind),
|
||||
func(s *mcclient.ClientSession, args *o.NamespaceResourceGetOptions) error {
|
||||
ret, err := manager.GetRaw(s, args.NAME, args.Params())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObjectYAML(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func NewK8sResourceEditRawCmd(cmdN CmdNameFactory, manager k8s.IClusterResourceManager) *Cmd {
|
||||
return NewCommand(
|
||||
&o.NamespaceResourceGetOptions{},
|
||||
cmdN.Do("edit-raw"),
|
||||
fmt.Sprintf("Edit and update k8s %s raw data", cmdN.Kind),
|
||||
func(s *mcclient.ClientSession, args *o.NamespaceResourceGetOptions) error {
|
||||
rawData, err := manager.GetRaw(s, args.NAME, args.Params())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
yamlBytes := rawData.YAMLString()
|
||||
tempfile, err := ioutil.TempFile("", fmt.Sprintf("k8s-%s-%s*.yaml", cmdN.Kind, args.NAME))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer os.Remove(tempfile.Name())
|
||||
if _, err := tempfile.Write([]byte(yamlBytes)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := tempfile.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd := exec.Command("vim", tempfile.Name())
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
if err := cmd.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
content, err := ioutil.ReadFile(tempfile.Name())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
jsonBytes, err := yaml.YAMLToJSON(content)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
body, err := jsonutils.Parse(jsonBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := manager.UpdateRaw(s, args.NAME, args.Params(), body.(*jsonutils.JSONDict)); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func NewK8sResourceDeleteCmd(cmdN CmdNameFactory, manager modulebase.Manager) *Cmd {
|
||||
return NewCommand(
|
||||
&o.ResourceDeleteOptions{},
|
||||
@@ -244,11 +314,13 @@ func NewK8sNsResourceDeleteCmd(cmdN CmdNameFactory, manager modulebase.Manager)
|
||||
return deleteCmd
|
||||
}
|
||||
|
||||
func initK8sNamespaceResource(kind string, manager modulebase.Manager) *ShellCommands {
|
||||
func initK8sNamespaceResource(kind string, manager k8s.IClusterResourceManager) *ShellCommands {
|
||||
cmdN := NewCmdNameFactory(kind)
|
||||
return NewShellCommands(cmdN.Do).AddR(
|
||||
NewK8sNsResourceListCmd(cmdN, manager),
|
||||
NewK8sNsResourceGetCmd(cmdN, manager),
|
||||
NewK8sNsResourceDeleteCmd(cmdN, manager),
|
||||
NewK8sNsResourceGetRawCmd(cmdN, manager),
|
||||
NewK8sResourceEditRawCmd(cmdN, manager),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -58,4 +58,23 @@ func initSecret() {
|
||||
return nil
|
||||
})
|
||||
registryCmd.AddR(createCmd)
|
||||
|
||||
cephCSICmd := NewCmdNameFactory("secret-ceph-csi")
|
||||
cephCSICreateCmd := NewCommand(
|
||||
&o.CephCSISecretCreateOptions{},
|
||||
cephCSICmd.Do("create"),
|
||||
"Create ceph csi user secret",
|
||||
func(s *mcclient.ClientSession, args *o.CephCSISecretCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.Secrets.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
secretCmd.AddR(cephCSICreateCmd)
|
||||
}
|
||||
|
||||
@@ -15,9 +15,70 @@
|
||||
package k8s
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
|
||||
o "yunion.io/x/onecloud/pkg/mcclient/options/k8s"
|
||||
)
|
||||
|
||||
func initStorageClass() {
|
||||
initK8sClusterResource("storageclass", k8s.Storageclass)
|
||||
cmdN := NewCmdNameFactory("storageclass")
|
||||
scCmd := initK8sClusterResource("storageclass", k8s.Storageclass)
|
||||
|
||||
setDefaultCmd := NewCommand(
|
||||
&o.ClusterResourceBaseOptions{},
|
||||
cmdN.Do("set-default"),
|
||||
"Set storageclass as default",
|
||||
func(s *mcclient.ClientSession, args *o.ClusterResourceBaseOptions) error {
|
||||
ret, err := k8s.Storageclass.PerformAction(s, args.NAME, "set-default", args.Params())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
scCmd.AddR(setDefaultCmd)
|
||||
|
||||
addStorageClassCephCSI(scCmd)
|
||||
}
|
||||
|
||||
func addStorageClassCephCSI(cmd *ShellCommands) {
|
||||
rbdN := NewCmdNameFactory("storageclass-ceph-csi-rbd")
|
||||
rbdCreateCmd := NewCommand(
|
||||
&o.StorageClassCephCSIRBDCreateOptions{},
|
||||
rbdN.Do("create"),
|
||||
"Create ceph csi rbd",
|
||||
func(s *mcclient.ClientSession, args *o.StorageClassCephCSIRBDCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.Storageclass.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
testConnCmd := NewCommand(
|
||||
&o.StorageClassCephCSIRBDTestOptions{},
|
||||
rbdN.Do("connection-test"),
|
||||
"Test storageclass connection",
|
||||
func(s *mcclient.ClientSession, args *o.StorageClassCephCSIRBDTestOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.Storageclass.PerformClassAction(s, "connection-test", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
cmd.AddR(rbdCreateCmd, testConnCmd)
|
||||
}
|
||||
|
||||
@@ -89,4 +89,11 @@ func init() {
|
||||
printObject(lblistenerrule)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerListenerRuleGetBackendStatusOptions{}, "lblistenerrule-backend-status", "Get lblistenerrule backend status", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerRuleGetBackendStatusOptions) error {
|
||||
backendStatus, err := modules.LoadbalancerListenerRules.GetSpecific(s, opts.ID, "backend-status", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return printLbBackendStatus(backendStatus)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,13 +15,44 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func printLbBackendStatus(backendStatus jsonutils.JSONObject) error {
|
||||
arr, ok := backendStatus.(*jsonutils.JSONArray)
|
||||
if !ok {
|
||||
return fmt.Errorf("want json array, got %s", backendStatus.String())
|
||||
}
|
||||
objList, err := arr.GetArray()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
listResult := &modulebase.ListResult{
|
||||
Data: objList,
|
||||
}
|
||||
columns := []string{
|
||||
"id",
|
||||
"name",
|
||||
"backend_type",
|
||||
"backend_id",
|
||||
"address",
|
||||
"port",
|
||||
"weight",
|
||||
"check_time",
|
||||
"check_status",
|
||||
"check_code",
|
||||
}
|
||||
printList(listResult, columns)
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
R(&options.LoadbalancerListenerCreateOptions{}, "lblistener-create", "Create lblistener", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerCreateOptions) error {
|
||||
@@ -99,4 +130,11 @@ func init() {
|
||||
printObject(lblistener)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerListenerGetBackendStatusOptions{}, "lblistener-backend-status", "Get lblistene backend status", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerGetBackendStatusOptions) error {
|
||||
backendStatus, err := modules.LoadbalancerListeners.GetSpecific(s, opts.ID, "backend-status", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return printLbBackendStatus(backendStatus)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -46,4 +46,5 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ func init() {
|
||||
})
|
||||
|
||||
type NetworkAddressOptions struct {
|
||||
NETWORK string `help:"if of network to query"`
|
||||
NETWORK string `help:"id or name of network to query"`
|
||||
}
|
||||
R(&NetworkAddressOptions{}, "network-addresses", "Query used addresses of network", func(s *mcclient.ClientSession, args *NetworkAddressOptions) error {
|
||||
result, err := modules.Networks.GetSpecific(s, args.NETWORK, "addresses", nil)
|
||||
@@ -433,4 +433,31 @@ func init() {
|
||||
printList(&listResult, nil)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkSyncOptions struct {
|
||||
NETWORK string `help:"id or name of network to sync"`
|
||||
}
|
||||
R(&NetworkSyncOptions{}, "network-sync", "Sync network status", func(s *mcclient.ClientSession, args *NetworkSyncOptions) error {
|
||||
result, err := modules.Networks.PerformAction(s, args.NETWORK, "sync", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkStatusOptions struct {
|
||||
NETWORK string `help:"id or name of network to sync" json:"-"`
|
||||
STATUS string `help:"status of network" choices:"available|unavailable" json:"status"`
|
||||
Reason string `help:"reason to change status" json:"reason"`
|
||||
}
|
||||
R(&NetworkStatusOptions{}, "network-status", "Set on-premise network status", func(s *mcclient.ClientSession, args *NetworkStatusOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Networks.PerformAction(s, args.NETWORK, "status", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,20 +29,26 @@ func init() {
|
||||
*/
|
||||
|
||||
type NotificationCreateOptions struct {
|
||||
Uid []string `help:"The user you wanna sent to (Keystone User ID)"`
|
||||
CONTACTTYPE string `help:"User's contacts type" choices:"email|mobile|dingtalk|webconsole"`
|
||||
TOPIC string `help:"Title or topic of the notification"`
|
||||
PRIORITY string `help:"Priority of the notification" choices:"normal|important|fatal"`
|
||||
MSG string `help:"The content of the notification"`
|
||||
Remark string `help:"Remark or description of the notification"`
|
||||
Group bool `help:"Send to group"`
|
||||
CONTACTTYPE string `help:"User's contacts type"`
|
||||
TOPIC string `help:"Title or topic of the notification"`
|
||||
PRIORITY string `help:"Priority of the notification" choices:"normal|important|fatal"`
|
||||
MSG string `help:"The content of the notification"`
|
||||
Remark string `help:"Remark or description of the notification"`
|
||||
Group bool `help:"Send to group"`
|
||||
}
|
||||
R(&NotificationCreateOptions{}, "notify", "Send a notification to sb", func(s *mcclient.ClientSession, args *NotificationCreateOptions) error {
|
||||
type NotificationCreateSingleOptions struct {
|
||||
UID string `help:"The user you wanna sent to (Keystone User ID)"`
|
||||
NotificationCreateOptions
|
||||
}
|
||||
|
||||
R(&NotificationCreateSingleOptions{}, "notify", "Send a notification to someone", func(s *mcclient.ClientSession,
|
||||
args *NotificationCreateSingleOptions) error {
|
||||
|
||||
msg := notify.SNotifyMessage{}
|
||||
if args.Group {
|
||||
msg.Gid = args.Uid
|
||||
msg.Gid = []string{args.UID}
|
||||
} else {
|
||||
msg.Uid = args.Uid
|
||||
msg.Uid = []string{args.UID}
|
||||
}
|
||||
|
||||
msg.ContactType = notify.TNotifyChannel(args.CONTACTTYPE)
|
||||
@@ -57,6 +63,35 @@ func init() {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
type NotificationCreateMultiOptions struct {
|
||||
Uid []string `help:"The user you wanna sent to (Keystone User ID)"`
|
||||
NotificationCreateOptions
|
||||
}
|
||||
|
||||
R(&NotificationCreateMultiOptions{}, "notify-batch", "Send a notification to someones",
|
||||
func(s *mcclient.ClientSession, args *NotificationCreateMultiOptions) error {
|
||||
|
||||
msg := notify.SNotifyMessage{}
|
||||
if args.Group {
|
||||
msg.Gid = args.Uid
|
||||
} else {
|
||||
msg.Uid = args.Uid
|
||||
}
|
||||
|
||||
msg.ContactType = notify.TNotifyChannel(args.CONTACTTYPE)
|
||||
msg.Topic = args.TOPIC
|
||||
msg.Priority = notify.TNotifyPriority(args.PRIORITY)
|
||||
msg.Msg = args.MSG
|
||||
msg.Remark = args.Remark
|
||||
|
||||
err := notify.Notifications.Send(s, msg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
/**
|
||||
* 发送全局通知
|
||||
*/
|
||||
@@ -72,7 +107,7 @@ func init() {
|
||||
R(&NotificationBroadcastOptions{}, "notify-broadcast", "Send a notification to all online users", func(s *mcclient.ClientSession, args *NotificationBroadcastOptions) error {
|
||||
msg := notify.SNotifyMessage{}
|
||||
msg.Broadcast = true
|
||||
msg.ContactType = notify.TNotifyChannel("webconsole")
|
||||
msg.ContactType = notify.NotifyByWebConsole
|
||||
msg.Topic = args.Topic
|
||||
msg.Priority = notify.TNotifyPriority(args.Priority)
|
||||
msg.Msg = args.Msg
|
||||
|
||||
@@ -34,7 +34,24 @@ func init() {
|
||||
}
|
||||
body := jsonutils.NewDict()
|
||||
body.Add(tmp, args.CONTACTTYPE)
|
||||
modules.Configs.Create(s, body)
|
||||
ret, err := modules.Configs.Create(s, body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ConfigCreate2Options{}, "notify-config-validate", "config validate", func(s *mcclient.ClientSession,
|
||||
args *ConfigCreate2Options) error {
|
||||
tmp := jsonutils.NewDict()
|
||||
for i := 0; i+1 < len(args.CONFIGS); i += 2 {
|
||||
tmp.Add(jsonutils.NewString(args.CONFIGS[i+1]), args.CONFIGS[i])
|
||||
}
|
||||
ret, err := modules.Configs.PerformAction(s, args.CONTACTTYPE, "validate", tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
90
cmd/climc/shell/notify_template.go
Normal file
90
cmd/climc/shell/notify_template.go
Normal file
@@ -0,0 +1,90 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type NotifyTemplateUpdateOptions struct {
|
||||
CONTACTTYPE string `help:"the contanct type, such as 'email', 'mobile'"`
|
||||
TOPIC string `help:"the topic of temlate, such as 'VERIFY', 'ALARM'"`
|
||||
TEMPLATETYPE string `help:"the type of template" choices:"content|title|remote"`
|
||||
CONTENT string `help:"the content of template"`
|
||||
}
|
||||
R(&NotifyTemplateUpdateOptions{}, "notify-template-update", "Create, update contact for user", func(s *mcclient.ClientSession,
|
||||
args *NotifyTemplateUpdateOptions) error {
|
||||
arr := jsonutils.NewArray()
|
||||
tmpObj := jsonutils.NewDict()
|
||||
tmpObj.Add(jsonutils.NewString(args.TOPIC), "topic")
|
||||
tmpObj.Add(jsonutils.NewString(args.TEMPLATETYPE), "template_type")
|
||||
tmpObj.Add(jsonutils.NewString(args.CONTENT), "content")
|
||||
arr.Add(tmpObj)
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(arr, "notifytemplates")
|
||||
|
||||
contact, err := modules.NotifyTemplates.PerformAction(s, args.CONTACTTYPE, "update-template", params)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printObject(contact)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NotifyTemplateDeleteOptions struct {
|
||||
CONTACTTYPE string `help:"the contanct type, such as 'email', 'mobile'"`
|
||||
Topic string `help:"the topic of temlate, such as 'VERIFY', 'ALARM'"`
|
||||
}
|
||||
|
||||
R(&NotifyTemplateDeleteOptions{}, "notify-template-delete", "delete notify template",
|
||||
func(s *mcclient.ClientSession, args *NotifyTemplateDeleteOptions) error {
|
||||
|
||||
tmpObj := jsonutils.NewDict()
|
||||
tmpObj.Add(jsonutils.NewString(args.CONTACTTYPE), "contact_type")
|
||||
tmpObj.Add(jsonutils.NewString(args.Topic), "topic")
|
||||
_, err := modules.NotifyTemplates.DeleteContents(s, tmpObj)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
type NotifyTemplateListOptions struct {
|
||||
options.BaseListOptions
|
||||
}
|
||||
|
||||
R(&NotifyTemplateListOptions{}, "notify-template-list", "List all notify template",
|
||||
func(s *mcclient.ClientSession, args *NotifyTemplateListOptions) error {
|
||||
|
||||
params, err := args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.NotifyTemplates.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.NotifyTemplates.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -17,8 +17,6 @@ package shell
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -32,6 +30,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/util/rbacutils"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -135,7 +134,7 @@ func init() {
|
||||
return nil
|
||||
}
|
||||
R(&PolicyPatchOptions{}, "policy-patch", "Patch policy", updateFunc)
|
||||
R(&PolicyPatchOptions{}, "policy-update", "Patch policy", updateFunc)
|
||||
R(&PolicyPatchOptions{}, "policy-update", "Update policy", updateFunc)
|
||||
|
||||
type PolicyPerformOptions struct {
|
||||
ID string `help:"ID of policy to update"`
|
||||
@@ -212,33 +211,13 @@ func init() {
|
||||
return err
|
||||
}
|
||||
|
||||
tmpfile, err := ioutil.TempFile("", "policy-blob")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer os.Remove(tmpfile.Name()) // clean up
|
||||
|
||||
if _, err := tmpfile.Write([]byte(yaml)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := tmpfile.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd := exec.Command("vim", tmpfile.Name())
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
err = cmd.Run()
|
||||
yaml, err = shellutils.Edit(yaml)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
policyBytes, err := ioutil.ReadFile(tmpfile.Name())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
params.Add(jsonutils.NewString(string(policyBytes)), "policy")
|
||||
params.Add(jsonutils.NewString(yaml), "policy")
|
||||
|
||||
result, err = modules.Policies.Patch(s, policyId, params)
|
||||
if err != nil {
|
||||
|
||||
@@ -16,73 +16,232 @@ package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
)
|
||||
|
||||
type QuotaBaseOptions struct {
|
||||
type ComputeQuotaKeys struct {
|
||||
ZoneQuotaKeys
|
||||
|
||||
Hypervisor string `help:"hypervisor" choices:"kvm|baremetal"`
|
||||
}
|
||||
|
||||
type ComputeQuotaOptions struct {
|
||||
ComputeQuotaKeys
|
||||
|
||||
Count int64 `help:"server count" json:"count,omitzero"`
|
||||
Cpu int64 `help:"CPU count" json:"cpu,omitzero"`
|
||||
Memory int64 `help:"Memory size in MB" json:"memory,omitzero"`
|
||||
Storage int64 `help:"Storage size in MB" json:"storage,omitzero"`
|
||||
Port int64 `help:"Internal NIC count" json:"port,omitzero"`
|
||||
Eport int64 `help:"External NIC count" json:"eport,omitzero"`
|
||||
Eip int64 `help:"Elastic IP count" json:"eip,omitzero"`
|
||||
Bw int64 `help:"Internal bandwidth in Mbps" json:"bw,omitzero"`
|
||||
Ebw int64 `help:"External bandwidth in Mbps" json:"ebw,omitzero"`
|
||||
IsolatedDevice int64 `help:"Isolated device count" json:"isolated_device,omitzero"`
|
||||
Snapshot int64 `help:"Snapshot count" json:"snapshot,omitzero"`
|
||||
Image int64 `help:"Template count" json:"image,omitzero"`
|
||||
Secgroup int64 `help:"Secgroup count" json:"secgroup,omitzero"`
|
||||
Bucket int64 `help:"bucket count" json:"bucket,omitzero"`
|
||||
ObjectGB int64 `help:"object size in GB" json:"object_gb,omitzero"`
|
||||
ObjectCnt int64 `help:"object count" json:"object_cnt,omitzero"`
|
||||
}
|
||||
|
||||
type RegionQuotaKeys struct {
|
||||
Provider string `help:"cloud provider" json:"provider,omitempty"`
|
||||
Brand string `help:"cloud brand" json:"brand,omitempty"`
|
||||
CloudEnv string `help:"cloud environment" json:"cloud_env,omitempty" choices:"onpremise|private|public"`
|
||||
AccountId string `help:"cloud account id" json:"account_id,omitempty"`
|
||||
ManagerId string `help:"cloud provider id" json:"manager_id,omitempty"`
|
||||
RegionId string `help:"region id" json:"region_id,omitempty"`
|
||||
}
|
||||
|
||||
type RegionQuotaOptions struct {
|
||||
RegionQuotaKeys
|
||||
|
||||
Port int64 `help:"Internal NIC count" json:"port,omitzero"`
|
||||
Eport int64 `help:"External NIC count" json:"eport,omitzero"`
|
||||
// Bw int64 `help:"Internal bandwidth in Mbps" json:"bw,omitzero"`
|
||||
// Ebw int64 `help:"External bandwidth in Mbps" json:"ebw,omitzero"`
|
||||
|
||||
Eip int64 `help:"Elastic IP count" json:"eip,omitzero"`
|
||||
|
||||
Snapshot int64 `help:"Snapshot count" json:"snapshot,omitzero"`
|
||||
|
||||
Bucket int64 `help:"bucket count" json:"bucket,omitzero"`
|
||||
ObjectGB int64 `help:"object size in GB" json:"object_gb,omitzero"`
|
||||
ObjectCnt int64 `help:"object count" json:"object_cnt,omitzero"`
|
||||
|
||||
Rds int64 `help:"Rds count" json:"rds,omitzero"`
|
||||
Cache int64 `help:"redis count" json:"cache,omitzero"`
|
||||
|
||||
Loadbalancer int64 `help:"loadbalancer instance count" json:"loadbalancer,omitzero"`
|
||||
}
|
||||
|
||||
type ZoneQuotaKeys struct {
|
||||
RegionQuotaKeys
|
||||
|
||||
ZoneId string `help:"zone id" json:"zone_id,omitempty"`
|
||||
}
|
||||
|
||||
type ZoneQuotaOptions struct {
|
||||
ZoneQuotaKeys
|
||||
}
|
||||
|
||||
type ProjectQuotaOptions struct {
|
||||
Secgroup int64 `help:"Secgroup count" json:"secgroup,omitzero"`
|
||||
}
|
||||
|
||||
type ImageQuotaKeys struct {
|
||||
Type string `help:"image type, either iso or image" choices:"iso|image" json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type ImageQuotaOptions struct {
|
||||
ImageQuotaKeys
|
||||
|
||||
Image int64 `help:"Template count" json:"image,omitzero"`
|
||||
}
|
||||
|
||||
type QuotaSetBaseOptions struct {
|
||||
Project string `help:"Tenant name or ID to set quota" json:"tenant,omitempty"`
|
||||
Domain string `help:"Domain name or ID to set quota" json:"domain,omitempty"`
|
||||
Action string `help:"quota set action" choices:"add|sub|reset|replace|delete|update"`
|
||||
}
|
||||
|
||||
func printQuotaList(result jsonutils.JSONObject) {
|
||||
printList(modulebase.JSON2ListResult(result), nil)
|
||||
}
|
||||
|
||||
func init() {
|
||||
type QuotaOptions struct {
|
||||
Tenant string `help:"Tenant name or ID"`
|
||||
ProjectDomain string `help:"Domain name or ID"`
|
||||
Scope string `help:"scope" choices:"domain|project"`
|
||||
Project string `help:"Tenant name or ID" json:"tenant"`
|
||||
Domain string `help:"Domain name or ID" json:"domain"`
|
||||
Refresh bool `help:"refresh" json:"refresh,omitfalse"`
|
||||
Primary bool `help:"get primary quota ONLY" json:"primary,omitfalse"`
|
||||
}
|
||||
R(&QuotaOptions{}, "quota", "Show quota for current user or tenant", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.Quotas.GetQuota(s, params)
|
||||
log.Debugf("%s", params)
|
||||
quotas, err := modules.Quotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "project-quota", "Show project-quota for current user or tenant", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, err := modules.ProjectQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "region-quota", "Show region-quota for current user or tenant", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, err := modules.RegionQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "zone-quota", "Show zone-quota for current user or tenant", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, err := modules.ZoneQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "project-quota", "Show project-quota for current user or tenant", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.ProjectQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
R(&QuotaOptions{}, "image-quota", "Show image quota for current user or tenant", func(s *mcclient.ClientSession, args *QuotaOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.ImageQuotas.GetQuota(s, params)
|
||||
quotas, err := modules.ImageQuotas.GetQuota(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type QuotaSetOptions struct {
|
||||
Tenant string `help:"Tenant name or ID to set quota" json:"tenant,omitempty"`
|
||||
ProjectDomain string `help:"Domain name or ID to set quota" json:",omitempty"`
|
||||
Action string `help:"quota set action" choices:"add|reset|replace"`
|
||||
Cascade bool `help:"cascade set quota so that auto increment domain quota if total project quota exceeds parent domain quota"`
|
||||
QuotaBaseOptions
|
||||
type ComputeQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
ComputeQuotaOptions
|
||||
}
|
||||
R(&QuotaSetOptions{}, "quota-set", "Set quota for tenant", func(s *mcclient.ClientSession, args *QuotaSetOptions) error {
|
||||
R(&ComputeQuotaSetOptions{}, "quota-set", "Set quota for tenant", func(s *mcclient.ClientSession, args *ComputeQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.Quotas.DoQuotaSet(s, params)
|
||||
quotas, e := modules.Quotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(result)
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type RegionQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
RegionQuotaOptions
|
||||
}
|
||||
R(&RegionQuotaSetOptions{}, "region-quota-set", "Set regional quota for tenant", func(s *mcclient.ClientSession, args *RegionQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, e := modules.RegionQuotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ZoneQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
ZoneQuotaOptions
|
||||
}
|
||||
R(&ZoneQuotaSetOptions{}, "zone-quota-set", "Set zonal quota for tenant", func(s *mcclient.ClientSession, args *ZoneQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, e := modules.ZoneQuotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ProjectQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
ProjectQuotaOptions
|
||||
}
|
||||
R(&ProjectQuotaSetOptions{}, "project-quota-set", "Set project quota for tenant", func(s *mcclient.ClientSession, args *ProjectQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, e := modules.ProjectQuotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ImageQuotaSetOptions struct {
|
||||
QuotaSetBaseOptions
|
||||
ImageQuotaOptions
|
||||
}
|
||||
R(&ImageQuotaSetOptions{}, "image-quota-set", "Set image quota for tenant", func(s *mcclient.ClientSession, args *ImageQuotaSetOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
quotas, e := modules.ImageQuotas.DoQuotaSet(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(quotas)
|
||||
return nil
|
||||
})
|
||||
|
||||
type QuotaListOptions struct {
|
||||
ProjectDomain string `help:"domain name or ID to query project quotas"`
|
||||
Refresh bool `help:"refresh" json:"refresh,omitfalse"`
|
||||
Primary bool `help:"list primary quota ONLY" json:"primary,omitfalse"`
|
||||
}
|
||||
R(&QuotaListOptions{}, "quota-list", "List quota of domains or projects of a domain", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
@@ -90,22 +249,98 @@ func init() {
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printList(modulebase.JSON2ListResult(result), nil)
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
/*type QuotaCheckOptions struct {
|
||||
TENANT string `help:"Tenant name or ID to check quota" json:"tenant,omitempty"`
|
||||
QuotaBaseOptions
|
||||
}
|
||||
R(&QuotaCheckOptions{}, "quota-check", "Check quota for tenant", func(s *mcclient.ClientSession, args *QuotaCheckOptions) error {
|
||||
R(&QuotaListOptions{}, "region-quota-list", "List region quota of domains or projects of a domain", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.Quotas.DoQuotaCheck(s, params)
|
||||
result, e := modules.RegionQuotas.GetQuotaList(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(result)
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})*/
|
||||
})
|
||||
|
||||
R(&QuotaListOptions{}, "zone-quota-list", "List zone quota of domains or projects of a domain", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.ZoneQuotas.GetQuotaList(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&QuotaListOptions{}, "project-quota-list", "List project quota of domains or projects of a domain", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.ProjectQuotas.GetQuotaList(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&QuotaListOptions{}, "image-quota-list", "List image quota of domains or projects of a domain", func(s *mcclient.ClientSession, args *QuotaListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, e := modules.ImageQuotas.GetQuotaList(s, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printQuotaList(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type CleanPendingUsageOptions struct {
|
||||
Scope string `help:"scope" choices:"domain|project"`
|
||||
Project string `help:"Tenant name or ID" json:"tenant"`
|
||||
Domain string `help:"Domain name or ID" json:"domain"`
|
||||
}
|
||||
R(&CleanPendingUsageOptions{}, "clean-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.Quotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CleanPendingUsageOptions{}, "clean-region-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.RegionQuotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CleanPendingUsageOptions{}, "clean-zone-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.ZoneQuotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CleanPendingUsageOptions{}, "clean-project-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.ProjectQuotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CleanPendingUsageOptions{}, "clean-image-pending-usage", "Clean pending usage for project or domain", func(s *mcclient.ClientSession, args *CleanPendingUsageOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
_, err := modules.ImageQuotas.DoCleanPendingUsage(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ func init() {
|
||||
NOTES string `help:"Why reserve this IP"`
|
||||
IPS []string `help:"IPs to reserve"`
|
||||
Duration string `help:"reservation duration, e.g. 1I, 1H, 2M"`
|
||||
Status string `help:"ip status"`
|
||||
}
|
||||
R(&NetworkReserveIPOptions{}, "network-reserve-ip", "Reserve an IP address from pool", func(s *mcclient.ClientSession, args *NetworkReserveIPOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -36,6 +37,9 @@ func init() {
|
||||
if len(args.Duration) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Duration), "duration")
|
||||
}
|
||||
if len(args.Status) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Status), "status")
|
||||
}
|
||||
net, err := modules.Networks.PerformAction(s, args.NETWORK, "reserve-ip", params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
func init() {
|
||||
type SecGroupsListOptions struct {
|
||||
Equals string `help:"Secgroup ID or Name, filter secgroups whose rules equals the specified one"`
|
||||
Server string `help:"Filter secgroups bound to specified server"`
|
||||
options.BaseListOptions
|
||||
}
|
||||
|
||||
@@ -43,6 +44,9 @@ func init() {
|
||||
if len(args.Equals) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Equals), "equals")
|
||||
}
|
||||
if len(args.Server) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Server), "server")
|
||||
}
|
||||
result, err := modules.SecGroups.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -37,6 +37,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
R(&options.ServerListOptions{}, "server-list", "List virtual servers", func(s *mcclient.ClientSession, opts *options.ServerListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
@@ -177,6 +178,19 @@ func init() {
|
||||
},
|
||||
)
|
||||
|
||||
R(&options.ServerCreateOptions{}, "server-check-create-data", "Check create server data", func(s *mcclient.ClientSession, opts *options.ServerCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
server, err := modules.Servers.PerformClassAction(s, "check-create-data", params.JSON(params))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(server)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerCreateOptions{}, "server-create", "Create a server", func(s *mcclient.ClientSession, opts *options.ServerCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
@@ -318,6 +332,13 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerIdsOptions{}, "server-resume", "Resume servers", func(s *mcclient.ClientSession,
|
||||
opts *options.ServerIdsOptions) error {
|
||||
ret := modules.Servers.BatchPerformAction(s, opts.ID, "resume", nil)
|
||||
printBatchResults(ret, modules.Servers.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerMigrateOptions{}, "server-migrate", "Migrate server", func(s *mcclient.ClientSession, opts *options.ServerMigrateOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
@@ -452,6 +473,19 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerModifySrcCheckOptions{}, "server-modify-src-check", "Modify src ip, mac check settings", func(s *mcclient.ClientSession, opts *options.ServerModifySrcCheckOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
srv, err := modules.Servers.PerformAction(s, opts.ID, "modify-src-check", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(srv)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerSecGroupsOptions{}, "server-set-secgroup", "Set security groups to a VM", func(s *mcclient.ClientSession, opts *options.ServerSecGroupsOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
|
||||
162
cmd/climc/shell/service_catalog.go
Normal file
162
cmd/climc/shell/service_catalog.go
Normal file
@@ -0,0 +1,162 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shell
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type ServiceCatalogListOpions struct {
|
||||
options.BaseListOptions
|
||||
}
|
||||
|
||||
R(&ServiceCatalogListOpions{}, "service-catalog-list", "List service catalog", func(s *mcclient.ClientSession,
|
||||
opts *ServiceCatalogListOpions) error {
|
||||
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := modules.ServiceCatalog.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(ret, modules.ServiceCatalog.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServiceCatalogCreateOptions struct {
|
||||
NAME string `help:"Name of service catalog"`
|
||||
GuestTemplate string `help:"guest template of service catalog"`
|
||||
IconUrl string `help:"icon url of service catalog"`
|
||||
GenerateName bool `help:"whether to generate name"`
|
||||
}
|
||||
|
||||
R(&ServiceCatalogCreateOptions{}, "service-catalog-create", "Create a service catalog",
|
||||
func(s *mcclient.ClientSession, opts *ServiceCatalogCreateOptions) error {
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
if opts.GenerateName {
|
||||
params.Add(jsonutils.NewString(opts.NAME), "generate_name")
|
||||
} else {
|
||||
params.Add(jsonutils.NewString(opts.NAME), "name")
|
||||
}
|
||||
if len(opts.GuestTemplate) != 0 {
|
||||
params.Add(jsonutils.NewString(opts.GuestTemplate), "guest_template")
|
||||
}
|
||||
if len(opts.IconUrl) != 0 {
|
||||
params.Add(jsonutils.NewString(opts.IconUrl), "icon_url")
|
||||
}
|
||||
serviceCatalog, err := modules.ServiceCatalog.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(serviceCatalog)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type ServiceCatalogOptions struct {
|
||||
ID string `help:"ID or name of service catalog"`
|
||||
}
|
||||
|
||||
R(&ServiceCatalogOptions{}, "service-catalog-show", "show a service catalog", func(s *mcclient.ClientSession,
|
||||
opts *ServiceCatalogOptions) error {
|
||||
|
||||
sc, err := modules.ServiceCatalog.Get(s, opts.ID, jsonutils.JSONNull)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(sc)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&ServiceCatalogOptions{}, "service-catalog-delete", "delete a service catalog", func(s *mcclient.ClientSession,
|
||||
opts *ServiceCatalogOptions) error {
|
||||
|
||||
sc, err := modules.ServiceCatalog.Delete(s, opts.ID, jsonutils.JSONNull)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(sc)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServiceCatalogUpdateOptions struct {
|
||||
ServiceCatalogOptions
|
||||
Name string `help:"Name of service catalog"`
|
||||
GuestTemplate string `help:"guest template of service catalog"`
|
||||
IconUrl string `help:"icon url of service catalog"`
|
||||
}
|
||||
|
||||
R(&ServiceCatalogUpdateOptions{}, "service-catalog-update", "update a service catalog",
|
||||
func(s *mcclient.ClientSession, opts *ServiceCatalogUpdateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if len(opts.Name) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Name), "name")
|
||||
}
|
||||
if len(opts.GuestTemplate) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.GuestTemplate), "guest_template")
|
||||
}
|
||||
if len(opts.IconUrl) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.IconUrl), "icon_url")
|
||||
}
|
||||
sc, err := modules.ServiceCatalog.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(sc)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
type ServiceCatalogDeployOptions struct {
|
||||
ServiceCatalogOptions
|
||||
Name string `help:"Name of guest"`
|
||||
GenerateName bool `help:"whether to generate name for guest"`
|
||||
Count int `help:"count of guest"`
|
||||
ProjectID string `help:"project id of guest"`
|
||||
}
|
||||
|
||||
R(&ServiceCatalogDeployOptions{}, "service-catalog-deploy", "deploy", func(s *mcclient.ClientSession,
|
||||
opts *ServiceCatalogDeployOptions) error {
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
if opts.GenerateName {
|
||||
params.Add(jsonutils.NewString(opts.Name), "generate_name")
|
||||
} else {
|
||||
params.Add(jsonutils.NewString(opts.Name), "name")
|
||||
}
|
||||
if opts.Count != 0 {
|
||||
params.Add(jsonutils.NewInt(int64(opts.Count)), "count")
|
||||
}
|
||||
if len(opts.ProjectID) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.ProjectID), "project_id")
|
||||
}
|
||||
|
||||
sc, err := modules.ServiceCatalog.PerformAction(s, opts.ID, "deploy", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(sc)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -163,8 +164,16 @@ func init() {
|
||||
|
||||
type ServiceConfigOptions struct {
|
||||
SERVICE string `help:"service name or id"`
|
||||
Config []string `help:"config key=value pair"`
|
||||
Remove bool `help:"remove config"`
|
||||
Config []string `help:"config options, can be a JSON, a YAML or a key=value pair, e.g:
|
||||
* JSON
|
||||
'{\"default\":{\"password_expiration_seconds\":300}}'
|
||||
* YAML
|
||||
default:
|
||||
password_expiration_seconds: 300
|
||||
* A key=value pair (under default section)
|
||||
password_expiration_seconds=300
|
||||
"`
|
||||
Remove bool `help:"remove config"`
|
||||
}
|
||||
R(&ServiceConfigOptions{}, "service-config", "Add config to service", func(s *mcclient.ClientSession, args *ServiceConfigOptions) error {
|
||||
config := jsonutils.NewDict()
|
||||
@@ -174,6 +183,24 @@ func init() {
|
||||
config.Add(jsonutils.NewString("update"), "action")
|
||||
}
|
||||
for _, c := range args.Config {
|
||||
json, _ := jsonutils.ParseString(c)
|
||||
if json != nil {
|
||||
if _, ok := json.(*jsonutils.JSONDict); ok {
|
||||
subconf := jsonutils.NewDict()
|
||||
subconf.Add(json, "config")
|
||||
config.Update(subconf)
|
||||
continue
|
||||
}
|
||||
}
|
||||
yaml, _ := jsonutils.ParseYAML(c)
|
||||
if yaml != nil {
|
||||
if _, ok := yaml.(*jsonutils.JSONDict); ok {
|
||||
subconf := jsonutils.NewDict()
|
||||
subconf.Add(yaml, "config")
|
||||
config.Update(subconf)
|
||||
continue
|
||||
}
|
||||
}
|
||||
pos := strings.IndexByte(c, '=')
|
||||
if pos < 0 {
|
||||
return fmt.Errorf("%s is not a key=value pair", c)
|
||||
@@ -213,4 +240,34 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServiceConfigEditOptions struct {
|
||||
SERVICE string `help:"service name or id"`
|
||||
}
|
||||
R(&ServiceConfigEditOptions{}, "service-config-edit", "Edit config yaml of a service", func(s *mcclient.ClientSession, args *ServiceConfigEditOptions) error {
|
||||
conf, err := modules.ServicesV3.GetSpecific(s, args.SERVICE, "config", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
confJson, err := conf.Get("config")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
content, err := shellutils.Edit(confJson.YAMLString())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
yamlJson, err := jsonutils.ParseYAML(content)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config := jsonutils.NewDict()
|
||||
config.Add(yamlJson, "config")
|
||||
nconf, err := modules.ServicesV3.PerformAction(s, args.SERVICE, "config", config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(nconf.PrettyString())
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -44,16 +44,13 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&TaskListOptions{}, "region-task-list", "List tasks on region server", func(s *mcclient.ClientSession, suboptions *TaskListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = suboptions.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
type RegionTaskListOptions struct {
|
||||
ObjName string `help:"object name"`
|
||||
ObjId string `help:"object id"`
|
||||
TaskName string `help:"task name"`
|
||||
}
|
||||
R(&RegionTaskListOptions{}, "region-task-list", "List tasks on region server", func(s *mcclient.ClientSession, args *RegionTaskListOptions) error {
|
||||
params := jsonutils.Marshal(args)
|
||||
result, err := modules.ComputeTasks.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -22,9 +22,9 @@ import (
|
||||
)
|
||||
|
||||
type GeneralUsageOptions struct {
|
||||
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack"`
|
||||
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack"`
|
||||
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|DStack"`
|
||||
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"`
|
||||
Project string `help:"show usage of specified project"`
|
||||
|
||||
ProjectDomain string `help:"show usage of specified domain"`
|
||||
|
||||
@@ -149,15 +149,17 @@ func init() {
|
||||
})
|
||||
|
||||
type UserCreateOptions struct {
|
||||
NAME string `help:"Name of the new user"`
|
||||
Domain string `help:"Domain"`
|
||||
Desc string `help:"Description"`
|
||||
Password string `help:"Password"`
|
||||
Displayname string `help:"Displayname"`
|
||||
Email string `help:"Email"`
|
||||
Mobile string `help:"Mobile"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
NAME string `help:"Name of the new user"`
|
||||
Domain string `help:"Domain"`
|
||||
Desc string `help:"Description"`
|
||||
Password *string `help:"Password"`
|
||||
Displayname string `help:"Displayname"`
|
||||
Email string `help:"Email"`
|
||||
Mobile string `help:"Mobile"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
|
||||
SkipPasswordComplexityCheck bool `help:"do password complexity check, default is false"`
|
||||
|
||||
// DefaultProject string `help:"Default project"`
|
||||
SystemAccount bool `help:"is a system account?"`
|
||||
@@ -174,8 +176,11 @@ func init() {
|
||||
}
|
||||
params.Add(jsonutils.NewString(domainId), "domain_id")
|
||||
}
|
||||
if len(args.Password) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Password), "password")
|
||||
if args.Password != nil {
|
||||
params.Add(jsonutils.NewString(*args.Password), "password")
|
||||
if args.SkipPasswordComplexityCheck {
|
||||
params.Add(jsonutils.JSONTrue, "skip_password_complexity_check")
|
||||
}
|
||||
}
|
||||
if len(args.Displayname) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Displayname), "displayname")
|
||||
@@ -222,16 +227,16 @@ func init() {
|
||||
})
|
||||
|
||||
type UserUpdateOptions struct {
|
||||
ID string `help:"ID or name of the user"`
|
||||
Domain string `help:"Domain"`
|
||||
Name string `help:"New name of the user"`
|
||||
Password string `help:"New password"`
|
||||
Desc string `help:"Description"`
|
||||
Displayname string `help:"Displayname"`
|
||||
Email string `help:"Email"`
|
||||
Mobile string `help:"Mobile"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
ID string `help:"ID or name of the user"`
|
||||
Domain string `help:"Domain"`
|
||||
Name string `help:"New name of the user"`
|
||||
Password *string `help:"New password"`
|
||||
Desc string `help:"Description"`
|
||||
Displayname string `help:"Displayname"`
|
||||
Email string `help:"Email"`
|
||||
Mobile string `help:"Mobile"`
|
||||
Enabled bool `help:"Enabled"`
|
||||
Disabled bool `help:"Disabled"`
|
||||
|
||||
SystemAccount bool `help:"Turn on is_system_account"`
|
||||
NotSystemAccount bool `help:"Turn off is_system_account"`
|
||||
@@ -262,8 +267,8 @@ func init() {
|
||||
if len(args.Name) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Name), "name")
|
||||
}
|
||||
if len(args.Password) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Password), "password")
|
||||
if args.Password != nil {
|
||||
params.Add(jsonutils.NewString(*args.Password), "password")
|
||||
}
|
||||
if len(args.Displayname) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Displayname), "displayname")
|
||||
|
||||
@@ -27,8 +27,9 @@ func init() {
|
||||
type VpcListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
Usable *bool `help:"Filter usable vpcs"`
|
||||
Region string `help:"ID or Name of region" json:"-"`
|
||||
Usable *bool `help:"Filter usable vpcs"`
|
||||
Region string `help:"ID or Name of region" json:"-"`
|
||||
Globalvpc string `help:"Filter by globalvpc"`
|
||||
}
|
||||
R(&VpcListOptions{}, "vpc-list", "List VPCs", func(s *mcclient.ClientSession, opts *VpcListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
@@ -158,4 +159,13 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&VpcUpdateStatusOptions{}, "vpc-sync", "Synchronize the status of a vpc", func(s *mcclient.ClientSession, args *VpcUpdateStatusOptions) error {
|
||||
result, err := modules.Vpcs.PerformAction(s, args.ID, "sync", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
23
cmd/cloudevent/main.go
Normal file
23
cmd/cloudevent/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// 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 (
|
||||
"yunion.io/x/onecloud/pkg/cloudevent/service"
|
||||
)
|
||||
|
||||
func main() {
|
||||
service.StartService()
|
||||
}
|
||||
138
cmd/ctyuncli/main.go
Normal file
138
cmd/ctyuncli/main.go
Normal file
@@ -0,0 +1,138 @@
|
||||
// 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 (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"yunion.io/x/structarg"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/multicloud/ctyun"
|
||||
_ "yunion.io/x/onecloud/pkg/multicloud/ctyun/shell"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
type BaseOptions struct {
|
||||
Help bool `help:"Show help" default:"false"`
|
||||
Debug bool `help:"Show debug" default:"false"`
|
||||
AccessKey string `help:"Access key" default:"$CTYUN_ACCESS_KEY"`
|
||||
Secret string `help:"Secret" default:"$CTYUN_SECRET"`
|
||||
RegionId string `help:"RegionId" default:"$CTYUN_REGION"`
|
||||
SUBCOMMAND string `help:"ctyuncli subcommand" subcommand:"true"`
|
||||
}
|
||||
|
||||
func getSubcommandParser() (*structarg.ArgumentParser, error) {
|
||||
parse, e := structarg.NewArgumentParser(&BaseOptions{},
|
||||
"ctyuncli",
|
||||
"Command-line interface to ctyun API.",
|
||||
`See "ctyuncli help COMMAND" for help on a specific command.`)
|
||||
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
|
||||
subcmd := parse.GetSubcommand()
|
||||
if subcmd == nil {
|
||||
return nil, fmt.Errorf("No subcommand argument.")
|
||||
}
|
||||
type HelpOptions struct {
|
||||
SUBCOMMAND string `help:"sub-command name"`
|
||||
}
|
||||
shellutils.R(&HelpOptions{}, "help", "Show help of a subcommand", func(args *HelpOptions) error {
|
||||
helpstr, e := subcmd.SubHelpString(args.SUBCOMMAND)
|
||||
if e != nil {
|
||||
return e
|
||||
} else {
|
||||
fmt.Print(helpstr)
|
||||
return nil
|
||||
}
|
||||
})
|
||||
for _, v := range shellutils.CommandTable {
|
||||
_, e := subcmd.AddSubParser(v.Options, v.Command, v.Desc, v.Callback)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
}
|
||||
return parse, nil
|
||||
}
|
||||
|
||||
func showErrorAndExit(e error) {
|
||||
fmt.Fprintf(os.Stderr, "%s", e)
|
||||
fmt.Fprintln(os.Stderr)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func newClient(options *BaseOptions) (*ctyun.SRegion, error) {
|
||||
if len(options.AccessKey) == 0 {
|
||||
return nil, fmt.Errorf("Missing accessKey")
|
||||
}
|
||||
|
||||
if len(options.Secret) == 0 {
|
||||
return nil, fmt.Errorf("Missing secret")
|
||||
}
|
||||
|
||||
cli, err := ctyun.NewSCtyunClient("", "", "",
|
||||
options.AccessKey, options.Secret, options.Debug)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
region := cli.GetRegion(options.RegionId)
|
||||
if region == nil {
|
||||
return nil, fmt.Errorf("No such region %s", options.RegionId)
|
||||
}
|
||||
|
||||
return region, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
parser, e := getSubcommandParser()
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
e = parser.ParseArgs(os.Args[1:], false)
|
||||
options := parser.Options().(*BaseOptions)
|
||||
|
||||
if options.Help {
|
||||
fmt.Print(parser.HelpString())
|
||||
} else {
|
||||
subcmd := parser.GetSubcommand()
|
||||
subparser := subcmd.GetSubParser()
|
||||
if e != nil {
|
||||
if subparser != nil {
|
||||
fmt.Print(subparser.Usage())
|
||||
} else {
|
||||
fmt.Print(parser.Usage())
|
||||
}
|
||||
showErrorAndExit(e)
|
||||
} else {
|
||||
suboptions := subparser.Options()
|
||||
if options.SUBCOMMAND == "help" {
|
||||
e = subcmd.Invoke(suboptions)
|
||||
} else {
|
||||
var region *ctyun.SRegion
|
||||
region, e = newClient(options)
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
e = subcmd.Invoke(region, suboptions)
|
||||
}
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
26
cmd/devtool/main.go
Normal file
26
cmd/devtool/main.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// 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 (
|
||||
"yunion.io/x/onecloud/pkg/devtool/service"
|
||||
"yunion.io/x/onecloud/pkg/util/atexit"
|
||||
)
|
||||
|
||||
func main() {
|
||||
defer atexit.Handle()
|
||||
|
||||
service.StartService()
|
||||
}
|
||||
147
cmd/googlecli/main.go
Normal file
147
cmd/googlecli/main.go
Normal file
@@ -0,0 +1,147 @@
|
||||
// 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 (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/structarg"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/multicloud/google"
|
||||
_ "yunion.io/x/onecloud/pkg/multicloud/google/shell"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
type BaseOptions struct {
|
||||
Debug bool `help:"debug mode"`
|
||||
Help bool `help:"Show help"`
|
||||
ClientEmail string `help:"Client email" default:"$GOOGLE_CLIENT_EMAIL"`
|
||||
ProjectID string `help:"Project ID" default:"$GOOGLE_PROJECT_ID"`
|
||||
PrivateKeyID string `help:"Private Key ID" default:"$GOOGLE_PRIVATE_KEY_ID"`
|
||||
PrivateKey string `help:"Private Key" default:"$GOOGLE_PRIVATE_KEY"`
|
||||
RegionID string `help:"RegionID" default:"$GOOGLE_REGION"`
|
||||
SUBCOMMAND string `help:"googlecli subcommand" subcommand:"true"`
|
||||
}
|
||||
|
||||
func getSubcommandParser() (*structarg.ArgumentParser, error) {
|
||||
parse, e := structarg.NewArgumentParser(&BaseOptions{},
|
||||
"googlecli",
|
||||
"Command-line interface to google API.",
|
||||
`See "googlecli help COMMAND" for help on a specific command.`)
|
||||
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
|
||||
subcmd := parse.GetSubcommand()
|
||||
if subcmd == nil {
|
||||
return nil, fmt.Errorf("No subcommand argument.")
|
||||
}
|
||||
type HelpOptions struct {
|
||||
SUBCOMMAND string `help:"sub-command name"`
|
||||
}
|
||||
shellutils.R(&HelpOptions{}, "help", "Show help of a subcommand", func(args *HelpOptions) error {
|
||||
helpstr, e := subcmd.SubHelpString(args.SUBCOMMAND)
|
||||
if e != nil {
|
||||
return e
|
||||
} else {
|
||||
fmt.Print(helpstr)
|
||||
return nil
|
||||
}
|
||||
})
|
||||
for _, v := range shellutils.CommandTable {
|
||||
_, e := subcmd.AddSubParser(v.Options, v.Command, v.Desc, v.Callback)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
}
|
||||
return parse, nil
|
||||
}
|
||||
|
||||
func showErrorAndExit(e error) {
|
||||
log.Errorf("%s", e)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func newClient(options *BaseOptions) (*google.SRegion, error) {
|
||||
if len(options.ClientEmail) == 0 {
|
||||
return nil, fmt.Errorf("Missing ClientEmail")
|
||||
}
|
||||
|
||||
if len(options.PrivateKeyID) == 0 {
|
||||
return nil, fmt.Errorf("Missing PrivateKeyID")
|
||||
}
|
||||
|
||||
if len(options.PrivateKey) == 0 {
|
||||
return nil, fmt.Errorf("Missing PrivateKey")
|
||||
}
|
||||
|
||||
if len(options.ProjectID) == 0 {
|
||||
return nil, fmt.Errorf("Missing ProjectID")
|
||||
}
|
||||
|
||||
cli, err := google.NewGoogleClient("", "", options.ProjectID, options.ClientEmail, options.PrivateKeyID, options.PrivateKey, options.Debug)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
region := cli.GetRegion(options.RegionID)
|
||||
if region == nil {
|
||||
return nil, fmt.Errorf("No such region %s", options.RegionID)
|
||||
}
|
||||
|
||||
return region, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
parser, e := getSubcommandParser()
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
e = parser.ParseArgs(os.Args[1:], false)
|
||||
options := parser.Options().(*BaseOptions)
|
||||
|
||||
if options.Help {
|
||||
fmt.Print(parser.HelpString())
|
||||
return
|
||||
}
|
||||
subcmd := parser.GetSubcommand()
|
||||
subparser := subcmd.GetSubParser()
|
||||
if e != nil {
|
||||
if subparser != nil {
|
||||
fmt.Print(subparser.Usage())
|
||||
} else {
|
||||
fmt.Print(parser.Usage())
|
||||
}
|
||||
showErrorAndExit(e)
|
||||
return
|
||||
}
|
||||
suboptions := subparser.Options()
|
||||
if options.SUBCOMMAND == "help" {
|
||||
e = subcmd.Invoke(suboptions)
|
||||
} else {
|
||||
var region *google.SRegion
|
||||
region, e = newClient(options)
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
e = subcmd.Invoke(region, suboptions)
|
||||
}
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
}
|
||||
30
docs/parameters/secgroup.yaml
Normal file
30
docs/parameters/secgroup.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
secgroupId:
|
||||
name: secgroupId
|
||||
required: true
|
||||
in: path
|
||||
type: string
|
||||
description: 安全组名称或者ID
|
||||
|
||||
scope:
|
||||
name: scope
|
||||
in: body
|
||||
type: string
|
||||
enum: [project, domain, system]
|
||||
default: system
|
||||
description: specify scope, either project, domain or system
|
||||
|
||||
shared_projects:
|
||||
name: shared_projects
|
||||
in: body
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: test-project
|
||||
description: 项目名称或ID
|
||||
description: 共享到的项目列表, 仅scope=project有效
|
||||
|
||||
server:
|
||||
name: server
|
||||
in: query
|
||||
type: string
|
||||
description: Filter secgroups bound to specified server
|
||||
@@ -661,6 +661,13 @@ InstanceCreate:
|
||||
items:
|
||||
type: string
|
||||
description: 主机组的ID或者Name
|
||||
secgroups:
|
||||
type: array
|
||||
description: 安全组列表
|
||||
items:
|
||||
type: string
|
||||
example: default
|
||||
description: 安全组名称或ID,建议使用ID
|
||||
|
||||
|
||||
InstanceDisk:
|
||||
|
||||
48
go.mod
48
go.mod
@@ -3,8 +3,9 @@ module yunion.io/x/onecloud
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.38.0
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0
|
||||
github.com/Azure/azure-sdk-for-go v34.4.0+incompatible
|
||||
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible
|
||||
github.com/Azure/go-autorest v10.15.5+incompatible
|
||||
github.com/DataDog/dd-trace-go v0.6.1 // indirect
|
||||
github.com/DataDog/zstd v1.3.4 // indirect
|
||||
@@ -13,7 +14,7 @@ require (
|
||||
github.com/Shopify/sarama v1.20.0 // indirect
|
||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8
|
||||
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20181116160301-c6838fdc33ed
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible
|
||||
github.com/anacrolix/dht v0.0.0-20181129074040-b09db78595aa // indirect
|
||||
github.com/anacrolix/go-libutp v0.0.0-20180808010927-aebbeb60ea05 // indirect
|
||||
github.com/anacrolix/log v0.0.0-20180808012509-286fcf906b48 // indirect
|
||||
@@ -27,13 +28,10 @@ require (
|
||||
github.com/c-bata/go-prompt v0.2.1
|
||||
github.com/ceph/go-ceph v0.0.0-20181217221554-e32f9f0f2e94
|
||||
github.com/coredns/coredns v1.3.0
|
||||
github.com/coreos/bbolt v1.3.3 // indirect
|
||||
github.com/coreos/etcd v3.3.10+incompatible // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a // indirect
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20190806190131-db2462fef53b // indirect
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
|
||||
github.com/dimchansky/utfbom v1.1.0 // indirect
|
||||
github.com/dnaeon/go-vcr v1.0.1 // indirect
|
||||
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11 // indirect
|
||||
@@ -57,10 +55,7 @@ require (
|
||||
github.com/golang-plus/testing v1.0.0 // indirect
|
||||
github.com/golang-plus/uuid v1.0.0
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
|
||||
github.com/golang/protobuf v1.3.1
|
||||
github.com/google/btree v1.0.0 // indirect
|
||||
github.com/google/go-querystring v1.0.0 // indirect
|
||||
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
|
||||
github.com/golang/protobuf v1.3.2
|
||||
github.com/google/gopacket v1.1.17
|
||||
github.com/google/uuid v1.1.0 // indirect
|
||||
github.com/googleapis/gnostic v0.2.0 // indirect
|
||||
@@ -70,9 +65,6 @@ require (
|
||||
github.com/gorilla/websocket v1.4.0
|
||||
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282
|
||||
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.2 // indirect
|
||||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
|
||||
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead
|
||||
github.com/huandu/xstrings v1.2.0 // indirect
|
||||
@@ -80,8 +72,6 @@ require (
|
||||
github.com/jinzhu/gorm v1.9.1
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.0.1 // indirect
|
||||
github.com/jonboulle/clockwork v0.1.0 // indirect
|
||||
github.com/json-iterator/go v1.1.5 // indirect
|
||||
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c
|
||||
github.com/kr/pty v1.1.3
|
||||
github.com/lib/pq v1.2.0 // indirect
|
||||
@@ -95,11 +85,8 @@ require (
|
||||
github.com/mholt/caddy v0.10.11
|
||||
github.com/miekg/dns v1.1.1
|
||||
github.com/minio/minio-go v6.0.14+incompatible
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||
github.com/moul/http2curl v1.0.0
|
||||
github.com/mozillazg/go-httpheader v0.2.1 // indirect
|
||||
github.com/mozillazg/go-pinyin v0.15.0
|
||||
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
|
||||
github.com/opentracing/opentracing-go v1.0.2 // indirect
|
||||
@@ -114,30 +101,28 @@ require (
|
||||
github.com/shirou/gopsutil v2.18.10+incompatible
|
||||
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
|
||||
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9
|
||||
github.com/soheilhy/cmux v0.1.4 // indirect
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.3 // indirect
|
||||
github.com/stretchr/testify v1.3.0
|
||||
github.com/stretchr/testify v1.4.0
|
||||
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181108132626-805d01dd0e2e
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190717101923-c5c1f9751e7f
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4
|
||||
github.com/tinylib/msgp v1.1.0 // indirect
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
|
||||
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c
|
||||
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3 // indirect
|
||||
github.com/vmihailenco/msgpack v4.0.4+incompatible
|
||||
github.com/vmware/govmomi v0.19.0
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
|
||||
go.etcd.io/bbolt v1.3.3 // indirect
|
||||
go.etcd.io/etcd v3.3.10+incompatible
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738
|
||||
go.uber.org/atomic v1.4.0 // indirect
|
||||
go.uber.org/multierr v1.1.0 // indirect
|
||||
go.uber.org/zap v1.10.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
|
||||
golang.org/x/net v0.0.0-20191007182048-72f939374954
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987
|
||||
google.golang.org/grpc v1.19.0
|
||||
google.golang.org/api v0.13.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
|
||||
google.golang.org/grpc v1.23.1
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
||||
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
|
||||
@@ -150,12 +135,11 @@ require (
|
||||
k8s.io/client-go v9.0.0+incompatible
|
||||
k8s.io/klog v0.1.0 // indirect
|
||||
k8s.io/kubernetes v1.12.3
|
||||
sigs.k8s.io/yaml v1.1.0 // indirect
|
||||
yunion.io/x/jsonutils v0.0.0-20191005115334-bb1c187fc0e7
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
|
||||
yunion.io/x/pkg v0.0.0-20191024065906-00964c53d82f
|
||||
yunion.io/x/jsonutils v0.0.0-20200303051356-aa609aba0cda
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
|
||||
yunion.io/x/pkg v0.0.0-20200312093207-f07f4cb157e0
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v0.0.0-20191008135637-33eb2e4f6cc7
|
||||
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
|
||||
)
|
||||
|
||||
|
||||
158
go.sum
158
go.sum
@@ -3,11 +3,13 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
|
||||
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
|
||||
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
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=
|
||||
github.com/Azure/azure-sdk-for-go v34.4.0+incompatible h1:NQG6PyG1+y9lL5SLWy+urw+VYMQloAKwmdqAzg8ZorM=
|
||||
github.com/Azure/azure-sdk-for-go v34.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible h1:smHlbChr/JDmsyUqELZXLs0YIgpXecIGdUibuc2983s=
|
||||
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
github.com/Azure/go-autorest v10.15.5+incompatible h1:vdxx6wM1rVkKt/3niByPVjguoLWkWImOcJNvEykgBzY=
|
||||
github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
@@ -17,6 +19,7 @@ github.com/DataDog/zstd v1.3.4 h1:LAGHkXuvC6yky+C2CUG2tD7w8QlrUwpue8XwIh0X4AY=
|
||||
github.com/DataDog/zstd v1.3.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
||||
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/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
|
||||
github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
|
||||
github.com/RoaringBitmap/roaring v0.4.16 h1:NholfewybRLOwACgfqfzn/N5xa6keKNs4fP00t0cwLo=
|
||||
github.com/RoaringBitmap/roaring v0.4.16/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
|
||||
@@ -32,8 +35,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8 h1:mb7rn6WX8viizO36Nv6VVCBrgwaq01HPrZv1qq07/Yg=
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20181116160301-c6838fdc33ed h1:8Nj1ihALo/UVM2EnOVQ1EY/kwNKRwLx1GW/z3Y65czY=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20181116160301-c6838fdc33ed/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible h1:EaK5256H3ELiyaq5O/Zwd6fnghD6DqmZDQmmzzJklUU=
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
|
||||
github.com/anacrolix/dht v0.0.0-20180412060941-24cbf25b72a4/go.mod h1:hQfX2BrtuQsLQMYQwsypFAab/GvHg8qxwVi4OJdR1WI=
|
||||
github.com/anacrolix/dht v0.0.0-20181127122252-acaa69c368bb/go.mod h1:Z/mP+H70xwnUv957UXVkTrzYRhKs0mGjS0lyqS331g4=
|
||||
github.com/anacrolix/dht v0.0.0-20181129074040-b09db78595aa h1:5RyX9Tvqa9oewlJhFihkxe8biS0ojTlrNU3ryqm5g2s=
|
||||
@@ -76,8 +79,10 @@ github.com/aws/aws-sdk-go v1.21.4 h1:1xB+x6Dzev8ETmeHEiSfUVbIzmC/0EyFfXMkJpzKPCE
|
||||
github.com/aws/aws-sdk-go v1.21.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
|
||||
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
|
||||
@@ -91,18 +96,20 @@ github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2w
|
||||
github.com/c-bata/go-prompt v0.2.1 h1:HTPxmnfY4y5x3Myo7Gq4ce989jfnvZIBgdBp6y8bjYM=
|
||||
github.com/c-bata/go-prompt v0.2.1/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
|
||||
github.com/coredns/coredns v1.3.0 h1:Ubjr8ZrOpEj95/A9dqQqQAG2k5DWEFdg2ZB3tUXuULA=
|
||||
github.com/coredns/coredns v1.3.0/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0=
|
||||
github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
|
||||
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a h1:W8b4lQ4tFF21aspRGoBuCNV6V2fFJBF+pm1J6OY8Lys=
|
||||
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -117,6 +124,7 @@ github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyG
|
||||
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11 h1:m8nX8hsUghn853BJ5qB0lX+VvS6LTJPksWyILFZRYN4=
|
||||
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11/go.mod h1:s1PfVYYVmTMgCSPtho4LKBDecEHJWtiVDPNv78Z985U=
|
||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
||||
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
@@ -169,8 +177,9 @@ github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaL
|
||||
github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
|
||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/golang-plus/errors v1.0.0 h1:9Rh4itnph6OYO7wm9u3FUTLMFMKCoL07+bLiYKELxWw=
|
||||
github.com/golang-plus/errors v1.0.0/go.mod h1:YTFZjOTBcUFieeZe4q+7Umfu/sceSr3XQyBIkTkzpd8=
|
||||
github.com/golang-plus/testing v1.0.0 h1:azmFWFV44LHK/j/jAkNTbzB2G2b6HdmqF358r73m8kg=
|
||||
@@ -179,14 +188,15 @@ github.com/golang-plus/uuid v1.0.0 h1:ga84hG89vda++AGpup4N/cbfbM3O4d3R5ON9/jcN6A
|
||||
github.com/golang-plus/uuid v1.0.0/go.mod h1:pBDDRrdgRHHqyYlj1d1i2gwyBq62Zc+sP2cDiCDkBLI=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
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/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
@@ -194,28 +204,29 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z
|
||||
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
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=
|
||||
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
|
||||
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
|
||||
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY=
|
||||
github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
|
||||
github.com/google/uuid v1.1.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=
|
||||
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
|
||||
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||
github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb h1:n22Aukg/TjoypWc37dbKIpCsz0VMFPD36HQk1WKvg3A=
|
||||
github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb/go.mod h1:MBpz1MS3P4HtRcBpQU4HcjvWXZ9q+JWacMEh2/BFYbg=
|
||||
github.com/googollee/go-socket.io v0.0.0-20181214084611-0ad7206c347a h1:NMY2a78Z98wdhMHJTJxTc9BFfnGGc5ZWfgY9a23zeck=
|
||||
github.com/googollee/go-socket.io v0.0.0-20181214084611-0ad7206c347a/go.mod h1:ftBGBMhSYToR5oV4ImIPKvAIsNaTkLC+tTvoNafqxlQ=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f h1:FDM3EtwZLyhW48YRiyqjivNlNZjAObv4xt4NnJaU+NQ=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
@@ -223,6 +234,7 @@ github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
|
||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gosuri/uilive v0.0.0-20170323041506-ac356e6e42cd/go.mod h1:qkLSc0A5EXSP6B04TrN4oQoxqFI7A8XvoXSlJi8cwk8=
|
||||
@@ -231,23 +243,26 @@ github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282 h1:KFqmdzEPbU7Uck2t
|
||||
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
|
||||
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6tubcjzGMODIVG5hlrCeImaBnZzKF2N8SM=
|
||||
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.2 h1:S+ef0492XaIknb8LMjcwgW2i3cNTzDYMmDrOThOJNWc=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU=
|
||||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
|
||||
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead h1:Y9WOGZY2nw5ksbEf5AIpk+vK52Tdg/VN/rHFRfEeeGQ=
|
||||
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
|
||||
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
|
||||
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
|
||||
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
|
||||
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jinzhu/gorm v1.9.1 h1:lDSDtsCt5AGGSKTs8AHlSDbbgif4G4+CKJ8ETBDVHTA=
|
||||
github.com/jinzhu/gorm v1.9.1/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo=
|
||||
@@ -260,14 +275,15 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht
|
||||
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw=
|
||||
github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
|
||||
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
|
||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE=
|
||||
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c h1:N7A4JCA2G+j5fuFxCsJqjFU/sZe0mj8H0sSoSwbaikw=
|
||||
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c/go.mod h1:Nn5wlyECw3iJrzi0AhIWg+AJUb4PlRQVW4/3XHH1LZA=
|
||||
@@ -286,11 +302,14 @@ github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/libvirt/libvirt-go-xml v5.2.0+incompatible h1:ALyVpa0/lFfFaUpb5l0fNBohufmQG6jsOGRCl/nKEi8=
|
||||
github.com/libvirt/libvirt-go-xml v5.2.0+incompatible/go.mod h1:oBlgD3xOA01ihiK5stbhFzvieyW+jVS6kbbsMVF623A=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
|
||||
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-sqlite3 v1.7.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
@@ -327,10 +346,12 @@ github.com/minio/minio-go/v6 v6.0.33 h1:CNThMAZ9bN6OEIP8DulqlYpaXKJ18rgG/Cqm14Q4
|
||||
github.com/minio/minio-go/v6 v6.0.33/go.mod h1:vaNT59cWULS37E+E9zkuN/BVnKHyXtVGS+b04Boc66Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=
|
||||
@@ -342,6 +363,7 @@ github.com/mozillazg/go-pinyin v0.15.0/go.mod h1:bO+dztNW6O2lSJdYLha7LO3bujXzjjU
|
||||
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY=
|
||||
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
@@ -370,17 +392,20 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/pquerna/otp v1.2.0 h1:/A3+Jn+cagqayeR3iHs/L62m5ue7710D35zl1zJ1kok=
|
||||
github.com/pquerna/otp v1.2.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
|
||||
github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU=
|
||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg=
|
||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
@@ -399,22 +424,20 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE=
|
||||
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo=
|
||||
github.com/smartystreets/assertions v0.0.0-20180607162144-eb5b59917fa2 h1:hjkfjJKpNSPqJZJKSrHbQgBz+eEui8ivYlorRc9DR64=
|
||||
github.com/smartystreets/assertions v0.0.0-20180607162144-eb5b59917fa2/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbmil4Ui/dDdFBExb7/cmkNjyX5F97oglmvCDo=
|
||||
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd h1:p5kvxG4NHogJX1brTLtvUSGdW0/aBvIyqDSW7tmnsmQ=
|
||||
github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd/go.mod h1:XUKj4gbqj2QvJk/OdLWzyZ3FYli0f+MdpngyryX0gcw=
|
||||
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
@@ -422,24 +445,27 @@ github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
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 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/syncthing/syncthing v0.14.48-rc.4/go.mod h1:nw3siZwHPA6M8iSfjDCWQ402eqvEIasMQOE8nFOxy7M=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181108132626-805d01dd0e2e h1:CtKVGXKh2bfmepZ/YogAjvL/CrSy9NGZET500K7arf4=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181108132626-805d01dd0e2e/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190717101923-c5c1f9751e7f h1:TzE7Cs9HhTyfot4WIoMnbD1rWfD4Jkwy2M3Zs66CaRE=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190717101923-c5c1f9751e7f/go.mod h1:/4BhymH1yO6ljUGQgcKsd7L3W+pdKRxoRiOuoZPLnGg=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4 h1:wVKDVTKxaf0ll8ONv22Q+cazYSSmcWt7JJOeQD0LoKQ=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk=
|
||||
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e h1:T5PdfK/M1xyrHwynxMIVMWLS7f/qHwfslZphxtGnw7s=
|
||||
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
|
||||
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
|
||||
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c h1:5q7IHeqvAA4hWR1CfpTOS7RFsTDC36TaSZ8Dvc00bPk=
|
||||
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c/go.mod h1:M/I710pXKQToMdqt/D+mJ4QsnW6WDaajyB6DWFmDXBs=
|
||||
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3 h1:KfqgRfYvGRyKOQUx8GphSC8D6vVoBndzco3rESP8I4k=
|
||||
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
|
||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
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.19.0 h1:CR6tEByWCPOnRoRyhLzuHaU+6o2ybF3qufNRWS/MGrY=
|
||||
@@ -456,9 +482,12 @@ github.com/yunionio/go-ceph v0.0.0-20190912101231-6f05a06b3859 h1:wu596gn6sV3j5w
|
||||
github.com/yunionio/go-ceph v0.0.0-20190912101231-6f05a06b3859/go.mod h1:8XuBae5AzsgotLArJSewMruYVaQs8AlfsK5jBCG8T9Y=
|
||||
go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/etcd v3.3.10+incompatible h1:qXVcIR1kU3CYLD8zXDseOmBNwg0uaui53e4Wg4uj0rk=
|
||||
go.etcd.io/etcd v3.3.10+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738 h1:lWF4f9Nypl1ZqSb4gLeh/DGvBYVaUYHuiB93teOmwgc=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
|
||||
@@ -467,12 +496,10 @@ go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A=
|
||||
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc h1:c0o/qxkaO2LF5t6fQrT4b5hzyggAkLLlCUjqfRxd8Q4=
|
||||
@@ -481,6 +508,8 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/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=
|
||||
@@ -494,9 +523,10 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
|
||||
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190419010253-1f3472d942ba/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191007182048-72f939374954 h1:JGZucVF/L/TotR719NbujzadOZ2AgnYlqphQGHDCKaU=
|
||||
@@ -504,12 +534,14 @@ golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180724212812-e072cadbbdc8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -526,48 +558,62 @@ golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606122018-79a91cf218c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190830023255-19e00faab6ad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191003212358-c178f38b412c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.zx2c4.com/wireguard v0.0.20190908 h1:SUoXDdwSMtomLdvke+zz83/u9tNvl4hHmcTIWp38tow=
|
||||
golang.zx2c4.com/wireguard v0.0.20190908/go.mod h1:LhfXh5z6bLC2lW2ve6BzYZFwnnsXK3OQjySR0Yh2dO8=
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987 h1:26OAgqBTufVr8WKonCEhhjO1oKsYhHv0iM5Dg92G1TM=
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987/go.mod h1:7hq1rEDsx7/FWl8IEEnfH2Xhs6M2MNnjUfN0PeI8Rm0=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo=
|
||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk=
|
||||
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
|
||||
@@ -591,6 +637,8 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76 h1:cGc6jt7tNK7a2WfgNKjxjoU/UXXr9Q7JTqvCupZ+6+Y=
|
||||
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
|
||||
k8s.io/apimachinery v0.0.0-20181215012845-4d029f033399 h1:xdXaRQ7uNX4x6NpvxXASvlVXtKa8+WbCXK7Hjr6XZ6c=
|
||||
@@ -605,19 +653,19 @@ sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051 h1:vtZw2iwGrsARNSwRTREGjmr2BWPdxbmXVkb3kI1qu28=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v0.0.0-20191005115334-bb1c187fc0e7 h1:9NcHs2OFMyN8O8SmJ3sFm5AJSVXP3u1N3avJsbyX3RI=
|
||||
yunion.io/x/jsonutils v0.0.0-20191005115334-bb1c187fc0e7/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v0.0.0-20200303051356-aa609aba0cda h1:wSwQj3MDGchGYM2RAo1riYhrTz4apH+5XyBnchuDi84=
|
||||
yunion.io/x/jsonutils v0.0.0-20200303051356-aa609aba0cda/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
|
||||
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b h1:Z9z+7iegu0HXuL+S8taVWRd1P4b9JJOgPXIeoqYrj7c=
|
||||
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d h1:59zrDL7Ft+hDukguJRmLr/Gdu/9V75x+yX99ovZwfaA=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf h1:OsKC+2ghZHwp+Ztm/MwKlLKKRiE7QcPG8eTp0GmsHbg=
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3 h1:5Wc5hkB8PtMudmHuzCyok960RuOa9I55imIGrigSdjs=
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20191024065906-00964c53d82f h1:rliduzLUj5k4kuY9kxbMDvMtxAANAOZ/hrsslpGK+fA=
|
||||
yunion.io/x/pkg v0.0.0-20191024065906-00964c53d82f/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200312093207-f07f4cb157e0 h1:ZgNhWrnxnVjw53rjx5uV5yQCYcwM8lpVHsrchmHWQI4=
|
||||
yunion.io/x/pkg v0.0.0-20200312093207-f07f4cb157e0/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v0.0.0-20191008135637-33eb2e4f6cc7 h1:9bxOxNLNN18mJoR8GDPVtRJIpDBgA3dYmEBsuVDy0O4=
|
||||
yunion.io/x/sqlchemy v0.0.0-20191008135637-33eb2e4f6cc7/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57 h1:KtQAuLJ00RSUVqkiRmJ1DiDABiw0U3xxXnzD3lGavaY=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3 h1:bfC8EhXYvyGYldRWlzxiCM39Zfj3s3+zham9mW2h2LE=
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
@@ -20,12 +20,13 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
api "yunion.io/x/onecloud/pkg/apis/ansible"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -75,8 +76,19 @@ func (man *SAnsiblePlaybookManager) ValidateCreateData(ctx context.Context, user
|
||||
if err := pbV.Validate(data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data.Set("status", jsonutils.NewString(AnsiblePlaybookStatusInit))
|
||||
return man.SVirtualResourceBaseManager.ValidateCreateData(ctx, userCred, ownerId, query, data)
|
||||
data.Set("status", jsonutils.NewString(api.AnsiblePlaybookStatusInit))
|
||||
var err error
|
||||
input := apis.VirtualResourceCreateInput{}
|
||||
err = data.Unmarshal(&input)
|
||||
if err != nil {
|
||||
return nil, httperrors.NewInternalServerError("unmarshal VirtualResourceCreateInput fail %s", err)
|
||||
}
|
||||
input, err = man.SVirtualResourceBaseManager.ValidateCreateData(ctx, userCred, ownerId, query, input)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data.Update(jsonutils.Marshal(input))
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (apb *SAnsiblePlaybook) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) {
|
||||
@@ -90,14 +102,14 @@ func (apb *SAnsiblePlaybook) PostCreate(ctx context.Context, userCred mcclient.T
|
||||
func (man *SAnsiblePlaybookManager) InitializeData() error {
|
||||
pbs := []SAnsiblePlaybook{}
|
||||
q := AnsiblePlaybookManager.Query()
|
||||
q = q.Filter(sqlchemy.Equals(q.Field("status"), AnsiblePlaybookStatusRunning))
|
||||
q = q.Filter(sqlchemy.Equals(q.Field("status"), api.AnsiblePlaybookStatusRunning))
|
||||
if err := db.FetchModelObjects(AnsiblePlaybookManager, q, &pbs); err != nil {
|
||||
return errors.WithMessage(err, "fetch running playbooks")
|
||||
return errors.Wrap(err, "fetch running playbooks")
|
||||
}
|
||||
for i := 0; i < len(pbs); i++ {
|
||||
pb := &pbs[i]
|
||||
_, err := db.Update(pb, func() error {
|
||||
pb.Status = AnsiblePlaybookStatusUnknown
|
||||
pb.Status = api.AnsiblePlaybookStatusUnknown
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
@@ -108,14 +120,14 @@ func (man *SAnsiblePlaybookManager) InitializeData() error {
|
||||
}
|
||||
|
||||
func (apb *SAnsiblePlaybook) ValidateDeleteCondition(ctx context.Context) error {
|
||||
if apb.Status == AnsiblePlaybookStatusRunning {
|
||||
if apb.Status == api.AnsiblePlaybookStatusRunning {
|
||||
return httperrors.NewConflictError("playbook is in running state")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (apb *SAnsiblePlaybook) ValidateUpdateCondition(ctx context.Context) error {
|
||||
if apb.Status == AnsiblePlaybookStatusRunning {
|
||||
if apb.Status == api.AnsiblePlaybookStatusRunning {
|
||||
return httperrors.NewConflictError("playbook is in running state")
|
||||
}
|
||||
return nil
|
||||
@@ -127,7 +139,7 @@ func (apb *SAnsiblePlaybook) ValidateUpdateData(ctx context.Context, userCred mc
|
||||
return nil, err
|
||||
}
|
||||
apb.Playbook = pbV.Playbook // Update as a whole
|
||||
data.Set("status", jsonutils.NewString(AnsiblePlaybookStatusInit))
|
||||
data.Set("status", jsonutils.NewString(api.AnsiblePlaybookStatusInit))
|
||||
return data, nil
|
||||
}
|
||||
|
||||
@@ -184,7 +196,7 @@ func (apb *SAnsiblePlaybook) runPlaybook(ctx context.Context, userCred mcclient.
|
||||
apb.StartTime = time.Now()
|
||||
apb.EndTime = time.Time{}
|
||||
apb.Output = ""
|
||||
apb.Status = AnsiblePlaybookStatusRunning
|
||||
apb.Status = api.AnsiblePlaybookStatusRunning
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
@@ -204,12 +216,12 @@ func (apb *SAnsiblePlaybook) runPlaybook(ctx context.Context, userCred mcclient.
|
||||
_, err := db.Update(apb, func() error {
|
||||
err := man.sessions.Err(apb.Id)
|
||||
if err != nil {
|
||||
apb.Status = AnsiblePlaybookStatusCanceled
|
||||
apb.Status = api.AnsiblePlaybookStatusCanceled
|
||||
} else if runErr != nil {
|
||||
log.Warningf("playbook %s(%s) failed: %v", apb.Name, apb.Id, runErr)
|
||||
apb.Status = AnsiblePlaybookStatusFailed
|
||||
apb.Status = api.AnsiblePlaybookStatusFailed
|
||||
} else {
|
||||
apb.Status = AnsiblePlaybookStatusSucceeded
|
||||
apb.Status = api.AnsiblePlaybookStatusSucceeded
|
||||
}
|
||||
apb.EndTime = time.Now()
|
||||
return nil
|
||||
@@ -226,9 +238,9 @@ func (apb *SAnsiblePlaybook) stopPlaybook(ctx context.Context, userCred mcclient
|
||||
man.sessionsMux.Lock()
|
||||
defer man.sessionsMux.Unlock()
|
||||
if !man.sessions.Has(apb.Id) {
|
||||
if apb.Status == AnsiblePlaybookStatusRunning {
|
||||
if apb.Status == api.AnsiblePlaybookStatusRunning {
|
||||
_, err := db.Update(apb, func() error {
|
||||
apb.Status = AnsiblePlaybookStatusUnknown
|
||||
apb.Status = api.AnsiblePlaybookStatusUnknown
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -26,6 +26,8 @@ import (
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
api "yunion.io/x/onecloud/pkg/apis/ansible"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -71,8 +73,18 @@ func init() {
|
||||
}
|
||||
|
||||
func (man *SAnsiblePlaybookV2Manager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
|
||||
data.Set("status", jsonutils.NewString(AnsiblePlaybookStatusInit))
|
||||
return man.SVirtualResourceBaseManager.ValidateCreateData(ctx, userCred, ownerId, query, data)
|
||||
data.Set("status", jsonutils.NewString(api.AnsiblePlaybookStatusInit))
|
||||
input := apis.VirtualResourceCreateInput{}
|
||||
err := data.Unmarshal(&input)
|
||||
if err != nil {
|
||||
return nil, httperrors.NewInternalServerError("unmarshal StandaloneResourceCreateInput fail %s", err)
|
||||
}
|
||||
input, err = man.SVirtualResourceBaseManager.ValidateCreateData(ctx, userCred, ownerId, query, input)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data.Update(jsonutils.Marshal(input))
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (apb *SAnsiblePlaybookV2) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) {
|
||||
@@ -86,14 +98,14 @@ func (apb *SAnsiblePlaybookV2) PostCreate(ctx context.Context, userCred mcclient
|
||||
func (man *SAnsiblePlaybookV2Manager) InitializeData() error {
|
||||
pbs := []SAnsiblePlaybookV2{}
|
||||
q := AnsiblePlaybookV2Manager.Query()
|
||||
q = q.Filter(sqlchemy.Equals(q.Field("status"), AnsiblePlaybookStatusRunning))
|
||||
q = q.Filter(sqlchemy.Equals(q.Field("status"), api.AnsiblePlaybookStatusRunning))
|
||||
if err := db.FetchModelObjects(AnsiblePlaybookV2Manager, q, &pbs); err != nil {
|
||||
return errors.WithMessage(err, "fetch running playbooks")
|
||||
}
|
||||
for i := 0; i < len(pbs); i++ {
|
||||
pb := &pbs[i]
|
||||
_, err := db.Update(pb, func() error {
|
||||
pb.Status = AnsiblePlaybookStatusUnknown
|
||||
pb.Status = api.AnsiblePlaybookStatusUnknown
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
@@ -104,7 +116,7 @@ func (man *SAnsiblePlaybookV2Manager) InitializeData() error {
|
||||
}
|
||||
|
||||
func (apb *SAnsiblePlaybookV2) ValidateDeleteCondition(ctx context.Context) error {
|
||||
if apb.Status == AnsiblePlaybookStatusRunning {
|
||||
if apb.Status == api.AnsiblePlaybookStatusRunning {
|
||||
return httperrors.NewConflictError("playbook is in running state")
|
||||
}
|
||||
return nil
|
||||
@@ -173,7 +185,7 @@ func (apb *SAnsiblePlaybookV2) runPlaybook(ctx context.Context, userCred mcclien
|
||||
apb.StartTime = time.Now()
|
||||
apb.EndTime = time.Time{}
|
||||
apb.Output = ""
|
||||
apb.Status = AnsiblePlaybookStatusRunning
|
||||
apb.Status = api.AnsiblePlaybookStatusRunning
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
@@ -200,12 +212,12 @@ func (apb *SAnsiblePlaybookV2) runPlaybook(ctx context.Context, userCred mcclien
|
||||
_, err := db.Update(apb, func() error {
|
||||
err := man.sessions.Err(apb.Id)
|
||||
if err != nil {
|
||||
apb.Status = AnsiblePlaybookStatusCanceled
|
||||
apb.Status = api.AnsiblePlaybookStatusCanceled
|
||||
} else if runErr != nil {
|
||||
log.Warningf("playbook %s(%s) failed: %v", apb.Name, apb.Id, runErr)
|
||||
apb.Status = AnsiblePlaybookStatusFailed
|
||||
apb.Status = api.AnsiblePlaybookStatusFailed
|
||||
} else {
|
||||
apb.Status = AnsiblePlaybookStatusSucceeded
|
||||
apb.Status = api.AnsiblePlaybookStatusSucceeded
|
||||
}
|
||||
apb.EndTime = time.Now()
|
||||
return nil
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/apigateway/constants"
|
||||
"yunion.io/x/onecloud/pkg/apigateway/options"
|
||||
policytool "yunion.io/x/onecloud/pkg/apigateway/policy"
|
||||
"yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/appctx"
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
|
||||
@@ -646,8 +647,11 @@ func getUserAuthCookie(ctx context.Context, s *mcclient.ClientSession, token mcc
|
||||
}
|
||||
|
||||
func getLBAgentInfo(s *mcclient.ClientSession, token mcclient.TokenCredential) (*jsonutils.JSONDict, error) {
|
||||
|
||||
lbagents, err := modules.LoadbalancerAgents.List(s, nil)
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString("hb_last_seen.isnotempty()"), "filter.0")
|
||||
params.Add(jsonutils.NewInt(1), "limit")
|
||||
params.Add(jsonutils.JSONFalse, "details")
|
||||
lbagents, err := modules.LoadbalancerAgents.List(s, params)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "user %s get lbagent", token.GetUserName())
|
||||
}
|
||||
@@ -665,6 +669,7 @@ func getLBAgentInfo(s *mcclient.ClientSession, token mcclient.TokenCredential) (
|
||||
}
|
||||
|
||||
func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.TokenCredential, req *http.Request) (*jsonutils.JSONDict, error) {
|
||||
log.Infof("getUserInfo modules.UsersV3.Get")
|
||||
usr, err := modules.UsersV3.Get(s, token.GetUserId(), nil)
|
||||
if err != nil {
|
||||
log.Errorf("modules.UsersV3.Get fail %s", err)
|
||||
@@ -693,6 +698,7 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
|
||||
data.Add(jsonutils.NewString(token.GetProjectDomain()), "projectDomain")
|
||||
data.Add(jsonutils.NewString(token.GetProjectDomainId()), "projectDomainId")
|
||||
|
||||
log.Infof("getUserInfo modules.RoleAssignments.List")
|
||||
query := jsonutils.NewDict()
|
||||
query.Add(jsonutils.JSONNull, "effective")
|
||||
query.Add(jsonutils.JSONNull, "include_names")
|
||||
@@ -772,6 +778,7 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
|
||||
log.Errorf("fail to find services????: %#v %s", adminToken, curReg)
|
||||
}
|
||||
|
||||
log.Infof("getUserInfo getLBAgentInfo")
|
||||
lb, err := getLBAgentInfo(s, adminToken)
|
||||
if err != nil {
|
||||
log.Errorf("getLBAgentInfo fail %s", err)
|
||||
@@ -788,13 +795,23 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
|
||||
}
|
||||
}
|
||||
|
||||
log.Infof("getUserInfo modules.Hosts.Get")
|
||||
s2 := auth.GetSession(ctx, token, FetchRegion(req), "v2")
|
||||
cap, err := modules.Capabilities.List(s2, nil)
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString("host_type"), "field")
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
params.Add(jsonutils.JSONTrue, "usable")
|
||||
params.Add(jsonutils.JSONTrue, "show_emulated")
|
||||
cap, err := modules.Hosts.Get(s2, "distinct-field", params)
|
||||
if err != nil {
|
||||
log.Errorf("modules.Capabilities.List fail %s", err)
|
||||
log.Errorf("modules.Servers.Get distinct-field fail %s", err)
|
||||
} else {
|
||||
hypervisors, _ := cap.Data[0].Get("hypervisors")
|
||||
data.Add(hypervisors, "hypervisors")
|
||||
hostTypes, _ := jsonutils.GetStringArray(cap, "host_type")
|
||||
hypervisors := make([]string, len(hostTypes))
|
||||
for i, hostType := range hostTypes {
|
||||
hypervisors[i] = compute.HOSTTYPE_HYPERVISOR[hostType]
|
||||
}
|
||||
data.Add(jsonutils.NewStringArray(hypervisors), "hypervisors")
|
||||
}
|
||||
|
||||
data.Add(menus, "menus")
|
||||
|
||||
@@ -24,18 +24,39 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/360EntSecGroup-Skylar/excelize"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apigateway/options"
|
||||
"yunion.io/x/onecloud/pkg/appctx"
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/auth"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
)
|
||||
|
||||
const (
|
||||
HOST_MAC = "*MAC地址"
|
||||
HOST_NAME = "*名称"
|
||||
HOST_IPMI_ADDR = "*IPMI地址"
|
||||
HOST_IPMI_USERNAME = "*IPMI用户名"
|
||||
HOST_IPMI_PASSWORD = "*IPMI密码"
|
||||
HOST_MNG_IP_ADDR = "*管理口IP地址"
|
||||
HOST_IPMI_ADDR_OPTIONAL = "IPMI地址"
|
||||
HOST_IPMI_USERNAME_OPTIONAL = "IPMI用户名"
|
||||
HOST_IPMI_PASSWORD_OPTIONAL = "IPMI密码"
|
||||
HOST_MNG_IP_ADDR_OPTIONAL = "管理口IP地址"
|
||||
)
|
||||
|
||||
const (
|
||||
BATCH_USER_REGISTER_QUANTITY_LIMITATION = 1000
|
||||
BATCH_HOST_REGISTER_QUANTITY_LIMITATION = 1000
|
||||
)
|
||||
|
||||
func FetchSession(ctx context.Context, r *http.Request, apiVersion string) *mcclient.ClientSession {
|
||||
token := AppContextToken(ctx)
|
||||
session := auth.GetSession(ctx, token, FetchRegion(r), apiVersion)
|
||||
@@ -96,6 +117,10 @@ func (mh *MiscHandler) PostUploads(ctx context.Context, w http.ResponseWriter, r
|
||||
case "BatchHostRegister":
|
||||
mh.DoBatchHostRegister(ctx, w, req)
|
||||
return
|
||||
// 用户批量注册
|
||||
case "BatchUserRegister":
|
||||
mh.DoBatchUserRegister(ctx, w, req)
|
||||
return
|
||||
default:
|
||||
err := httperrors.NewInputParameterError("Unsupported action %s", actions[0])
|
||||
httperrors.JsonClientError(w, err)
|
||||
@@ -135,29 +160,207 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
|
||||
log.Errorf(err.Error())
|
||||
e := httperrors.NewInternalServerError("can't parse file")
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
h := ""
|
||||
// skipped header row
|
||||
for _, row := range xlsx.GetRows("hosts")[1:] {
|
||||
if len(row) < 4 {
|
||||
log.Debugf("batchHostRegister row length too short (less than 4) %s", row)
|
||||
rows := xlsx.GetRows("hosts")
|
||||
if len(rows) == 0 {
|
||||
e := httperrors.NewGeneralError(fmt.Errorf("empty file content"))
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
paramKeys := []string{}
|
||||
for _, title := range rows[0] {
|
||||
switch title {
|
||||
case HOST_MAC:
|
||||
paramKeys = append(paramKeys, "access_mac")
|
||||
case HOST_NAME:
|
||||
paramKeys = append(paramKeys, "name")
|
||||
case HOST_IPMI_ADDR, HOST_IPMI_ADDR_OPTIONAL:
|
||||
paramKeys = append(paramKeys, "ipmi_ip_addr")
|
||||
case HOST_IPMI_USERNAME, HOST_IPMI_USERNAME_OPTIONAL:
|
||||
paramKeys = append(paramKeys, "ipmi_username")
|
||||
case HOST_IPMI_PASSWORD, HOST_IPMI_PASSWORD_OPTIONAL:
|
||||
paramKeys = append(paramKeys, "ipmi_password")
|
||||
case HOST_MNG_IP_ADDR, HOST_MNG_IP_ADDR_OPTIONAL:
|
||||
paramKeys = append(paramKeys, "access_ip")
|
||||
default:
|
||||
e := httperrors.NewInternalServerError("empty file content")
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
h = h + strings.Join(row, ",") + "\n"
|
||||
}
|
||||
|
||||
s := FetchSession(ctx, req, "")
|
||||
// skipped header row
|
||||
if len(rows) > BATCH_HOST_REGISTER_QUANTITY_LIMITATION {
|
||||
e := httperrors.NewInputParameterError(fmt.Sprintf("beyond limitation. excel file rows must less than %d", BATCH_HOST_REGISTER_QUANTITY_LIMITATION))
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
hosts := bytes.Buffer{}
|
||||
for _, row := range rows[1:] {
|
||||
hosts.WriteString(strings.Join(row, ",") + "\n")
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("hosts", jsonutils.NewString(h))
|
||||
resp, err := modules.Hosts.DoBatchRegister(s, params)
|
||||
s := FetchSession(ctx, req, "")
|
||||
params.Set("hosts", jsonutils.NewString(hosts.String()))
|
||||
|
||||
// extra params
|
||||
for k, values := range req.MultipartForm.Value {
|
||||
if len(values) > 0 && k != "action" {
|
||||
params.Set(k, jsonutils.NewString(values[0]))
|
||||
}
|
||||
}
|
||||
|
||||
submitResult, err := modules.Hosts.BatchRegister(s, paramKeys, params)
|
||||
if err != nil {
|
||||
e := httperrors.NewGeneralError(err)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
appsrv.SendJSON(w, resp)
|
||||
w.WriteHeader(207)
|
||||
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(submitResult))
|
||||
}
|
||||
|
||||
func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
adminS := auth.GetAdminSession(ctx, FetchRegion(req), "")
|
||||
s := FetchSession(ctx, req, "")
|
||||
files := req.MultipartForm.File
|
||||
|
||||
userfiles, ok := files["users"]
|
||||
if !ok || len(userfiles) == 0 || userfiles[0] == nil {
|
||||
e := httperrors.NewInputParameterError("Missing parameter %s", "users")
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
fileHeader := userfiles[0].Header
|
||||
contentType := fileHeader.Get("Content-Type")
|
||||
if contentType != "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" {
|
||||
e := httperrors.NewInputParameterError("Wrong content type %s, required application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", contentType)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
file, err := userfiles[0].Open()
|
||||
defer file.Close()
|
||||
if err != nil {
|
||||
log.Errorf(err.Error())
|
||||
e := httperrors.NewInternalServerError("can't open file")
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
xlsx, err := excelize.OpenReader(file)
|
||||
if err != nil {
|
||||
log.Errorf(err.Error())
|
||||
e := httperrors.NewInternalServerError("can't parse file")
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
// skipped header row
|
||||
rows := xlsx.GetRows("users")
|
||||
if len(rows) <= 1 {
|
||||
e := httperrors.NewInputParameterError("empty file")
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
} else if len(rows) > BATCH_USER_REGISTER_QUANTITY_LIMITATION {
|
||||
e := httperrors.NewInputParameterError(fmt.Sprintf("beyond limitation.excel file rows must less than %d", BATCH_USER_REGISTER_QUANTITY_LIMITATION))
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
users := []jsonutils.JSONObject{}
|
||||
names := map[string]bool{}
|
||||
domains := map[string]string{}
|
||||
for i, row := range rows[1:] {
|
||||
rowIdx := i + 2
|
||||
name := row[0]
|
||||
password := row[1]
|
||||
domain := row[2]
|
||||
allowWebConsole := strings.ToLower(row[3])
|
||||
|
||||
// 忽略空白行
|
||||
rowStr := strings.Join(row, "")
|
||||
if len(strings.TrimSpace(rowStr)) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
if len(name) == 0 {
|
||||
e := httperrors.NewClientError("row %d name is empty", rowIdx)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
if _, ok := names[name]; ok {
|
||||
e := httperrors.NewClientError("row %d duplicate name %s", rowIdx, name)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
} else {
|
||||
names[name] = true
|
||||
_, err := modules.UsersV3.Get(s, name, nil)
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
domainId, ok := domains[domain]
|
||||
if !ok {
|
||||
if len(domain) == 0 {
|
||||
e := httperrors.NewClientError("row %d domain is empty", rowIdx)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
id, err := modules.Domains.GetId(adminS, domain, nil)
|
||||
if err != nil {
|
||||
httperrors.JsonClientError(w, httperrors.NewGeneralError(err))
|
||||
return
|
||||
}
|
||||
|
||||
domainId = id
|
||||
domains[domain] = id
|
||||
}
|
||||
|
||||
user := jsonutils.NewDict()
|
||||
user.Add(jsonutils.NewString(name), "name")
|
||||
user.Add(jsonutils.NewString(domainId), "domain_id")
|
||||
if len(password) > 0 {
|
||||
user.Add(jsonutils.NewString(password), "password")
|
||||
user.Add(jsonutils.JSONTrue, "skip_password_complexity_check")
|
||||
}
|
||||
|
||||
if allowWebConsole == "true" || allowWebConsole == "1" {
|
||||
user.Add(jsonutils.JSONTrue, "allow_web_console")
|
||||
} else {
|
||||
user.Add(jsonutils.JSONFalse, "allow_web_console")
|
||||
}
|
||||
|
||||
users = append(users, user)
|
||||
}
|
||||
|
||||
// batch create
|
||||
var userG errgroup.Group
|
||||
for i := range users {
|
||||
user := users[i]
|
||||
userG.Go(func() error {
|
||||
_, err := modules.UsersV3.Create(s, user)
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
if err := userG.Wait(); err != nil {
|
||||
e := httperrors.NewGeneralError(err)
|
||||
httperrors.GeneralServerError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
appsrv.SendJSON(w, jsonutils.NewDict())
|
||||
}
|
||||
|
||||
func (mh *MiscHandler) getDownloadsHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
@@ -168,23 +371,60 @@ func (mh *MiscHandler) getDownloadsHandler(ctx context.Context, w http.ResponseW
|
||||
return
|
||||
}
|
||||
|
||||
var err error
|
||||
var content bytes.Buffer
|
||||
switch template {
|
||||
case "BatchHostRegister":
|
||||
records := [][]string{{"MAC地址", "名称", "IPMI地址", "IPMI用户名", "IPMI密码"}}
|
||||
content, err := writeXlsx("hosts", records)
|
||||
records := [][]string{{HOST_MAC, HOST_NAME, HOST_IPMI_ADDR_OPTIONAL, HOST_IPMI_USERNAME_OPTIONAL, HOST_IPMI_PASSWORD_OPTIONAL}}
|
||||
content, err = writeXlsx("hosts", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
return
|
||||
}
|
||||
case "BatchHostISORegister":
|
||||
records := [][]string{{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR}}
|
||||
content, err = writeXlsx("hosts", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
return
|
||||
}
|
||||
case "BatchHostPXERegister":
|
||||
records := [][]string{{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR_OPTIONAL}}
|
||||
content, err = writeXlsx("hosts", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
return
|
||||
}
|
||||
case "BatchUserRegister":
|
||||
records := [][]string{{"*用户名(user)", "用户密码(password)", "*部门/域(domain)", "*是否登录控制台(allow_web_console:true、false)"}}
|
||||
content, err = writeXlsx("users", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
return
|
||||
}
|
||||
case "BatchProjectRegister":
|
||||
var titles []string
|
||||
if options.Options.NonDefaultDomainProjects {
|
||||
titles = []string{"项目名称", "域", "配额"}
|
||||
} else {
|
||||
titles = []string{"项目名称", "域"}
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
w.Header().Set("Content-Disposition", "Attachment; filename=hosts_template.xlsx")
|
||||
w.Write(content.Bytes())
|
||||
return
|
||||
records := [][]string{titles}
|
||||
content, err = writeXlsx("projects", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
return
|
||||
}
|
||||
default:
|
||||
httperrors.InputParameterError(w, "template not found %s", template)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
w.Header().Set("Content-Disposition", "Attachment; filename=template.xlsx")
|
||||
w.Write(content.Bytes())
|
||||
return
|
||||
}
|
||||
|
||||
func (mh *MiscHandler) postPIUploads(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
@@ -606,28 +606,45 @@ func (f *ResourceHandlers) patchJointHandler(ctx context.Context, w http.Respons
|
||||
}
|
||||
}
|
||||
|
||||
// batch update Joint
|
||||
// * batch update Joint
|
||||
// * put specific
|
||||
// /<resname>/<resid>/<resname2>
|
||||
// /<resname>/<resid>/<spec>
|
||||
func (f *ResourceHandlers) batchUpdateJointHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
req := newRequest(ctx, w, r).WithMod1().WithMod2()
|
||||
req := newRequest(ctx, w, r).WithMod1()
|
||||
if err := req.Error(); err != nil {
|
||||
httperrors.GeneralServerError(w, err)
|
||||
return
|
||||
}
|
||||
session := req.Session()
|
||||
module := req.Mod1()
|
||||
module2 := req.Mod2()
|
||||
body := req.Body()
|
||||
query := req.Query()
|
||||
|
||||
idlist := fetchIdList(query, w)
|
||||
if idlist == nil {
|
||||
if idlist, _ := query.GetArray("id"); len(idlist) == 0 {
|
||||
// do put specific
|
||||
spec := req.ResName2()
|
||||
obj, e := module.PutSpecific(session, req.ResID(), spec, query, body)
|
||||
if e != nil {
|
||||
httperrors.GeneralServerError(w, e)
|
||||
} else {
|
||||
appsrv.SendJSON(w, obj)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
req = req.WithMod2()
|
||||
if err := req.Error(); err != nil {
|
||||
httperrors.GeneralServerError(w, err)
|
||||
return
|
||||
}
|
||||
module2 := req.Mod2()
|
||||
jmod, e := modulebase.GetJointModule2(session, module, module2)
|
||||
if e != nil { // update joint
|
||||
httperrors.GeneralServerError(w, e)
|
||||
return
|
||||
}
|
||||
idlist := fetchIdList(query, w)
|
||||
ret := jmod.BatchUpdate(session, req.ResID(), idlist, query, body)
|
||||
w.WriteHeader(207)
|
||||
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(ret))
|
||||
|
||||
@@ -117,15 +117,24 @@ func rpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
v, ok := retobj.Interface().(jsonutils.JSONObject)
|
||||
if ok {
|
||||
appsrv.SendJSON(w, v)
|
||||
} else {
|
||||
httperrors.BadGatewayError(w, "recv invalid data")
|
||||
return
|
||||
}
|
||||
|
||||
v2, ok := retobj.Interface().([]modulebase.SubmitResult)
|
||||
if ok {
|
||||
w.WriteHeader(207)
|
||||
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(v2))
|
||||
return
|
||||
}
|
||||
|
||||
httperrors.BadGatewayError(w, "recv invalid data")
|
||||
} else {
|
||||
v, ok := reterr.Interface().(*httputils.JSONClientError)
|
||||
if ok {
|
||||
httperrors.JsonClientError(w, v)
|
||||
} else {
|
||||
httperrors.BadGatewayError(w, fmt.Sprintf("%s", reterr.Interface()))
|
||||
return
|
||||
}
|
||||
|
||||
httperrors.BadGatewayError(w, fmt.Sprintf("%s", reterr.Interface()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,9 +29,21 @@ type GatewayOptions struct {
|
||||
|
||||
SqlitePath string `help:"sqlite db path" default:"/etc/yunion/data/yunionapi.db"`
|
||||
|
||||
common_options.CommonOptions
|
||||
common_options.CommonOptions `"request_worker_count->default":"32"`
|
||||
}
|
||||
|
||||
var (
|
||||
Options GatewayOptions
|
||||
Options *GatewayOptions
|
||||
)
|
||||
|
||||
func OnOptionsChange(oldO, newO interface{}) bool {
|
||||
oldOpts := oldO.(*GatewayOptions)
|
||||
newOpts := newO.(*GatewayOptions)
|
||||
|
||||
changed := false
|
||||
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
|
||||
changed = true
|
||||
}
|
||||
|
||||
return changed
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/apigateway/app"
|
||||
"yunion.io/x/onecloud/pkg/apigateway/clientman"
|
||||
"yunion.io/x/onecloud/pkg/apigateway/options"
|
||||
api "yunion.io/x/onecloud/pkg/apis/apigateway"
|
||||
app_common "yunion.io/x/onecloud/pkg/cloudcommon/app"
|
||||
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -32,14 +33,17 @@ import (
|
||||
)
|
||||
|
||||
func StartService() {
|
||||
opts := &options.Options
|
||||
options.Options = &options.GatewayOptions{}
|
||||
opts := options.Options
|
||||
baseOpts := &opts.BaseOptions
|
||||
commonOpts := &opts.CommonOptions
|
||||
common_options.ParseOptions(opts, os.Args, "apigateway.conf", "apigateway")
|
||||
common_options.ParseOptions(opts, os.Args, "apigateway.conf", api.SERVICE_TYPE)
|
||||
app_common.InitAuth(commonOpts, func() {
|
||||
log.Infof("Auth complete.")
|
||||
})
|
||||
|
||||
common_options.StartOptionManager(opts, opts.ConfigSyncPeriodSeconds, api.SERVICE_TYPE, api.SERVICE_VERSION, options.OnOptionsChange)
|
||||
|
||||
if opts.DisableModuleApiVersion {
|
||||
mcclient.DisableApiVersionByModule()
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package models
|
||||
package ansible
|
||||
|
||||
const (
|
||||
AnsiblePlaybookStatusInit = "init"
|
||||
20
pkg/apis/apigateway/consts.go
Normal file
20
pkg/apis/apigateway/consts.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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 apigateway
|
||||
|
||||
const (
|
||||
SERVICE_TYPE = "yunionapi"
|
||||
SERVICE_VERSION = ""
|
||||
)
|
||||
15
pkg/apis/apigateway/doc.go
Normal file
15
pkg/apis/apigateway/doc.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// 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 apigateway // import "yunion.io/x/onecloud/pkg/apis/apigateway"
|
||||
38
pkg/apis/cloudevent/cloudevent.go
Normal file
38
pkg/apis/cloudevent/cloudevent.go
Normal file
@@ -0,0 +1,38 @@
|
||||
// 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 cloudevent
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type CloudeventListInput struct {
|
||||
apis.BaseListInput
|
||||
|
||||
// 根据平台过滤
|
||||
Providers []string `json:"providers"`
|
||||
// 根据品牌过滤
|
||||
Brands []string `json:"brands"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Brand []string `json:"brand" deprecated-by:"brands"`
|
||||
|
||||
// 操作日志起始时间
|
||||
Since time.Time `json:"since"`
|
||||
// 操作日志截止时间
|
||||
Until time.Time `json:"until"`
|
||||
}
|
||||
47
pkg/apis/cloudevent/cloudevent_const.go
Normal file
47
pkg/apis/cloudevent/cloudevent_const.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 cloudevent
|
||||
|
||||
const (
|
||||
CLOUD_EVENT_SERVICE_COMPUTE = "compute"
|
||||
CLOUD_EVENT_SERVICE_UNKNOWN = "unknown"
|
||||
|
||||
CLOUD_EVENT_RESOURCE_TYPE_SERVER = "server"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_BUCKET = "bucket"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_DBINSTANCEACCOUNT = "dbinstanceaccount"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_DBINSTANCEBACKUP = "dbinstancebackup"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_DBINSTANCEDATABASE = "dbinstancedatabase"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_DBINSTANCEPARAMETER = "dbinstanceparameter"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_DBINSTANCEPRIVILEGE = "dbinstanceprivilege"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_DBINSTANCE = "dbinstance"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_DISK = "disk"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_EIP = "eip"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_HOST = "host"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_IMAGE = "image"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_LOADBALANCERBACKENDGROUP = "loadbalancerbackendgroup"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_LOADBALANCERBACKEND = "loadbalancerbackend"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_LOADBALANCERLISTENERRULE = "loadbalancerlistenerrule"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_LOADBALANCERLISTENER = "loadbalancerlistener"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_LOADBALANCER = "loadbalancer"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_NATDENTRY = "natdentry"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_NATGATEWAY = "natgateway"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_NATSENTRY = "natsentry"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_NETWORKINTERFACE = "networkinterface"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_NETWORK = "network"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_SECGROUPCACHE = "secgroupcache"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_SNAPSHOTPOLICY = "snapshotpolicy"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_SNAPSHOT = "snapshot"
|
||||
CLOUD_EVENT_RESOURCE_TYPE_VPC = "vpc"
|
||||
)
|
||||
15
pkg/apis/cloudevent/doc.go
Normal file
15
pkg/apis/cloudevent/doc.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// 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 cloudevent // import "yunion.io/x/onecloud/pkg/apis/cloudevent"
|
||||
15
pkg/apis/cloudprovider/doc.go
Normal file
15
pkg/apis/cloudprovider/doc.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// 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 cloudprovider // import "yunion.io/x/onecloud/pkg/apis/cloudprovider"
|
||||
23
pkg/apis/cloudprovider/zz_generated.model.go
Normal file
23
pkg/apis/cloudprovider/zz_generated.model.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// 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.
|
||||
|
||||
// Code generated by model-api-gen. DO NOT EDIT.
|
||||
|
||||
package cloudprovider
|
||||
|
||||
// SGeographicInfo is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SGeographicInfo.
|
||||
type SGeographicInfo struct {
|
||||
Latitude float32 `json:"latitude"`
|
||||
Longitude float32 `json:"longitude"`
|
||||
City string `json:"city"`
|
||||
CountryCode string `json:"country_code"`
|
||||
}
|
||||
@@ -121,8 +121,6 @@ type ServerConfigs struct {
|
||||
// ResourceType "shared|prepaid|dedicated"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
InstanceType string `json:"instance_type"`
|
||||
Project string `json:"project_id"`
|
||||
Domain string `json:"domain_id"`
|
||||
Backup bool `json:"backup"`
|
||||
Count int `json:"count"`
|
||||
|
||||
@@ -156,38 +154,41 @@ type DeployConfig struct {
|
||||
}
|
||||
|
||||
type ServerCreateInput struct {
|
||||
apis.Meta
|
||||
apis.VirtualResourceCreateInput
|
||||
DeletePreventableCreateInput
|
||||
|
||||
*ServerConfigs
|
||||
|
||||
Name string `json:"name"`
|
||||
GenerateName string `json:"generate_name"`
|
||||
VmemSize int `json:"vmem_size"`
|
||||
VcpuCount int `json:"vcpu_count"`
|
||||
UserData string `json:"user_data"`
|
||||
VmemSize int `json:"vmem_size"`
|
||||
VcpuCount int `json:"vcpu_count"`
|
||||
UserData string `json:"user_data"`
|
||||
Metadata map[string]string `json:"__meta__"`
|
||||
|
||||
KeypairId string `json:"keypair_id"`
|
||||
Password string `json:"password"`
|
||||
Cdrom string `json:"cdrom"`
|
||||
Vga string `json:"vga"`
|
||||
Vdi string `json:"vdi"`
|
||||
Bios string `json:"bios"`
|
||||
Description string `json:"description"`
|
||||
BootOrder string `json:"boot_order"`
|
||||
EnableCloudInit bool `json:"enable_cloud_init"`
|
||||
ResetPassword *bool `json:"reset_password"`
|
||||
DisableDelete *bool `json:"disable_delete"`
|
||||
ShutdownBehavior string `json:"shutdown_behavior"`
|
||||
AutoStart bool `json:"auto_start"`
|
||||
DeployConfigs []*DeployConfig `json:"deploy_configs"`
|
||||
IsSystem bool `json:"is_system"`
|
||||
Duration string `json:"duration"`
|
||||
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
|
||||
SecgroupId string `json:"secgrp_id"`
|
||||
EipBw int `json:"eip_bw,omitzero"`
|
||||
EipChargeType string `json:"eip_charge_type,omitempty"`
|
||||
Eip string `json:"eip,omitempty"`
|
||||
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
|
||||
// swagger:ignore
|
||||
Keypair string `json:"keypair" deprecated-by:"keypair_id"`
|
||||
KeypairId string `json:"keypair_id"`
|
||||
Password string `json:"password"`
|
||||
Cdrom string `json:"cdrom"`
|
||||
Vga string `json:"vga"`
|
||||
Vdi string `json:"vdi"`
|
||||
Bios string `json:"bios"`
|
||||
// Description string `json:"description"`
|
||||
BootOrder string `json:"boot_order"`
|
||||
EnableCloudInit bool `json:"enable_cloud_init"`
|
||||
ResetPassword *bool `json:"reset_password"`
|
||||
// DisableDelete *bool `json:"disable_delete"`
|
||||
ShutdownBehavior string `json:"shutdown_behavior"`
|
||||
AutoStart bool `json:"auto_start"`
|
||||
DeployConfigs []*DeployConfig `json:"deploy_configs"`
|
||||
// IsSystem bool `json:"is_system"`
|
||||
Duration string `json:"duration"`
|
||||
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
|
||||
SecgroupId string `json:"secgrp_id"`
|
||||
EipBw int `json:"eip_bw,omitzero"`
|
||||
EipChargeType string `json:"eip_charge_type,omitempty"`
|
||||
Eip string `json:"eip,omitempty"`
|
||||
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
|
||||
Secgroups []string `json:"secgroups"`
|
||||
|
||||
OsType string `json:"os_type"`
|
||||
// Fill by server
|
||||
|
||||
@@ -14,6 +14,16 @@
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"yunion.io/x/pkg/errors"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
)
|
||||
|
||||
const (
|
||||
BUCKET_OPS_STATS_CHANGE = "stats_change"
|
||||
|
||||
@@ -30,3 +40,53 @@ const (
|
||||
BUCKET_UPLOAD_OBJECT_ACL_HEADER = "X-Yunion-Bucket-Upload-Acl"
|
||||
BUCKET_UPLOAD_OBJECT_STORAGECLASS_HEADER = "X-Yunion-Bucket-Upload-Storageclass"
|
||||
)
|
||||
|
||||
type BucketCreateInput struct {
|
||||
apis.VirtualResourceCreateInput
|
||||
RegionalResourceCreateInput
|
||||
ManagedResourceCreateInput
|
||||
|
||||
StorageClass string `json:"storage_class"`
|
||||
}
|
||||
|
||||
type BucketDetail struct {
|
||||
apis.Meta
|
||||
SBucket
|
||||
CloudproviderDetails
|
||||
}
|
||||
|
||||
type BucketObjectsActionInput struct {
|
||||
Key []string
|
||||
}
|
||||
|
||||
type BucketAclInput struct {
|
||||
BucketObjectsActionInput
|
||||
|
||||
Acl cloudprovider.TBucketACLType
|
||||
}
|
||||
|
||||
func (input *BucketAclInput) Validate() error {
|
||||
switch input.Acl {
|
||||
case cloudprovider.ACLPrivate, cloudprovider.ACLAuthRead, cloudprovider.ACLPublicRead, cloudprovider.ACLPublicReadWrite:
|
||||
// do nothing
|
||||
default:
|
||||
return errors.Wrap(httperrors.ErrInputParameter, "acl")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BucketMetadataInput struct {
|
||||
BucketObjectsActionInput
|
||||
|
||||
Metadata http.Header
|
||||
}
|
||||
|
||||
func (input *BucketMetadataInput) Validate() error {
|
||||
if len(input.Key) == 0 {
|
||||
return errors.Wrap(httperrors.ErrEmptyRequest, "key")
|
||||
}
|
||||
if len(input.Metadata) == 0 {
|
||||
return errors.Wrap(httperrors.ErrEmptyRequest, "metadata")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -16,49 +16,44 @@ package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
)
|
||||
|
||||
type CloudaccountCreateInput struct {
|
||||
apis.Meta
|
||||
apis.EnabledStatusStandaloneResourceCreateInput
|
||||
|
||||
Provider string
|
||||
AccountId string
|
||||
Brand string
|
||||
IsPublicCloud bool
|
||||
IsOnPremise bool
|
||||
Account string
|
||||
Secret string
|
||||
AccessUrl string
|
||||
Tenant string
|
||||
TenantId string
|
||||
Name string
|
||||
Description string
|
||||
Enabled bool
|
||||
EnableAutoSync bool
|
||||
SyncIntervalSeconds int
|
||||
AutoCreateProject bool
|
||||
Options *jsonutils.JSONObject
|
||||
|
||||
ProjectName string //OpenStack
|
||||
DomainName string //OpenStack
|
||||
Username string //OpenStack Esxi ZStack
|
||||
Password string //OpenStack Esxi ZStack
|
||||
AuthUrl string //OpenStack ZStack
|
||||
|
||||
AccessKeyId string //Huawei Aliyun Ucloud Aws
|
||||
AccessKeySecret string //Huawei Aliyun Ucloud Aws
|
||||
Environment string //Huawei Azure Aws
|
||||
|
||||
DirectoryId string //Azure
|
||||
ClientId string //Azure
|
||||
ClientSecret string //Azure
|
||||
|
||||
Host string //Esxi
|
||||
Port int //Esxi
|
||||
|
||||
Endpoint string
|
||||
|
||||
AppId string //Qcloud
|
||||
SecretId string //Qcloud
|
||||
SecretKey string //Qcloud
|
||||
cloudprovider.SCloudaccount
|
||||
cloudprovider.SCloudaccountCredential
|
||||
}
|
||||
|
||||
type CloudaccountShareModeInput struct {
|
||||
apis.Meta
|
||||
|
||||
ShareMode string
|
||||
}
|
||||
|
||||
func (i CloudaccountShareModeInput) Validate() error {
|
||||
if len(i.ShareMode) == 0 {
|
||||
return httperrors.NewMissingParameterError("share_mode")
|
||||
}
|
||||
if !utils.IsInStringArray(i.ShareMode, CLOUD_ACCOUNT_SHARE_MODES) {
|
||||
return httperrors.NewInputParameterError("invalid share_mode %s", i.ShareMode)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ const (
|
||||
CLOUD_PROVIDER_OPENSTACK = "OpenStack"
|
||||
CLOUD_PROVIDER_UCLOUD = "Ucloud"
|
||||
CLOUD_PROVIDER_ZSTACK = "ZStack"
|
||||
CLOUD_PROVIDER_GOOGLE = "Google"
|
||||
CLOUD_PROVIDER_CTYUN = "Ctyun"
|
||||
|
||||
CLOUD_PROVIDER_GENERICS3 = "S3"
|
||||
CLOUD_PROVIDER_CEPH = "Ceph"
|
||||
@@ -64,6 +66,7 @@ const (
|
||||
CLOUD_ACCESS_ENV_AZURE_CHINA = CLOUD_PROVIDER_AZURE
|
||||
CLOUD_ACCESS_ENV_HUAWEI_GLOBAL = CLOUD_PROVIDER_HUAWEI + "-int"
|
||||
CLOUD_ACCESS_ENV_HUAWEI_CHINA = CLOUD_PROVIDER_HUAWEI
|
||||
CLOUD_ACCESS_ENV_CTYUN_CHINA = CLOUD_PROVIDER_CTYUN
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -82,6 +85,8 @@ var (
|
||||
CLOUD_PROVIDER_OPENSTACK,
|
||||
CLOUD_PROVIDER_UCLOUD,
|
||||
CLOUD_PROVIDER_ZSTACK,
|
||||
CLOUD_PROVIDER_GOOGLE,
|
||||
CLOUD_PROVIDER_CTYUN,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -92,3 +97,17 @@ const (
|
||||
|
||||
CLOUD_ENV_PRIVATE_ON_PREMISE = "private_or_onpremise"
|
||||
)
|
||||
|
||||
const (
|
||||
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN = "account_domain"
|
||||
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM = "system"
|
||||
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN = "provider_domain"
|
||||
)
|
||||
|
||||
var (
|
||||
CLOUD_ACCOUNT_SHARE_MODES = []string{
|
||||
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN,
|
||||
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM,
|
||||
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN,
|
||||
}
|
||||
)
|
||||
|
||||
98
pkg/apis/compute/cloudprovider.go
Normal file
98
pkg/apis/compute/cloudprovider.go
Normal file
@@ -0,0 +1,98 @@
|
||||
// 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 CloudproviderDetails struct {
|
||||
Provider string `json:"provider,omitempty"`
|
||||
Brand string `json:"brand,omitempty"`
|
||||
Account string `json:"account,omitempty"`
|
||||
AccountId string `json:"account_id,omitempty"`
|
||||
Manager string `json:"manager,omitempty"`
|
||||
ManagerId string `json:"manager_id,omitempty"`
|
||||
ManagerProject string `json:"manager_project,omitempty"`
|
||||
ManagerProjectId string `json:"manager_project_id,omitempty"`
|
||||
ManagerDomain string `json:"manager_domain,omitempty"`
|
||||
ManagerDomainId string `json:"manager_domain_id,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
RegionId string `json:"region_id,omitempty"`
|
||||
CloudregionId string `json:"cloudregion_id,omitempty"`
|
||||
RegionExternalId string `json:"region_external_id,omitempty"`
|
||||
RegionExtId string `json:"region_ext_id,omitempty"`
|
||||
Zone string `json:"zone,omitempty"`
|
||||
ZoneId string `json:"zone_id,omitempty"`
|
||||
ZoneExtId string `json:"zone_ext_id,omitempty"`
|
||||
CloudEnv string `json:"cloud_env,omitempty"`
|
||||
}
|
||||
|
||||
type CloudaccountListInput struct {
|
||||
// List objects belonging to the cloud provider
|
||||
Cloudprovider string `json:"cloudprovider"`
|
||||
|
||||
// List objects belonging to the cloud provider
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
Manager string `json:"manager"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
ManagerId string `json:"manager_id"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
|
||||
// List objects belonging to the cloud account
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
Account string `json:"account"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
AccountId string `json:"account_id"`
|
||||
|
||||
// List objects from the providers, choices:"OneCloud|VMware|Aliyun|Qcloud|Azure|Aws|Huawei|OpenStack|Ucloud|ZStack|Google"
|
||||
Providers []string `json:"provider"`
|
||||
|
||||
// List objects belonging to brands
|
||||
Brands []string `json:"brand"`
|
||||
}
|
||||
|
||||
type CloudTypeListInput struct {
|
||||
// enum: public_cloud,private_cloud,on_premise
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
PublicCloud bool `json:"public_cloud"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsPublic bool `json:"is_public"`
|
||||
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
PrivateCloud bool `json:"private_cloud"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsPrivate bool `json:"is_private"`
|
||||
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
IsOnPremise bool `json:"is_on_premise"`
|
||||
|
||||
// List objects managed by external providers
|
||||
// default: false
|
||||
IsManaged bool `json:"is_managed"`
|
||||
}
|
||||
@@ -31,11 +31,31 @@ const (
|
||||
CITY_HONG_KONG = "Hongkong" //香港
|
||||
CITY_NING_XIA = "Ningxia" //宁夏
|
||||
CITY_GUANG_ZHOU = "Guangzhou" //广州
|
||||
CITY_TAI_WAN = "Taiwan" //台湾
|
||||
CITY_GUI_YANG = "Guiyang" //贵阳
|
||||
CITY_TAIPEI = "Taipei" //台北市
|
||||
CITY_KAOHSIUNG = "Kaohsiung" //高雄市
|
||||
CITY_CHENG_DU = "Chengdu" //成都
|
||||
CITY_HE_YUAN = "HeYuan" //河源
|
||||
CITY_CHONG_QING = "Chongqing" //重庆
|
||||
CITY_LAN_ZHOU = "Lanzhou" //兰州
|
||||
CITY_TAI_YUAN = "Taiyuan" //太原
|
||||
CITY_TIAN_JIN = "Tianjin" //天津
|
||||
CITY_WU_LU_MU_QI = "Wulumuqi" //乌鲁木齐
|
||||
CITY_NAN_NING = "Nanning" //南宁
|
||||
CITY_ZHENG_ZHOU = "Zhengzhou" //郑州
|
||||
CITY_KUN_MING = "Kunming" //昆明
|
||||
CITY_XI_AN = "Xian" //西安
|
||||
CITY_HAI_KOU = "Haikou" //海口
|
||||
CITY_WU_HU = "Wuhu" //芜湖
|
||||
CITY_FU_ZHOU = "Fuzhou" //福州
|
||||
CITY_WU_HAN = "Wuhan" //武汉
|
||||
CITY_CHANG_SHA = "Changsha" //长沙
|
||||
CITY_SHU_ZHOU = "Shuzhou" //苏州
|
||||
CITY_BAO_DING = "Baoding" //保定
|
||||
CITY_NAN_JING = "Nanjing" //南京
|
||||
CITY_FO_SHAN = "Foshan" //佛山
|
||||
CITY_QUAN_ZHOU = "Quanzhou" //泉州
|
||||
|
||||
// 日本
|
||||
CITY_TOKYO = "Tokyo" //东京
|
||||
@@ -49,6 +69,20 @@ const (
|
||||
CITY_YARRALUMLA = "Yarralumla" //亚拉伦拉
|
||||
CITY_MELBOURNE = "Melbourne" //墨尔本
|
||||
|
||||
//芬兰
|
||||
CITY_FINLAND = "Finland"
|
||||
|
||||
//比利时
|
||||
CITY_BELGIUM = "Belgium" //比利时
|
||||
|
||||
//瑞士
|
||||
CITY_ZURICH = "Zurich" //苏黎世
|
||||
CITY_GENEVA = "Geneva" //日内瓦
|
||||
|
||||
// 挪威
|
||||
CITY_STAVANGER = "Stavanger" //斯塔万格
|
||||
CITY_OSLO = "Oslo" // 奥斯陆
|
||||
|
||||
// 马来西亚
|
||||
CITY_KUALA_LUMPUR = "Kuala Lumpur" //吉隆坡
|
||||
|
||||
@@ -61,20 +95,22 @@ const (
|
||||
CITY_MAHARASHTRA = "Maharashtra" //马哈拉施特拉邦
|
||||
|
||||
// 美国
|
||||
CITY_VIRGINIA = "Virginia" //弗吉尼亚
|
||||
CITY_SILICONVALLEY = "Siliconvalley" //硅谷
|
||||
CITY_OHIO = "Ohio" //俄亥俄州
|
||||
CITY_N_VIRGINIA = "N. Virginia" //北弗吉尼亚
|
||||
CITY_N_CALIFORNIA = "N. California" //北加州
|
||||
CITY_OREGON = "Oregon" //俄勒冈州
|
||||
CITY_LOS_ANGELES = "Los Angeles" //洛杉矶
|
||||
CITY_SAN_FRANCISCO = "San Francisco" //旧金山
|
||||
CITY_UTAH = "Utah" //犹他州
|
||||
CITY_WASHINGTON = "Washington" //华盛顿
|
||||
CITY_TEXAS = "Texas" //德克萨斯
|
||||
CITY_CHICAGO = "Chicago" //芝加哥
|
||||
CITY_IOWA = "Iowa" //爱荷华
|
||||
CITY_US_GOV_WEST = "us-gov-west" //???
|
||||
CITY_VIRGINIA = "Virginia" //弗吉尼亚
|
||||
CITY_SILICONVALLEY = "Siliconvalley" //硅谷
|
||||
CITY_OHIO = "Ohio" //俄亥俄州
|
||||
CITY_N_VIRGINIA = "N. Virginia" //北弗吉尼亚
|
||||
CITY_N_CALIFORNIA = "N. California" //北加州
|
||||
CITY_OREGON = "Oregon" //俄勒冈州
|
||||
CITY_LOS_ANGELES = "Los Angeles" //洛杉矶
|
||||
CITY_SAN_FRANCISCO = "San Francisco" //旧金山
|
||||
CITY_UTAH = "Utah" //犹他州
|
||||
CITY_WASHINGTON = "Washington" //华盛顿
|
||||
CITY_TEXAS = "Texas" //德克萨斯
|
||||
CITY_CHICAGO = "Chicago" //芝加哥
|
||||
CITY_IOWA = "Iowa" //爱荷华
|
||||
CITY_US_GOV_WEST = "us-gov-west" //???
|
||||
CITY_SOUTH_CAROLINA = "South Carolina" //南卡罗来纳州
|
||||
CITY_SALT_LAKE_CITY = "Salt Lake City" //盐湖城
|
||||
|
||||
// 英国
|
||||
CITY_LONDON = "London" //伦敦
|
||||
@@ -85,7 +121,8 @@ const (
|
||||
CITY_DUBAI = "Dubai" //迪拜
|
||||
|
||||
// 德国
|
||||
CITY_FRANKFURT = "Frankfurt" //法兰克福
|
||||
CITY_FRANKFURT = "Frankfurt" // 法兰克福
|
||||
CITY_DELMENHORST = "Delmenhorst" // 代尔门霍斯特
|
||||
|
||||
// 韩国
|
||||
CITY_SEOUL = "Seoul" //首尔
|
||||
@@ -95,6 +132,7 @@ const (
|
||||
CITY_CANADA_CENTRAL = "Canada Central" //加拿大中部
|
||||
CITY_QUEBEC = "Quebec" //魁北克市
|
||||
CITY_TORONTO = "Toronto" //多伦多
|
||||
CITY_MONTREAL = "Montreal" //蒙特利尔
|
||||
|
||||
// 爱尔兰
|
||||
CITY_IRELAND = "Ireland" //爱尔兰
|
||||
@@ -154,4 +192,6 @@ const (
|
||||
COUNTRY_CODE_RU = "RU" //俄罗斯
|
||||
COUNTRY_CODE_NG = "NG" //尼日利亚
|
||||
COUNTRY_CODE_VN = "VN" //越南
|
||||
COUNTRY_CODE_CH = "CH" //瑞士
|
||||
COUNTRY_CODE_NO = "NO" //挪威
|
||||
)
|
||||
|
||||
@@ -56,11 +56,12 @@ const (
|
||||
BACKUP_MODE_MANUAL = "manual" //手动
|
||||
|
||||
//实例数据库状态
|
||||
DBINSTANCE_DATABASE_CREATING = "creating" //创建中
|
||||
DBINSTANCE_DATABASE_CREATE_FAILE = "create_failed" //创建失败
|
||||
DBINSTANCE_DATABASE_RUNNING = "running" //正常
|
||||
DBINSTANCE_DATABASE_DELETING = "deleting" //删除中
|
||||
DBINSTANCE_DATABASE_DELETE_FAILED = "delete_failed" //删除失败
|
||||
DBINSTANCE_DATABASE_CREATING = "creating" //创建中
|
||||
DBINSTANCE_DATABASE_CREATE_FAILE = "create_failed" //创建失败
|
||||
DBINSTANCE_DATABASE_RUNNING = "running" //正常
|
||||
DBINSTANCE_DATABASE_GRANT_PRIVILEGE = "grant_privilege" //赋予权限中
|
||||
DBINSTANCE_DATABASE_DELETING = "deleting" //删除中
|
||||
DBINSTANCE_DATABASE_DELETE_FAILED = "delete_failed" //删除失败
|
||||
|
||||
//实例用户状态
|
||||
DBINSTANCE_USER_UNAVAILABLE = "unavailable" //不可用
|
||||
@@ -107,10 +108,10 @@ const (
|
||||
ALIYUN_DBINSTANCE_STORAGE_TYPE_CLOUD_SSD = "cloud_ssd" //SSD云盘
|
||||
|
||||
//华为云存储类型
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_SSD = "SSD" //超高IO云硬盘
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_SAS = "SAS" //高IO云硬盘
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_SATA = "SATA" //普通IO云硬盘
|
||||
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGH = "ULTRAHIGH" //超高IO云硬盘
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGHPRO = "ULTRAHIGHPRO"
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_COMMON = "COMMON"
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_HIGH = "HIGH"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -18,7 +18,7 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type SDBInstanceDatabasePrivilege struct {
|
||||
Account string
|
||||
DBInstancedccountId string
|
||||
DBInstanceaccountId string
|
||||
Privilege string
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
type DiskCreateInput struct {
|
||||
apis.Meta
|
||||
apis.VirtualResourceCreateInput
|
||||
|
||||
*DiskConfig
|
||||
|
||||
@@ -29,16 +29,14 @@ type DiskCreateInput struct {
|
||||
PreferWire string `json:"prefer_wire_id"`
|
||||
PreferHost string `json:"prefer_host_id"`
|
||||
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
Project string `json:"project"`
|
||||
Domain string `json:"domain_id"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
// Project string `json:"project"`
|
||||
// Domain string `json:"domain_id"`
|
||||
}
|
||||
|
||||
// ToServerCreateInput used by disk schedule
|
||||
func (req *DiskCreateInput) ToServerCreateInput() *ServerCreateInput {
|
||||
return &ServerCreateInput{
|
||||
input := ServerCreateInput{
|
||||
ServerConfigs: &ServerConfigs{
|
||||
PreferRegion: req.PreferRegion,
|
||||
PreferZone: req.PreferZone,
|
||||
@@ -46,22 +44,29 @@ func (req *DiskCreateInput) ToServerCreateInput() *ServerCreateInput {
|
||||
PreferHost: req.PreferHost,
|
||||
Hypervisor: req.Hypervisor,
|
||||
Disks: []*DiskConfig{req.DiskConfig},
|
||||
Project: req.Project,
|
||||
Domain: req.Domain,
|
||||
// Project: req.Project,
|
||||
// Domain: req.Domain,
|
||||
},
|
||||
Name: req.Name,
|
||||
}
|
||||
input.Name = req.Name
|
||||
input.Project = req.Project
|
||||
input.ProjectId = req.ProjectId
|
||||
input.Domain = req.Domain
|
||||
input.DomainId = req.DomainId
|
||||
return &input
|
||||
}
|
||||
|
||||
func (req *ServerCreateInput) ToDiskCreateInput() *DiskCreateInput {
|
||||
return &DiskCreateInput{
|
||||
input := DiskCreateInput{
|
||||
DiskConfig: req.Disks[0],
|
||||
PreferRegion: req.PreferRegion,
|
||||
PreferHost: req.PreferHost,
|
||||
PreferZone: req.PreferZone,
|
||||
PreferWire: req.PreferWire,
|
||||
Name: req.Name,
|
||||
Project: req.Project,
|
||||
Hypervisor: req.Hypervisor,
|
||||
}
|
||||
input.Name = req.Name
|
||||
input.Project = req.Project
|
||||
input.Domain = req.Domain
|
||||
return &input
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ const (
|
||||
EIP_ASSOCIATE_TYPE_SERVER = "server"
|
||||
EIP_ASSOCIATE_TYPE_NAT_GATEWAY = "natgateway"
|
||||
EIP_ASSOCIATE_TYPE_LOADBALANCER = "loadbalancer"
|
||||
EIP_ASSOCIATE_TYPE_UNKNOWN = "unknown"
|
||||
|
||||
EIP_STATUS_READY = "ready"
|
||||
EIP_STATUS_UNKNOWN = "unknown"
|
||||
@@ -38,10 +39,6 @@ const (
|
||||
EIP_CHARGE_TYPE_BY_TRAFFIC = "traffic"
|
||||
EIP_CHARGE_TYPE_BY_BANDWIDTH = "bandwidth"
|
||||
EIP_CHARGE_TYPE_DEFAULT = EIP_CHARGE_TYPE_BY_TRAFFIC
|
||||
|
||||
// EIP associate resource type
|
||||
EIP_ASSOCIATE_TYPE_VM = "server"
|
||||
EIP_ASSOCIATE_TYPE_ELB = "elb"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
23
pkg/apis/compute/globalvpc.go
Normal file
23
pkg/apis/compute/globalvpc.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type GlobalVpcCreateInput struct {
|
||||
apis.EnabledStatusStandaloneResourceCreateInput
|
||||
}
|
||||
20
pkg/apis/compute/globalvpc_const.go
Normal file
20
pkg/apis/compute/globalvpc_const.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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
|
||||
|
||||
const (
|
||||
GLOBAL_VPC_STATUS_AVAILABLE = "available"
|
||||
GLOBAL_VPC_STATUS_UNKNOWN = "unknown"
|
||||
)
|
||||
@@ -59,6 +59,9 @@ const (
|
||||
VM_SUSPEND = "suspend"
|
||||
VM_SUSPEND_FAILED = "suspend_failed"
|
||||
|
||||
VM_RESUMING = "resuming"
|
||||
VM_RESUME_FAILED = "resume_failed"
|
||||
|
||||
VM_START_DELETE = "start_delete"
|
||||
VM_DELETE_FAIL = "delete_fail"
|
||||
VM_DELETING = "deleting"
|
||||
@@ -140,11 +143,18 @@ const (
|
||||
HYPERVISOR_OPENSTACK = "openstack"
|
||||
HYPERVISOR_UCLOUD = "ucloud"
|
||||
HYPERVISOR_ZSTACK = "zstack"
|
||||
HYPERVISOR_GOOGLE = "google"
|
||||
HYPERVISOR_CTYUN = "ctyun"
|
||||
|
||||
// HYPERVISOR_DEFAULT = HYPERVISOR_KVM
|
||||
HYPERVISOR_DEFAULT = HYPERVISOR_KVM
|
||||
)
|
||||
|
||||
const (
|
||||
CPU_MODE_QEMU = "qemu"
|
||||
CPU_MODE_HOST = "host"
|
||||
)
|
||||
|
||||
var VM_RUNNING_STATUS = []string{VM_START_START, VM_STARTING, VM_RUNNING, VM_BLOCK_STREAM}
|
||||
var VM_CREATING_STATUS = []string{VM_CREATE_NETWORK, VM_CREATE_DISK, VM_START_DEPLOY, VM_DEPLOYING}
|
||||
|
||||
@@ -161,6 +171,8 @@ var HYPERVISORS = []string{
|
||||
HYPERVISOR_OPENSTACK,
|
||||
HYPERVISOR_UCLOUD,
|
||||
HYPERVISOR_ZSTACK,
|
||||
HYPERVISOR_GOOGLE,
|
||||
HYPERVISOR_CTYUN,
|
||||
}
|
||||
|
||||
var ONECLOUD_HYPERVISORS = []string{
|
||||
@@ -176,6 +188,8 @@ var PUBLIC_CLOUD_HYPERVISORS = []string{
|
||||
HYPERVISOR_QCLOUD,
|
||||
HYPERVISOR_HUAWEI,
|
||||
HYPERVISOR_UCLOUD,
|
||||
HYPERVISOR_GOOGLE,
|
||||
HYPERVISOR_CTYUN,
|
||||
}
|
||||
|
||||
var PRIVATE_CLOUD_HYPERVISORS = []string{
|
||||
@@ -198,6 +212,8 @@ var HYPERVISOR_HOSTTYPE = map[string]string{
|
||||
HYPERVISOR_OPENSTACK: HOST_TYPE_OPENSTACK,
|
||||
HYPERVISOR_UCLOUD: HOST_TYPE_UCLOUD,
|
||||
HYPERVISOR_ZSTACK: HOST_TYPE_ZSTACK,
|
||||
HYPERVISOR_GOOGLE: HOST_TYPE_GOOGLE,
|
||||
HYPERVISOR_CTYUN: HOST_TYPE_CTYUN,
|
||||
}
|
||||
|
||||
var HOSTTYPE_HYPERVISOR = map[string]string{
|
||||
@@ -213,6 +229,8 @@ var HOSTTYPE_HYPERVISOR = map[string]string{
|
||||
HOST_TYPE_OPENSTACK: HYPERVISOR_OPENSTACK,
|
||||
HOST_TYPE_UCLOUD: HYPERVISOR_UCLOUD,
|
||||
HOST_TYPE_ZSTACK: HYPERVISOR_ZSTACK,
|
||||
HOST_TYPE_GOOGLE: HYPERVISOR_GOOGLE,
|
||||
HOST_TYPE_CTYUN: HYPERVISOR_CTYUN,
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -224,9 +242,18 @@ const (
|
||||
VM_METADATA_CREATE_PARAMS = "create_params"
|
||||
VM_METADATA_LOGIN_ACCOUNT = "login_account"
|
||||
VM_METADATA_LOGIN_KEY = "login_key"
|
||||
VM_METADATA_LAST_LOGIN_KEY = "last_login_key"
|
||||
VM_METADATA_LOGIN_KEY_TIMESTAMP = "login_key_timestamp"
|
||||
VM_METADATA_OS_ARCH = "os_arch"
|
||||
VM_METADATA_OS_DISTRO = "os_distribution"
|
||||
VM_METADATA_OS_NAME = "os_name"
|
||||
VM_METADATA_OS_VERSION = "os_version"
|
||||
)
|
||||
|
||||
func Hypervisors2HostTypes(hypervisors []string) []string {
|
||||
hostTypes := make([]string, len(hypervisors))
|
||||
for i := range hypervisors {
|
||||
hostTypes[i] = HYPERVISOR_HOSTTYPE[hypervisors[i]]
|
||||
}
|
||||
return hostTypes
|
||||
}
|
||||
|
||||
110
pkg/apis/compute/guests.go
Normal file
110
pkg/apis/compute/guests.go
Normal file
@@ -0,0 +1,110 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type ServerListInput struct {
|
||||
apis.BaseListInput
|
||||
|
||||
// 过滤可用区底下的资源
|
||||
Zone string `json:"zone"`
|
||||
// 过滤连接此二层网络的资源
|
||||
Wire string `json:"wire"`
|
||||
// 过滤关联此网络的资源
|
||||
Network string `json:"network"`
|
||||
// Disk ID or Name
|
||||
Disk string `json:"disk"`
|
||||
// Host ID or Name
|
||||
Host string `json:"host"`
|
||||
// Show baremetal servers
|
||||
Baremetal *bool `json:"baremetal"`
|
||||
// Show gpu servers
|
||||
Gpu *bool `json:"gpu"`
|
||||
// Secgroup ID or Name
|
||||
Secgroup string `json:"secgroup"`
|
||||
// AdminSecgroup ID or Name
|
||||
AdminSecgroup string `json:"admin_security"`
|
||||
// Show server of hypervisor choices:"kvm|esxi|container|baremetal|aliyun|azure|aws|huawei|ucloud|zstack|openstack"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
// Show servers in cloudregion
|
||||
Region string `json:"region"`
|
||||
// Show Servers with EIP
|
||||
WithEip *bool `json:"with_eip"`
|
||||
// Show Servers without EIP
|
||||
WithoutEip *bool `json:"without_eip"`
|
||||
// OS Type choices:"linux|windows|vmware"`
|
||||
OsType string `json:"os_type"`
|
||||
// Order by disk size choices:"asc|desc"
|
||||
OrderByDisk string `json:"order_by_disk"`
|
||||
// Order by host name choices:"asc|desc"
|
||||
OrderByHost string `json:"order_by_host"`
|
||||
// Vpc id or name
|
||||
Vpc string `json:"vpc"`
|
||||
// Eip id or name
|
||||
UsableServerForEip string `json:"usable_server_for_eip"`
|
||||
// Show Servers without user metadata
|
||||
WithoutUserMeta *bool `json:"without_user_meta"`
|
||||
// Instance Group ID or Name
|
||||
Group string `json:"group"`
|
||||
// Resource type choices:"shared|prepaid|dedicated"
|
||||
ResourceType string `json:"resource_type"`
|
||||
// Billing type choices:"postpaid|prepaid"
|
||||
BillingType string `json:"billing_type"`
|
||||
// 根据宿主机 SN 过滤
|
||||
HostSn string `json:"host_sn"`
|
||||
}
|
||||
|
||||
type ServerRebuildRootInput struct {
|
||||
apis.Meta
|
||||
|
||||
// 镜像名称
|
||||
Image string `json:"image"`
|
||||
// 镜像 id
|
||||
// required: true
|
||||
ImageId string `json:"image_id"`
|
||||
Keypair string `json:"keypair"`
|
||||
KeypairId string `json:"keypair_id"`
|
||||
ResetPassword *bool `json:"reset_password"`
|
||||
Password string `json:"password"`
|
||||
AutoStart *bool `json:"auto_start"`
|
||||
AllDisks *bool `json:"all_disks"`
|
||||
}
|
||||
|
||||
func (i ServerRebuildRootInput) GetImageName() string {
|
||||
if len(i.Image) > 0 {
|
||||
return i.Image
|
||||
}
|
||||
if len(i.ImageId) > 0 {
|
||||
return i.ImageId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (i ServerRebuildRootInput) GetKeypairName() string {
|
||||
if len(i.Keypair) > 0 {
|
||||
return i.Keypair
|
||||
}
|
||||
if len(i.KeypairId) > 0 {
|
||||
return i.KeypairId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ServerResumeInput struct {
|
||||
apis.Meta
|
||||
}
|
||||
91
pkg/apis/compute/guesttemplate.go
Normal file
91
pkg/apis/compute/guesttemplate.go
Normal file
@@ -0,0 +1,91 @@
|
||||
// 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/apis"
|
||||
)
|
||||
|
||||
type GuesttemplateCreateInput struct {
|
||||
apis.SharableVirtualResourceCreateInput
|
||||
|
||||
// description: the content of guest template
|
||||
// required: true
|
||||
Content jsonutils.JSONObject `json:"content"`
|
||||
|
||||
VmemSize int `json:"vmem_size"`
|
||||
VcpuCount int `json:"vcpu_count"`
|
||||
OsType string `json:"os_type"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
ImageType string `json:"image_type"`
|
||||
ImageId string `json:"image_id"`
|
||||
}
|
||||
|
||||
type GuesttemplateDetails struct {
|
||||
apis.Meta
|
||||
apis.SharableVirtualResourceDetails
|
||||
SGuestTemplate
|
||||
|
||||
ConfigInfo GuesttemplateConfigInfo `json:"config_info"`
|
||||
}
|
||||
|
||||
type GuesttemplateConfigInfo struct {
|
||||
Region string `json:"region"`
|
||||
Zone string `json:"zone"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
OsType string `json:"os_type"`
|
||||
Sku GuesttemplateSku `json:"sku"`
|
||||
Disks []GuesttemplateDisk `json:"disks"`
|
||||
Keypair string `json:"keypair"`
|
||||
Nets []GuesttemplateNetwork `json:"nets"`
|
||||
Secgroup string `json:"secgroup"`
|
||||
IsolatedDeviceConfig []IsolatedDeviceConfig `json:"isolated_device_config"`
|
||||
Image string `json:"image"`
|
||||
ResetPassword bool `json:"reset_password"`
|
||||
}
|
||||
|
||||
type GuesttemplateDisk struct {
|
||||
Backend string `json:"backend"`
|
||||
DiskType string `json:"disk_type"`
|
||||
Index int `json:"index"`
|
||||
SizeMb int `json:"size_mb"`
|
||||
}
|
||||
|
||||
type GuesttemplateNetwork struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
GuestIpStart string `json:"guest_ip_start"`
|
||||
GuestIpEnd string `json:"guest_ip_end"`
|
||||
VlanId int `json:"vlan_id"`
|
||||
}
|
||||
|
||||
type GuesttemplateSku struct {
|
||||
Name string `json:"name"`
|
||||
CpuCoreCount int `json:"cpu_core_count"`
|
||||
MemorySizeMb int `json:"memory_size_mb"`
|
||||
InstanceTypeCategory string `json:"instance_type_category`
|
||||
InstanceTypeFamily string `json:"instance_type_family"`
|
||||
}
|
||||
|
||||
type GuesttemplatePublicInput struct {
|
||||
apis.Meta
|
||||
|
||||
// description: the scope about public operator
|
||||
// required: true
|
||||
// example: system
|
||||
Scope string `json:"scope"`
|
||||
}
|
||||
@@ -31,6 +31,8 @@ const (
|
||||
HOST_TYPE_OPENSTACK = "openstack"
|
||||
HOST_TYPE_UCLOUD = "ucloud"
|
||||
HOST_TYPE_ZSTACK = "zstack"
|
||||
HOST_TYPE_GOOGLE = "google"
|
||||
HOST_TYPE_CTYUN = "ctyun"
|
||||
|
||||
HOST_TYPE_DEFAULT = HOST_TYPE_HYPERVISOR
|
||||
|
||||
@@ -107,6 +109,7 @@ var HOST_TYPES = []string{
|
||||
HOST_TYPE_OPENSTACK,
|
||||
HOST_TYPE_UCLOUD,
|
||||
HOST_TYPE_ZSTACK,
|
||||
HOST_TYPE_CTYUN,
|
||||
}
|
||||
|
||||
var NIC_TYPES = []string{NIC_TYPE_IPMI, NIC_TYPE_ADMIN}
|
||||
|
||||
29
pkg/apis/compute/input.go
Normal file
29
pkg/apis/compute/input.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// 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 RegionalResourceCreateInput struct {
|
||||
Cloudregion string `json:"cloudregion"`
|
||||
CloudregionId string `json:"cloudregion_id"`
|
||||
}
|
||||
|
||||
type ManagedResourceCreateInput struct {
|
||||
Manager string `json:"manager"`
|
||||
ManagerId string `json:"manager_id"`
|
||||
}
|
||||
|
||||
type DeletePreventableCreateInput struct {
|
||||
DisableDelete *bool `json:"disable_delete"`
|
||||
}
|
||||
36
pkg/apis/compute/instance_group.go
Normal file
36
pkg/apis/compute/instance_group.go
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type InstanceGroupListInput struct {
|
||||
apis.BaseListInput
|
||||
|
||||
// Filter by service type
|
||||
ServiceType string `json:"service_type"`
|
||||
// Filter by parent id
|
||||
ParentId string `json:"parent_id"`
|
||||
// Filter by zone id
|
||||
ZoneId string `json:"zone_id"`
|
||||
// Filter by guest id or name
|
||||
Server string `json:"server"`
|
||||
}
|
||||
|
||||
type InstanceGroupDetail struct {
|
||||
apis.Meta
|
||||
SGroup
|
||||
GuestCount int64 `json:"guest_count"`
|
||||
}
|
||||
200
pkg/apis/compute/network.go
Normal file
200
pkg/apis/compute/network.go
Normal file
@@ -0,0 +1,200 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type NetworkListInput struct {
|
||||
apis.BaseListInput
|
||||
|
||||
apis.SharableVirtualResourceListInput
|
||||
|
||||
CloudaccountListInput
|
||||
CloudTypeListInput
|
||||
|
||||
Zone string `json:"zone"`
|
||||
Zones []string `json:"zones"`
|
||||
|
||||
Vpc string `json:"vpc"`
|
||||
|
||||
Cloudregion string `json:"cloudregion"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudregionId string `json:"cloudregion_id"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
Region string `json:"region"`
|
||||
// deprecate:true
|
||||
// description: this param will be deprecate at 3.0
|
||||
RegionId string `json:"region_id"`
|
||||
|
||||
Usable bool `json:"usable"`
|
||||
Host string `json:"host"`
|
||||
City string `json:"city"`
|
||||
}
|
||||
|
||||
type NetworkCreateInput struct {
|
||||
apis.SharableVirtualResourceCreateInput
|
||||
|
||||
// description: ip range of guest, if not set, you shoud set guest_ip_start,guest_ip_end and guest_ip_mask params
|
||||
// example: 10.168.222.1/24
|
||||
GuestIpPrefix string `json:"guest_ip_prefix"`
|
||||
|
||||
// description: ip range of guest ip start, if set guest_ip_prefix, this parameter will be useless
|
||||
// example: 10.168.222.1
|
||||
GuestIpStart string `json:"guest_ip_start"`
|
||||
|
||||
// description: ip range of guest ip end, if set guest_ip_prefix, this parameter will be useless
|
||||
// example: 10.168.222.100
|
||||
GuestIpEnd string `json:"guest_ip_end"`
|
||||
|
||||
// description: ip range of guest ip mask, if set guest_ip_prefix, this parameter will be useless
|
||||
// example: 24
|
||||
// maximum: 30
|
||||
// minimum: 12
|
||||
GuestIpMask int64 `json:"guest_ip_mask"`
|
||||
|
||||
IfnameHint string `json:"ifname_hint"`
|
||||
|
||||
// description: guest gateway
|
||||
// example: 192.168.222.1
|
||||
GuestGateway string `json:"guest_gateway"`
|
||||
|
||||
// description: guest dns
|
||||
// example: 114.114.114.114
|
||||
GuestDns string `json:"guest_dns"`
|
||||
|
||||
// description: guest dhcp
|
||||
// example: 192.168.222.1,192.168.222.4
|
||||
GuestDHCP string `json:"guest_dhcp"`
|
||||
|
||||
// swagger:ignore
|
||||
WireId string `json:"wire_id"`
|
||||
|
||||
// description: wire id or name
|
||||
Wire string `json:"wire"`
|
||||
|
||||
// description: zone id or name
|
||||
Zone string `json:"zone"`
|
||||
|
||||
// description: vpc id or name
|
||||
Vpc string `json:"vpc"`
|
||||
|
||||
// description: server type
|
||||
// enum: guest,baremetal,pxe,ipmi
|
||||
// default: guest
|
||||
ServerType string `json:"server_type"`
|
||||
}
|
||||
|
||||
type NetworkDetails struct {
|
||||
apis.Meta
|
||||
apis.SharableVirtualResourceDetails
|
||||
|
||||
CloudproviderDetails
|
||||
SNetwork
|
||||
Wire string `json:"wire"`
|
||||
Exit bool `json:"exit"`
|
||||
Ports int `json:"ports"`
|
||||
PortsUsed int `json:"ports_used"`
|
||||
Vnics int `json:"vnics"`
|
||||
BmVnics int `json:"bm_nics"`
|
||||
LbVnics int `json:"lb_vnics"`
|
||||
EipVnics int `json:"eip_vnics"`
|
||||
GroupVnics int `json:"group_vnics"`
|
||||
ReserveVnics int `json:"reserve_vnics"`
|
||||
Vpc string `json:"vpc"`
|
||||
VpcId string `json:"vpc_id"`
|
||||
VpcExtId string `json:"vpc_ext_id"`
|
||||
|
||||
Routes [][]string `json:"routes"`
|
||||
Schedtags []SchedtagShortDescDetails `json:"schedtags"`
|
||||
}
|
||||
|
||||
type NetworkReserveIpInput struct {
|
||||
apis.Meta
|
||||
|
||||
// description: reserved ip list
|
||||
// required: true
|
||||
// example: [10.168.222.131, 10.168.222.134]
|
||||
Ips []string `json:"ips"`
|
||||
|
||||
// description: the comment
|
||||
// example: reserve ip for test
|
||||
Notes string `json:"notes"`
|
||||
Status string `json:"status"`
|
||||
// description: The reserved cycle
|
||||
// required: false
|
||||
Duration string `json:"duration"`
|
||||
}
|
||||
|
||||
type NetworkReleaseReservedIpInput struct {
|
||||
apis.Meta
|
||||
|
||||
// description: IP to be released
|
||||
// required: true
|
||||
// example: 10.168.222.121
|
||||
Ip string `json:"ip"`
|
||||
}
|
||||
|
||||
type NetworkPurgeInput struct {
|
||||
apis.Meta
|
||||
}
|
||||
|
||||
type NetworkMergeInput struct {
|
||||
apis.Meta
|
||||
|
||||
// description: network id or name to be merged
|
||||
// required: true
|
||||
// example: test-network
|
||||
Target string `json:"target"`
|
||||
}
|
||||
|
||||
type NetworkSplitInput struct {
|
||||
apis.Meta
|
||||
|
||||
// description: The middle - separated IP must belong to the network
|
||||
// required: true
|
||||
// example: 10.168.222.181
|
||||
SplitIp string `json:"split_ip"`
|
||||
|
||||
// description: another network name after split
|
||||
// required: false
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type NetworkTryCreateNetworkInput struct {
|
||||
apis.Meta
|
||||
|
||||
Ip string `json:"ip"`
|
||||
Mask int `json:"mask"`
|
||||
ServerType string `json:"server_type"`
|
||||
IsOnPremise bool `json:"is_on_premise"`
|
||||
}
|
||||
|
||||
type NetworkSyncInput struct {
|
||||
apis.Meta
|
||||
}
|
||||
|
||||
type NetworkStatusInput struct {
|
||||
apis.Meta
|
||||
|
||||
// description: network status
|
||||
// required: true
|
||||
// example: available
|
||||
// enum: available,unavailable
|
||||
Status string `json:"status"`
|
||||
}
|
||||
@@ -14,6 +14,10 @@
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
// # DEFAULT_BANDWIDTH = options.default_bandwidth
|
||||
MAX_BANDWIDTH = 100000
|
||||
@@ -40,6 +44,8 @@ const (
|
||||
NETWORK_STATUS_DELETING = "deleting"
|
||||
NETWORK_STATUS_DELETED = "deleted"
|
||||
NETWORK_STATUS_DELETE_FAILED = "delete_failed"
|
||||
NETWORK_STATUS_START_SYNC = "start_sync"
|
||||
NETWORK_STATUS_SYNCING = "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -53,7 +59,9 @@ var (
|
||||
|
||||
REGIONAL_NETWORK_PROVIDERS = []string{
|
||||
CLOUD_PROVIDER_HUAWEI,
|
||||
CLOUD_PROVIDER_CTYUN,
|
||||
CLOUD_PROVIDER_UCLOUD,
|
||||
CLOUD_PROVIDER_GOOGLE,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -75,4 +83,5 @@ type SNetworkAddress struct {
|
||||
OwnerType string
|
||||
AssociateId string
|
||||
AssociateType string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
23
pkg/apis/compute/routetable_const.go
Normal file
23
pkg/apis/compute/routetable_const.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package compute
|
||||
|
||||
const (
|
||||
ROUTE_TABLE_TYPE_VPC = "VPC" // VPC路由器
|
||||
ROUTE_TABLE_TYPE_VBR = "VBR" // 边界路由器
|
||||
)
|
||||
|
||||
const (
|
||||
ROUTE_ENTRY_TYPE_CUSTOM = "Custom" // 自定义路由
|
||||
ROUTE_ENTRY_TYPE_SYSTEM = "System" // 系统路由
|
||||
)
|
||||
|
||||
const (
|
||||
Next_HOP_TYPE_INSTANCE = "Instance" // ECS实例。
|
||||
Next_HOP_TYPE_HAVIP = "HaVip" // 高可用虚拟IP。
|
||||
Next_HOP_TYPE_VPN = "VpnGateway" // VPN网关。
|
||||
Next_HOP_TYPE_NAT = "NatGateway" // NAT网关。
|
||||
Next_HOP_TYPE_NETWORK = "NetworkInterface" // 辅助弹性网卡。
|
||||
Next_HOP_TYPE_ROUTER = "RouterInterface" // 路由器接口。
|
||||
Next_HOP_TYPE_IPV6 = "IPv6Gateway" // IPv6网关。
|
||||
Next_HOP_TYPE_INTERNET = "InternetGateway" // Internet网关。
|
||||
Next_HOP_TYPE_EGRESS_INTERNET = "EgressInternetGateway" // egress only Internet网关。
|
||||
)
|
||||
22
pkg/apis/compute/schedtag.go
Normal file
22
pkg/apis/compute/schedtag.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type SchedtagShortDescDetails struct {
|
||||
*apis.StandaloneResourceShortDescDetail
|
||||
Default string `json:"default"`
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
type SSecgroupRuleCreateInput struct {
|
||||
apis.Meta
|
||||
apis.ResourceBaseCreateInput
|
||||
|
||||
Priority int
|
||||
Protocol string
|
||||
@@ -37,6 +37,7 @@ type SSecgroupRuleCreateInput struct {
|
||||
CIDR string
|
||||
Action string
|
||||
Description string
|
||||
Secgroup string
|
||||
SecgroupId string
|
||||
}
|
||||
|
||||
@@ -70,10 +71,14 @@ func (input *SSecgroupRuleCreateInput) Check() error {
|
||||
}
|
||||
|
||||
type SSecgroupCreateInput struct {
|
||||
apis.Meta
|
||||
apis.SharableVirtualResourceCreateInput
|
||||
|
||||
Name string
|
||||
Status string
|
||||
Description string
|
||||
Rules []SSecgroupRuleCreateInput
|
||||
Rules []SSecgroupRuleCreateInput `json:"rules"`
|
||||
}
|
||||
|
||||
type SSecgroupListFilterInput struct {
|
||||
apis.BaseListInput
|
||||
|
||||
Equals string
|
||||
Server string
|
||||
}
|
||||
|
||||
60
pkg/apis/compute/service_catalog.go
Normal file
60
pkg/apis/compute/service_catalog.go
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type ServiceCatalogCreateInput struct {
|
||||
apis.SharableVirtualResourceCreateInput
|
||||
|
||||
// description: service catalog icon url
|
||||
// example: https://yunion.io/files/hello.png
|
||||
IconUrl string `json:"icon_url"`
|
||||
|
||||
// description: the id or name of guest template
|
||||
// example: good
|
||||
// required: true
|
||||
GuestTemplate string `json:"guest_template"`
|
||||
}
|
||||
|
||||
type ServiceCatalogUpdateInput struct {
|
||||
// description: resource name
|
||||
// unique: true
|
||||
// example: test-network
|
||||
Name string `json:"name"`
|
||||
|
||||
// description: service catalog icon url
|
||||
// example: https://yunion.io/files/hello.png
|
||||
IconUrl string `json:"icon_url"`
|
||||
|
||||
// description: the id or name of guest template
|
||||
// example: good
|
||||
GuestTemplate string `json:"guest_template"`
|
||||
}
|
||||
|
||||
type ServiceCatalogDeploy struct {
|
||||
|
||||
// description: name of the new vm
|
||||
// example: hello
|
||||
Name string `json:"name"`
|
||||
|
||||
// description: generate name automatically if name is repeated, and only one of name and this shoudle be given
|
||||
// example: hello
|
||||
GenerateName string `json:"generate_name"`
|
||||
|
||||
// description: the count of the new vm
|
||||
// example: 1
|
||||
Count int `json:"count"`
|
||||
}
|
||||
@@ -22,6 +22,7 @@ type SSnapshotCreateInput struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
|
||||
Disk string `json:"disk"`
|
||||
DiskId string `json:"disk_id"`
|
||||
StorageId string `json:"storage_id"`
|
||||
CreatedBy string `json:"created_by"`
|
||||
|
||||
@@ -49,6 +49,7 @@ const (
|
||||
// STORAGE_CLOUD_SSD ="cloud_ssd"
|
||||
STORAGE_LOCAL_BASIC = "local_basic"
|
||||
STORAGE_LOCAL_SSD = "local_ssd"
|
||||
STORAGE_LOCAL_PRO = "local_pro"
|
||||
STORAGE_CLOUD_BASIC = "cloud_basic"
|
||||
STORAGE_CLOUD_PREMIUM = "cloud_premium"
|
||||
|
||||
@@ -59,6 +60,7 @@ const (
|
||||
|
||||
// openstack
|
||||
STORAGE_OPENSTACK_ISCSI = "iscsi"
|
||||
STORAGE_OPENSTACK_NOVA = "nova"
|
||||
|
||||
// Ucloud storage type
|
||||
STORAGE_UCLOUD_CLOUD_NORMAL = "CLOUD_NORMAL" // 普通云盘
|
||||
@@ -70,6 +72,16 @@ const (
|
||||
// Zstack storage type
|
||||
STORAGE_ZSTACK_LOCAL_STORAGE = "localstorage"
|
||||
STORAGE_ZSTACK_CEPH = "ceph"
|
||||
|
||||
// Google storage type
|
||||
STORAGE_GOOGLE_LOCAL_SSD = "local-ssd" //本地SSD暂存盘 (最多8个)
|
||||
STORAGE_GOOGLE_PD_STANDARD = "pd-standard" //标准永久性磁盘
|
||||
STORAGE_GOOGLE_PD_SSD = "pd-ssd" //SSD永久性磁盘
|
||||
|
||||
// ctyun storage type
|
||||
STORAGE_CTYUN_SSD = "SSD" // 超高IO云硬盘
|
||||
STORAGE_CTYUN_SAS = "SAS" // 高IO云硬盘
|
||||
STORAGE_CTYUN_SATA = "SATA" // 普通IO云硬盘
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -24,6 +24,8 @@ const (
|
||||
VPC_STATUS_DELETE_FAILED = "delete_failed"
|
||||
VPC_STATUS_DELETED = "deleted"
|
||||
VPC_STATUS_UNKNOWN = "unknown"
|
||||
VPC_STATUS_START_SYNC = "start_sync"
|
||||
VPC_STATUS_SYNCING = "sync"
|
||||
|
||||
MAX_VPC_PER_REGION = 3
|
||||
|
||||
|
||||
1348
pkg/apis/compute/zz_generated.model.go
Normal file
1348
pkg/apis/compute/zz_generated.model.go
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user