mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-21 00:24:07 +08:00
Compare commits
458 Commits
v4.0.2-rc.
...
v3.3.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86dca4ec62 | ||
|
|
9c71b76e79 | ||
|
|
ec659ddd44 | ||
|
|
e2d98a4ce3 | ||
|
|
47e515cb1f | ||
|
|
6eb7c39d3b | ||
|
|
52d06ec9c4 | ||
|
|
d8fcdaa023 | ||
|
|
b4e57895f6 | ||
|
|
015bb265d3 | ||
|
|
8ee2bc0153 | ||
|
|
3077c49255 | ||
|
|
79ef55b4f6 | ||
|
|
c7c1082e94 | ||
|
|
78eb02e501 | ||
|
|
03590d9f9b | ||
|
|
a0246b410f | ||
|
|
03de172d85 | ||
|
|
94409c25cc | ||
|
|
6ea402b576 | ||
|
|
7b7b3a9416 | ||
|
|
142b1bee29 | ||
|
|
c0dc06d15d | ||
|
|
1100892f10 | ||
|
|
8a3d9e7d0d | ||
|
|
e52415a73a | ||
|
|
32195ed702 | ||
|
|
d5251af976 | ||
|
|
3c7c7c1721 | ||
|
|
f15d7d8f3e | ||
|
|
938c9a6817 | ||
|
|
589d7d48a0 | ||
|
|
9424de9cf7 | ||
|
|
9272b43991 | ||
|
|
cc051942d7 | ||
|
|
3268e59d20 | ||
|
|
f142206652 | ||
|
|
d8275fa79a | ||
|
|
9ec851df2a | ||
|
|
c5e616b196 | ||
|
|
23d01a1e3c | ||
|
|
ac18702727 | ||
|
|
3a966df659 | ||
|
|
cf313dd2cc | ||
|
|
a04ee820f6 | ||
|
|
64d0b4f8c8 | ||
|
|
9f3b937e6a | ||
|
|
99818a7c0f | ||
|
|
6cab61ecb8 | ||
|
|
01a8384071 | ||
|
|
b5875e00d1 | ||
|
|
d91f5fa87e | ||
|
|
a346fd47fe | ||
|
|
cedd4ccdfa | ||
|
|
f5d1adcbd0 | ||
|
|
66a5410e7d | ||
|
|
3637b671ed | ||
|
|
7a58d9f197 | ||
|
|
5c8a7769e3 | ||
|
|
ebe1eb603b | ||
|
|
eb67c681d3 | ||
|
|
e099f006fa | ||
|
|
c9b485b9f3 | ||
|
|
22231edba6 | ||
|
|
0742afb487 | ||
|
|
3b036e6c30 | ||
|
|
227fa57883 | ||
|
|
5439457bb4 | ||
|
|
57cd48354f | ||
|
|
3c63af8de0 | ||
|
|
52488eeb50 | ||
|
|
9114556da3 | ||
|
|
abe44154ba | ||
|
|
89de86a243 | ||
|
|
6cdbae22a4 | ||
|
|
6f5be444c3 | ||
|
|
13d165e3c1 | ||
|
|
d3d977a359 | ||
|
|
0f37875b40 | ||
|
|
bb1752fb7b | ||
|
|
b152aa3337 | ||
|
|
bb01236942 | ||
|
|
7a81820cd3 | ||
|
|
525a18dde2 | ||
|
|
39bcc36c2d | ||
|
|
138088027e | ||
|
|
a023cf56e4 | ||
|
|
a17e90ed3b | ||
|
|
2153a79dcb | ||
|
|
780cf826c7 | ||
|
|
62d2a732e2 | ||
|
|
f6409e8511 | ||
|
|
4cbe29d0c5 | ||
|
|
221fb3f527 | ||
|
|
042cd597f6 | ||
|
|
aae065f06f | ||
|
|
d834f3331e | ||
|
|
703f59760e | ||
|
|
5a1935bd54 | ||
|
|
6e64fc4caa | ||
|
|
8172a551bb | ||
|
|
381a2796ba | ||
|
|
49b0a01b08 | ||
|
|
88497da742 | ||
|
|
38e02db07f | ||
|
|
fbda89ce2a | ||
|
|
c11ee3ed56 | ||
|
|
18f5f9cb8c | ||
|
|
bb500edc81 | ||
|
|
d9488f552e | ||
|
|
b39e4e37e3 | ||
|
|
880f889d4a | ||
|
|
7ad7774f80 | ||
|
|
e64f249453 | ||
|
|
9dfed28459 | ||
|
|
dd7967dd65 | ||
|
|
80ae1b6cde | ||
|
|
b513216421 | ||
|
|
a0b464b8d6 | ||
|
|
d29b105efc | ||
|
|
1cf42ccfcc | ||
|
|
353384f32a | ||
|
|
92d8437c45 | ||
|
|
65cd074ffa | ||
|
|
5dc8296332 | ||
|
|
46fa77b29b | ||
|
|
c39de392c3 | ||
|
|
a2d562ccaa | ||
|
|
7e47d7aeb4 | ||
|
|
01f384cf80 | ||
|
|
5833f1a905 | ||
|
|
04abe448f1 | ||
|
|
ab71f5e6c6 | ||
|
|
8a79c0f708 | ||
|
|
c3bab46d23 | ||
|
|
5ee9698218 | ||
|
|
925caf9111 | ||
|
|
cc6f22d9d7 | ||
|
|
816b29267c | ||
|
|
f9b51a9f54 | ||
|
|
14ddc69b40 | ||
|
|
d1a2fe39a7 | ||
|
|
ba953f20ce | ||
|
|
04b4ab3760 | ||
|
|
8fa3e77995 | ||
|
|
583d783ce6 | ||
|
|
fecb127100 | ||
|
|
6b2cb20f4c | ||
|
|
632aef4fab | ||
|
|
65562c25f5 | ||
|
|
28a80ac52e | ||
|
|
843c52c221 | ||
|
|
bd6b45aaef | ||
|
|
7103f4e716 | ||
|
|
f03d021aa5 | ||
|
|
0b8baeef6a | ||
|
|
2ac39e704a | ||
|
|
df63c8ddde | ||
|
|
e0b9cec7e8 | ||
|
|
4d96c8fc75 | ||
|
|
3f09d00198 | ||
|
|
738425170b | ||
|
|
27a4696a6d | ||
|
|
ce13c0cbe9 | ||
|
|
3617855bcb | ||
|
|
0d66aaa734 | ||
|
|
b68c40e5a5 | ||
|
|
c40ececb34 | ||
|
|
a66ba3f391 | ||
|
|
02b30326fd | ||
|
|
d06d2026f4 | ||
|
|
35ddf5da65 | ||
|
|
cd01258555 | ||
|
|
2270704c4f | ||
|
|
f2456d2364 | ||
|
|
8d1d9ece01 | ||
|
|
f624ab1529 | ||
|
|
ded8da0016 | ||
|
|
58ed07b4e3 | ||
|
|
6193221764 | ||
|
|
bb66e2d197 | ||
|
|
92fbc44b6d | ||
|
|
d93edbe427 | ||
|
|
a4d89b1f6c | ||
|
|
5255df021e | ||
|
|
4d33d1a703 | ||
|
|
c90c0944c1 | ||
|
|
e7fc9b94b0 | ||
|
|
7512e48236 | ||
|
|
bb6e4b4610 | ||
|
|
7ef340fb68 | ||
|
|
fef5147ae4 | ||
|
|
afed84a502 | ||
|
|
a329cd536b | ||
|
|
32b36ee10e | ||
|
|
671d202271 | ||
|
|
7e629b3c80 | ||
|
|
3d3ff3f866 | ||
|
|
2c27db42c2 | ||
|
|
18dd47c713 | ||
|
|
ec933e4805 | ||
|
|
2ff5d2aaf4 | ||
|
|
b5aceb67f9 | ||
|
|
2794c84ac0 | ||
|
|
ce9646f9e9 | ||
|
|
be8da39ce1 | ||
|
|
dacc8adce1 | ||
|
|
b79c410b0e | ||
|
|
b5754d2e3d | ||
|
|
8a6ee6c9ab | ||
|
|
309c1ca3f1 | ||
|
|
f3bc3ca51d | ||
|
|
7c82002903 | ||
|
|
2a0c16c6f3 | ||
|
|
1c4e9e00a5 | ||
|
|
3599904eee | ||
|
|
ba983df32b | ||
|
|
194105f4d3 | ||
|
|
ea374ac0c0 | ||
|
|
df4d88e195 | ||
|
|
f9c4221125 | ||
|
|
f246c47a33 | ||
|
|
fdcaa1c8e7 | ||
|
|
7f7aef031a | ||
|
|
1451a75646 | ||
|
|
5c57493f5b | ||
|
|
af2bf4e8cd | ||
|
|
42fbf12d66 | ||
|
|
1ec53dbf7f | ||
|
|
37c2e004fb | ||
|
|
c65fc0f1dc | ||
|
|
c371e04aaf | ||
|
|
9c61ce86cc | ||
|
|
d6b1fa02d8 | ||
|
|
e3cd4be117 | ||
|
|
508f30901a | ||
|
|
18bae18498 | ||
|
|
ecb7249a1d | ||
|
|
fa67bd8312 | ||
|
|
f8471832e9 | ||
|
|
3e5eceeefa | ||
|
|
0e617ec137 | ||
|
|
9b1ea9f303 | ||
|
|
94555e348c | ||
|
|
23e17fe0a1 | ||
|
|
a443975f7e | ||
|
|
5cd0873ee8 | ||
|
|
7e796affb3 | ||
|
|
4b2cb45b0c | ||
|
|
dde94aa754 | ||
|
|
771d8b42aa | ||
|
|
544b62c683 | ||
|
|
1c2c0c75f4 | ||
|
|
4ef5267a85 | ||
|
|
30aa75e047 | ||
|
|
1b29a59d8f | ||
|
|
d6b83fbbf8 | ||
|
|
f30b191d05 | ||
|
|
4a0d019b6e | ||
|
|
5218f8aab3 | ||
|
|
37ee6f8446 | ||
|
|
e5dd8efd7a | ||
|
|
916943a7c2 | ||
|
|
cee24b2a7d | ||
|
|
b806e536f1 | ||
|
|
0bfba15dfc | ||
|
|
a933d5d7a8 | ||
|
|
c09174dd39 | ||
|
|
1a36e3a512 | ||
|
|
cac1db5391 | ||
|
|
1b5b8081f1 | ||
|
|
52e02d85b9 | ||
|
|
14f10307c1 | ||
|
|
64599b4819 | ||
|
|
fb229f6c79 | ||
|
|
65408519ae | ||
|
|
4831aee2dc | ||
|
|
a5fc7c807c | ||
|
|
09f2b2af26 | ||
|
|
2b923eb5b7 | ||
|
|
ebe81b9c51 | ||
|
|
b31f35ba26 | ||
|
|
f9c6a23280 | ||
|
|
f09eb6690d | ||
|
|
c003f78f62 | ||
|
|
26434683c4 | ||
|
|
26757cb8d8 | ||
|
|
c90420b61f | ||
|
|
4b6d385e1a | ||
|
|
ea3097240e | ||
|
|
1881789981 | ||
|
|
a6db3d353c | ||
|
|
4882ead845 | ||
|
|
8a8d0e1cb3 | ||
|
|
bb2e014514 | ||
|
|
0420266b7d | ||
|
|
550883197f | ||
|
|
a365a0f459 | ||
|
|
5d82212284 | ||
|
|
99caf7b142 | ||
|
|
2f42e9e5f4 | ||
|
|
b52eb8491c | ||
|
|
32638ac3c0 | ||
|
|
2bc5db8d20 | ||
|
|
d335c570c6 | ||
|
|
fe472cbf49 | ||
|
|
c17436cdb0 | ||
|
|
a2d7854fb7 | ||
|
|
39776f339a | ||
|
|
c97e2ab1c2 | ||
|
|
5070775cd3 | ||
|
|
7056fa01b4 | ||
|
|
3f391649c6 | ||
|
|
f73e11b0bd | ||
|
|
99cf724d2c | ||
|
|
ef6d0c2adc | ||
|
|
09ccf107cb | ||
|
|
cea59e8794 | ||
|
|
18a023f2fb | ||
|
|
4c1d9e5e0f | ||
|
|
db43b87568 | ||
|
|
25d34f34b0 | ||
|
|
13f44debcd | ||
|
|
a186f25871 | ||
|
|
8f7223b1d6 | ||
|
|
05c730acea | ||
|
|
b921d993ab | ||
|
|
434e0d8be2 | ||
|
|
b4ed259633 | ||
|
|
89cb75bfeb | ||
|
|
1ca0859d51 | ||
|
|
f62bd8968e | ||
|
|
136f2c547d | ||
|
|
1caf8b6c0b | ||
|
|
8f6b72bb82 | ||
|
|
21178638f0 | ||
|
|
e8ff39a011 | ||
|
|
5f9b6622f0 | ||
|
|
2286ef19b4 | ||
|
|
8a1d2d1eaf | ||
|
|
adc50ec864 | ||
|
|
4963d750fb | ||
|
|
8bc891590d | ||
|
|
efbf033c2d | ||
|
|
4fe7006920 | ||
|
|
5e0d66d5df | ||
|
|
76906efea2 | ||
|
|
a997cf4982 | ||
|
|
6ac6768e36 | ||
|
|
acdc1dafd3 | ||
|
|
b60c97822d | ||
|
|
279d1398cc | ||
|
|
eb342a70ab | ||
|
|
eb7b055ca2 | ||
|
|
367d3f1470 | ||
|
|
821283952d | ||
|
|
e7cd84275e | ||
|
|
4bd60ccd38 | ||
|
|
79d0169855 | ||
|
|
5db35871eb | ||
|
|
21d67a4297 | ||
|
|
dcf4e3ebf2 | ||
|
|
d15259cd5e | ||
|
|
b49272eb35 | ||
|
|
6133b1a5cc | ||
|
|
fcf1e193b9 | ||
|
|
35f75db920 | ||
|
|
42ad035e56 | ||
|
|
f303512a7c | ||
|
|
5ff0613ef3 | ||
|
|
c5d448cbb3 | ||
|
|
69a4b12724 | ||
|
|
b63dc0f91d | ||
|
|
acf641be26 | ||
|
|
a54a9c05b1 | ||
|
|
1ace096c5b | ||
|
|
dc3ef5c61e | ||
|
|
5533d5131b | ||
|
|
31a4822aea | ||
|
|
9c62343075 | ||
|
|
544c19f3ce | ||
|
|
7e30803175 | ||
|
|
25c20ec6f8 | ||
|
|
4b2086e0b4 | ||
|
|
220fc57201 | ||
|
|
de889ec6cc | ||
|
|
82d0f5c03f | ||
|
|
5db73a6670 | ||
|
|
66fc71cc81 | ||
|
|
04427515fa | ||
|
|
87cf251d2d | ||
|
|
029233a5a4 | ||
|
|
57ae145034 | ||
|
|
6f72aadf39 | ||
|
|
a3245195ab | ||
|
|
eb6d0ed5f0 | ||
|
|
160a315d7b | ||
|
|
23c76dc796 | ||
|
|
9685684876 | ||
|
|
b4884e3dde | ||
|
|
22c915d617 | ||
|
|
386746365d | ||
|
|
f97c397b13 | ||
|
|
41a9d92421 | ||
|
|
781cc3ed6b | ||
|
|
f8938b819c | ||
|
|
87043ebb5c | ||
|
|
207cd93fe0 | ||
|
|
45819e6c12 | ||
|
|
223c9439b1 | ||
|
|
9fb62eb504 | ||
|
|
8842b97ca0 | ||
|
|
5ecb97d532 | ||
|
|
e20e308ac6 | ||
|
|
10052eb330 | ||
|
|
986878289e | ||
|
|
e31334b471 | ||
|
|
b25295bf03 | ||
|
|
21a09d29d6 | ||
|
|
5de04ebdf4 | ||
|
|
265bbc6e77 | ||
|
|
ef0242d15b | ||
|
|
0d1826644b | ||
|
|
77d1ac7056 | ||
|
|
d20654575c | ||
|
|
60293ef052 | ||
|
|
db9789c868 | ||
|
|
8751082487 | ||
|
|
89ec83fec3 | ||
|
|
030a2edfb9 | ||
|
|
a23f57da4d | ||
|
|
561465e7e8 | ||
|
|
5f49670e18 | ||
|
|
fa521da2cd | ||
|
|
fb0e4e093f | ||
|
|
6a64efb7e5 | ||
|
|
2fa8e1b658 | ||
|
|
202f6b4be2 | ||
|
|
9012180b60 | ||
|
|
33d9ef948a | ||
|
|
6f20638f8b | ||
|
|
161db6d95f | ||
|
|
4f5a2ff433 | ||
|
|
611b9e9b5e | ||
|
|
f8cce28926 | ||
|
|
965b51c633 | ||
|
|
20443286f6 | ||
|
|
f12192f1c4 | ||
|
|
615fe1da8b | ||
|
|
0ec55c87c1 | ||
|
|
9a6c26de1c | ||
|
|
c44a8e0b77 | ||
|
|
afaf9406e8 | ||
|
|
f1dfcd5e06 | ||
|
|
7d47ac4dd7 | ||
|
|
2f79c99dc7 | ||
|
|
aeba29c4b3 | ||
|
|
28e83a3125 |
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:1.0.0
|
||||
|
||||
ADD ./_output/bin/ansibleserver /opt/yunion/bin/ansibleserver
|
||||
ADD ./_output/alpine-build/bin/ansibleserver /opt/yunion/bin/ansibleserver
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
FROM frolvlad/alpine-glibc:glibc-2.28
|
||||
FROM alpine:3.11.6
|
||||
|
||||
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"
|
||||
MAINTAINER "Yousong Zhou <zhouyousong@yunionyun.com>"
|
||||
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache tzdata git ansible ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
# openssh-client, for ansible ssh connection
|
||||
# git, ca-certificates, for fetching ansible roles
|
||||
RUN set -x \
|
||||
&& apk update \
|
||||
&& apk add openssh-client \
|
||||
&& apk add ansible \
|
||||
&& apk add tzdata git ca-certificates \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/apigateway /opt/yunion/bin/apigateway
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/cloudevent /opt/yunion/bin/cloudevent
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/cloudid /opt/yunion/bin/cloudid
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/cloudnet /opt/yunion/bin/cloudnet
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/devtool /opt/yunion/bin/devtool
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
COPY ./build/esxi-agent/root/opt/ /opt/
|
||||
ADD ./_output/bin/esxi-agent /opt/yunion/bin/esxi-agent
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/keystone /opt/yunion/bin/keystone
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/logger /opt/yunion/bin/logger
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/monitor /opt/yunion/bin/monitor
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
COPY ./build/notify/root/opt/ /opt/
|
||||
ADD ./_output/bin/notify /opt/yunion/bin/notify
|
||||
|
||||
@@ -7,7 +7,7 @@ ENV TZ Asia/Shanghai
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache tzdata ca-certificates && \
|
||||
apk add --no-cache tzdata curl busybox-extras tcpdump strace ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
COPY ./build/region/root/opt/ /opt/
|
||||
ADD ./_output/bin/region /opt/yunion/bin/region
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/s3gateway /opt/yunion/bin/s3gateway
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/scheduler /opt/yunion/bin/scheduler
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
|
||||
|
||||
ADD ./_output/bin/yunionconf /opt/yunion/bin/yunionconf
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ func init() {
|
||||
|
||||
ClouduserId string `json:"clouduser_id"`
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
Usable bool `json:"usable"`
|
||||
}
|
||||
R(&CloudgroupListOptions{}, "cloud-group-list", "List cloud groups", func(s *mcclient.ClientSession, opts *CloudgroupListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
@@ -78,4 +80,30 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&GlobalVpcShowOptions{}, "global-vpc-change-owner-candidate-domains", "Show candiate domains of a global vpc for changing owner", func(s *mcclient.ClientSession, args *GlobalVpcShowOptions) error {
|
||||
result, err := modules.GlobalVpcs.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type GlobalVpcChangeOwnerOptions struct {
|
||||
ID string `help:"ID or name of vpc" json:"-"`
|
||||
ProjectDomain string `json:"project_domain" help:"target domain"`
|
||||
}
|
||||
R(&GlobalVpcChangeOwnerOptions{}, "global-vpc-change-owner", "Change owner domain of a global vpc", func(s *mcclient.ClientSession, args *GlobalVpcChangeOwnerOptions) error {
|
||||
if len(args.ProjectDomain) == 0 {
|
||||
return fmt.Errorf("empty project_domain")
|
||||
}
|
||||
params := jsonutils.Marshal(args)
|
||||
ret, err := modules.GlobalVpcs.PerformAction(s, args.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -145,6 +145,15 @@ func init() {
|
||||
},
|
||||
)
|
||||
|
||||
R(&GuestTemplateOptions{}, "server-template-inspect", "Inspect server template", func(s *mcclient.ClientSession, opts *GuestTemplateOptions) error {
|
||||
tem, err := modules.GuestTemplate.PerformAction(s, opts.ID, "inspect", 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"`
|
||||
|
||||
@@ -19,6 +19,7 @@ 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"
|
||||
@@ -360,15 +361,18 @@ func init() {
|
||||
|
||||
type NetworkAddressOptions struct {
|
||||
NETWORK string `help:"id or name of network to query"`
|
||||
|
||||
api.GetNetworkAddressesInput
|
||||
}
|
||||
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)
|
||||
result, err := modules.Networks.GetSpecific(s, args.NETWORK, "addresses", jsonutils.Marshal(args.GetNetworkAddressesInput))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
addrList, err := result.GetArray("addresses")
|
||||
if err != nil {
|
||||
return err
|
||||
addrList, _ := result.GetArray("addresses")
|
||||
if addrList == nil {
|
||||
fmt.Println("no result")
|
||||
return nil
|
||||
}
|
||||
listResult := modulebase.ListResult{Data: addrList}
|
||||
printList(&listResult, nil)
|
||||
|
||||
@@ -111,10 +111,11 @@ func init() {
|
||||
type SchedulerCleanCacheOptions struct {
|
||||
HostId string `help:"ID of host" short-token:"h"`
|
||||
SessionId string `help:"Session id" short-token:"s"`
|
||||
Sync bool `help:"Sync do clean sched cache"`
|
||||
}
|
||||
R(&SchedulerCleanCacheOptions{}, "scheduler-clean-cache", "Clean scheduler hosts cache",
|
||||
func(s *mcclient.ClientSession, args *SchedulerCleanCacheOptions) error {
|
||||
err := modules.SchedManager.CleanCache(s, args.HostId, args.SessionId)
|
||||
err := modules.SchedManager.CleanCache(s, args.HostId, args.SessionId, args.Sync)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -25,33 +25,20 @@ import (
|
||||
func init() {
|
||||
type SecGroupRulesListOptions struct {
|
||||
options.BaseListOptions
|
||||
Secgroup string `help:"Secgroup ID or Name"`
|
||||
Direction string `help:"filter Direction of rule" choices:"in|out"`
|
||||
Protocol string `help:"filter Protocol of rule" choices:"any|tcp|udp|icmp"`
|
||||
Action string `help:"filter Actin of rule" choices:"allow|deny"`
|
||||
Secgroup string `help:"Secgroup ID or Name"`
|
||||
SecgroupName string `help:"Search rules by fuzzy secgroup name"`
|
||||
Projects []string `help:"Filter rules by project"`
|
||||
Direction string `help:"filter Direction of rule" choices:"in|out"`
|
||||
Protocol string `help:"filter Protocol of rule" choices:"any|tcp|udp|icmp"`
|
||||
Action string `help:"filter Actin of rule" choices:"allow|deny"`
|
||||
Ports string `help:"filter Ports of rule"`
|
||||
Ip string `help:"filter cidr of rule"`
|
||||
}
|
||||
|
||||
R(&SecGroupRulesListOptions{}, "secgroup-rule-list", "List all security group", func(s *mcclient.ClientSession, args *SecGroupRulesListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
if len(args.Secgroup) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Secgroup), "secgroup")
|
||||
}
|
||||
if len(args.Direction) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Direction), "direction")
|
||||
}
|
||||
if len(args.Protocol) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Protocol), "protocol")
|
||||
}
|
||||
if len(args.Action) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Action), "action")
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.SecGroupRules.List(s, params)
|
||||
if err != nil {
|
||||
|
||||
@@ -29,23 +29,15 @@ func init() {
|
||||
Equals string `help:"Secgroup ID or Name, filter secgroups whose rules equals the specified one"`
|
||||
Server string `help:"Filter secgroups bound to specified server"`
|
||||
options.BaseListOptions
|
||||
Ip string `help:"Filter secgroup by ip"`
|
||||
Ports string `help:"Filter secgroup by ports"`
|
||||
Direction string `help:"Filter secgroup by ports" choices:"all|in|out"`
|
||||
}
|
||||
|
||||
R(&SecGroupsListOptions{}, "secgroup-list", "List all security group", func(s *mcclient.ClientSession, args *SecGroupsListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
if len(args.Equals) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Equals), "equals")
|
||||
}
|
||||
if len(args.Server) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Server), "server")
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.SecGroups.List(s, params)
|
||||
if err != nil {
|
||||
|
||||
@@ -298,6 +298,12 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerIdsOptions{}, "server-reconcile-backup", "Reconcile backup server", func(s *mcclient.ClientSession, opts *options.ServerIdsOptions) error {
|
||||
ret := modules.Servers.BatchPerformAction(s, opts.ID, "reconcile-backup", nil)
|
||||
printBatchResults(ret, modules.Servers.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerIdsOptions{}, "server-create-backup", "Create backup guest", func(s *mcclient.ClientSession, opts *options.ServerIdsOptions) error {
|
||||
ret := modules.Servers.BatchPerformAction(s, opts.ID, "create-backup", nil)
|
||||
printBatchResults(ret, modules.Servers.GetColumns(s))
|
||||
@@ -1146,6 +1152,7 @@ func init() {
|
||||
ID string `help:"ID or name of VM"`
|
||||
DisableIsaSerial string `help:"disable isa serial device" choices:"true|false"`
|
||||
DisablePvpanic string `help:"disable pvpanic device" choices:"true|false"`
|
||||
DisableUsbKbd string `help:"disable usb kbd" choices:"true|false"`
|
||||
}
|
||||
|
||||
R(&ServerQemuParams{}, "server-set-qemu-params", "config qemu params", func(s *mcclient.ClientSession,
|
||||
@@ -1157,6 +1164,9 @@ func init() {
|
||||
if len(opts.DisablePvpanic) > 0 {
|
||||
params.Set("disable_pvpanic", jsonutils.NewString(opts.DisablePvpanic))
|
||||
}
|
||||
if len(opts.DisableUsbKbd) > 0 {
|
||||
params.Set("disable_usb_kbd", jsonutils.NewString(opts.DisableUsbKbd))
|
||||
}
|
||||
result, err := modules.Servers.PerformAction(s, opts.ID, "set-qemu-params", params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -35,7 +35,10 @@ type BaseEventListOptions struct {
|
||||
Action []string `help:"Log action"`
|
||||
|
||||
User string `help:"filter by operator user"`
|
||||
Project string `help:"filter by owner project"`
|
||||
Project string `help:"filter by operator user's project"`
|
||||
|
||||
OwnerProjectIds []string `help:"filter by owner project ids"`
|
||||
OwnerDomainIds []string `help:"filter by owner domain ids"`
|
||||
|
||||
PagingMarker string `help:"marker for pagination"`
|
||||
}
|
||||
@@ -107,6 +110,12 @@ func doEventList(man modulebase.ResourceManager, s *mcclient.ClientSession, args
|
||||
if len(args.Scope) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Scope), "scope")
|
||||
}
|
||||
if len(args.OwnerProjectIds) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(args.OwnerProjectIds), "owner_project_ids")
|
||||
}
|
||||
if len(args.OwnerDomainIds) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(args.OwnerDomainIds), "owner_domain_ids")
|
||||
}
|
||||
if len(args.PagingMarker) > 0 {
|
||||
params.Add(jsonutils.NewString(args.PagingMarker), "paging_marker")
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ type ImageOptionalOptions struct {
|
||||
Hypervisor []string `help:"Prefer hypervisor type" choices:"kvm|esxi|baremetal|container|openstack|ctyun"`
|
||||
DiskDriver string `help:"Perfer disk driver" choices:"virtio|scsi|pvscsi|ide|sata"`
|
||||
NetDriver string `help:"Preferred network driver" choices:"virtio|e1000|vmxnet3"`
|
||||
DisableUsbKbd bool `help:"Disable usb keyboard on this image(for hypervisor kvm)"`
|
||||
}
|
||||
|
||||
func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDict, args ImageOptionalOptions) error {
|
||||
@@ -131,6 +132,9 @@ func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDi
|
||||
if len(args.Hypervisor) > 0 {
|
||||
params.Add(jsonutils.NewString(strings.Join(args.Hypervisor, ",")), "properties", "hypervisor")
|
||||
}
|
||||
if args.DisableUsbKbd {
|
||||
params.Add(jsonutils.NewString("true"), "properties", "disable_usb_kbd")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -252,7 +256,7 @@ func init() {
|
||||
}
|
||||
|
||||
type ImageDeleteOptions struct {
|
||||
ID []string `help:"Image ID or name"`
|
||||
ID []string `help:"Image ID or name" json:"-"`
|
||||
OverridePendingDelete *bool `help:"Delete image directly instead of pending delete" short-token:"f"`
|
||||
}
|
||||
R(&ImageDeleteOptions{}, "image-delete", "Delete a image", func(s *mcclient.ClientSession, args *ImageDeleteOptions) error {
|
||||
|
||||
@@ -188,6 +188,19 @@ func initKubeCluster() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.ClusterSyncOptions{}, cmdN("sync"), "Sync cluster k8s resources", func(s *mcclient.ClientSession, args *o.ClusterSyncOptions) error {
|
||||
param, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "sync", param)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.IdentOptions{}, cmdN("public"), "Make cluster public", func(s *mcclient.ClientSession, args *o.IdentOptions) error {
|
||||
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "public", nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -43,7 +43,6 @@ func init() {
|
||||
initRepo()
|
||||
initChart()
|
||||
initRelease()
|
||||
initReleaseApps()
|
||||
|
||||
// kubernetes original resources
|
||||
initRaw()
|
||||
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
)
|
||||
|
||||
func getPrinterRowValue(printer k8s.ListPrinter, obj jsonutils.JSONObject, col string) interface{} {
|
||||
getFuncName := fmt.Sprintf("Get%s", strings.Title(col))
|
||||
getFuncName := fmt.Sprintf("Get_%s", strings.Title(col))
|
||||
manValue := reflect.ValueOf(printer)
|
||||
funcValue := manValue.MethodByName(getFuncName)
|
||||
if !funcValue.IsValid() || funcValue.IsNil() {
|
||||
|
||||
@@ -22,8 +22,10 @@ import (
|
||||
|
||||
func initRbac() {
|
||||
//cmdRole := initK8sNamespaceResource("rbacrole", k8s.RbacRoles)
|
||||
initK8sNamespaceResource("rbacrole", k8s.RbacRoles)
|
||||
initK8sNamespaceResource("rbacrolebinding", k8s.RbacRoleBindings)
|
||||
initK8sNamespaceResource("rbac-role", k8s.RbacRoles)
|
||||
initK8sNamespaceResource("rbac-rolebinding", k8s.RbacRoleBindings)
|
||||
initK8sClusterResource("rbac-clusterrole", k8s.RbacClusterRoles)
|
||||
initK8sClusterResource("rbac-clusterrolebinding", k8s.RbacClusterRoleBindings)
|
||||
initK8sNamespaceResource("serviceaccount", k8s.ServiceAccounts)
|
||||
//cmdRoleN := cmdRole.CommandNameFactory
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package k8s
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
|
||||
o "yunion.io/x/onecloud/pkg/mcclient/options/k8s"
|
||||
)
|
||||
|
||||
func initReleaseApps() {
|
||||
cmdN := func(app string) string {
|
||||
return resourceCmdN(fmt.Sprintf("app-%s", app), "create")
|
||||
}
|
||||
R(&o.AppCreateOptions{}, cmdN("meter"), "Create yunion meter helm release", func(s *mcclient.ClientSession, args *o.AppCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.MeterReleaseApps.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.AppCreateOptions{}, cmdN("servicetree"), "Create yunion servicetree helm release", func(s *mcclient.ClientSession, args *o.AppCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.ServicetreeReleaseApps.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&o.AppCreateOptions{}, cmdN("notify"), "Create yunion notify helm release", func(s *mcclient.ClientSession, args *o.AppCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := k8s.NotifyReleaseApps.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -35,6 +35,7 @@ func init() {
|
||||
Copyright string `help:"The copyright"`
|
||||
Email string `help:"The Email"`
|
||||
Docs *string `help:"the Docs website address"`
|
||||
License *string `help:"the license generator website address"`
|
||||
}
|
||||
|
||||
R(&CopyrightUpdateOptions{}, "copyright-update", "update copyright", func(s *mcclient.ClientSession, args *CopyrightUpdateOptions) error {
|
||||
@@ -47,6 +48,10 @@ func init() {
|
||||
params.Add(jsonutils.NewString(*args.Docs), "docs")
|
||||
}
|
||||
|
||||
if args.License != nil {
|
||||
params.Add(jsonutils.NewString(*args.License), "license")
|
||||
}
|
||||
|
||||
if len(args.Copyright) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Copyright), "copyright")
|
||||
}
|
||||
|
||||
47
cmd/climc/shell/monitor/commonalert.go
Normal file
47
cmd/climc/shell/monitor/commonalert.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package monitor
|
||||
|
||||
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 CommonAlertListOptions struct {
|
||||
options.BaseListOptions
|
||||
// 报警类型
|
||||
AlertType string `help:"common alert type" choices:"normal|system"`
|
||||
Level string `help:"common alert notify level" choices:"normal|important|fatal"`
|
||||
}
|
||||
R(&CommonAlertListOptions{}, "commonalert-list", "List commonalert", func(s *mcclient.ClientSession,
|
||||
args *CommonAlertListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.CommonAlertManager.List(s, params)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
printList(result, modules.CommonAlertManager.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type CommonAlertDeleteOptions struct {
|
||||
ID string `help:"ID of alart"`
|
||||
Force bool `help:"force to delete alert"`
|
||||
}
|
||||
R(&CommonAlertDeleteOptions{}, "commonalert-delete", "List commonalert", func(s *mcclient.ClientSession,
|
||||
args *CommonAlertDeleteOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewBool(args.Force), "force")
|
||||
object, err := modules.CommonAlertManager.Delete(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(object)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -18,17 +18,21 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/structarg"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/multicloud/google"
|
||||
_ "yunion.io/x/onecloud/pkg/multicloud/google/shell"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
type BaseOptions struct {
|
||||
Debug bool `help:"debug mode"`
|
||||
Help bool `help:"Show help"`
|
||||
AuthFile string `help:"google cloud auth json file path" default:"$GOOGLE_AUTH_FILE"`
|
||||
ClientEmail string `help:"Client email" default:"$GOOGLE_CLIENT_EMAIL"`
|
||||
ProjectID string `help:"Project ID" default:"$GOOGLE_PROJECT_ID"`
|
||||
PrivateKeyID string `help:"Private Key ID" default:"$GOOGLE_PRIVATE_KEY_ID"`
|
||||
@@ -78,6 +82,20 @@ func showErrorAndExit(e error) {
|
||||
}
|
||||
|
||||
func newClient(options *BaseOptions) (*google.SRegion, error) {
|
||||
if len(options.AuthFile) > 0 {
|
||||
jsonStr, err := fileutils2.FileGetContents(options.AuthFile)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "FileGetContents")
|
||||
}
|
||||
jsonCfg, err := jsonutils.ParseString(jsonStr)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "jsonutils.ParseString")
|
||||
}
|
||||
options.ClientEmail, _ = jsonCfg.GetString("client_email")
|
||||
options.PrivateKeyID, _ = jsonCfg.GetString("private_key_id")
|
||||
options.PrivateKey, _ = jsonCfg.GetString("private_key")
|
||||
options.ProjectID, _ = jsonCfg.GetString("project_id")
|
||||
}
|
||||
if len(options.ClientEmail) == 0 {
|
||||
return nil, fmt.Errorf("Missing ClientEmail")
|
||||
}
|
||||
|
||||
167
cmd/raidcli/main.go
Normal file
167
cmd/raidcli/main.go
Normal file
@@ -0,0 +1,167 @@
|
||||
// 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/cmd/raidcli/shell"
|
||||
"yunion.io/x/onecloud/pkg/baremetal/utils/raid"
|
||||
"yunion.io/x/onecloud/pkg/baremetal/utils/raid/drivers"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
"yunion.io/x/onecloud/pkg/util/ssh"
|
||||
)
|
||||
|
||||
type BaseOptions struct {
|
||||
Debug bool `help:"debug mode"`
|
||||
Help bool `help:"Show help"`
|
||||
Host string `help:"SSH Host IP" default:"$RAID_HOST" metavar:"RAID_HOST"`
|
||||
Username string `help:"Username, usually root" default:"$RAID_USERNAME" metavar:"RAID_USERNAME"`
|
||||
Password string `help:"Password" default:"$RAID_PASSWORD" metavar:"RAID_PASSWORD"`
|
||||
Driver string `help:"Password" default:"$RAID_DRIVER" metavar:"RAID_DRIVER" choices:"MegaRaid|HPSARaid|Mpt2SAS|MarvelRaid"`
|
||||
SUBCOMMAND string `help:"s3cli subcommand" subcommand:"true"`
|
||||
}
|
||||
|
||||
var (
|
||||
options = &BaseOptions{}
|
||||
)
|
||||
|
||||
func getSubcommandParser() (*structarg.ArgumentParser, error) {
|
||||
parse, e := structarg.NewArgumentParser(options,
|
||||
"raidcli",
|
||||
"Command-line interface to test RAID drivers.",
|
||||
`See "raidcli 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() (raid.IRaidDriver, error) {
|
||||
if len(options.Host) == 0 {
|
||||
return nil, fmt.Errorf("Missing host")
|
||||
}
|
||||
|
||||
if len(options.Username) == 0 {
|
||||
return nil, fmt.Errorf("Missing username")
|
||||
}
|
||||
|
||||
if len(options.Password) == 0 {
|
||||
return nil, fmt.Errorf("Missing password")
|
||||
}
|
||||
|
||||
if len(options.Driver) == 0 {
|
||||
return nil, fmt.Errorf("Missing driver")
|
||||
}
|
||||
|
||||
if options.Debug {
|
||||
raid.Debug = true
|
||||
}
|
||||
|
||||
sshClient, err := ssh.NewClient(
|
||||
options.Host,
|
||||
22,
|
||||
options.Username,
|
||||
options.Password,
|
||||
"",
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ssh client init fail: %s", err)
|
||||
}
|
||||
|
||||
drv := drivers.GetDriver(options.Driver, sshClient)
|
||||
if drv == nil {
|
||||
return nil, fmt.Errorf("not supported driver %s", options.Driver)
|
||||
}
|
||||
|
||||
err = drv.ParsePhyDevs()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parse phyical devices error %s", err)
|
||||
}
|
||||
|
||||
return drv, 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 client raid.IRaidDriver
|
||||
client, e = newClient()
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
e = subcmd.Invoke(client, suboptions)
|
||||
}
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
37
cmd/raidcli/shell/raid.go
Normal file
37
cmd/raidcli/shell/raid.go
Normal file
@@ -0,0 +1,37 @@
|
||||
// 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/baremetal/utils/raid"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type ShowOptions struct {
|
||||
}
|
||||
shellutils.R(&ShowOptions{}, "show", "show raid info", func(drv raid.IRaidDriver, args *ShowOptions) error {
|
||||
adpts := drv.GetAdapters()
|
||||
for i := range adpts {
|
||||
fmt.Println("Index:", i)
|
||||
fmt.Println(jsonutils.Marshal(adpts[i].GetDevices()).PrettyString())
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -17,12 +17,16 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"yunion.io/x/structarg"
|
||||
|
||||
_ "yunion.io/x/onecloud/cmd/redfishcli/shell"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/redfish"
|
||||
"yunion.io/x/onecloud/pkg/util/redfish/bmconsole"
|
||||
_ "yunion.io/x/onecloud/pkg/util/redfish/loader"
|
||||
"yunion.io/x/onecloud/pkg/util/shellutils"
|
||||
)
|
||||
@@ -36,8 +40,12 @@ type BaseOptions struct {
|
||||
SUBCOMMAND string `help:"s3cli subcommand" subcommand:"true"`
|
||||
}
|
||||
|
||||
var (
|
||||
options = &BaseOptions{}
|
||||
)
|
||||
|
||||
func getSubcommandParser() (*structarg.ArgumentParser, error) {
|
||||
parse, e := structarg.NewArgumentParser(&BaseOptions{},
|
||||
parse, e := structarg.NewArgumentParser(options,
|
||||
"redfishcli",
|
||||
"Command-line interface to redfish API.",
|
||||
`See "redfishcli help COMMAND" for help on a specific command.`)
|
||||
@@ -62,6 +70,7 @@ func getSubcommandParser() (*structarg.ArgumentParser, error) {
|
||||
return nil
|
||||
}
|
||||
})
|
||||
bmcJnlp()
|
||||
for _, v := range shellutils.CommandTable {
|
||||
_, e := subcmd.AddSubParser(v.Options, v.Command, v.Desc, v.Callback)
|
||||
if e != nil {
|
||||
@@ -71,13 +80,49 @@ func getSubcommandParser() (*structarg.ArgumentParser, error) {
|
||||
return parse, nil
|
||||
}
|
||||
|
||||
func bmcJnlp() {
|
||||
type BmcGetOptions struct {
|
||||
BRAND string `help:"brand of baremetal" choices:"Lenovo|Huawei|HPE|Dell|Supermicro"`
|
||||
Save string `help:"save to file"`
|
||||
Debug bool `help:"turn on debug mode"`
|
||||
}
|
||||
shellutils.R(&BmcGetOptions{}, "bmc-jnlp", "Get Java Console JNLP file", func(args *BmcGetOptions) error {
|
||||
ctx := context.Background()
|
||||
parts, err := url.Parse(options.Endpoint)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
bmc := bmconsole.NewBMCConsole(parts.Hostname(), options.Username, options.Password, args.Debug)
|
||||
var jnlp string
|
||||
switch strings.ToLower(args.BRAND) {
|
||||
case "hp", "hpe":
|
||||
jnlp, err = bmc.GetIloConsoleJNLP(ctx)
|
||||
case "dell", "dell inc.":
|
||||
jnlp, err = bmc.GetIdracConsoleJNLP(ctx, "", "")
|
||||
case "supermicro":
|
||||
jnlp, err = bmc.GetSupermicroConsoleJNLP(ctx)
|
||||
case "lenovo":
|
||||
jnlp, err = bmc.GetLenovoConsoleJNLP(ctx)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.Save) > 0 {
|
||||
return fileutils2.FilePutContents(args.Save, jnlp, false)
|
||||
} else {
|
||||
fmt.Println(jnlp)
|
||||
return nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func showErrorAndExit(e error) {
|
||||
fmt.Fprintf(os.Stderr, "%s", e)
|
||||
fmt.Fprintln(os.Stderr)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func newClient(options *BaseOptions) (redfish.IRedfishDriver, error) {
|
||||
func newClient() (redfish.IRedfishDriver, error) {
|
||||
if len(options.Endpoint) == 0 {
|
||||
return nil, fmt.Errorf("Missing endpoint")
|
||||
}
|
||||
@@ -104,7 +149,7 @@ func main() {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
e = parser.ParseArgs(os.Args[1:], false)
|
||||
options := parser.Options().(*BaseOptions)
|
||||
// options := parser.Options().(*BaseOptions)
|
||||
|
||||
if options.Help {
|
||||
fmt.Print(parser.HelpString())
|
||||
@@ -122,9 +167,11 @@ func main() {
|
||||
suboptions := subparser.Options()
|
||||
if options.SUBCOMMAND == "help" {
|
||||
e = subcmd.Invoke(suboptions)
|
||||
} else if options.SUBCOMMAND == "bmc-jnlp" {
|
||||
e = subcmd.Invoke(suboptions)
|
||||
} else {
|
||||
var client redfish.IRedfishDriver
|
||||
client, e = newClient(options)
|
||||
client, e = newClient()
|
||||
if e != nil {
|
||||
showErrorAndExit(e)
|
||||
}
|
||||
|
||||
8
go.mod
8
go.mod
@@ -131,13 +131,13 @@ require (
|
||||
k8s.io/cluster-bootstrap v0.17.3
|
||||
k8s.io/kubernetes v1.16.0
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
|
||||
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9
|
||||
yunion.io/x/jsonutils v0.0.0-20200814075449-927b118adbd8
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
|
||||
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
|
||||
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v0.0.0-20200608080702-9b6683aa048c
|
||||
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7
|
||||
yunion.io/x/sqlchemy v0.0.0-20200814052348-164f1f20f8a6
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
|
||||
)
|
||||
|
||||
replace (
|
||||
|
||||
21
go.sum
21
go.sum
@@ -94,7 +94,9 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx
|
||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
|
||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/a8m/mark v0.1.1-0.20170507133748-44f2db618845/go.mod h1:c8Mh99Cw82nrsAnPgxQSZHkswVOJF7/MqZb1ZdvriLM=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
|
||||
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=
|
||||
@@ -1016,6 +1018,7 @@ google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
|
||||
google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
|
||||
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=
|
||||
@@ -1123,10 +1126,9 @@ vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74 h1:A15C6VdVRWvmQ9pAJHrUs9yan5qKlYH7uaRxHg1kRbk=
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9 h1:s7sobXxn4ckRHdjIaA91Rnfy2kreV/+dN3P2pQLg7F0=
|
||||
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
|
||||
yunion.io/x/jsonutils v0.0.0-20200814075449-927b118adbd8 h1:KQVw5EmohJCqBDMdZ3fAcOQNNMIYgVuNCNWNwg4EM3A=
|
||||
yunion.io/x/jsonutils v0.0.0-20200814075449-927b118adbd8/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE=
|
||||
yunion.io/x/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/log v0.0.0-20200313080802-57a4ce5966b3 h1:5Wc5hkB8PtMudmHuzCyok960RuOa9I55imIGrigSdjs=
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
@@ -1134,12 +1136,11 @@ yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7 h1:gjqNa2uQzIEXyySsbvVz0Ult
|
||||
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982 h1:VnE92PZ2DOBn7qOKHHHPrwo4tPsjrxET/xDyWfMFQHI=
|
||||
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6 h1:UarEDTBGkgcgc+nc+PZ75uo9M9+jiOGd5P2B90TxDNw=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/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-20200608080702-9b6683aa048c h1:/i93mWSKLYUq8RsaXGbMpwwnkGi09wL/HdCBiexL/+c=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200608080702-9b6683aa048c/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7 h1:HjWH0gG/5KzvCxItnzRxizfAnMOvGcxPfsEOFwOGBhQ=
|
||||
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200814052348-164f1f20f8a6 h1:k7E8Zjwzyk/lo1dDO0jtLbODwYRNv+w/zsUJrKWCXvo=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200814052348-164f1f20f8a6/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce h1:kU8xE7O5uZ1GSJVMZHoJ+jrNL7csUQHYGyAPW9QfNpE=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
@@ -39,6 +39,7 @@ func InitHandlers(app *appsrv.Application) {
|
||||
db.InitAllManagers()
|
||||
|
||||
db.RegisterModelManager(db.OpsLog)
|
||||
db.RegisterModelManager(db.Metadata)
|
||||
db.RegisterModelManager(db.UserCacheManager)
|
||||
db.RegisterModelManager(db.TenantCacheManager)
|
||||
for _, manager := range []db.IModelManager{
|
||||
|
||||
@@ -230,6 +230,9 @@ func doTenantLogin(ctx context.Context, w http.ResponseWriter, req *http.Request
|
||||
} else {
|
||||
otpVerified = true
|
||||
}
|
||||
} else {
|
||||
// if totp disabled, then assume totp been verified
|
||||
otpVerified = true
|
||||
}
|
||||
|
||||
token, e = auth.Client().SetProject(tenantId, "", "", token)
|
||||
@@ -396,7 +399,7 @@ func isUserAllowWebconsole(ctx context.Context, w http.ResponseWriter, req *http
|
||||
return false
|
||||
}
|
||||
if !jsonutils.QueryBoolean(usr, "allow_web_console", true) {
|
||||
httperrors.ForbiddenError(w, "forbidden user %q login from web", usr.String())
|
||||
httperrors.ForbiddenError(w, "user forbidden login from web")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
@@ -536,6 +539,11 @@ func (h *AuthHandlers) postLoginHandler(ctx context.Context, w http.ResponseWrit
|
||||
httperrors.GeneralServerError(w, err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// if totp is disabled, assume totp been verified
|
||||
totp := clientman.TokenMan.GetTotp(tid)
|
||||
totp.MarkVerified()
|
||||
clientman.TokenMan.SaveTotp(tid)
|
||||
}
|
||||
|
||||
appsrv.Send(w, qrcode)
|
||||
|
||||
129
pkg/apigateway/handler/imageutils.go
Normal file
129
pkg/apigateway/handler/imageutils.go
Normal file
@@ -0,0 +1,129 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/auth"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
)
|
||||
|
||||
func readImageForm(r *multipart.Reader) (map[string]string, *multipart.Part, error) {
|
||||
params := make(map[string]string)
|
||||
|
||||
maxValueBytes := int64(10 << 20)
|
||||
for {
|
||||
p, err := r.NextPart()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
name := p.FormName()
|
||||
if name == "" {
|
||||
continue
|
||||
}
|
||||
filename := p.FileName()
|
||||
|
||||
var b bytes.Buffer
|
||||
|
||||
_, hasContentTypeHeader := p.Header["Content-Type"]
|
||||
if !hasContentTypeHeader && filename == "" {
|
||||
// value, store as string in memory
|
||||
n, err := io.CopyN(&b, p, maxValueBytes+1)
|
||||
if err != nil && err != io.EOF {
|
||||
return nil, nil, err
|
||||
}
|
||||
maxValueBytes -= n
|
||||
if maxValueBytes < 0 {
|
||||
return nil, nil, multipart.ErrMessageTooLarge
|
||||
}
|
||||
params[name] = b.String()
|
||||
continue
|
||||
}
|
||||
|
||||
if name == "image" || name == "file" {
|
||||
return params, p, nil
|
||||
} else {
|
||||
return nil, nil, fmt.Errorf("no file uploaded")
|
||||
}
|
||||
}
|
||||
return nil, nil, fmt.Errorf("empty form")
|
||||
}
|
||||
|
||||
func imageUploadHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
reader, e := r.MultipartReader()
|
||||
if e != nil {
|
||||
httperrors.InvalidInputError(w, "无效的表单")
|
||||
return
|
||||
}
|
||||
|
||||
p, f, e := readImageForm(reader)
|
||||
if e != nil {
|
||||
httperrors.InvalidInputError(w, "无效的表单")
|
||||
return
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
|
||||
name, ok := p["name"]
|
||||
if !ok {
|
||||
httperrors.InvalidInputError(w, "缺少镜像名称")
|
||||
return
|
||||
}
|
||||
params.Add(jsonutils.NewString(name), "name")
|
||||
|
||||
_imageSize, ok := p["image_size"]
|
||||
if !ok {
|
||||
httperrors.InvalidInputError(w, "缺少文件信息")
|
||||
return
|
||||
}
|
||||
imageSize, e := strconv.ParseInt(_imageSize, 10, 64)
|
||||
if e != nil {
|
||||
httperrors.InvalidInputError(w, "文件信息错误")
|
||||
return
|
||||
}
|
||||
|
||||
// add all other params
|
||||
for k, v := range p {
|
||||
if k == "name" || k == "image_size" {
|
||||
continue
|
||||
}
|
||||
params.Add(jsonutils.NewString(v), k)
|
||||
}
|
||||
|
||||
token := AppContextToken(ctx)
|
||||
s := auth.GetSession(ctx, token, FetchRegion(r), "")
|
||||
|
||||
res, e := modules.Images.Upload(s, params, f, imageSize)
|
||||
if e != nil {
|
||||
httperrors.GeneralServerError(w, e)
|
||||
return
|
||||
} else {
|
||||
appsrv.SendJSON(w, res)
|
||||
}
|
||||
}
|
||||
|
||||
func uploadHandlerInfo(method, prefix string, handler func(context.Context, http.ResponseWriter, *http.Request)) *appsrv.SHandlerInfo {
|
||||
log.Debugf("%s - %s", method, prefix)
|
||||
hi := appsrv.SHandlerInfo{}
|
||||
hi.SetMethod(method)
|
||||
hi.SetPath(prefix)
|
||||
hi.SetHandler(handler)
|
||||
hi.SetProcessTimeout(6 * time.Hour)
|
||||
hi.SetWorkerManager(GetUploaderWorker())
|
||||
return &hi
|
||||
}
|
||||
@@ -112,15 +112,15 @@ func FetchAuthToken(f func(context.Context, http.ResponseWriter, *http.Request))
|
||||
return
|
||||
}
|
||||
// 启用双因子认证
|
||||
t := AppContextToken(ctx)
|
||||
if isUserEnableTotp(ctx, r, t) {
|
||||
tid := getAuthToken(r)
|
||||
totp := clientman.TokenMan.GetTotp(tid)
|
||||
if !totp.IsVerified() {
|
||||
httperrors.UnauthorizedError(w, "TOTP authentication failed")
|
||||
return
|
||||
}
|
||||
// t := AppContextToken(ctx)
|
||||
// if isUserEnableTotp(ctx, r, t) {
|
||||
tid := getAuthToken(r)
|
||||
totp := clientman.TokenMan.GetTotp(tid)
|
||||
if !totp.IsVerified() {
|
||||
httperrors.UnauthorizedError(w, "TOTP authentication failed")
|
||||
return
|
||||
}
|
||||
// }
|
||||
|
||||
f(ctx, w, r)
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -28,6 +29,7 @@ import (
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apigateway/options"
|
||||
"yunion.io/x/onecloud/pkg/appctx"
|
||||
@@ -37,6 +39,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient/auth"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/util/httputils"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -50,6 +53,7 @@ const (
|
||||
HOST_IPMI_USERNAME_OPTIONAL = "IPMI用户名"
|
||||
HOST_IPMI_PASSWORD_OPTIONAL = "IPMI密码"
|
||||
HOST_MNG_IP_ADDR_OPTIONAL = "管理口IP地址"
|
||||
HOST_MNG_MAC_ADDR_OPTIONAL = "管理口MAC地址"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -57,6 +61,12 @@ const (
|
||||
BATCH_HOST_REGISTER_QUANTITY_LIMITATION = 1000
|
||||
)
|
||||
|
||||
var (
|
||||
BatchHostRegisterTemplate = []string{HOST_MAC, HOST_NAME, HOST_IPMI_ADDR_OPTIONAL, HOST_IPMI_USERNAME_OPTIONAL, HOST_IPMI_PASSWORD_OPTIONAL}
|
||||
BatchHostISORegisterTemplate = []string{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR}
|
||||
BatchHostPXERegisterTemplate = []string{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_MAC_ADDR_OPTIONAL, HOST_MNG_IP_ADDR_OPTIONAL}
|
||||
)
|
||||
|
||||
func FetchSession(ctx context.Context, r *http.Request, apiVersion string) *mcclient.ClientSession {
|
||||
token := AppContextToken(ctx)
|
||||
session := auth.GetSession(ctx, token, FetchRegion(r), apiVersion)
|
||||
@@ -82,6 +92,10 @@ func (h *MiscHandler) Bind(app *appsrv.Application) {
|
||||
app.AddHandler3(uploader)
|
||||
app.AddHandler(GET, prefix+"downloads/<template_id>", FetchAuthToken(h.getDownloadsHandler))
|
||||
app.AddHandler(POST, prefix+"piuploads", FetchAuthToken(h.postPIUploads)) // itsm process instances upload api
|
||||
imageUploader := uploadHandlerInfo("POST", prefix+"/imageutils/upload", FetchAuthToken(imageUploadHandler))
|
||||
app.AddHandler3(imageUploader)
|
||||
s3upload := uploadHandlerInfo(POST, prefix+"s3uploads", FetchAuthToken(h.postS3UploadHandler))
|
||||
app.AddHandler3(s3upload)
|
||||
}
|
||||
|
||||
func UploadHandlerInfo(method, prefix string, handler func(context.Context, http.ResponseWriter, *http.Request)) *appsrv.SHandlerInfo {
|
||||
@@ -170,20 +184,43 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
|
||||
return
|
||||
}
|
||||
|
||||
// check header line
|
||||
titlesOk := false
|
||||
for _, t := range [][]string{BatchHostRegisterTemplate, BatchHostISORegisterTemplate, BatchHostPXERegisterTemplate} {
|
||||
if len(t) == len(rows[0]) {
|
||||
for _, title := range rows[0] {
|
||||
if !utils.IsInStringArray(title, t) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
titlesOk = true
|
||||
}
|
||||
}
|
||||
|
||||
if !titlesOk {
|
||||
httperrors.InputParameterError(w, "template file is invalid.please check.")
|
||||
return
|
||||
}
|
||||
|
||||
paramKeys := []string{}
|
||||
for _, title := range rows[0] {
|
||||
i1 := -1
|
||||
i2 := -1
|
||||
for i, title := range rows[0] {
|
||||
switch title {
|
||||
case HOST_MAC:
|
||||
case HOST_MAC, HOST_MNG_MAC_ADDR_OPTIONAL:
|
||||
paramKeys = append(paramKeys, "access_mac")
|
||||
case HOST_NAME:
|
||||
paramKeys = append(paramKeys, "name")
|
||||
case HOST_IPMI_ADDR, HOST_IPMI_ADDR_OPTIONAL:
|
||||
i1 = i
|
||||
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:
|
||||
i2 = i
|
||||
paramKeys = append(paramKeys, "access_ip")
|
||||
default:
|
||||
e := httperrors.NewInternalServerError("empty file content")
|
||||
@@ -199,8 +236,33 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
|
||||
return
|
||||
}
|
||||
|
||||
ips := []string{}
|
||||
hosts := bytes.Buffer{}
|
||||
for _, row := range rows[1:] {
|
||||
var e *httputils.JSONClientError
|
||||
if i1 >= 0 && len(row[i1]) > 0 {
|
||||
i1Ip := fmt.Sprintf("%d-%s", i1, row[i1])
|
||||
if utils.IsInStringArray(i1Ip, ips) {
|
||||
e = httperrors.NewDuplicateIdError("ip", row[i1])
|
||||
} else {
|
||||
ips = append(ips, i1Ip)
|
||||
}
|
||||
}
|
||||
|
||||
if i2 >= 0 && len(row[i2]) > 0 {
|
||||
i2Ip := fmt.Sprintf("%d-%s", i2, row[i2])
|
||||
if utils.IsInStringArray(i2Ip, ips) {
|
||||
e = httperrors.NewDuplicateIdError("ip", row[i2])
|
||||
} else {
|
||||
ips = append(ips, i2Ip)
|
||||
}
|
||||
}
|
||||
|
||||
if e != nil {
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
}
|
||||
|
||||
hosts.WriteString(strings.Join(row, ",") + "\n")
|
||||
}
|
||||
|
||||
@@ -297,18 +359,6 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
|
||||
return
|
||||
}
|
||||
|
||||
if _, ok := names[name]; ok {
|
||||
e := httperrors.NewClientError("row %d duplicate name %s", rowIdx, name)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
} else {
|
||||
names[name] = true
|
||||
_, err := modules.UsersV3.Get(s, name, nil)
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
domainId, ok := domains[domain]
|
||||
if !ok {
|
||||
if len(domain) == 0 {
|
||||
@@ -327,6 +377,18 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
|
||||
domains[domain] = id
|
||||
}
|
||||
|
||||
if _, ok := names[name+"/"+domainId]; ok {
|
||||
e := httperrors.NewClientError("row %d duplicate name %s", rowIdx, name)
|
||||
httperrors.JsonClientError(w, e)
|
||||
return
|
||||
} else {
|
||||
names[name+"/"+domainId] = true
|
||||
_, err := modules.UsersV3.Get(s, name, nil)
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
user := jsonutils.NewDict()
|
||||
user.Add(jsonutils.NewString(name), "name")
|
||||
user.Add(jsonutils.NewString(domainId), "domain_id")
|
||||
@@ -375,21 +437,21 @@ func (mh *MiscHandler) getDownloadsHandler(ctx context.Context, w http.ResponseW
|
||||
var content bytes.Buffer
|
||||
switch template {
|
||||
case "BatchHostRegister":
|
||||
records := [][]string{{HOST_MAC, HOST_NAME, HOST_IPMI_ADDR_OPTIONAL, HOST_IPMI_USERNAME_OPTIONAL, HOST_IPMI_PASSWORD_OPTIONAL}}
|
||||
records := [][]string{BatchHostRegisterTemplate}
|
||||
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}}
|
||||
records := [][]string{BatchHostISORegisterTemplate}
|
||||
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}}
|
||||
records := [][]string{BatchHostPXERegisterTemplate}
|
||||
content, err = writeXlsx("hosts", records)
|
||||
if err != nil {
|
||||
httperrors.InternalServerError(w, "internal server error")
|
||||
@@ -453,6 +515,61 @@ func (mh *MiscHandler) postPIUploads(ctx context.Context, w http.ResponseWriter,
|
||||
appsrv.SendJSON(w, resp)
|
||||
}
|
||||
|
||||
func (mh *MiscHandler) postS3UploadHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
reader, e := r.MultipartReader()
|
||||
if e != nil {
|
||||
log.Debugf("postS3UploadHandler.MultipartReader %s", e)
|
||||
httperrors.InvalidInputError(w, "invalid form")
|
||||
return
|
||||
}
|
||||
|
||||
p, f, e := readImageForm(reader)
|
||||
if e != nil {
|
||||
log.Debugf("postS3UploadHandler.readImageForm %s", e)
|
||||
httperrors.InvalidInputError(w, "invalid form")
|
||||
return
|
||||
}
|
||||
|
||||
bucket_id, ok := p["bucket_id"]
|
||||
if !ok {
|
||||
httperrors.MissingParameterError(w, "bucket_id")
|
||||
return
|
||||
}
|
||||
|
||||
key, ok := p["key"]
|
||||
if !ok {
|
||||
httperrors.MissingParameterError(w, "key")
|
||||
return
|
||||
}
|
||||
|
||||
_content_length, ok := p["content_length"]
|
||||
if !ok {
|
||||
httperrors.MissingParameterError(w, "content_length")
|
||||
return
|
||||
}
|
||||
|
||||
content_length, e := strconv.ParseInt(_content_length, 10, 64)
|
||||
if e != nil {
|
||||
httperrors.InvalidInputError(w, "invalid content_length %s", _content_length)
|
||||
return
|
||||
}
|
||||
|
||||
storage_class, _ := p["storage_class"]
|
||||
acl, _ := p["acl"]
|
||||
|
||||
token := AppContextToken(ctx)
|
||||
s := auth.GetSession(ctx, token, FetchRegion(r), "")
|
||||
|
||||
meta := http.Header{}
|
||||
meta.Set("Content-Type", "application/octet-stream")
|
||||
e = modules.Buckets.Upload(s, bucket_id, key, f, content_length, storage_class, acl, meta)
|
||||
if e != nil {
|
||||
httperrors.GeneralServerError(w, e)
|
||||
return
|
||||
}
|
||||
appsrv.SendJSON(w, jsonutils.NewDict())
|
||||
}
|
||||
|
||||
func writeCsv(records [][]string) (bytes.Buffer, error) {
|
||||
var content bytes.Buffer
|
||||
content.WriteString("\xEF\xBB\xBF") // 写入UTF-8 BOM, 防止office打开后中文乱码
|
||||
|
||||
@@ -57,7 +57,7 @@ type ProxySettingResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
ProxySettingId string `json:"proxy_setting_id" "yunion:deprecated-by":"proxy_setting"`
|
||||
ProxySettingId string `json:"proxy_setting_id" yunion-deprecated-by:"proxy_setting"`
|
||||
}
|
||||
|
||||
type ProxySettingTestInput struct {
|
||||
|
||||
@@ -22,7 +22,7 @@ type CloudaccountResourceListInput struct {
|
||||
Provider []string `json:"provider"`
|
||||
|
||||
// swagger:ignore
|
||||
CloudaccountId string `json:"cloudaccount_id" "yunion:deprecated-by":"cloudaccount"`
|
||||
CloudaccountId string `json:"cloudaccount_id" yunion-deprecated-by:"cloudaccount"`
|
||||
}
|
||||
|
||||
type CloudproviderResourceListInput struct {
|
||||
@@ -30,7 +30,7 @@ type CloudproviderResourceListInput struct {
|
||||
Cloudprovider string `json:"cloudprovider"`
|
||||
|
||||
// swagger:ignore
|
||||
CloudproviderId string `json:"cloudprovider_id" "yunion:deprecated-by":"cloudprovider"`
|
||||
CloudproviderId string `json:"cloudprovider_id" yunion-deprecated-by:"cloudprovider"`
|
||||
}
|
||||
|
||||
type CloudaccountResourceDetails struct {
|
||||
|
||||
@@ -37,7 +37,7 @@ type CloudgroupJointsListInput struct {
|
||||
// 根据公有云用户组过滤资源
|
||||
Cloudgroup string `json:"cloudgroup"`
|
||||
// swagger:ignore
|
||||
CloudgroupId string `json:"cloudgroup_id" "yunion:deprecated-by":"cloudgroup"`
|
||||
CloudgroupId string `json:"cloudgroup_id" yunion-deprecated-by:"cloudgroup"`
|
||||
}
|
||||
|
||||
type CloudgroupJointBaseUpdateInput struct {
|
||||
@@ -80,6 +80,9 @@ type CloudgroupListInput struct {
|
||||
|
||||
// 根据权限过滤权限组
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
|
||||
// 是否可用
|
||||
Usable *bool `json:"usable"`
|
||||
}
|
||||
|
||||
type SCloudIdBaseResource struct {
|
||||
@@ -105,15 +108,7 @@ type CloudgroupDetails struct {
|
||||
type CloudgroupCreateInput struct {
|
||||
apis.StatusInfrasResourceBaseCreateInput
|
||||
|
||||
// 平台
|
||||
//
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 支持 |
|
||||
// | Qcloud | 支持 |
|
||||
// 平台, 目前支持Qcloud,Google,Azure,Aliyun,Huawei,Aws
|
||||
Provider string `json:"provider"`
|
||||
|
||||
// 权限Id列表, 权限provider必须和权限组provider一致
|
||||
@@ -123,84 +118,36 @@ type CloudgroupCreateInput struct {
|
||||
type CloudgroupAddUserInput struct {
|
||||
|
||||
// 用户Id
|
||||
//
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 不支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
ClouduserId string `json:"clouduser_id"`
|
||||
}
|
||||
|
||||
type CloudgroupRemoveUserInput struct {
|
||||
|
||||
// 用户Id
|
||||
//
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 不支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
ClouduserId string `json:"clouduser_id"`
|
||||
}
|
||||
|
||||
type CloudgroupAttachPolicyInput struct {
|
||||
|
||||
// 权限Id
|
||||
//
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 不支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 不支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
}
|
||||
|
||||
type CloudgroupSetUsersInput struct {
|
||||
|
||||
// 公有云子账号Ids
|
||||
//
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
ClouduserIds []string `json:"clouduser_ids"`
|
||||
}
|
||||
|
||||
type CloudgroupSetPoliciesInput struct {
|
||||
|
||||
// 权限Ids
|
||||
//
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 不支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
CloudpolicyIds []string `json:"cloudpolicy_ids"`
|
||||
}
|
||||
|
||||
type CloudgroupDetachPolicyInput struct {
|
||||
|
||||
// 权限Id
|
||||
//
|
||||
// | 云平台 | 说明 |
|
||||
// |----------|---------------------------------------------|
|
||||
// | Google | 不支持 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 支持 |
|
||||
// | Azure | 不支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
CloudpolicyId string `json:"cloudpolicy_id"`
|
||||
}
|
||||
|
||||
|
||||
22
pkg/apis/cloudid/cloudid.go
Normal file
22
pkg/apis/cloudid/cloudid.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 cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
SERVICE_TYPE = apis.SERVICE_TYPE_CLOUDID
|
||||
SERVICE_VERSION = ""
|
||||
)
|
||||
@@ -56,7 +56,7 @@ type CloudpolicyResourceListInput struct {
|
||||
Cloudpolicy string `json:"cloudpolicy"`
|
||||
|
||||
// swagger:ignore
|
||||
CloudpolicyId string `json:"cloudpolicy_id" "yunion:deprecated-by":"cloudpolicy"`
|
||||
CloudpolicyId string `json:"cloudpolicy_id" yunion-deprecated-by:"cloudpolicy"`
|
||||
}
|
||||
|
||||
type CloudpolicyResourceDetails struct {
|
||||
|
||||
@@ -35,7 +35,7 @@ const (
|
||||
)
|
||||
|
||||
type ClouduserCreateInput struct {
|
||||
apis.StatusUserResourceCreateInput
|
||||
apis.StatusDomainLevelUserResourceCreateInput
|
||||
apis.StatusBaseResourceCreateInput
|
||||
|
||||
// 云订阅ID
|
||||
@@ -88,7 +88,7 @@ type ClouduserCreateInput struct {
|
||||
// | Google | 至少需要一个初始权限 |
|
||||
// | Aliyun | 支持 |
|
||||
// | Huawei | 不支持 |
|
||||
// | Azure | 不支持 |
|
||||
// | Azure | 支持 |
|
||||
// | 腾讯云 | 支持 |
|
||||
CloudpolicyIds []string `json:"cloudpolicy_ids"`
|
||||
|
||||
@@ -100,7 +100,7 @@ type ClouduserCreateInput struct {
|
||||
}
|
||||
|
||||
type ClouduserListInput struct {
|
||||
apis.StatusUserResourceListInput
|
||||
apis.StatusDomainLevelUserResourceListInput
|
||||
|
||||
CloudaccountResourceListInput
|
||||
CloudproviderResourceListInput
|
||||
@@ -113,7 +113,7 @@ type ClouduserListInput struct {
|
||||
}
|
||||
|
||||
type ClouduserDetails struct {
|
||||
apis.StatusUserResourceDetails
|
||||
apis.StatusDomainLevelUserResourceDetails
|
||||
SClouduser
|
||||
|
||||
CloudaccountResourceDetails
|
||||
@@ -162,7 +162,7 @@ type ClouduserResourceListInput struct {
|
||||
Clouduser string `json:"clouduser"`
|
||||
|
||||
// swagger:ignore
|
||||
ClouduserId string `json:"clouduser_id" "yunion:deprecated-by":"clouduser"`
|
||||
ClouduserId string `json:"clouduser_id" yunion-deprecated-by:"clouduser"`
|
||||
}
|
||||
|
||||
type ClouduserResourceDetails struct {
|
||||
|
||||
@@ -22,10 +22,9 @@ import (
|
||||
type SCloudaccount struct {
|
||||
apis.SStandaloneResourceBase
|
||||
apis.SDomainizedResourceBase
|
||||
Provider string `json:"provider"`
|
||||
Brand string `json:"brand"`
|
||||
IamLoginUrl string `json:"iam_login_url"`
|
||||
IsSupportCloudId *bool `json:"is_support_cloud_id,omitempty"`
|
||||
Provider string `json:"provider"`
|
||||
Brand string `json:"brand"`
|
||||
IamLoginUrl string `json:"iam_login_url"`
|
||||
}
|
||||
|
||||
// SCloudaccountResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudaccountResourceBase.
|
||||
@@ -103,7 +102,7 @@ type SCloudproviderResourceBase struct {
|
||||
|
||||
// SClouduser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SClouduser.
|
||||
type SClouduser struct {
|
||||
apis.SStatusUserResourceBase
|
||||
apis.SStatusDomainLevelUserResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudproviderResourceBase
|
||||
SCloudaccountResourceBase
|
||||
|
||||
@@ -285,11 +285,11 @@ type ServerConfigs struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// alias for InstanceType
|
||||
Sku string `json:"sku" "yunion:deprecated-by":"instance_type"`
|
||||
Sku string `json:"sku" yunion-deprecated-by:"instance_type"`
|
||||
|
||||
// 虚拟机高可用(创建备机)
|
||||
// default: false
|
||||
// requried: false
|
||||
// required: false
|
||||
Backup bool `json:"backup"`
|
||||
|
||||
// 创建虚拟机数量
|
||||
@@ -359,7 +359,7 @@ type ServerCreateInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
KeypairId string `json:"keypair_id" "yunion:deprecated-by":"keypair"`
|
||||
KeypairId string `json:"keypair_id" yunion-deprecated-by:"keypair"`
|
||||
|
||||
// 秘钥对Id
|
||||
// required: false
|
||||
@@ -471,7 +471,8 @@ type ServerCreateInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
OsType string `json:"os_type"`
|
||||
|
||||
// swagger:ignore
|
||||
DisableUsbKbd bool `json:"disable_usb_kbd"`
|
||||
// swagger:ignore
|
||||
OsProfile jsonutils.JSONObject `json:"__os_profile__"`
|
||||
// swagger:ignore
|
||||
|
||||
@@ -30,24 +30,3 @@ type CachedLoadbalancerAclListInput struct {
|
||||
ManagedResourceListInput
|
||||
LoadbalancerAclFilterListInput
|
||||
}
|
||||
|
||||
type LoadbalancerAclResourceInfo struct {
|
||||
// 负载均衡ACL名称
|
||||
Acl string `json:"acl"`
|
||||
}
|
||||
|
||||
type LoadbalancerAclResourceInput struct {
|
||||
// ACL名称或ID
|
||||
Acl string `json:"acl"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
AclId string `json:"acl_id" "yunion:deprecated-by":"acl"`
|
||||
}
|
||||
|
||||
type LoadbalancerAclFilterListInput struct {
|
||||
LoadbalancerAclResourceInput
|
||||
|
||||
// 以ACL名称排序
|
||||
OrderByAcl string `json:"order_by_acl"`
|
||||
}
|
||||
|
||||
@@ -31,24 +31,3 @@ type CachedLoadbalancerCertificateListInput struct {
|
||||
RegionalFilterListInput
|
||||
LoadbalancerCertificateFilterListInput
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateResourceInfo struct {
|
||||
// 负载均衡证书名称
|
||||
Certificate string `json:"certificate"`
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateResourceInput struct {
|
||||
// 证书名称或ID
|
||||
Certificate string `json:"certificate"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
CertificateId string `json:"certificate_id" "yunion:deprecated-by":"certificate"`
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateFilterListInput struct {
|
||||
LoadbalancerCertificateResourceInput
|
||||
|
||||
// 以证书名称排序
|
||||
OrderByCertificate string `json:"order_by_certificate"`
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ type CloudenvResourceListInput struct {
|
||||
Providers []string `json:"providers"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Provider []string `json:"provider" "yunion:deprecated-by":"providers"`
|
||||
Provider []string `json:"provider" yunion-deprecated-by:"providers"`
|
||||
|
||||
// 列出指定云平台品牌的资源,一般来说brand和provider相同,除了以上支持的provider之外,还支持以下band
|
||||
//
|
||||
@@ -77,7 +77,7 @@ type CloudenvResourceListInput struct {
|
||||
Brands []string `json:"brands"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Brand []string `json:"brand" "yunion:deprecated-by":"brands"`
|
||||
Brand []string `json:"brand" yunion-deprecated-by:"brands"`
|
||||
|
||||
// 列出指定云环境的资源,支持云环境如下:
|
||||
//
|
||||
@@ -180,9 +180,9 @@ type CloudaccountCreateInput struct {
|
||||
// 自动同步间隔时间
|
||||
SyncIntervalSeconds int `json:"sync_interval_seconds"`
|
||||
|
||||
// 自动根据云上项目或订阅创建本地项目
|
||||
// 自动根据云上项目或订阅创建本地项目, OpenStack此参数为true
|
||||
// default: false
|
||||
AutoCreateProject bool `json:"auto_create_project"`
|
||||
AutoCreateProject *bool `json:"auto_create_project"`
|
||||
|
||||
// 额外信息,例如账单的access key
|
||||
Options *jsonutils.JSONDict `json:"options"`
|
||||
@@ -227,7 +227,7 @@ type CloudaccountListInput struct {
|
||||
// 代理
|
||||
ProxySetting string `json:"proxy_setting"`
|
||||
// swagger:ignore
|
||||
ProxySettingId string `json:"proxy_setting_id" "yunion:deprecated-by":"proxy_setting"`
|
||||
ProxySettingId string `json:"proxy_setting_id" yunion-deprecated-by:"proxy_setting"`
|
||||
}
|
||||
|
||||
type ProviderProject struct {
|
||||
|
||||
@@ -147,15 +147,15 @@ type CloudproviderResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
Manager string `json:"manager" "yunion:deprecated-by":"cloudprovider"`
|
||||
Manager string `json:"manager" yunion-deprecated-by:"cloudprovider"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
ManagerId string `json:"manager_id" "yunion:deprecated-by":"cloudprovider"`
|
||||
ManagerId string `json:"manager_id" yunion-deprecated-by:"cloudprovider"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudproviderId string `json:"cloudprovider_id" "yunion:deprecated-by":"cloudprovider"`
|
||||
CloudproviderId string `json:"cloudprovider_id" yunion-deprecated-by:"cloudprovider"`
|
||||
}
|
||||
|
||||
type ManagedResourceListInput struct {
|
||||
@@ -169,15 +169,15 @@ type ManagedResourceListInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudaccountId string `json:"cloudaccount_id" "yunion:deprecated-by":"cloudaccount"`
|
||||
CloudaccountId string `json:"cloudaccount_id" yunion-deprecated-by:"cloudaccount"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
Account string `json:"account" "yunion:deprecated-by":"cloudaccount"`
|
||||
Account string `json:"account" yunion-deprecated-by:"cloudaccount"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
AccountId string `json:"account_id" "yunion:deprecated-by":"cloudaccount"`
|
||||
AccountId string `json:"account_id" yunion-deprecated-by:"cloudaccount"`
|
||||
|
||||
// 过滤资源,是否为非OneCloud内置私有云管理的资源
|
||||
// default: false
|
||||
@@ -251,3 +251,23 @@ type CloudproviderUpdateInput struct {
|
||||
|
||||
type CloudproviderCreateInput struct {
|
||||
}
|
||||
|
||||
type CloudproviderGetStorageClassInput struct {
|
||||
CloudregionResourceInput
|
||||
}
|
||||
|
||||
type CloudproviderGetStorageClassOutput struct {
|
||||
// 对象存储存储类型
|
||||
StorageClasses []string `json:"storage_classes"`
|
||||
}
|
||||
|
||||
type CloudproviderGetCannedAclInput struct {
|
||||
CloudregionResourceInput
|
||||
}
|
||||
|
||||
type CloudproviderGetCannedAclOutput struct {
|
||||
// Bucket支持的预置ACL列表
|
||||
BucketCannedAcls []string `json:"bucket_canned_acls"`
|
||||
// Object支持的预置ACL列表
|
||||
ObjectCannedAcls []string `json:"object_canned_acls"`
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ type DBInstanceCreateInput struct {
|
||||
// | ----- | ------ | --- |
|
||||
// | 华为云 |ha, single, replica| |
|
||||
// | 阿里云 |basic, high_availability, always_on, finance||
|
||||
// | Google |SECOND_GEN | FIRST_GEN 目前谷歌已弃用|
|
||||
// | Google |Zonal, Regional | |
|
||||
// 翻译:
|
||||
// basic: 基础版
|
||||
// high_availability: 高可用
|
||||
@@ -118,7 +118,8 @@ type DBInstanceCreateInput struct {
|
||||
// ha: 高可用
|
||||
// single: 单机
|
||||
// replica: 只读
|
||||
// SECNOD_GEN: 第二代
|
||||
// Zonal: 单区域
|
||||
// Regional: 区域级
|
||||
// required: true
|
||||
Category string `json:"category"`
|
||||
|
||||
@@ -178,9 +179,22 @@ type SDBInstanceChangeConfigInput struct {
|
||||
type SDBInstanceRecoveryConfigInput struct {
|
||||
apis.Meta
|
||||
|
||||
DBInstancebackup string
|
||||
DBInstancebackupId string `json:"dbinstancebackup_id"`
|
||||
Databases map[string]string `json:"databases,allowempty"`
|
||||
// swagger:ignore
|
||||
DBInstancebackup string `json:"dbinstancebackup" yunion-deprecated-by:"dbinstancebackup_id"`
|
||||
|
||||
// 备份Id
|
||||
//
|
||||
//
|
||||
// | 平台 | 支持引擎 | 说明 |
|
||||
// | ----- | ------ | --- |
|
||||
// | 华为云 |MySQL, SQL Server | 仅SQL Server支持恢复到当前实例 |
|
||||
// | 阿里云 |MySQL, SQL Server | MySQL要求必须开启单库单表恢复功能 并且只能是MySQL 8.0 高可用版(本地SSD盘)MySQL 5.7 高可用版(本地SSD盘)或MySQL 5.6 高可用版, MySQL仅支持恢复到当前实例|
|
||||
// | Google |MySQL, PostgreSQL, SQL Server | PostgreSQL备份恢复时,要求实例不能有副本 |
|
||||
DBInstancebackupId string `json:"dbinstancebackup_id"`
|
||||
|
||||
// 数据库信息, 例如 {"src":"dest"} 是将备份中的src数据库恢复到目标实例的dest数据库中, 阿里云此参数为必传
|
||||
// example: {"sdb1":"ddb1"}
|
||||
Databases map[string]string `json:"databases,allowempty"`
|
||||
}
|
||||
|
||||
type DBInstanceListInput struct {
|
||||
@@ -321,7 +335,7 @@ type DBInstanceResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
DBInstanceId string `json:"dbinstance_id" "yunion:deprecated-by":"dbinstance"`
|
||||
DBInstanceId string `json:"dbinstance_id" yunion-deprecated-by:"dbinstance"`
|
||||
}
|
||||
|
||||
type DBInstanceFilterListInputBase struct {
|
||||
|
||||
@@ -70,13 +70,13 @@ type SDBInstanceSetPrivilegesInput struct {
|
||||
|
||||
type DBInstancePrivilege struct {
|
||||
// 数据库名称
|
||||
Database string
|
||||
Database string `json:"database"`
|
||||
// 账号名称
|
||||
Account string
|
||||
Account string `json:"account"`
|
||||
// 数据库Id
|
||||
DBInstancedatabaseId string
|
||||
DBInstancedatabaseId string `json:"dbinstancedatabase_id"`
|
||||
// 权限
|
||||
Privileges string
|
||||
Privileges string `json:"privileges"`
|
||||
}
|
||||
|
||||
type DBInstanceAccountDetails struct {
|
||||
|
||||
@@ -16,19 +16,20 @@ package compute
|
||||
|
||||
const (
|
||||
//实例状态
|
||||
DBINSTANCE_DEPLOYING = "deploying" //部署中
|
||||
DBINSTANCE_RUNNING = "running" //运行中
|
||||
DBINSTANCE_REBOOTING = "rebooting" //重启中
|
||||
DBINSTANCE_MIGRATING = "migrating" //迁移中
|
||||
DBINSTANCE_BACKING_UP = "backing_up" //备份中
|
||||
DBINSTANCE_RESTORING = "restoring" //备份恢复中
|
||||
DBINSTANCE_RESTORE_FAILED = "restore_failed"
|
||||
DBINSTANCE_IMPORTING = "importing" //数据导入中
|
||||
DBINSTANCE_CLONING = "cloning" //克隆中
|
||||
DBINSTANCE_DELETING = "deleting" //删除中
|
||||
DBINSTANCE_DELETE_FAILED = "delete_failed" //删除失败
|
||||
DBINSTANCE_MAINTENANCE = "maintenance" //维护中
|
||||
DBINSTANCE_UNKNOWN = "unknown"
|
||||
DBINSTANCE_DEPLOYING = "deploying" //部署中
|
||||
DBINSTANCE_RUNNING = "running" //运行中
|
||||
DBINSTANCE_REBOOTING = "rebooting" //重启中
|
||||
DBINSTANCE_MIGRATING = "migrating" //迁移中
|
||||
DBINSTANCE_BACKING_UP = "backing_up" //备份中
|
||||
DBINSTANCE_BACKING_UP_FAILED = "backing_up_failed" //备份失败
|
||||
DBINSTANCE_RESTORING = "restoring" //备份恢复中
|
||||
DBINSTANCE_RESTORE_FAILED = "restore_failed"
|
||||
DBINSTANCE_IMPORTING = "importing" //数据导入中
|
||||
DBINSTANCE_CLONING = "cloning" //克隆中
|
||||
DBINSTANCE_DELETING = "deleting" //删除中
|
||||
DBINSTANCE_DELETE_FAILED = "delete_failed" //删除失败
|
||||
DBINSTANCE_MAINTENANCE = "maintenance" //维护中
|
||||
DBINSTANCE_UNKNOWN = "unknown"
|
||||
|
||||
DBINSTANCE_CHANGE_CONFIG = "change_config" //调整配置
|
||||
DBINSTANCE_CHANGE_CONFIG_FAILED = "change_config_failed" //调整配置失败
|
||||
@@ -103,6 +104,10 @@ const (
|
||||
HUAWEI_DBINSTANCE_CATEGORY_SINGLE = "single" //单机
|
||||
HUAWEI_DBINSTANCE_CATEGORY_REPLICA = "replica" //只读
|
||||
|
||||
//谷歌云实例类型
|
||||
GOOGLE_DBINSTANCE_CATEGORY_REGIONAL = "Regional" // 高可用性(区域级)
|
||||
GOOGLE_DBINSTANCE_CATEGORY_ZONAL = "Zonal" // 单个地区
|
||||
|
||||
//阿里云存储类型
|
||||
ALIYUN_DBINSTANCE_STORAGE_TYPE_LOCAL_SSD = "local_ssd" //本地盘SSD盘
|
||||
ALIYUN_DBINSTANCE_STORAGE_TYPE_CLOUD_ESSD = "cloud_essd" //ESSD云盘
|
||||
|
||||
@@ -88,7 +88,7 @@ type SnapshotPolicyResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter disk by snapshotpolicy_id
|
||||
SnapshotpolicyId string `json:"snapshotpolicy_id" "yunion:deprecated-by":"snapshotpolicy"`
|
||||
SnapshotpolicyId string `json:"snapshotpolicy_id" yunion-deprecated-by:"snapshotpolicy"`
|
||||
}
|
||||
|
||||
type SnapshotPolicyFilterListInput struct {
|
||||
@@ -113,7 +113,7 @@ type DiskListInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by disk type
|
||||
Type string `json:"type" "yunion:deprecated-by":"disk_type"`
|
||||
Type string `json:"type" yunion-deprecated-by:"disk_type"`
|
||||
// 过滤指定disk_type的磁盘列表,可能的值为:sys, data, swap. volume
|
||||
//
|
||||
// | disk_type值 | 说明 |
|
||||
@@ -137,13 +137,13 @@ type DiskListInput struct {
|
||||
Template string `json:"template"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
TemplateId string `json:"template_id" "yunion:deprecated-by":"template"`
|
||||
TemplateId string `json:"template_id" yunion-deprecated-by:"template"`
|
||||
|
||||
// 快照
|
||||
Snapshot string `json:"snapshot"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
SnapshotId string `json:"snapshot_id" "yunion:deprecated-by":"snapshot"`
|
||||
SnapshotId string `json:"snapshot_id" yunion-deprecated-by:"snapshot"`
|
||||
}
|
||||
|
||||
type DiskResourceInput struct {
|
||||
@@ -152,7 +152,7 @@ type DiskResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by disk_id
|
||||
DiskId string `json:"disk_id" "yunion:deprecated-by":"disk"`
|
||||
DiskId string `json:"disk_id" yunion-deprecated-by:"disk"`
|
||||
}
|
||||
|
||||
type DiskFilterListInputBase struct {
|
||||
|
||||
@@ -14,5 +14,11 @@
|
||||
|
||||
package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type DnsRecordCreateInput struct {
|
||||
apis.AdminSharableVirtualResourceBaseCreateInput
|
||||
}
|
||||
|
||||
type DnsRecordUpdateInput struct {
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ type ELasticcacheResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
ElasticcacheId string `json:"elasticcache_id" "yunion:deprecated-by":"elasticcache"`
|
||||
ElasticcacheId string `json:"elasticcache_id" yunion-deprecated-by:"elasticcache"`
|
||||
}
|
||||
|
||||
type ElasticcacheFilterListInput struct {
|
||||
|
||||
@@ -16,9 +16,16 @@ package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
EXTERNAL_PROJECT_STATUS_AVAILABLE = "available" // 可用
|
||||
EXTERNAL_PROJECT_STATUS_UNAVAILABLE = "unavailable" // 不可用
|
||||
EXTERNAL_PROJECT_STATUS_CREATING = "creating" // 创建中
|
||||
EXTERNAL_PROJECT_STATUS_DELETING = "deleting" // 删除中
|
||||
EXTERNAL_PROJECT_STATUS_UNKNOWN = "unknown" // 未知
|
||||
)
|
||||
|
||||
type ExternalProjectDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
apis.ProjectizedResourceInfo
|
||||
apis.VirtualResourceDetails
|
||||
ManagedResourceInfo
|
||||
|
||||
SExternalProject
|
||||
|
||||
@@ -24,15 +24,15 @@ type CloudregionResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
CloudregionId string `json:"cloudregion_id" "yunion:deprecated-by":"cloudregion"`
|
||||
CloudregionId string `json:"cloudregion_id" yunion-deprecated-by:"cloudregion"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
Region string `json:"region" "yunion:deprecated-by":"cloudregion"`
|
||||
Region string `json:"region" yunion-deprecated-by:"cloudregion"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// description: this param will be deprecate at 3.0
|
||||
RegionId string `json:"region_id" "yunion:deprecated-by":"cloudregion"`
|
||||
RegionId string `json:"region_id" yunion-deprecated-by:"cloudregion"`
|
||||
}
|
||||
|
||||
type RegionalFilterListInput struct {
|
||||
@@ -64,6 +64,23 @@ type ZonalFilterListBase struct {
|
||||
OrderByZone string `json:"order_by_zone"`
|
||||
}
|
||||
|
||||
func (input ZonalFilterListBase) ZoneList() []string {
|
||||
zoneStr := input.Zone
|
||||
if len(zoneStr) > 0 {
|
||||
input.Zones = append(input.Zones, zoneStr)
|
||||
}
|
||||
return input.Zones
|
||||
}
|
||||
|
||||
func (input ZonalFilterListBase) FirstZone() string {
|
||||
if len(input.Zone) > 0 {
|
||||
return input.Zone
|
||||
}
|
||||
if len(input.Zones) > 0 {
|
||||
return input.Zones[0]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (input ZonalFilterListInput) ZoneList() []string {
|
||||
zoneStr := input.Zone
|
||||
if len(zoneStr) > 0 {
|
||||
@@ -117,5 +134,5 @@ type ZoneResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
ZoneId string `json:"zone_id" "yunion:deprecated-by":"zone"`
|
||||
ZoneId string `json:"zone_id" yunion-deprecated-by:"zone"`
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ type GlobalVpcResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
GlobalvpcId string `json:"globalvpc_id" "yunion:deprecated-by":"globalvpc"`
|
||||
GlobalvpcId string `json:"globalvpc_id" yunion-deprecated-by:"globalvpc"`
|
||||
}
|
||||
|
||||
type GlobalVpcResourceListInput struct {
|
||||
|
||||
@@ -21,6 +21,8 @@ type GuestnetworkDetails struct {
|
||||
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
// 所属Wire
|
||||
WireId string `json:"wire_id"`
|
||||
}
|
||||
|
||||
type GuestnetworkShortDesc struct {
|
||||
|
||||
@@ -28,13 +28,13 @@ type ServerListInput struct {
|
||||
|
||||
HostFilterListInput
|
||||
|
||||
NetworkFilterListInput `"yunion:ambiguous-prefix":"vpc_"`
|
||||
NetworkFilterListInput `yunion-ambiguous-prefix:"vpc_"`
|
||||
|
||||
billing.BillingResourceListInput
|
||||
|
||||
GroupFilterListInput
|
||||
SecgroupFilterListInput
|
||||
//DiskFilterListInput `"yunion:ambiguous-prefix":"storage_"`
|
||||
//DiskFilterListInput `yunion-ambiguous-prefix:"storage_"`
|
||||
ScalingGroupFilterListInput
|
||||
|
||||
// 只列出裸金属主机
|
||||
@@ -64,13 +64,13 @@ type ServerListInput struct {
|
||||
// 列出可以挂载磁盘的主机
|
||||
AttachableServersForDisk string `json:"attachable_servers_for_disk"`
|
||||
// Deprecated:列出可以挂载磁盘的主机
|
||||
Disk string `json:"disk" "yunion:deprecated-by":"attachable_servers_for_disk"`
|
||||
Disk string `json:"disk" yunion-deprecated-by:"attachable_servers_for_disk"`
|
||||
|
||||
// 按主机资源类型进行排序
|
||||
// enum: shared,prepaid,dedicated
|
||||
ResourceType string `json:"resource_type"`
|
||||
// 返回开启主备机功能的主机
|
||||
GetBackupGuestsOnHost *bool `json:"get_backup_guests_on_host"`
|
||||
// 返回该宿主机上的所有虚拟机,包括备份机
|
||||
GetAllGuestsOnHost string `json:"get_all_guests_on_host"`
|
||||
|
||||
// 根据宿主机 SN 过滤
|
||||
// HostSn string `json:"host_sn"`
|
||||
@@ -285,15 +285,15 @@ type ServerResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by guest Id
|
||||
ServerId string `json:"server_id" "yunion:deprecated-by":"server"`
|
||||
ServerId string `json:"server_id" yunion-deprecated-by:"server"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by guest Id
|
||||
Guest string `json:"guest" "yunion:deprecated-by":"server"`
|
||||
Guest string `json:"guest" yunion-deprecated-by:"server"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by guest Id
|
||||
GuestId string `json:"guest_id" "yunion:deprecated-by":"server"`
|
||||
GuestId string `json:"guest_id" yunion-deprecated-by:"server"`
|
||||
}
|
||||
|
||||
type ServerFilterListInput struct {
|
||||
@@ -340,3 +340,8 @@ type GuestSaveToTemplateInput struct {
|
||||
// The generate name of guest template
|
||||
GenerateName string `json:"generate_name"`
|
||||
}
|
||||
|
||||
type GuestSyncFixNicsInput struct {
|
||||
// 需要修正的IP地址列表
|
||||
Ip []string `json:"ip"`
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ type GuestTemplateDetails struct {
|
||||
|
||||
Secgroups []string `json:"secgroups"`
|
||||
Zone string `json:"zone"`
|
||||
ZoneId string `json:"zone_id"`
|
||||
Brand string `json:"brand"`
|
||||
|
||||
ConfigInfo GuestTemplateConfigInfo `json:"config_info"`
|
||||
@@ -71,9 +72,7 @@ type GuestTemplateListInput struct {
|
||||
}
|
||||
|
||||
type GuestTemplateConfigInfo struct {
|
||||
Region string `json:"region"`
|
||||
Zone string `json:"zone"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
Secgroup string `json:"secgroup"`
|
||||
Sku GuestTemplateSku `json:"sku"`
|
||||
Disks []GuestTemplateDisk `json:"disks"`
|
||||
|
||||
@@ -108,6 +108,8 @@ type HostListInput struct {
|
||||
Uuid []string `json:"uuid"`
|
||||
// 主机启动模式, 可能值位PXE和ISO
|
||||
BootMode []string `json:"boot_mode"`
|
||||
// 虚拟机所在的二层网络
|
||||
ServerIdForNetwork string `json:"server_id_for_network"`
|
||||
}
|
||||
|
||||
type HostDetails struct {
|
||||
@@ -119,9 +121,10 @@ type HostDetails struct {
|
||||
|
||||
Schedtags []SchedtagShortDescDetails `json:"schedtags"`
|
||||
|
||||
ServerId string `json:"server_id"`
|
||||
Server string `json:"server"`
|
||||
ServerIps string `json:"server_ips"`
|
||||
ServerId string `json:"server_id"`
|
||||
Server string `json:"server"`
|
||||
ServerIps string `json:"server_ips"`
|
||||
ServerPendingDeleted bool `json:"server_pending_deleted"`
|
||||
// 网卡数量
|
||||
NicCount int `json:"nic_count"`
|
||||
// 网卡详情
|
||||
@@ -138,7 +141,7 @@ type HostDetails struct {
|
||||
NonsystemGuests int `json:"nonsystem_guests"`
|
||||
// 运行中云主机数量
|
||||
// example: 2
|
||||
RunningGuests int `json:"running_geusts"`
|
||||
RunningGuests int `json:"running_guests"`
|
||||
// CPU超分率
|
||||
CpuCommitRate float64 `json:"cpu_commit_rate"`
|
||||
// 内存超分率
|
||||
@@ -164,7 +167,8 @@ type HostDetails struct {
|
||||
CanPrepare bool `json:"can_prepare"`
|
||||
PrepareFailReason string `json:"prepare_fail_reason"`
|
||||
// 允许开启宿主机健康检查
|
||||
AllowHealthCheck bool `json:"allow_health_check"`
|
||||
AllowHealthCheck bool `json:"allow_health_check"`
|
||||
AutoMigrateOnHostDown bool `json:"auto_migrate_on_host_down"`
|
||||
|
||||
// reserved resource for isolated device
|
||||
ReservedResourceForGpu IsolatedDeviceReservedResourceInput `json:"reserved_resource_for_gpu"`
|
||||
@@ -228,7 +232,7 @@ type HostResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by host_id
|
||||
HostId string `json:"host_id" "yunion:deprecated-by":"host"`
|
||||
HostId string `json:"host_id" yunion-deprecated-by:"host"`
|
||||
}
|
||||
|
||||
type HostRegisterMetadata struct {
|
||||
|
||||
@@ -21,7 +21,7 @@ type HostJointResourceDetailsBase struct {
|
||||
Host string `json:"host"`
|
||||
// 裸金属服务器名称
|
||||
// Deprecated
|
||||
Baremetal string `json:"baremetal" "yunion:deprecated-by":"host"`
|
||||
Baremetal string `json:"baremetal" yunion-deprecated-by:"host"`
|
||||
}
|
||||
|
||||
type HostJointResourceDetails struct {
|
||||
|
||||
@@ -61,8 +61,7 @@ type CachedimageListInput struct {
|
||||
}
|
||||
|
||||
type ExternalProjectListInput struct {
|
||||
apis.StandaloneResourceListInput
|
||||
apis.ProjectizedResourceListInput
|
||||
apis.VirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
ManagedResourceListInput
|
||||
@@ -145,7 +144,7 @@ type GuestTemplateFilterListInput struct {
|
||||
GuestTemplate string `json:"guest_template"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
GuestTemplateId string `json:"guest_template_id" "yunion:deprecated-by":"guest_template"`
|
||||
GuestTemplateId string `json:"guest_template_id" yunion-deprecated-by:"guest_template"`
|
||||
}
|
||||
|
||||
type ServiceCatalogListInput struct {
|
||||
|
||||
@@ -50,7 +50,7 @@ type GroupResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by instance group Id
|
||||
GroupId string `json:"group_id" "yunion:deprecated-by":"group"`
|
||||
GroupId string `json:"group_id" yunion-deprecated-by:"group"`
|
||||
}
|
||||
|
||||
type GroupFilterListInput struct {
|
||||
|
||||
@@ -50,6 +50,9 @@ type InstanceSnapshotDetails struct {
|
||||
// 快照列表
|
||||
Snapshots []SimpleSnapshot `json:"snapshots"`
|
||||
Properties map[string]string `json:"properties"`
|
||||
|
||||
// 主机快照大小
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
type InstanceSnapshotListInput struct {
|
||||
|
||||
@@ -170,6 +170,8 @@ type LoadbalancerDetails struct {
|
||||
ManagedResourceInfo
|
||||
CloudregionResourceInfo
|
||||
|
||||
LoadbalancerClusterResourceInfo
|
||||
|
||||
VpcResourceInfoBase
|
||||
ZoneResourceInfoBase
|
||||
NetworkResourceInfoBase
|
||||
@@ -208,7 +210,7 @@ type LoadbalancerResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
LoadbalancerId string `json:"loadbalancer_id" "yunion:deprecated-by":"loadbalancer"`
|
||||
LoadbalancerId string `json:"loadbalancer_id" yunion-deprecated-by:"loadbalancer"`
|
||||
}
|
||||
|
||||
type LoadbalancerFilterListInput struct {
|
||||
|
||||
@@ -23,3 +23,24 @@ type LoadbalancerAclDetails struct {
|
||||
|
||||
SLoadbalancerAcl
|
||||
}
|
||||
|
||||
type LoadbalancerAclResourceInfo struct {
|
||||
// 负载均衡ACL名称
|
||||
Acl string `json:"acl"`
|
||||
}
|
||||
|
||||
type LoadbalancerAclResourceInput struct {
|
||||
// ACL名称或ID
|
||||
AclId string `json:"acl_id"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Acl string `json:"acl" yunion-deprecated-by:"acl_id"`
|
||||
}
|
||||
|
||||
type LoadbalancerAclFilterListInput struct {
|
||||
LoadbalancerAclResourceInput
|
||||
|
||||
// 以ACL名称排序
|
||||
OrderByAcl string `json:"order_by_acl"`
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ type LoadbalancerBackendGroupResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
BackendGroupId string `json:"backend_group_id" "yunion:deprecated-by":"backend_group"`
|
||||
BackendGroupId string `json:"backend_group_id" yunion-deprecated-by:"backend_group"`
|
||||
}
|
||||
|
||||
type LoadbalancerBackendGroupFilterListInput struct {
|
||||
|
||||
@@ -20,3 +20,24 @@ type LoadbalancerCertificateDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancerCertificate
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateResourceInfo struct {
|
||||
// 负载均衡证书名称
|
||||
Certificate string `json:"certificate"`
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateResourceInput struct {
|
||||
// 证书名称或ID
|
||||
Certificate string `json:"certificate"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
CertificateId string `json:"certificate_id" yunion-deprecated-by:"certificate"`
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateFilterListInput struct {
|
||||
LoadbalancerCertificateResourceInput
|
||||
|
||||
// 以证书名称排序
|
||||
OrderByCertificate string `json:"order_by_certificate"`
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ type LoadbalancerClusterResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
ClusterId string `json:"cluster_id" "yunion:deprecated-by":"cluster"`
|
||||
ClusterId string `json:"cluster_id" yunion-deprecated-by:"cluster"`
|
||||
}
|
||||
|
||||
type LoadbalancerClusterFilterListInput struct {
|
||||
|
||||
@@ -19,11 +19,12 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
type LoadbalancerListenerDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
LoadbalancerResourceInfo
|
||||
LoadbalancerAclResourceInfo
|
||||
LoadbalancerCertificateResourceInfo
|
||||
|
||||
SLoadbalancerListener
|
||||
|
||||
BackendGroup string `json:"backend_group"`
|
||||
AclName string `json:"acl_name"`
|
||||
CertificateName string `json:"certificate_name"`
|
||||
OriginCertificateId string `json:"origin_certificate_id"`
|
||||
}
|
||||
@@ -45,7 +46,7 @@ type LoadbalancerListenerResourceInput struct {
|
||||
// 负载均衡监听器ID
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
ListenerId string `json:"listener_id" "yunion:deprecated-by":"listener"`
|
||||
ListenerId string `json:"listener_id" yunion-deprecated-by:"listener"`
|
||||
}
|
||||
|
||||
type LoadbalancerListenerFilterListInput struct {
|
||||
|
||||
@@ -89,7 +89,7 @@ type NatGatewayResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
NatgatewayId string `json:"natgateway_id" "yunion:deprecated-by":"natgateway"`
|
||||
NatgatewayId string `json:"natgateway_id" yunion-deprecated-by:"natgateway"`
|
||||
}
|
||||
|
||||
type NatGatewayFilterListInput struct {
|
||||
|
||||
@@ -24,7 +24,7 @@ type WireResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// fitler by wire id
|
||||
WireId string `json:"wire_id" "yunion:deprecated-by":"wire"`
|
||||
WireId string `json:"wire_id" yunion-deprecated-by:"wire"`
|
||||
}
|
||||
|
||||
type WireFilterListBase struct {
|
||||
@@ -47,7 +47,7 @@ type NetworkResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by networkId
|
||||
NetworkId string `json:"network_id" "yunion:deprecated-by":"network"`
|
||||
NetworkId string `json:"network_id" yunion-deprecated-by:"network"`
|
||||
}
|
||||
|
||||
type NetworkFilterListBase struct {
|
||||
@@ -300,3 +300,13 @@ type NetworkUpdateInput struct {
|
||||
// 分配策略
|
||||
AllocPolicy string `json:"alloc_policy"`
|
||||
}
|
||||
|
||||
type GetNetworkAddressesInput struct {
|
||||
// 获取资源的范围,例如 project|domain|system
|
||||
Scope string `json:"scope"`
|
||||
}
|
||||
|
||||
type GetNetworkAddressesOutput struct {
|
||||
// IP子网地址记录
|
||||
Addresses []SNetworkAddress `json:"addresses"`
|
||||
}
|
||||
|
||||
@@ -134,9 +134,15 @@ type ScalingGroupDetails struct {
|
||||
// example: OneCloud
|
||||
Brand string `json:"brand"`
|
||||
|
||||
// description: 网络ID
|
||||
// example: net-12345
|
||||
Networks []string `json:"networks"`
|
||||
// description: 网络信息
|
||||
Networks []ScalingGroupNetwork `json:"networks"`
|
||||
}
|
||||
|
||||
type ScalingGroupNetwork struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
GuestIpStart string `json:"guest_ip_start"`
|
||||
GuestIpEnd string `json:"guest_ip_end"`
|
||||
}
|
||||
|
||||
type ScalingGroupResourceInfo struct {
|
||||
|
||||
@@ -45,7 +45,7 @@ type SchedtagResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by schedtag_id
|
||||
SchedtagId string `json:"schedtag_id" "yunion:deprecated-by":"schedtag"`
|
||||
SchedtagId string `json:"schedtag_id" yunion-deprecated-by:"schedtag"`
|
||||
}
|
||||
|
||||
type SchedtagFilterListInput struct {
|
||||
@@ -65,11 +65,11 @@ type SchedtagListInput struct {
|
||||
apis.ScopedResourceBaseListInput
|
||||
|
||||
// fitler by resource_type
|
||||
ResourceType string `json:"resource_type"`
|
||||
ResourceType []string `json:"resource_type"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by type, alias for resource_type
|
||||
Type string `json:"type" "yunion:deprecated-by":"resource_type"`
|
||||
Type string `json:"type" yunion-deprecated-by:"resource_type"`
|
||||
|
||||
DefaultStrategy []string `json:"default_strategy"`
|
||||
}
|
||||
@@ -86,6 +86,7 @@ type SchedtagDetails struct {
|
||||
HostCount int `json:"host_count"`
|
||||
ServerCount int `json:"server_count"`
|
||||
OtherCount int `json:"other_count"`
|
||||
ResourceCount int `json:"resource_count"`
|
||||
JoinModelKeyword string `json:"join_model_keyword"`
|
||||
}
|
||||
|
||||
|
||||
@@ -145,8 +145,18 @@ type SecgroupListInput struct {
|
||||
// pattern:asc|desc
|
||||
OrderByGuestCnt string `json:"order_by_guest_cnt"`
|
||||
|
||||
// 是否被修改
|
||||
IsDirty *bool `json:"is_dirty"`
|
||||
// 模糊过滤规则中含有指定ip的安全组
|
||||
// example: 10.10.2.1
|
||||
Ip string `json:"ip"`
|
||||
|
||||
// 精确匹配规则中含有指定端口的安全组
|
||||
// example: 100-200
|
||||
Ports string `json:"ports"`
|
||||
|
||||
// 指定过滤规则的方向(仅在指定ip或ports时生效) choices: all|in|out
|
||||
// default: all
|
||||
// example: in
|
||||
Direction string `json:"direction"`
|
||||
}
|
||||
|
||||
type SecurityGroupCacheListInput struct {
|
||||
@@ -164,12 +174,18 @@ type SecurityGroupRuleListInput struct {
|
||||
apis.ResourceBaseListInput
|
||||
SecgroupFilterListInput
|
||||
|
||||
Projects []string `json:"projects"`
|
||||
|
||||
// 以direction字段过滤安全组规则
|
||||
Direction string `json:"direction"`
|
||||
// 以action字段过滤安全组规则
|
||||
Action string `json:"action"`
|
||||
// 以protocol字段过滤安全组规则
|
||||
Protocol string `json:"protocol"`
|
||||
// 以ports字段过滤安全组规则
|
||||
Ports string `json:"ports"`
|
||||
// 根据ip模糊匹配安全组规则
|
||||
Ip string `json:"ip"`
|
||||
}
|
||||
|
||||
type SecgroupResourceInput struct {
|
||||
@@ -178,7 +194,10 @@ type SecgroupResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by secgroup_id
|
||||
SecgroupId string `json:"secgroup_id" "yunion:deprecated-by":"secgroup"`
|
||||
SecgroupId string `json:"secgroup_id" yunion-deprecated-by:"secgroup"`
|
||||
|
||||
// 模糊匹配安全组规则名称
|
||||
SecgroupName string `json:"secgroup_name"`
|
||||
}
|
||||
|
||||
type SecgroupFilterListInput struct {
|
||||
@@ -193,15 +212,22 @@ type SecgroupDetails struct {
|
||||
SSecurityGroup
|
||||
|
||||
// 关联云主机数量
|
||||
GuestCnt int `json:"guest_cnt"`
|
||||
GuestCnt int `json:"guest_cnt,allowempty"`
|
||||
|
||||
// 关联此安全组的云主机is_system为true数量
|
||||
SystemGuestCnt int `json:"system_guest_cnt,allowempty"`
|
||||
|
||||
// admin_secgrp_id为此安全组的云主机数量
|
||||
AdminGuestCnt int `json:"admin_guest_cnt,allowempty"`
|
||||
|
||||
// 安全组缓存数量
|
||||
CacheCnt int `json:"cache_cnt"`
|
||||
CacheCnt int `json:"cache_cnt,allowempty"`
|
||||
// 规则信息
|
||||
Rules string `json:"rules"`
|
||||
Rules []SSecurityGroupRule `json:"rules"`
|
||||
// 入方向规则信息
|
||||
InRules string `json:"in_rules"`
|
||||
InRules []SSecurityGroupRule `json:"in_rules"`
|
||||
// 出方向规则信息
|
||||
OutRules string `json:"out_rules"`
|
||||
OutRules []SSecurityGroupRule `json:"out_rules"`
|
||||
}
|
||||
|
||||
type SecurityGroupResourceInfo struct {
|
||||
|
||||
@@ -127,7 +127,7 @@ var (
|
||||
STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_ZSTACK_CEPH, STORAGE_GPFS,
|
||||
}
|
||||
|
||||
HOST_STORAGE_LOCAL_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_ZSTACK_LOCAL_STORAGE}
|
||||
HOST_STORAGE_LOCAL_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_OPENSTACK_NOVA}
|
||||
|
||||
STORAGE_LIMITED_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_NAS, STORAGE_RBD, STORAGE_NFS, STORAGE_GPFS}
|
||||
|
||||
@@ -144,7 +144,7 @@ type StorageResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by storage_id
|
||||
StorageId string `json:"storage_id" "yunion:deprecated-by":"storage"`
|
||||
StorageId string `json:"storage_id" yunion-deprecated-by:"storage"`
|
||||
}
|
||||
|
||||
type StorageFilterListInputBase struct {
|
||||
|
||||
@@ -48,13 +48,13 @@ type StoragecachedimageListInput struct {
|
||||
Storagecache string `json:"storagecache"`
|
||||
// Deprecated
|
||||
// swagger:ignore
|
||||
StoragecacheId string `json:"storagecache_id" "yunion:deprecated-by":"storagecache"`
|
||||
StoragecacheId string `json:"storagecache_id" yunion-deprecated-by:"storagecache"`
|
||||
|
||||
// 以镜像缓存过滤
|
||||
Cachedimage string `json:"cachedimage"`
|
||||
// Deprecated
|
||||
// swagger:ignore
|
||||
CachedimageId string `json:"cachedimage_id" "yunion:deprecated-by":"cachedimage"`
|
||||
CachedimageId string `json:"cachedimage_id" yunion-deprecated-by:"cachedimage"`
|
||||
|
||||
// 镜像状态
|
||||
Status []string `json:"status"`
|
||||
|
||||
@@ -90,7 +90,7 @@ type VpcResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by vpc Id
|
||||
VpcId string `json:"vpc_id" "yunion:deprecated-by":"vpc"`
|
||||
VpcId string `json:"vpc_id" yunion-deprecated-by:"vpc"`
|
||||
|
||||
// Vpc外网访问模式
|
||||
ExternalAccessMode string `json:"external_access_mode"`
|
||||
|
||||
@@ -32,6 +32,34 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
sVpcInterCidr = "100.65.0.0/17"
|
||||
sVpcInterExtCidr = "100.65.0.0/30"
|
||||
VpcInterExtMask = 30
|
||||
sVpcInterExtIP1 = "100.65.0.1"
|
||||
sVpcInterExtIP2 = "100.65.0.2"
|
||||
VpcInterExtMac1 = "ee:ee:ee:ee:ee:f0"
|
||||
VpcInterExtMac2 = "ee:ee:ee:ee:ee:f1"
|
||||
)
|
||||
|
||||
var (
|
||||
vpcInterCidr netutils.IPV4Prefix
|
||||
vpcInterExtIP1 netutils.IPV4Addr
|
||||
vpcInterExtIP2 netutils.IPV4Addr
|
||||
)
|
||||
|
||||
func VpcInterCidr() netutils.IPV4Prefix {
|
||||
return vpcInterCidr
|
||||
}
|
||||
|
||||
func VpcInterExtIP1() netutils.IPV4Addr {
|
||||
return vpcInterExtIP1
|
||||
}
|
||||
|
||||
func VpcInterExtIP2() netutils.IPV4Addr {
|
||||
return vpcInterExtIP2
|
||||
}
|
||||
|
||||
const (
|
||||
sVpcMappedCidr = "100.64.0.0/17"
|
||||
VpcMappedIPMask = 17
|
||||
@@ -92,6 +120,10 @@ func init() {
|
||||
return v
|
||||
}
|
||||
|
||||
vpcInterCidr = mp(netutils.NewIPV4Prefix(sVpcInterCidr))
|
||||
vpcInterExtIP1 = mi(netutils.NewIPV4Addr(sVpcInterExtIP1))
|
||||
vpcInterExtIP2 = mi(netutils.NewIPV4Addr(sVpcInterExtIP2))
|
||||
|
||||
vpcMappedCidr = mp(netutils.NewIPV4Prefix(sVpcMappedCidr))
|
||||
vpcMappedGatewayIP = mi(netutils.NewIPV4Addr(sVpcMappedGatewayIP))
|
||||
|
||||
|
||||
@@ -202,8 +202,6 @@ type SCloudaccount struct {
|
||||
ProxySettingId string `json:"proxy_setting_id"`
|
||||
// 公有云子账号登录地址
|
||||
IamLoginUrl string `json:"iam_login_url"`
|
||||
// 是否支持创建公有云子账号
|
||||
IsSupportCloudId *bool `json:"is_support_cloud_id,omitempty"`
|
||||
}
|
||||
|
||||
// SCloudprovider is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudprovider.
|
||||
@@ -731,10 +729,11 @@ type SElasticip struct {
|
||||
|
||||
// SExternalProject is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SExternalProject.
|
||||
type SExternalProject struct {
|
||||
apis.SStandaloneResourceBase
|
||||
apis.SProjectizedResourceBase
|
||||
apis.SVirtualResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SManagedResourceBase
|
||||
// 归属云账号ID
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
}
|
||||
|
||||
// SGlobalVpc is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGlobalVpc.
|
||||
@@ -868,6 +867,20 @@ type SGuestTemplateResourceBase struct {
|
||||
GuestTemplateId string `json:"guest_template_id"`
|
||||
}
|
||||
|
||||
// SGuestcdrom is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestcdrom.
|
||||
type SGuestcdrom struct {
|
||||
Id string `json:"id"`
|
||||
// = Column(VARCHAR(36, charset='ascii'), primary_key=True)
|
||||
ImageId string `json:"image_id"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
Name string `json:"name"`
|
||||
// Column(VARCHAR(64, charset='ascii'), nullable=True)
|
||||
Path string `json:"path"`
|
||||
// Column(VARCHAR(256, charset='ascii'), nullable=True)
|
||||
Size int `json:"size"`
|
||||
UpdateVersion int `json:"update_version"`
|
||||
}
|
||||
|
||||
// SGuestdisk is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestdisk.
|
||||
type SGuestdisk struct {
|
||||
SGuestJointsBase
|
||||
@@ -987,11 +1000,10 @@ type SHost struct {
|
||||
OvnVersion string `json:"ovn_version"`
|
||||
IsBaremetal bool `json:"is_baremetal"`
|
||||
// 是否处于维护状态
|
||||
IsMaintenance bool `json:"is_maintenance"`
|
||||
LastPingAt time.Time `json:"last_ping_at"`
|
||||
EnableHealthCheck bool `json:"enable_health_check"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
RealExternalId string `json:"real_external_id"`
|
||||
IsMaintenance bool `json:"is_maintenance"`
|
||||
EnableHealthCheck bool `json:"enable_health_check"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
RealExternalId string `json:"real_external_id"`
|
||||
// 是否为导入的宿主机
|
||||
IsImport bool `json:"is_import"`
|
||||
// 是否允许PXE启动
|
||||
@@ -1179,8 +1191,7 @@ type SLoadbalancer struct {
|
||||
AddressType string `json:"address_type"`
|
||||
// 网络类型
|
||||
NetworkType string `json:"network_type"`
|
||||
// 负载均衡集群Id
|
||||
ClusterId string `json:"cluster_id"`
|
||||
SLoadbalancerClusterResourceBase
|
||||
// 计费类型
|
||||
ChargeType string `json:"charge_type"`
|
||||
// 套餐名称
|
||||
@@ -1246,12 +1257,9 @@ type SLoadbalancerAgentDeployment struct {
|
||||
|
||||
// SLoadbalancerAgentParams is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParams.
|
||||
type SLoadbalancerAgentParams struct {
|
||||
KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"`
|
||||
HaproxyConfTmpl string `json:"haproxy_conf_tmpl"`
|
||||
TelegrafConfTmpl string `json:"telegraf_conf_tmpl"`
|
||||
Vrrp SLoadbalancerAgentParamsVrrp `json:"vrrp"`
|
||||
Haproxy SLoadbalancerAgentParamsHaproxy `json:"haproxy"`
|
||||
Telegraf SLoadbalancerAgentParamsTelegraf `json:"telegraf"`
|
||||
KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"`
|
||||
HaproxyConfTmpl string `json:"haproxy_conf_tmpl"`
|
||||
TelegrafConfTmpl string `json:"telegraf_conf_tmpl"`
|
||||
}
|
||||
|
||||
// SLoadbalancerAgentParamsHaproxy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParamsHaproxy.
|
||||
@@ -1377,7 +1385,7 @@ type SLoadbalancerHTTPRedirect struct {
|
||||
|
||||
// SLoadbalancerHTTPSListener is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerHTTPSListener.
|
||||
type SLoadbalancerHTTPSListener struct {
|
||||
CertificateId string `json:"certificate_id"`
|
||||
SLoadbalancerCertificateResourceBase
|
||||
CachedCertificateId string `json:"cached_certificate_id"`
|
||||
TLSCipherPolicy string `json:"tls_cipher_policy"`
|
||||
EnableHttp2 bool `json:"enable_http2"`
|
||||
@@ -1425,8 +1433,8 @@ type SLoadbalancerListener struct {
|
||||
BackendIdleTimeout int `json:"backend_idle_timeout"`
|
||||
AclStatus string `json:"acl_status"`
|
||||
AclType string `json:"acl_type"`
|
||||
AclId string `json:"acl_id"`
|
||||
CachedAclId string `json:"cached_acl_id"`
|
||||
SLoadbalancerAclResourceBase
|
||||
CachedAclId string `json:"cached_acl_id"`
|
||||
SLoadbalancerRateLimiter
|
||||
SLoadbalancerTCPListener
|
||||
SLoadbalancerUDPListener
|
||||
@@ -1493,6 +1501,16 @@ type SManagedResourceBase struct {
|
||||
ManagerId string `json:"manager_id"`
|
||||
}
|
||||
|
||||
// SNatDEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatDEntry.
|
||||
type SNatDEntry struct {
|
||||
SNatEntry
|
||||
ExternalIP string `json:"external_ip"`
|
||||
ExternalPort int `json:"external_port"`
|
||||
InternalIP string `json:"internal_ip"`
|
||||
InternalPort int `json:"internal_port"`
|
||||
IpProtocol string `json:"ip_protocol"`
|
||||
}
|
||||
|
||||
// SNatEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatEntry.
|
||||
type SNatEntry struct {
|
||||
apis.SStatusInfrasResourceBase
|
||||
@@ -1523,6 +1541,25 @@ type SNatgatewayResourceBase struct {
|
||||
NatgatewayId string `json:"natgateway_id"`
|
||||
}
|
||||
|
||||
// SNetInterface is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetInterface.
|
||||
type SNetInterface struct {
|
||||
Mac string `json:"mac"`
|
||||
// Column(VARCHAR(36, charset='ascii'), primary_key=True)
|
||||
BaremetalId string `json:"baremetal_id"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
WireId string `json:"wire_id"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
Rate int `json:"rate"`
|
||||
// Column(Integer, nullable=True) # Mbps
|
||||
NicType string `json:"nic_type"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
Index byte `json:"index"`
|
||||
// Column(TINYINT, nullable=True)
|
||||
LinkUp bool `json:"link_up"`
|
||||
// Column(Boolean, nullable=True)
|
||||
Mtu int16 `json:"mtu"`
|
||||
}
|
||||
|
||||
// SNetwork is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetwork.
|
||||
type SNetwork struct {
|
||||
apis.SSharableVirtualResourceBase
|
||||
@@ -1697,8 +1734,6 @@ type SScalingAlarm struct {
|
||||
Value float64 `json:"value"`
|
||||
// Real-time cumulate number
|
||||
RealCumulate int `json:"real_cumulate"`
|
||||
// Last trigger time
|
||||
LastTriggerTime time.Time `json:"last_trigger_time"`
|
||||
}
|
||||
|
||||
// SScalingGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroup.
|
||||
@@ -1729,10 +1764,6 @@ type SScalingGroup struct {
|
||||
HealthCheckGov int `json:"health_check_gov"`
|
||||
LoadbalancerBackendPort int `json:"loadbalancer_backend_port"`
|
||||
LoadbalancerBackendWeight int `json:"loadbalancer_backend_weight"`
|
||||
// Time to allow scale
|
||||
AllowScaleTime time.Time `json:"allow_scale_time"`
|
||||
// NextCheckTime descripe the next time to check instance's health
|
||||
NextCheckTime time.Time `json:"next_check_time"`
|
||||
}
|
||||
|
||||
// SScalingGroupGuest is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroupGuest.
|
||||
@@ -1856,7 +1887,8 @@ type SSecurityGroupCache struct {
|
||||
SManagedResourceBase
|
||||
SSecurityGroupResourceBase
|
||||
// 虚拟私有网络外部Id
|
||||
VpcId string `json:"vpc_id"`
|
||||
VpcId string `json:"vpc_id"`
|
||||
ExternalProjectId string `json:"external_project_id"`
|
||||
}
|
||||
|
||||
// SSecurityGroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSecurityGroupResourceBase.
|
||||
|
||||
@@ -73,7 +73,7 @@ type IdentityProviderCreateInput struct {
|
||||
TargetDomain string `json:"target_domain"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
TargetDomainId string `json:"target_domain_id" "yunion:deprecated-by":"target_domain"`
|
||||
TargetDomainId string `json:"target_domain_id" yunion-deprecated-by:"target_domain"`
|
||||
|
||||
// 新建域的时候是否自动新建第一个项目
|
||||
AutoCreateProject *bool `json:"auto_create_project"`
|
||||
|
||||
@@ -49,22 +49,22 @@ type ProjectFilterListInput struct {
|
||||
ProjectDomain string `json:"project_domain"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
ProjectDomainId string `json:"project_domain_id" "yunion:deprecated-by":"project-domain"`
|
||||
ProjectDomainId string `json:"project_domain_id" yunion-deprecated-by:"project-domain"`
|
||||
|
||||
// 以项目(ID或Name)过滤列表结果
|
||||
Project string `json:"project"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by project_id
|
||||
ProjectId string `json:"project_id" "yunion:deprecated-by":"project"`
|
||||
ProjectId string `json:"project_id" yunion-deprecated-by:"project"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by tenant
|
||||
Tenant string `json:"tenant" "yunion:deprecated-by":"project"`
|
||||
Tenant string `json:"tenant" yunion-deprecated-by:"project"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by tenant_id
|
||||
TenantId string `json:"tenant_id" "yunion:deprecated-by":"project"`
|
||||
TenantId string `json:"tenant_id" yunion-deprecated-by:"project"`
|
||||
}
|
||||
|
||||
type UserFilterListInput struct {
|
||||
@@ -79,7 +79,7 @@ type UserFilterListInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by user_id
|
||||
UserId string `json:"user_id" "yunion:deprecated-by":"user"`
|
||||
UserId string `json:"user_id" yunion-deprecated-by:"user"`
|
||||
}
|
||||
|
||||
type GroupFilterListInput struct {
|
||||
@@ -94,7 +94,7 @@ type GroupFilterListInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by group_id
|
||||
GroupId string `json:"group_id" "yunion:deprecated-by":"group"`
|
||||
GroupId string `json:"group_id" yunion-deprecated-by:"group"`
|
||||
}
|
||||
|
||||
type RoleFilterListInput struct {
|
||||
@@ -109,7 +109,7 @@ type RoleFilterListInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by role_id
|
||||
RoleId string `json:"role_id" "yunion:deprecated-by":"role"`
|
||||
RoleId string `json:"role_id" yunion-deprecated-by:"role"`
|
||||
}
|
||||
|
||||
type ServiceFilterListInput struct {
|
||||
@@ -121,7 +121,7 @@ type ServiceFilterListInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// filter by service_id
|
||||
ServiceId string `json:"service_id" "yunion:deprecated-by":"service"`
|
||||
ServiceId string `json:"service_id" yunion-deprecated-by:"service"`
|
||||
|
||||
// 以服务名称排序
|
||||
OrderByService string `json:"order_by_service"`
|
||||
@@ -151,6 +151,9 @@ type ProjectListInput struct {
|
||||
|
||||
UserFilterListInput
|
||||
GroupFilterListInput
|
||||
|
||||
// 过滤出指定用户或者组可以加入的项目
|
||||
Jointable *bool `json:"jointable"`
|
||||
}
|
||||
|
||||
type DomainListInput struct {
|
||||
@@ -322,7 +325,7 @@ type RegionFilterListInput struct {
|
||||
Region string `json:"region"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
RegionId string `json:"region_id" "yunion:deprecated-by":"region"`
|
||||
RegionId string `json:"region_id" yunion-deprecated-by:"region"`
|
||||
}
|
||||
|
||||
type RegionListInput struct {
|
||||
|
||||
@@ -92,6 +92,20 @@ type SFederatedUser struct {
|
||||
DisplayName string `json:"display_name"`
|
||||
}
|
||||
|
||||
// SFederationProtocol is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFederationProtocol.
|
||||
type SFederationProtocol struct {
|
||||
Id string `json:"id"`
|
||||
IdpId string `json:"idp_id"`
|
||||
MappingId string `json:"mapping_id"`
|
||||
}
|
||||
|
||||
// SFernetKey is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFernetKey.
|
||||
type SFernetKey struct {
|
||||
Type string `json:"type"`
|
||||
Index int `json:"index"`
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
// SGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SGroup.
|
||||
type SGroup struct {
|
||||
SIdentityBaseResource
|
||||
@@ -129,28 +143,45 @@ type SIdmapping struct {
|
||||
EntityType string `json:"entity_type"`
|
||||
}
|
||||
|
||||
// SIdpRemoteIds is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SIdpRemoteIds.
|
||||
type SIdpRemoteIds struct {
|
||||
IdpId string `json:"idp_id"`
|
||||
RemoteId string `json:"remote_id"`
|
||||
}
|
||||
|
||||
// SImpliedRole is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SImpliedRole.
|
||||
type SImpliedRole struct {
|
||||
PriorRoleId string `json:"prior_role_id"`
|
||||
ImpliedRoleId string `json:"implied_role_id"`
|
||||
}
|
||||
|
||||
// SLocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SLocalUser.
|
||||
type SLocalUser struct {
|
||||
apis.SResourceBase
|
||||
Id int `json:"id"`
|
||||
UserId string `json:"user_id"`
|
||||
DomainId string `json:"domain_id"`
|
||||
Name string `json:"name"`
|
||||
FailedAuthCount int `json:"failed_auth_count"`
|
||||
FailedAuthAt time.Time `json:"failed_auth_at"`
|
||||
Id int `json:"id"`
|
||||
UserId string `json:"user_id"`
|
||||
DomainId string `json:"domain_id"`
|
||||
Name string `json:"name"`
|
||||
FailedAuthCount int `json:"failed_auth_count"`
|
||||
}
|
||||
|
||||
// SNonlocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SNonlocalUser.
|
||||
type SNonlocalUser struct {
|
||||
DomainId string `json:"domain_id"`
|
||||
Name string `json:"name"`
|
||||
UserId string `json:"user_id"`
|
||||
}
|
||||
|
||||
// SPassword is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPassword.
|
||||
type SPassword struct {
|
||||
apis.SResourceBase
|
||||
Id int `json:"id"`
|
||||
LocalUserId int `json:"local_user_id"`
|
||||
Password string `json:"password"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
SelfService bool `json:"self_service"`
|
||||
PasswordHash string `json:"password_hash"`
|
||||
CreatedAtInt int64 `json:"created_at_int"`
|
||||
ExpiresAtInt int64 `json:"expires_at_int"`
|
||||
Id int `json:"id"`
|
||||
LocalUserId int `json:"local_user_id"`
|
||||
Password string `json:"password"`
|
||||
SelfService bool `json:"self_service"`
|
||||
PasswordHash string `json:"password_hash"`
|
||||
CreatedAtInt int64 `json:"created_at_int"`
|
||||
ExpiresAtInt int64 `json:"expires_at_int"`
|
||||
}
|
||||
|
||||
// SPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPolicy.
|
||||
@@ -168,6 +199,12 @@ type SProject struct {
|
||||
IsDomain *bool `json:"is_domain,omitempty"`
|
||||
}
|
||||
|
||||
// SProjectExtended is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SProjectExtended.
|
||||
type SProjectExtended struct {
|
||||
SProject
|
||||
DomainName string `json:"domain_name"`
|
||||
}
|
||||
|
||||
// SRegion is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRegion.
|
||||
type SRegion struct {
|
||||
apis.SStandaloneResourceBase
|
||||
@@ -181,6 +218,17 @@ type SRole struct {
|
||||
apis.SSharableBaseResource
|
||||
}
|
||||
|
||||
// SScopeResource is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SScopeResource.
|
||||
type SScopeResource struct {
|
||||
DomainId string `json:"domain_id"`
|
||||
ProjectId string `json:"project_id"`
|
||||
OwnerId string `json:"owner_id"`
|
||||
RegionId string `json:"region_id"`
|
||||
ServiceId string `json:"service_id"`
|
||||
Resource string `json:"resource"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
// SService is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SService.
|
||||
type SService struct {
|
||||
apis.SStandaloneResourceBase
|
||||
@@ -213,6 +261,13 @@ type SUser struct {
|
||||
EnableMfa *bool `json:"enable_mfa,omitempty"`
|
||||
}
|
||||
|
||||
// SUserOption is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUserOption.
|
||||
type SUserOption struct {
|
||||
UserId string `json:"user_id"`
|
||||
OptionId string `json:"option_id"`
|
||||
OptionValue string `json:"option_value"`
|
||||
}
|
||||
|
||||
// SUsergroupMembership is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUsergroupMembership.
|
||||
type SUsergroupMembership struct {
|
||||
apis.SResourceBase
|
||||
|
||||
@@ -50,6 +50,7 @@ const (
|
||||
IMAGE_IS_READONLY = "is_readonly"
|
||||
IMAGE_PARTITION_TYPE = "partition_type"
|
||||
IMAGE_INSTALLED_CLOUDINIT = "installed_cloud_init"
|
||||
IMAGE_DISABLE_USB_KBD = "disable_usb_kbd"
|
||||
|
||||
IMAGE_STATUS_UPDATING = "updating"
|
||||
)
|
||||
|
||||
@@ -62,9 +62,44 @@ type SImage struct {
|
||||
OssChecksum string `json:"oss_checksum"`
|
||||
}
|
||||
|
||||
// SImageMember is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageMember.
|
||||
type SImageMember struct {
|
||||
SImagePeripheral
|
||||
Member string `json:"member"`
|
||||
CanShare bool `json:"can_share"`
|
||||
}
|
||||
|
||||
// SImagePeripheral is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImagePeripheral.
|
||||
type SImagePeripheral struct {
|
||||
apis.SResourceBase
|
||||
Id int `json:"id"`
|
||||
ImageId string `json:"image_id"`
|
||||
}
|
||||
|
||||
// SImageProperty is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageProperty.
|
||||
type SImageProperty struct {
|
||||
SImagePeripheral
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// SImageSubformat is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageSubformat.
|
||||
type SImageSubformat struct {
|
||||
SImagePeripheral
|
||||
Format string `json:"format"`
|
||||
Size int64 `json:"size"`
|
||||
Location string `json:"location"`
|
||||
Checksum string `json:"checksum"`
|
||||
FastHash string `json:"fast_hash"`
|
||||
Status string `json:"status"`
|
||||
TorrentSize int64 `json:"torrent_size"`
|
||||
TorrentLocation string `json:"torrent_location"`
|
||||
TorrentChecksum string `json:"torrent_checksum"`
|
||||
TorrentStatus string `json:"torrent_status"`
|
||||
}
|
||||
|
||||
// SImageTag is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageTag.
|
||||
type SImageTag struct {
|
||||
SImagePeripheral
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
@@ -21,15 +21,15 @@ type DomainizedResourceInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Domain string `json:"domain" "yunion:deprecated-by":"project_domain"`
|
||||
Domain string `json:"domain" yunion-deprecated-by:"project_domain"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Project domain Id filter, alias for project_domain
|
||||
ProjectDomainId string `json:"project_domain_id" "yunion:deprecated-by":"project_domain"`
|
||||
ProjectDomainId string `json:"project_domain_id" yunion-deprecated-by:"project_domain"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Domain Id filter, alias for project_domain
|
||||
DomainId string `json:"domain_id" "yunion:deprecated-by":"project_domain"`
|
||||
DomainId string `json:"domain_id" yunion-deprecated-by:"project_domain"`
|
||||
}
|
||||
|
||||
type ProjectizedResourceInput struct {
|
||||
@@ -39,15 +39,15 @@ type ProjectizedResourceInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by project_id, alias for project
|
||||
ProjectId string `json:"project_id" "yunion:deprecated-by":"project"`
|
||||
ProjectId string `json:"project_id" yunion-deprecated-by:"project"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by tenant ID or Name, alias for project
|
||||
Tenant string `json:"tenant" "yunion:deprecated-by":"project"`
|
||||
Tenant string `json:"tenant" yunion-deprecated-by:"project"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by tenant_id, alias for project
|
||||
TenantId string `json:"tenant_id" "yunion:deprecated-by":"project"`
|
||||
TenantId string `json:"tenant_id" yunion-deprecated-by:"project"`
|
||||
}
|
||||
|
||||
type DomainizedResourceCreateInput struct {
|
||||
@@ -75,9 +75,18 @@ type SharableVirtualResourceCreateInput struct {
|
||||
SharableResourceBaseCreateInput
|
||||
}
|
||||
|
||||
type StatusUserResourceCreateInput struct {
|
||||
StatusBaseResourceCreateInput
|
||||
UserResourceCreateInput
|
||||
type AdminSharableVirtualResourceBaseCreateInput struct {
|
||||
SharableVirtualResourceCreateInput
|
||||
|
||||
// 记录
|
||||
Records string `json:"records"`
|
||||
}
|
||||
|
||||
type StatusDomainLevelUserResourceCreateInput struct {
|
||||
StatusDomainLevelResourceCreateInput
|
||||
|
||||
// 本地用户Id,若为空则使用当前用户Id作为此参数值
|
||||
OwnerId string `json:"owner_id"`
|
||||
}
|
||||
|
||||
type UserResourceCreateInput struct {
|
||||
|
||||
@@ -50,19 +50,27 @@ type ProjectizedResourceListInput struct {
|
||||
OrderByProject string `json:"order_by_project"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
OrderByTenant string `json:"order_by_tenant" "yunion:deprecated-by":"order_by_project"`
|
||||
OrderByTenant string `json:"order_by_tenant" yunion-deprecated-by:"order_by_project"`
|
||||
}
|
||||
|
||||
type StatusUserResourceListInput struct {
|
||||
StatusResourceBaseListInput
|
||||
UserResourceListInput
|
||||
type StatusDomainLevelUserResourceListInput struct {
|
||||
StatusDomainLevelResourceListInput
|
||||
|
||||
// 查询指定的用户(ID或名称)拥有的资源
|
||||
User string `json:"user"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by userId
|
||||
UserId string `json:"user_id" yunion-deprecated-by:"user"`
|
||||
}
|
||||
|
||||
type UserResourceListInput struct {
|
||||
StandaloneResourceListInput
|
||||
ScopedResourceInput
|
||||
|
||||
// list in admin mode
|
||||
// swagger:ignore
|
||||
// Is an admin call? equivalent to scope=system
|
||||
// Deprecated
|
||||
Admin *bool `json:"admin"`
|
||||
|
||||
// 查询指定的用户(ID或名称)拥有的资源
|
||||
@@ -70,7 +78,7 @@ type UserResourceListInput struct {
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// Filter by userId
|
||||
UserId string `json:"user_id" "yunion:deprecated-by":"user"`
|
||||
UserId string `json:"user_id" yunion-deprecated-by:"user"`
|
||||
}
|
||||
|
||||
type ModelBaseListInput struct {
|
||||
|
||||
@@ -23,6 +23,8 @@ const (
|
||||
CommonAlertFieldOpt_Division = "/"
|
||||
)
|
||||
|
||||
var CommonAlertLevels = []string{"normal", "important", "fatal"}
|
||||
|
||||
type CommonAlertCreateInput struct {
|
||||
CommonMetricInputQuery
|
||||
AlertCreateInput
|
||||
|
||||
@@ -79,6 +79,16 @@ type SDataSource struct {
|
||||
IsDefault *bool `json:"is_default,omitempty"`
|
||||
}
|
||||
|
||||
// SMeterAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMeterAlert.
|
||||
type SMeterAlert struct {
|
||||
SV1Alert
|
||||
}
|
||||
|
||||
// SNodeAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SNodeAlert.
|
||||
type SNodeAlert struct {
|
||||
SV1Alert
|
||||
}
|
||||
|
||||
// SNotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SNotification.
|
||||
type SNotification struct {
|
||||
apis.SVirtualResourceBase
|
||||
@@ -124,3 +134,8 @@ type SSuggestSysRule struct {
|
||||
Setting interface{} `json:"setting"`
|
||||
ExecTime time.Time `json:"exec_time"`
|
||||
}
|
||||
|
||||
// SV1Alert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SV1Alert.
|
||||
type SV1Alert struct {
|
||||
SAlert
|
||||
}
|
||||
|
||||
@@ -121,8 +121,11 @@ type MetadataResourceInfo struct {
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
}
|
||||
|
||||
type StatusUserResourceDetails struct {
|
||||
UserResourceDetails
|
||||
type StatusDomainLevelUserResourceDetails struct {
|
||||
StatusDomainLevelResourceDetails
|
||||
|
||||
// 用户名称
|
||||
OwnerName string `json:"owner_name"`
|
||||
}
|
||||
|
||||
type UserResourceDetails struct {
|
||||
@@ -152,11 +155,11 @@ type ProjectizedResourceInfo struct {
|
||||
|
||||
// 资源归属项目的ID(向后兼容别名)
|
||||
// Deprecated
|
||||
TenantId string `json:"project_id" "yunion:deprecated-by":"tenant_id"`
|
||||
TenantId string `json:"project_id" yunion-deprecated-by:"tenant_id"`
|
||||
|
||||
// 资源归属项目的名称(向后兼容别名)
|
||||
// Deprecated
|
||||
Tenant string `json:"project" "yunion:deprecated-by":"tenant"`
|
||||
Tenant string `json:"project" yunion-deprecated-by:"tenant"`
|
||||
}
|
||||
|
||||
type ScopedResourceBaseInfo struct {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user