mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
Compare commits
382 Commits
v3.11.8-rc
...
v3.11.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd01cc9c95 | ||
|
|
6f5feb6a7f | ||
|
|
23a8fefbd0 | ||
|
|
e04fe21a5c | ||
|
|
272e32c0b9 | ||
|
|
bed77085c2 | ||
|
|
c9f3c9578d | ||
|
|
8deaead935 | ||
|
|
87e65dab12 | ||
|
|
671e24b01e | ||
|
|
3d8ea72139 | ||
|
|
70f29b481c | ||
|
|
35cb610755 | ||
|
|
62f44a77ff | ||
|
|
2ba9f0b887 | ||
|
|
1e676fb2e8 | ||
|
|
cfc6d56361 | ||
|
|
f50929bc60 | ||
|
|
2ebbfb4dd9 | ||
|
|
feb6a1981f | ||
|
|
ded669c7a2 | ||
|
|
2241f34b9b | ||
|
|
59ad7f73e8 | ||
|
|
2b08c946ff | ||
|
|
4f0ca33bf9 | ||
|
|
340d246ee5 | ||
|
|
ae0920476b | ||
|
|
2ffa2cf4ca | ||
|
|
cc4fdf189a | ||
|
|
5ab6e57d73 | ||
|
|
0ec0162857 | ||
|
|
f00099e29f | ||
|
|
0bbc92e46d | ||
|
|
4c3186f4a1 | ||
|
|
6722c43868 | ||
|
|
e4391b9cce | ||
|
|
70887c8d58 | ||
|
|
66840c2c16 | ||
|
|
34b417c60b | ||
|
|
b96abf5af6 | ||
|
|
433747ff99 | ||
|
|
614b13cd13 | ||
|
|
d7f0a6f065 | ||
|
|
160b6e3faf | ||
|
|
7a82d04f70 | ||
|
|
104c927e74 | ||
|
|
2d795063dd | ||
|
|
e0ed7e80df | ||
|
|
c880ee5940 | ||
|
|
88f61e6be2 | ||
|
|
0777418c63 | ||
|
|
3ddd2603f8 | ||
|
|
1a4a0fe647 | ||
|
|
0c090d08f2 | ||
|
|
c37b15a3d0 | ||
|
|
0eb0f9d99c | ||
|
|
620fd06d87 | ||
|
|
944267af35 | ||
|
|
f40095bd46 | ||
|
|
4781f552e2 | ||
|
|
8eb11e7865 | ||
|
|
523653e755 | ||
|
|
84dea5ace9 | ||
|
|
07912a9f8c | ||
|
|
bd72a48ecb | ||
|
|
4377da3aff | ||
|
|
140fda72e6 | ||
|
|
521bc94749 | ||
|
|
78850c6d03 | ||
|
|
32b85c1b28 | ||
|
|
ea65acf6ed | ||
|
|
f09e9f081d | ||
|
|
78eaa50af1 | ||
|
|
d9e8c89711 | ||
|
|
3b34ac8dba | ||
|
|
b93d913948 | ||
|
|
7d2bcd2828 | ||
|
|
76d798044e | ||
|
|
382d51e18c | ||
|
|
a316053a4f | ||
|
|
634058a832 | ||
|
|
4c2ba4a9c9 | ||
|
|
e244be79b1 | ||
|
|
6615224f93 | ||
|
|
555d77f9d0 | ||
|
|
c15d5ba838 | ||
|
|
5fce56f5e6 | ||
|
|
9a5b906d10 | ||
|
|
4d45708d11 | ||
|
|
1f39911996 | ||
|
|
d3154a0cde | ||
|
|
a5e4471e1f | ||
|
|
c00c81f23b | ||
|
|
061988edea | ||
|
|
7d453caff6 | ||
|
|
c231b0bc66 | ||
|
|
d83fd7490a | ||
|
|
1d7b27e5e3 | ||
|
|
1f083d2490 | ||
|
|
e7227612ea | ||
|
|
e304c99316 | ||
|
|
6c4c73c79e | ||
|
|
ba9457df30 | ||
|
|
5027e6bbde | ||
|
|
13060902a0 | ||
|
|
6c726c7211 | ||
|
|
1b6f13738a | ||
|
|
4455aa2f6d | ||
|
|
345de4a5c3 | ||
|
|
944953957e | ||
|
|
8775daf05f | ||
|
|
7e7e6c1b45 | ||
|
|
8ac7f8242a | ||
|
|
a1a5f23fc9 | ||
|
|
c5871a0d2f | ||
|
|
7bae678b01 | ||
|
|
4444a0f69c | ||
|
|
4360870e5f | ||
|
|
5f56de3c5d | ||
|
|
ace1efdb51 | ||
|
|
831a3044df | ||
|
|
e93e9a0a8a | ||
|
|
1aa70f504a | ||
|
|
2325bc601c | ||
|
|
4f68617ea6 | ||
|
|
6d8ebbb369 | ||
|
|
d9d93eb921 | ||
|
|
74b79a6231 | ||
|
|
1e5d035fd9 | ||
|
|
93f5a49260 | ||
|
|
a8d7758c83 | ||
|
|
cf71a29b67 | ||
|
|
a9eb3872e4 | ||
|
|
8e7b136c4b | ||
|
|
13197c19a4 | ||
|
|
66b052741b | ||
|
|
b020507894 | ||
|
|
050932287f | ||
|
|
eff18d4808 | ||
|
|
0bfc818173 | ||
|
|
acc6f28e27 | ||
|
|
8f786c2337 | ||
|
|
15db145c2d | ||
|
|
2f6ebb265a | ||
|
|
cd5fb77c59 | ||
|
|
ad21f56e1f | ||
|
|
4795331a8b | ||
|
|
cd44f8e218 | ||
|
|
2a3d2cb725 | ||
|
|
aa447b1d3f | ||
|
|
78903516ed | ||
|
|
6bfc2da7e7 | ||
|
|
4930e191dc | ||
|
|
ae7d4f7d22 | ||
|
|
927e74d42c | ||
|
|
3bd3e1204f | ||
|
|
f54bfdc5d6 | ||
|
|
10cb69326a | ||
|
|
e7d453409b | ||
|
|
958c8deb86 | ||
|
|
eca32b85a2 | ||
|
|
de40f28b18 | ||
|
|
909c01b734 | ||
|
|
9cfe1c2509 | ||
|
|
c2195b97ac | ||
|
|
8c817acf2a | ||
|
|
0dfed10e90 | ||
|
|
280eb700a6 | ||
|
|
a9d8445603 | ||
|
|
ce77468604 | ||
|
|
fa321a7a1d | ||
|
|
7b689a7de6 | ||
|
|
3df60efa85 | ||
|
|
acabecbb61 | ||
|
|
f0966a0296 | ||
|
|
b02ef75216 | ||
|
|
2a0ac9d196 | ||
|
|
1fa3e39b4b | ||
|
|
ae9647a060 | ||
|
|
3964086aae | ||
|
|
3e564eefac | ||
|
|
3cbecfb8ce | ||
|
|
1cdcf58d2a | ||
|
|
6df5b9168b | ||
|
|
f28519bbbf | ||
|
|
1021d39c15 | ||
|
|
54c4e78470 | ||
|
|
4edc483209 | ||
|
|
2ff5f9331f | ||
|
|
bcfb906879 | ||
|
|
883a6c38e7 | ||
|
|
8cc49b3bee | ||
|
|
100575e6a8 | ||
|
|
0c4b3784e0 | ||
|
|
37dca8c6fc | ||
|
|
aeb3b620ed | ||
|
|
33f7ca1681 | ||
|
|
9874b4af3f | ||
|
|
ea36eb2e82 | ||
|
|
2a4231658f | ||
|
|
8e4d673139 | ||
|
|
d34db8ebf5 | ||
|
|
357b5c1f43 | ||
|
|
2b60f5a217 | ||
|
|
bd2ccad027 | ||
|
|
e5d1bbd245 | ||
|
|
a27a67f82a | ||
|
|
0edb97930e | ||
|
|
29438227a7 | ||
|
|
6efd55eff3 | ||
|
|
47ad526e75 | ||
|
|
bb31b2abfc | ||
|
|
698aad1eb1 | ||
|
|
9408f234fa | ||
|
|
1f215d316c | ||
|
|
c25e1b5981 | ||
|
|
58b90f1d9c | ||
|
|
4756215435 | ||
|
|
1b37a6ab95 | ||
|
|
137d6a674c | ||
|
|
48453911ca | ||
|
|
77efa95856 | ||
|
|
b081dc43de | ||
|
|
e03fc31ba2 | ||
|
|
3e43510b5c | ||
|
|
4a4f529600 | ||
|
|
4a2e1cc26d | ||
|
|
68aef7f31c | ||
|
|
f32665adf2 | ||
|
|
12f27298b7 | ||
|
|
1f2d2863b4 | ||
|
|
4420290011 | ||
|
|
f4bcf38f72 | ||
|
|
6e0f595d8a | ||
|
|
3bc77548b6 | ||
|
|
d759f836ce | ||
|
|
29a0d421fc | ||
|
|
60b8ea0021 | ||
|
|
368ebf5129 | ||
|
|
d1ad8f7998 | ||
|
|
f7f42b0d56 | ||
|
|
c1934735f1 | ||
|
|
3eab8e495f | ||
|
|
3820efa0b4 | ||
|
|
b176297a30 | ||
|
|
4dcf4283a5 | ||
|
|
135fa82ee1 | ||
|
|
518bd57bcb | ||
|
|
e5c8ca496b | ||
|
|
eacf7444c0 | ||
|
|
e06fbef9f0 | ||
|
|
7848a2eacc | ||
|
|
95b4c9dab0 | ||
|
|
e9ae6171b5 | ||
|
|
2677a402fc | ||
|
|
8ca9fd5640 | ||
|
|
2143052cac | ||
|
|
5b3bb19a84 | ||
|
|
a3265c0370 | ||
|
|
65199c6487 | ||
|
|
83477a7150 | ||
|
|
7a19870f54 | ||
|
|
63e6043e0a | ||
|
|
23d9cc2a55 | ||
|
|
016f93ec2c | ||
|
|
266732b9b0 | ||
|
|
06c901897b | ||
|
|
569fa010b7 | ||
|
|
0a432e16c4 | ||
|
|
4f3e35f110 | ||
|
|
a5c5b7ac39 | ||
|
|
7dd7c005f6 | ||
|
|
e94f62d511 | ||
|
|
e30f782bb1 | ||
|
|
fae0a0dd7e | ||
|
|
daaf2305e7 | ||
|
|
9734c5187c | ||
|
|
3d1befff66 | ||
|
|
5c77ddcf00 | ||
|
|
12f5f83fce | ||
|
|
a9816b929f | ||
|
|
b25f1f356b | ||
|
|
4e0df86bf1 | ||
|
|
525e93445e | ||
|
|
843e6b8e29 | ||
|
|
4c18310404 | ||
|
|
b6b5523822 | ||
|
|
5e3a7f82cd | ||
|
|
8818e68e75 | ||
|
|
cee4111854 | ||
|
|
dc8207ba41 | ||
|
|
375d73dd1f | ||
|
|
f9f24ac560 | ||
|
|
26999afa35 | ||
|
|
2419a6f8db | ||
|
|
8915c4408d | ||
|
|
f22d54b94a | ||
|
|
8813a99a7a | ||
|
|
5c46e663a3 | ||
|
|
74f4acedb7 | ||
|
|
c87eb001c9 | ||
|
|
a7a0d57830 | ||
|
|
194f9412b1 | ||
|
|
1b62580dce | ||
|
|
32bb02f443 | ||
|
|
9d666573c0 | ||
|
|
ba2b03b2dc | ||
|
|
bc63b300cd | ||
|
|
3a5a8ba6ca | ||
|
|
64652c4656 | ||
|
|
93c06cf715 | ||
|
|
9478982cf0 | ||
|
|
5bcbecf5bb | ||
|
|
5191a3b7f2 | ||
|
|
b2766640ef | ||
|
|
667e3a4f7c | ||
|
|
b373e74560 | ||
|
|
6bcee5cbed | ||
|
|
d5469ae918 | ||
|
|
2280def838 | ||
|
|
2857dcaef2 | ||
|
|
d463a945f7 | ||
|
|
db83d01929 | ||
|
|
c8510d007e | ||
|
|
c4324e25e6 | ||
|
|
da7e2a010a | ||
|
|
b4852c75cd | ||
|
|
35c0dde143 | ||
|
|
175a354c4f | ||
|
|
69780561f9 | ||
|
|
38e82e262a | ||
|
|
12fe3fa05c | ||
|
|
e96810ef0c | ||
|
|
36a616d575 | ||
|
|
ce913c10e0 | ||
|
|
cb8ab4b052 | ||
|
|
ef7762d758 | ||
|
|
2883aeb870 | ||
|
|
e102d90486 | ||
|
|
0718d2abe6 | ||
|
|
d53802e0bc | ||
|
|
e546326539 | ||
|
|
6c60044bcb | ||
|
|
5ac7edf489 | ||
|
|
583d5be908 | ||
|
|
8f356b65a2 | ||
|
|
0b79844c12 | ||
|
|
4c0fa9a6fe | ||
|
|
cb409c75b8 | ||
|
|
0b791de55f | ||
|
|
259ddccb04 | ||
|
|
bb1d55b944 | ||
|
|
be112dd6cc | ||
|
|
d45514a104 | ||
|
|
e1f524e832 | ||
|
|
6b39ee756f | ||
|
|
8eaf118118 | ||
|
|
1d51a4fb21 | ||
|
|
2ac233d40b | ||
|
|
13c3ea0ee0 | ||
|
|
8aa76d2176 | ||
|
|
03e7dcd2b7 | ||
|
|
5033905cd1 | ||
|
|
e3779e2c81 | ||
|
|
547c3b939a | ||
|
|
06ca635327 | ||
|
|
8da3c5aa02 | ||
|
|
e3a4b93205 | ||
|
|
aa7197c53a | ||
|
|
87b710ef58 | ||
|
|
833dfcc6e2 | ||
|
|
ceb5598041 | ||
|
|
6087afa546 | ||
|
|
80870e97ad | ||
|
|
a1bf4c7b6c | ||
|
|
d82c7bc5a5 | ||
|
|
a266f4ccc2 | ||
|
|
123b51a321 | ||
|
|
568b781177 | ||
|
|
9c894020c9 | ||
|
|
0c9f0314c7 | ||
|
|
1641c178b9 |
3
.github/pull_request_template.md
vendored
3
.github/pull_request_template.md
vendored
@@ -13,8 +13,7 @@ If no, just write "NONE".
|
||||
If don't know, write "UNKNOWN", and let the reviewer decide.
|
||||
|
||||
If yes, write the release branches name in the below format and submit the related cherry-pick PR:
|
||||
- release/3.7
|
||||
- release/3.6
|
||||
- release/3.11
|
||||
|
||||
Take a look at "https://www.cloudpods.org/en/docs/contribute/contrib/" to learn how to submit a cherry-pick PR.
|
||||
-->
|
||||
|
||||
13
Makefile
13
Makefile
@@ -47,11 +47,6 @@ PKGS := go list ./...
|
||||
CGO_CFLAGS_ENV = $(shell go env CGO_CFLAGS)
|
||||
CGO_LDFLAGS_ENV = $(shell go env CGO_LDFLAGS)
|
||||
|
||||
ifdef LIBQEMUIO_PATH
|
||||
X_CGO_CFLAGS := ${CGO_CFLAGS_ENV} -I${LIBQEMUIO_PATH}/src -I${LIBQEMUIO_PATH}/src/include
|
||||
X_CGO_LDFLAGS := ${CGO_LDFLAGS_ENV} -laio -lqemuio -lpthread -lgnutls -lnettle -L ${LIBQEMUIO_PATH}/src
|
||||
endif
|
||||
|
||||
export GOOS ?= linux
|
||||
export GO111MODULE:=on
|
||||
export CGO_CFLAGS = ${X_CGO_CFLAGS}
|
||||
@@ -63,7 +58,7 @@ ifeq ($(UNAME), Linux)
|
||||
XARGS_FLAGS = --no-run-if-empty
|
||||
endif
|
||||
|
||||
cmdTargets:=$(filter-out cmd/host-image,$(wildcard cmd/*))
|
||||
cmdTargets:=$(wildcard cmd/*)
|
||||
rpmTargets:=$(foreach b,$(patsubst cmd/%,%,$(cmdTargets)),$(if $(shell [ -f "$(CURDIR)/build/$(b)/vars" ] && echo 1),rpm/$(b)))
|
||||
debTargets:=$(foreach b,$(patsubst cmd/%,%,$(cmdTargets)),$(if $(shell [ -f "$(CURDIR)/build/$(b)/vars" ] && echo 1),deb/$(b)))
|
||||
|
||||
@@ -282,12 +277,12 @@ dep:
|
||||
@echo "$$depDeprecated"
|
||||
@$(MAKE) mod
|
||||
|
||||
RELEASE_BRANCH:=release/3.11
|
||||
RELEASE_BRANCH:=release/3.11.12
|
||||
GOPROXY ?= direct
|
||||
|
||||
mod:
|
||||
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get -d yunion.io/x/cloudmux@$(RELEASE_BRANCH)
|
||||
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get -d $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p' | grep -v '/cloudmux$$'))
|
||||
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get yunion.io/x/cloudmux@$(RELEASE_BRANCH)
|
||||
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p' | grep -v '/cloudmux$$'))
|
||||
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go mod tidy
|
||||
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go mod vendor -v
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:v1.1.1
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:v1.1.3
|
||||
|
||||
# install playbook and telegraf install pkg
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/playbook /opt/yunion/playbook
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.4 /opt/yunion/playbook /opt/yunion/playbook
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.4 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
|
||||
|
||||
ADD ./_output/alpine-build/bin/ansibleserver /opt/yunion/bin/ansibleserver
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.3.5
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v3.15.4-0
|
||||
|
||||
MAINTAINER "Yousong Zhou <zhouyousong@yunionyun.com>"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.4.0 as file-repo
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.0 AS file-repo
|
||||
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.2
|
||||
|
||||
MAINTAINER "Rain Zheng <zhengyu@yunion.com>"
|
||||
LABEL maintainer="Rain Zheng <zhengyu@yunion.com>"
|
||||
|
||||
# openssh-client, for ansible ssh connection
|
||||
# git, ca-certificates, for fetching ansible roles
|
||||
@@ -12,15 +12,12 @@ RUN set -x \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# install default playbook and install pkg
|
||||
Run mkdir -p /opt/yunion/ansible-install-pkg
|
||||
RUN mkdir -p /opt/yunion/ansible-install-pkg
|
||||
# file repo base image from https://github.com/yunionio/telegraf/blob/612b918a28a93cf8e354b8d59544753b021b824a/Makefile.yn#L24
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf*.rpm /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf*.deb /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf*.zip /opt/yunion/ansible-install-pkg
|
||||
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf-0.x86_64.rpm /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf-0.aarch64.rpm /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf_1.19.2-yn~be742cbf-0_arm64.deb /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf_1.19.2-yn~be742cbf-0_amd64.deb /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf_windows_amd64.zip /opt/yunion/ansible-install-pkg
|
||||
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf_windows_i386.zip /opt/yunion/ansible-install-pkg
|
||||
|
||||
Run mkdir -p /opt/yunion/playbook
|
||||
Run mkdir /opt/yunion/playbook/monitor-agent
|
||||
Run git clone https://github.com/yunionio/monitor-agent.git /opt/yunion/playbook/monitor-agent --recurse-submodules
|
||||
RUN mkdir -p /opt/yunion/playbook
|
||||
RUN mkdir /opt/yunion/playbook/monitor-agent
|
||||
RUN git clone https://github.com/yunionio/monitor-agent.git /opt/yunion/playbook/monitor-agent --recurse-submodules
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.5.0
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.7.0
|
||||
|
||||
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.4.8
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.4.11
|
||||
|
||||
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.3.5-1
|
||||
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
|
||||
ENV TZ UTC
|
||||
|
||||
ADD ./_output/bin/host-image /opt/yunion/bin/host-image
|
||||
ADD ./_output/bin/.host-image.bin /opt/yunion/bin/.host-image.bin
|
||||
ADD ./_output/bin/bundles/host-image /opt/yunion/bin/bundles/host-image
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
ADD ./_output/alpine-build/bin/host-image /opt/yunion/bin/host-image
|
||||
|
||||
@@ -15,7 +15,7 @@ onecloud-base:
|
||||
onecloud-base-3-15-4:
|
||||
$(DOCKER_BUILDX)/onecloud-base:$(ONECLOUD_BASE_VERSION_3-15-4) -f ./Dockerfile.onecloud-base-3-15-4 .
|
||||
|
||||
ANSIBLESERVER_BASE = v1.1.2
|
||||
ANSIBLESERVER_BASE = v1.1.3
|
||||
|
||||
ansibleserver-base:
|
||||
$(DOCKER_BUILDX)/ansibleserver-base:$(ANSIBLESERVER_BASE) -f ./Dockerfile.ansibleserver-base .
|
||||
@@ -44,10 +44,10 @@ GLANCE_BASE_VERSION = v0.0.1
|
||||
glance-base:
|
||||
$(DOCKER_BUILDX)/glance-base:$(GLANCE_BASE_VERSION) -f ./Dockerfile.glance-base .
|
||||
|
||||
FILE_REPO_VERSION = v0.5.2
|
||||
FILE_REPO_VERSION = v0.5.4
|
||||
|
||||
file-repo:
|
||||
$(DOCKER_BUILDX)/file-repo:$(FILE_REPO_VERSION) -f ./Dockerfile.file-repo .
|
||||
$(DOCKER_BUILDX)/file-repo:$(FILE_REPO_VERSION) -f ./Dockerfile.file-repo . --no-cache
|
||||
|
||||
HOST_IMAGE_VERSION ?= v1.0.2
|
||||
HOST_IMAGE_NAME = $(REGISTRY)/host-image:$(HOST_IMAGE_VERSION)
|
||||
|
||||
@@ -7,11 +7,11 @@ COPY . /root/go/src/yunion.io/x/onecloud
|
||||
WORKDIR /root/go/src/yunion.io/x/onecloud
|
||||
RUN make cmd/host
|
||||
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.4.0
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.7.0
|
||||
|
||||
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
|
||||
|
||||
ENV TZ Asia/Shanghai
|
||||
ENV TZ UTC
|
||||
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
COPY --from=build /root/go/src/yunion.io/x/onecloud/_output/bin/host /opt/yunion/bin/host
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
}
|
||||
</style>
|
||||
{{$match_tags_str := .match_tags_str}}
|
||||
<body>
|
||||
<h3 class="title">报警提醒</h3>
|
||||
<table border="0" cellspacing="0" cellpadding="0" class="table">
|
||||
@@ -108,7 +109,11 @@
|
||||
<td>名称</td>
|
||||
<td>IP</td>
|
||||
<td>平台</td>
|
||||
<td>指标</td>
|
||||
<td>触发值</td>
|
||||
{{if gt (len $match_tags_str) 1}}
|
||||
<td>标签</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -124,7 +129,11 @@
|
||||
<td>
|
||||
{{ index .tags "brand" }}
|
||||
</td>
|
||||
<td>{{$Matche.value_str}}</td>
|
||||
<td>{{ $Matche.metric }}</td>
|
||||
<td>{{ $Matche.value_str }}</td>
|
||||
{{if gt (len $match_tags_str) 1}}
|
||||
<td>{{ index $match_tags_str $i }}</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
}
|
||||
</style>
|
||||
{{$match_tags_str := .match_tags_str}}
|
||||
<body>
|
||||
<h3 class="title">Alert</h3>
|
||||
<table border="0" cellspacing="0" cellpadding="0" class="table">
|
||||
@@ -108,7 +109,11 @@
|
||||
<td>Name</td>
|
||||
<td>IP</td>
|
||||
<td>Brand</td>
|
||||
<td>Metric</td>
|
||||
<td>Trigger value</td>
|
||||
{{if gt (len $match_tags_str) 1}}
|
||||
<td>Tags</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -124,7 +129,11 @@
|
||||
<td>
|
||||
{{ index .tags "brand" }}
|
||||
</td>
|
||||
<td>{{$Matche.value_str}}</td>
|
||||
<td>{{ $Matche.metric }}</td>
|
||||
<td>{{ $Matche.value_str }}</td>
|
||||
{{if gt (len $match_tags_str) 1}}
|
||||
<td>{{ index $match_tags_str $i }}</td>
|
||||
{{end}}
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
|
||||
@@ -70,7 +70,7 @@ type BaseOptions struct {
|
||||
|
||||
OsRegionName string `default:"$OS_REGION_NAME" help:"Defaults to env[OS_REGION_NAME]"`
|
||||
OsZoneName string `default:"$OS_ZONE_NAME" help:"Defaults to env[OS_ZONE_NAME]"`
|
||||
OsEndpointType string `default:"$OS_ENDPOINT_TYPE|internalURL" help:"Defaults to env[OS_ENDPOINT_TYPE] or internalURL" choices:"publicURL|internalURL|adminURL"`
|
||||
OsEndpointType string `default:"$OS_ENDPOINT_TYPE|internalURL" help:"Defaults to env[OS_ENDPOINT_TYPE] or internalURL" choices:"publicURL|internalURL|adminURL|apigateway"`
|
||||
// ApiVersion string `default:"$API_VERSION" help:"override default modules service api version"`
|
||||
OutputFormat string `default:"$CLIMC_OUTPUT_FORMAT|table" choices:"table|kv|json|yaml|flatten-table|flatten-kv" help:"output format"`
|
||||
|
||||
@@ -335,7 +335,6 @@ func ClimcMain() {
|
||||
}
|
||||
|
||||
if parser.IsHelpSet() {
|
||||
fmt.Print(parser.HelpString())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -41,48 +41,12 @@ import (
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Disks)
|
||||
cmd.List(&compute_options.DiskListOptions{})
|
||||
cmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.Perform("rebuild", &options.ResourceIdOptions{})
|
||||
cmd.Perform("migrate", &compute_options.DiskMigrateOptions{})
|
||||
|
||||
type DiskListOptions struct {
|
||||
options.BaseListOptions
|
||||
Unused *bool `help:"Show unused disks"`
|
||||
Share *bool `help:"Show Share storage disks"`
|
||||
Local *bool `help:"Show Local storage disks"`
|
||||
Guest string `help:"Guest ID or name"`
|
||||
GuestStatus string `help:"Guest Status"`
|
||||
OrderByServer string `help:"Order By Server"`
|
||||
Storage string `help:"Storage ID or name"`
|
||||
Type string `help:"Disk type" choices:"sys|data|swap|volume"`
|
||||
CloudType string `help:"Public cloud or private cloud" choices:"Public|Private"`
|
||||
|
||||
OrderByGuestCount string `help:"Order By Guest Count"`
|
||||
|
||||
BillingType string `help:"billing type" choices:"postpaid|prepaid"`
|
||||
|
||||
SnapshotpolicyId string `help:"snapshotpolicy id"`
|
||||
}
|
||||
R(&DiskListOptions{}, "disk-list", "List virtual disks", func(s *mcclient.ClientSession, opts *DiskListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(opts.CloudType) > 0 {
|
||||
if opts.CloudType == "Public" {
|
||||
params.Add(jsonutils.JSONTrue, "public_cloud")
|
||||
} else if opts.CloudType == "Private" {
|
||||
params.Add(jsonutils.JSONTrue, "private_cloud")
|
||||
}
|
||||
}
|
||||
|
||||
result, err := modules.Disks.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Disks.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
cmd.Perform("change-billing-type", new(compute_options.DiskChangeBillingTypeOptions))
|
||||
cmd.Perform("change-storage-type", &compute_options.DiskChangeStorageTypeOptions{})
|
||||
|
||||
type DiskDetailOptions struct {
|
||||
ID string `help:"ID or Name of disk"`
|
||||
@@ -176,6 +140,7 @@ func init() {
|
||||
AutoSnapshot string `help:"enable/disable auto snapshot of disk" choices:"enable|disable"`
|
||||
DiskType string `help:"Disk type" choices:"data|volume|sys"`
|
||||
IsSsd *bool `help:"mark disk as ssd" negative:"no-is-ssd"`
|
||||
AutoReset *bool `help:"Enable auto reset disk after geust shutdown"`
|
||||
}
|
||||
R(&DiskUpdateOptions{}, "disk-update", "Update property of a virtual disk", func(s *mcclient.ClientSession, args *DiskUpdateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -209,6 +174,10 @@ func init() {
|
||||
params.Add(jsonutils.JSONFalse, "is_ssd")
|
||||
}
|
||||
}
|
||||
if args.AutoReset != nil {
|
||||
params.Add(jsonutils.NewBool(*args.AutoReset), "auto_reset")
|
||||
}
|
||||
|
||||
if params.Size() == 0 {
|
||||
return InvalidUpdateError()
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import (
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Hosts)
|
||||
cmd.List(&compute.HostListOptions{})
|
||||
cmd.Show(&options.BaseShowOptions{})
|
||||
cmd.GetMetadata(&options.BaseIdOptions{})
|
||||
cmd.GetProperty(&compute.HostStatusStatisticsOptions{})
|
||||
|
||||
@@ -55,6 +54,7 @@ func init() {
|
||||
cmd.Perform("class-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.PerformClass("validate-ipmi", &compute.HostValidateIPMI{})
|
||||
cmd.Perform("set-commit-bound", &compute.HostSetCommitBoundOptions{})
|
||||
|
||||
cmd.BatchPerform("enable", &options.BaseIdsOptions{})
|
||||
cmd.BatchPerform("disable", &options.BaseIdsOptions{})
|
||||
@@ -70,6 +70,10 @@ func init() {
|
||||
cmd.Get("ipmi", &options.BaseIdOptions{})
|
||||
cmd.Get("vnc", &options.BaseIdOptions{})
|
||||
cmd.Get("app-options", &options.BaseIdOptions{})
|
||||
cmd.GetWithCustomShow("worker-stats", func(data jsonutils.JSONObject) {
|
||||
stats, _ := data.GetArray("workers")
|
||||
printList(&printutils.ListResult{Data: stats}, nil)
|
||||
}, &options.BaseIdOptions{})
|
||||
cmd.Get("tap-config", &options.BaseIdOptions{})
|
||||
cmd.GetWithCustomShow("nics", func(data jsonutils.JSONObject) {
|
||||
results := printutils.ListResult{}
|
||||
@@ -89,6 +93,34 @@ func init() {
|
||||
}
|
||||
}, &options.BaseIdOptions{})
|
||||
|
||||
R(&compute.HostShowOptions{}, "host-show", "Show details of a host", func(s *mcclient.ClientSession, args *compute.HostShowOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Hosts.Get(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
resultDict := result.(*jsonutils.JSONDict)
|
||||
if !args.ShowAll {
|
||||
if !args.ShowMetadata {
|
||||
print("ShowMetadata\n")
|
||||
resultDict.Remove("metadata")
|
||||
}
|
||||
if !args.ShowNicInfo {
|
||||
print("ShowMetadata\n")
|
||||
resultDict.Remove("nic_info")
|
||||
}
|
||||
if !args.ShowSysInfo {
|
||||
print("ShowSysInfo\n")
|
||||
resultDict.Remove("sys_info")
|
||||
}
|
||||
}
|
||||
printObject(resultDict)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.BaseIdOptions{}, "host-logininfo", "Get SSH login information of a host", func(s *mcclient.ClientSession, args *options.BaseIdOptions) error {
|
||||
i, e := modules.Hosts.PerformAction(s, args.ID, "login-info", nil)
|
||||
if e != nil {
|
||||
@@ -174,14 +206,12 @@ func init() {
|
||||
})
|
||||
|
||||
type HostUpdateOptions struct {
|
||||
ID string `help:"ID or Name of Host"`
|
||||
Name string `help:"New name of the host"`
|
||||
Desc string `help:"New Description of the host"`
|
||||
CpuCommitBound float64 `help:"CPU overcommit upper bound at this host"`
|
||||
MemoryCommitBound float64 `help:"Memory overcommit upper bound at this host"`
|
||||
MemoryReserved string `help:"Memory reserved"`
|
||||
CpuReserved int64 `help:"CPU reserved"`
|
||||
HostType string `help:"Change host type, CAUTION!!!!" choices:"hypervisor|kubelet|esxi|baremetal"`
|
||||
ID string `help:"ID or Name of Host"`
|
||||
Name string `help:"New name of the host"`
|
||||
Desc string `help:"New Description of the host"`
|
||||
MemoryReserved string `help:"Memory reserved"`
|
||||
CpuReserved int64 `help:"CPU reserved"`
|
||||
HostType string `help:"Change host type, CAUTION!!!!" choices:"hypervisor|kubelet|esxi|baremetal"`
|
||||
// AccessIp string `help:"Change access ip, CAUTION!!!!"`
|
||||
AccessMac string `help:"Change baremetal access MAC, CAUTION!!!!"`
|
||||
Uuid string `help:"Change baremetal UUID, CAUTION!!!!"`
|
||||
@@ -203,12 +233,6 @@ func init() {
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if args.CpuCommitBound > 0.0 {
|
||||
params.Add(jsonutils.NewFloat64(args.CpuCommitBound), "cpu_cmtbound")
|
||||
}
|
||||
if args.MemoryCommitBound > 0.0 {
|
||||
params.Add(jsonutils.NewFloat64(args.MemoryCommitBound), "mem_cmtbound")
|
||||
}
|
||||
if len(args.MemoryReserved) > 0 {
|
||||
params.Add(jsonutils.NewString(args.MemoryReserved), "mem_reserved")
|
||||
}
|
||||
|
||||
@@ -59,6 +59,17 @@ func init() {
|
||||
printBatchResults(ret, modules.InstanceSnapshots.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
type InstanceSnapshotPurgeOptions struct {
|
||||
ID string `help:"Delete snapshot id"`
|
||||
}
|
||||
R(&InstanceSnapshotPurgeOptions{}, "instance-snapshot-purge", "Purge snapshots", func(s *mcclient.ClientSession, args *InstanceSnapshotPurgeOptions) error {
|
||||
result, err := modules.InstanceSnapshots.PerformAction(s, args.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type InstanceSnapshotShowOptions struct {
|
||||
ID string `help:"ID or Name of snapshot"`
|
||||
|
||||
@@ -15,90 +15,16 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type DeviceListOptions struct {
|
||||
options.BaseListOptions
|
||||
Unused bool `help:"Only show unused devices"`
|
||||
Gpu bool `help:"Only show gpu devices"`
|
||||
Host string `help:"Host ID or Name"`
|
||||
Region string `help:"Cloudregion ID or Name"`
|
||||
Zone string `help:"Zone ID or Name"`
|
||||
Server string `help:"Server ID or Name"`
|
||||
}
|
||||
R(&DeviceListOptions{}, "isolated-device-list", "List isolated devices like GPU", func(s *mcclient.ClientSession, args *DeviceListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
if len(args.Host) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Host), "host")
|
||||
}
|
||||
if args.Unused {
|
||||
params.Add(jsonutils.JSONTrue, "unused")
|
||||
}
|
||||
if args.Gpu {
|
||||
params.Add(jsonutils.JSONTrue, "gpu")
|
||||
}
|
||||
if len(args.Region) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Region), "region")
|
||||
}
|
||||
if args.Zone != "" {
|
||||
params.Add(jsonutils.NewString(args.Zone), "zone")
|
||||
}
|
||||
if args.Server != "" {
|
||||
params.Add(jsonutils.NewString(args.Server), "guest_id")
|
||||
}
|
||||
result, err := modules.IsolatedDevices.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.IsolatedDevices.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type DeviceShowOptions struct {
|
||||
ID string `help:"ID of the isolated device"`
|
||||
}
|
||||
R(&DeviceShowOptions{}, "isolated-device-show", "Show isolated device details", func(s *mcclient.ClientSession, args *DeviceShowOptions) error {
|
||||
result, err := modules.IsolatedDevices.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DeviceDeleteOptions struct {
|
||||
IDS []string `help:"IDs of the isolated device"`
|
||||
}
|
||||
R(&DeviceDeleteOptions{}, "isolated-device-delete", "Delete a isolated device", func(s *mcclient.ClientSession, args *DeviceDeleteOptions) error {
|
||||
result := modules.IsolatedDevices.BatchDelete(s, args.IDS, nil)
|
||||
printBatchResults(result, modules.IsolatedDevices.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type DeviceUpdateOptions struct {
|
||||
ID []string `help:"ID of the isolated device" json:"-"`
|
||||
ReservedCpu *int `help:"reserved cpu for isolated device"`
|
||||
ReservedMem *int `help:"reserved mem for isolated device"`
|
||||
ReservedStorage *int `help:"reserved storage for isolated device"`
|
||||
DevType string `help:"Device type" choices:"GPU-HPC|GPU-VGA"`
|
||||
}
|
||||
R(&DeviceUpdateOptions{}, "isolated-device-update", "Update a isolated device", func(s *mcclient.ClientSession, args *DeviceUpdateOptions) error {
|
||||
res := modules.IsolatedDevices.BatchUpdate(s, args.ID, jsonutils.Marshal(args))
|
||||
printBatchResults(res, modules.IsolatedDevices.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
cmd := shell.NewResourceCmd(&modules.IsolatedDevices)
|
||||
cmd.List(&compute.DeviceListOptions{})
|
||||
cmd.Update(&compute.DeviceUpdateOptions{})
|
||||
cmd.Show(&compute.DeviceShowOptions{})
|
||||
cmd.BatchDelete(&compute.DeviceDeleteOptions{})
|
||||
cmd.BatchPerform("purge", &compute.DevicePurgeOptions{})
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ func init() {
|
||||
type ServerDiskUpdateOptions struct {
|
||||
SERVER string `help:"ID or Name of server"`
|
||||
DISK string `help:"ID or Name of Disk"`
|
||||
Driver string `help:"Driver of vDisk" choices:"virtio|ide|scsi|pvscsi"`
|
||||
Driver string `help:"Driver of vDisk" choices:"virtio|ide|sata|scsi|pvscsi"`
|
||||
Cache string `help:"Cache mode of vDisk" choices:"writethrough|none|writeback|directsync"`
|
||||
Aio string `help:"Asynchronous IO mode of vDisk" choices:"native|threads"`
|
||||
Index int64 `help:"Index of vDisk" default:"-1"`
|
||||
|
||||
@@ -155,8 +155,9 @@ func init() {
|
||||
})
|
||||
|
||||
type ServerAttachNetworkOptions struct {
|
||||
SERVER string `help:"ID or Name of server"`
|
||||
NETDESC []string `help:"Network description"`
|
||||
SERVER string `help:"ID or Name of server"`
|
||||
DisableSyncConfig bool `help:"Disable sync config"`
|
||||
NETDESC []string `help:"Network description"`
|
||||
}
|
||||
R(&ServerAttachNetworkOptions{}, "server-attach-network", "Attach a server to a virtual network", func(s *mcclient.ClientSession, args *ServerAttachNetworkOptions) error {
|
||||
input := compute.AttachNetworkInput{}
|
||||
@@ -167,6 +168,7 @@ func init() {
|
||||
}
|
||||
input.Nets = append(input.Nets, conf)
|
||||
}
|
||||
input.DisableSyncConfig = &args.DisableSyncConfig
|
||||
params := jsonutils.Marshal(input)
|
||||
srv, err := modules.Servers.PerformAction(s, args.SERVER, "attachnetwork", params)
|
||||
if err != nil {
|
||||
|
||||
@@ -51,6 +51,7 @@ func init() {
|
||||
cmd.BatchPut(new(options.ServerUpdateOptions))
|
||||
cmd.GetMetadata(new(options.ServerIdOptions))
|
||||
cmd.Perform("clone", new(options.ServerCloneOptions))
|
||||
cmd.Perform("change-billing-type", new(options.ServerChangeBillingTypeOptions))
|
||||
cmd.BatchPerform("start", new(options.ServerStartOptions))
|
||||
cmd.BatchPerform("syncstatus", new(options.ServerIdsOptions))
|
||||
cmd.BatchPerform("sync", new(options.ServerIdsOptions))
|
||||
@@ -127,7 +128,8 @@ func init() {
|
||||
cmd.BatchPerform("start-rescue", &options.ServerStartOptions{})
|
||||
cmd.BatchPerform("stop-rescue", &options.ServerStartOptions{})
|
||||
cmd.BatchPerform("sync-os-info", &options.ServerIdsOptions{})
|
||||
|
||||
cmd.BatchPerform("set-root-disk-matcher", &options.ServerSetRootDiskMatcher{})
|
||||
cmd.Perform("disable-auto-merge-snapshot", &options.ServerDisableAutoMergeSnapshot{})
|
||||
cmd.Get("vnc", new(options.ServerVncOptions))
|
||||
cmd.Get("desc", new(options.ServerIdOptions))
|
||||
cmd.Get("status", new(options.ServerIdOptions))
|
||||
@@ -141,6 +143,8 @@ func init() {
|
||||
cmd.Get("sshport", new(options.ServerIdOptions))
|
||||
cmd.Get("qemu-info", new(options.ServerIdOptions))
|
||||
cmd.Get("hardware-info", new(options.ServerIdOptions))
|
||||
cmd.Get("screen-dump-show", new(options.ServerScreenDumpOptions))
|
||||
cmd.BatchPerform("screen-dump", new(options.ServerIdsOptions))
|
||||
|
||||
cmd.GetProperty(&options.ServerStatusStatisticsOptions{})
|
||||
cmd.GetProperty(&options.ServerProjectStatisticsOptions{})
|
||||
|
||||
23
cmd/climc/shell/compute/serverscreendumps.go
Normal file
23
cmd/climc/shell/compute/serverscreendumps.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
type ServerScreenDumpListOptions struct {
|
||||
options.BaseListOptions
|
||||
Server string `help:"Id or name of server"`
|
||||
}
|
||||
|
||||
func (o *ServerScreenDumpListOptions) Params() (jsonutils.JSONObject, error) {
|
||||
return jsonutils.Marshal(o), nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.ServerScreenDumps)
|
||||
cmd.List(new(ServerScreenDumpListOptions))
|
||||
}
|
||||
@@ -28,5 +28,7 @@ func init() {
|
||||
cmd.Create(&compute.SnapshotPolicyCreateOptions{})
|
||||
cmd.Perform("bind-disks", &compute.SnapshotPolicyDisksOptions{})
|
||||
cmd.Perform("unbind-disks", &compute.SnapshotPolicyDisksOptions{})
|
||||
cmd.Perform("bind-resources", &compute.SnapshotPolicyResourcesOptions{})
|
||||
cmd.Perform("unbind-resources", &compute.SnapshotPolicyResourcesOptions{})
|
||||
cmd.Perform("syncstatus", &options.BaseIdOptions{})
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ func init() {
|
||||
Share *bool `help:"Show shared snapshots"`
|
||||
DiskType string `help:"Filter by disk type" choices:"sys|data"`
|
||||
Server string `help:"Filter by server" json:"server_id"`
|
||||
Unused bool
|
||||
StorageId string `help:"Filter by storage id"`
|
||||
|
||||
OrderByGuest string
|
||||
OrderByDiskName string
|
||||
|
||||
@@ -47,6 +47,7 @@ func init() {
|
||||
cmd.Perform("private", &options.BaseIdOptions{})
|
||||
cmd.Get("hardware-info", &options.BaseIdOptions{})
|
||||
cmd.Perform("set-hardware-info", &compute.StorageSetHardwareInfoOptions{})
|
||||
cmd.Perform("set-commit-bound", &compute.StorageSetCommitBoundOptions{})
|
||||
|
||||
type StorageCephRunOptions struct {
|
||||
ID string `help:"ID or name of ceph storage"`
|
||||
@@ -60,9 +61,10 @@ func init() {
|
||||
info := struct {
|
||||
StorageType string `json:"storage_type"`
|
||||
StorageConf struct {
|
||||
Key string `json:"key"`
|
||||
MonHost string `json:"mon_host"`
|
||||
Pool string `json:"pool"`
|
||||
Key string `json:"key"`
|
||||
MonHost string `json:"mon_host"`
|
||||
Pool string `json:"pool"`
|
||||
EnableMessengerV2 bool `json:"enable_messenger_v2"`
|
||||
}
|
||||
}{}
|
||||
err = result.Unmarshal(&info)
|
||||
@@ -76,6 +78,7 @@ func init() {
|
||||
info.StorageConf.MonHost,
|
||||
info.StorageConf.Key,
|
||||
info.StorageConf.Pool,
|
||||
info.StorageConf.EnableMessengerV2,
|
||||
)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "cephutils.NewClient")
|
||||
|
||||
@@ -33,7 +33,7 @@ import (
|
||||
type GeneralUsageOptions struct {
|
||||
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun"`
|
||||
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun"`
|
||||
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|DStack|Google|Ctyun"`
|
||||
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun"`
|
||||
Project string `help:"show usage of specified project"`
|
||||
|
||||
ProjectDomain string `help:"show usage of specified domain"`
|
||||
|
||||
@@ -211,7 +211,13 @@ func init() {
|
||||
}
|
||||
key := strings.TrimSpace(c[:pos])
|
||||
value := strings.TrimSpace(c[pos+1:])
|
||||
config.Add(jsonutils.NewString(value), "config", "default", key)
|
||||
var v jsonutils.JSONObject
|
||||
if value == "true" || value == "false" {
|
||||
v = jsonutils.NewBool(value == "true")
|
||||
} else {
|
||||
v = jsonutils.NewString(value)
|
||||
}
|
||||
config.Add(v, "config", "default", key)
|
||||
}
|
||||
nconf, err := modules.ServicesV3.PerformAction(s, args.SERVICE, "config", config)
|
||||
if err != nil {
|
||||
|
||||
@@ -47,7 +47,7 @@ type BaseActionListOptions struct {
|
||||
|
||||
type ActionListOptions struct {
|
||||
BaseActionListOptions
|
||||
Service []string `help:"service name`
|
||||
Service []string `help:"service name"`
|
||||
Id string `help:"" metavar:"OBJ_ID"`
|
||||
Type []string `help:"Type of relevant object" metavar:"OBJ_TYPE"`
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
@@ -68,6 +69,10 @@ func init() {
|
||||
return fmt.Errorf("no service address provide")
|
||||
}
|
||||
|
||||
if opts.Service == "identity" {
|
||||
svcUrl = strings.TrimSuffix(svcUrl, "/v3")
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewInt(int64(opts.Second)), "seconds")
|
||||
if pType == "heap" && opts.Gc {
|
||||
|
||||
@@ -36,9 +36,7 @@ func initAlertNotification() {
|
||||
return err
|
||||
}
|
||||
var result *printutils.ListResult
|
||||
if len(args.Alert) > 0 {
|
||||
result, err = monitor.Alertnotification.ListDescendent(s, args.Alert, params)
|
||||
} else if len(args.Notification) > 0 {
|
||||
if len(args.Notification) > 0 {
|
||||
result, err = monitor.Alertnotification.ListDescendent2(s, args.Notification, params)
|
||||
} else {
|
||||
result, err = monitor.Alertnotification.List(s, params)
|
||||
|
||||
@@ -23,5 +23,6 @@ func init() {
|
||||
cmd := NewResourceCmd(modules.AlertRecordManager)
|
||||
cmd.List(new(options.AlertRecordListOptions))
|
||||
cmd.Show(new(options.AlertRecordShowOptions))
|
||||
cmd.Get("", new(options.AlertRecordTotalOptions))
|
||||
cmd.GetProperty(new(options.AlertRecordTotalOptions))
|
||||
cmd.GetProperty(new(options.AlertRecordHistoryAlertOptions))
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/ldap.v3"
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
|
||||
"yunion.io/x/pkg/util/shellutils"
|
||||
|
||||
|
||||
27
go.mod
27
go.mod
@@ -5,9 +5,8 @@ go 1.21
|
||||
require (
|
||||
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0
|
||||
github.com/LeeEirc/terminalparser v0.0.0-20220328021224-de16b7643ea4
|
||||
github.com/LeeEirc/terminalparser v0.0.0-20240205084113-fbf78c8480f2
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.684
|
||||
github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778
|
||||
github.com/anacrolix/torrent v0.0.0-20181129073333-cc531b8c4a80
|
||||
github.com/benbjohnson/clock v1.0.0
|
||||
github.com/bitly/go-simplejson v0.5.0
|
||||
@@ -20,6 +19,7 @@ require (
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/ghodss/yaml v1.0.0
|
||||
github.com/gin-gonic/gin v1.7.7
|
||||
github.com/go-ldap/ldap/v3 v3.1.5
|
||||
github.com/go-yaml/yaml v2.1.0+incompatible
|
||||
github.com/golang-plus/uuid v1.0.0
|
||||
github.com/golang/mock v1.4.4
|
||||
@@ -30,7 +30,6 @@ require (
|
||||
github.com/gorilla/websocket v1.4.1
|
||||
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282
|
||||
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead
|
||||
github.com/hugozhu/godingtalk v1.0.6
|
||||
github.com/influxdata/influxql v1.1.0
|
||||
github.com/influxdata/promql/v2 v2.12.0
|
||||
github.com/jaypipes/ghw v0.11.0
|
||||
@@ -45,6 +44,7 @@ require (
|
||||
github.com/mholt/caddy v0.10.11
|
||||
github.com/miekg/dns v1.1.25
|
||||
github.com/minio/minio-go v6.0.14+incompatible
|
||||
github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb
|
||||
github.com/pierrec/lz4/v4 v4.1.15
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pkg/sftp v1.13.6
|
||||
@@ -66,7 +66,8 @@ require (
|
||||
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74
|
||||
github.com/vmihailenco/msgpack v4.0.4+incompatible
|
||||
github.com/xuri/excelize/v2 v2.7.1
|
||||
github.com/zexi/influxql-to-metricsql v0.0.9
|
||||
github.com/zeebo/xxh3 v1.0.2
|
||||
github.com/zexi/influxql-to-metricsql v0.1.1
|
||||
go.etcd.io/etcd/api/v3 v3.5.0
|
||||
go.etcd.io/etcd/client/v3 v3.5.0
|
||||
golang.org/x/crypto v0.19.0
|
||||
@@ -80,7 +81,6 @@ require (
|
||||
google.golang.org/grpc v1.62.0
|
||||
google.golang.org/protobuf v1.32.0
|
||||
gopkg.in/fatih/set.v0 v0.2.1
|
||||
gopkg.in/ldap.v3 v3.0.3
|
||||
gopkg.in/mail.v2 v2.3.1
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
k8s.io/api v0.19.3
|
||||
@@ -88,14 +88,14 @@ require (
|
||||
k8s.io/client-go v0.19.3
|
||||
k8s.io/cluster-bootstrap v0.19.3
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240926044403-b549642e9ab3
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251015023252-07f4567eae95
|
||||
yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0
|
||||
yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
|
||||
yunion.io/x/pkg v1.10.1-0.20240905110705-77c46e716318
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240926163039-d41512b264e1
|
||||
yunion.io/x/pkg v1.10.4-0.20250820035218-6008459eb4f0
|
||||
yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20250925091009-4ca0766fc8f0
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
|
||||
)
|
||||
|
||||
@@ -130,6 +130,7 @@ require (
|
||||
github.com/anacrolix/log v0.0.0-20180808012509-286fcf906b48 // indirect
|
||||
github.com/anacrolix/missinggo v0.0.0-20181129073415-3237bf955fed // indirect
|
||||
github.com/anacrolix/mmsg v0.0.0-20180808012353-5adb2c1127c0 // indirect
|
||||
github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778 // indirect
|
||||
github.com/anacrolix/utp v0.0.0-20180219060659-9e0e1d1d0572 // indirect
|
||||
github.com/aokoli/goutils v1.0.1 // indirect
|
||||
github.com/apache/thrift v0.13.0 // indirect
|
||||
@@ -163,6 +164,7 @@ require (
|
||||
github.com/frankban/quicktest v1.14.3 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect
|
||||
github.com/go-logfmt/logfmt v0.5.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
@@ -196,7 +198,9 @@ require (
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/ks3sdklib/aws-sdk-go v1.8.1 // indirect
|
||||
github.com/leodido/go-urn v1.2.0 // indirect
|
||||
github.com/lestrrat-go/iter v0.0.0-20200422075355-fc1769541911 // indirect
|
||||
github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d // indirect
|
||||
@@ -276,7 +280,6 @@ require (
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240304161311-37d4d3c04a78 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240228224816-df926f6c8641 // indirect
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
57
go.sum
57
go.sum
@@ -86,8 +86,8 @@ github.com/DataDog/dd-trace-go v0.6.1 h1:nsZ2lohbSw1CKtfNRu3wPh1jFirv6XSz8vqNpuI
|
||||
github.com/DataDog/dd-trace-go v0.6.1/go.mod h1:SmQTTcC37XMyEm75HV0AWiZIYxDiaNhRi49zorIpW+o=
|
||||
github.com/DataDog/zstd v1.3.4 h1:LAGHkXuvC6yky+C2CUG2tD7w8QlrUwpue8XwIh0X4AY=
|
||||
github.com/DataDog/zstd v1.3.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
||||
github.com/LeeEirc/terminalparser v0.0.0-20220328021224-de16b7643ea4 h1:Gk7m4Nu2jqVqJAJqNlTYqkiq96WkANAtB4fVi+t7Xv8=
|
||||
github.com/LeeEirc/terminalparser v0.0.0-20220328021224-de16b7643ea4/go.mod h1:tiLv6VBLH4Z3KdBSe2qIKRwQDGCVQ9/F5fOKpQGvyoA=
|
||||
github.com/LeeEirc/terminalparser v0.0.0-20240205084113-fbf78c8480f2 h1:XGB3B0651J1uKOE1KJa1gsrV/DO1kthhk2NTDUHATgs=
|
||||
github.com/LeeEirc/terminalparser v0.0.0-20240205084113-fbf78c8480f2/go.mod h1:tiLv6VBLH4Z3KdBSe2qIKRwQDGCVQ9/F5fOKpQGvyoA=
|
||||
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3 h1:gImoAO1xAcC1oDlYmD/X7dggsodGf2DFJOVE5m0ssms=
|
||||
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3/go.mod h1:u0H9gMieFLxkUy8RS0X8VbFWyPs2815qQAaitRbj6x0=
|
||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||
@@ -281,12 +281,17 @@ github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 h1:Ujru
|
||||
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
|
||||
github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493 h1:OTanQnFt0bi5iLFSdbEVA/idR6Q2WhCm+deb7ir2CcM=
|
||||
github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
|
||||
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 h1:BP4M0CvQ4S3TGls2FvczZtj5Re/2ZzkV9VwqPHH/3Bo=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
github.com/go-ldap/ldap/v3 v3.1.5 h1:5o1ik2It7MJoXwoS7JXWUebf18L7E1VWBBgYV/iVsN0=
|
||||
github.com/go-ldap/ldap/v3 v3.1.5/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
|
||||
@@ -390,7 +395,6 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
@@ -456,15 +460,12 @@ github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0
|
||||
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
|
||||
github.com/huaweicloud/huaweicloud-sdk-go v1.0.26 h1:aWTl4Ng9lZUW1DupYyqYiqkTwuTKMmqUZBKLmX0iWxo=
|
||||
github.com/huaweicloud/huaweicloud-sdk-go v1.0.26/go.mod h1:YHXxw/bm7AohI4jTY8Z43JYw+DPCDLqjxoLTqmcyja4=
|
||||
github.com/hugozhu/godingtalk v1.0.6 h1:K280OQGbYVS/UQuVWJz5cHhv/Wvfj1FHNo8lbbLGsNQ=
|
||||
github.com/hugozhu/godingtalk v1.0.6/go.mod h1:Je6PSjUH7IKCPpFq5ti2I9ak1szzSNgCIMlP0s+8pbQ=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
|
||||
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/influxdata/influxql v1.1.0 h1:sPsaumLFRPMwR5QtD3Up54HXpNND8Eu7G1vQFmi3quQ=
|
||||
github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo=
|
||||
github.com/ipandtcp/godingtalk v0.0.0-20180410032244-ca3d6ac197fb/go.mod h1:3umLciE1jBnh2LgrL15R2zbEe+HVPRZXnlSjjb/dYiw=
|
||||
github.com/jaypipes/ghw v0.11.0 h1:i0pKvAM7eZk0KvLm9vzpcpDKTRnfR6AQ5pFkPVnYJXU=
|
||||
github.com/jaypipes/ghw v0.11.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g=
|
||||
github.com/jdcloud-api/jdcloud-sdk-go v1.55.0 h1:mzVj8r6fluEwjn8ogqtGfYW2qSIVUaEq0JAsvjCav3A=
|
||||
@@ -498,6 +499,8 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALr
|
||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c h1:N7A4JCA2G+j5fuFxCsJqjFU/sZe0mj8H0sSoSwbaikw=
|
||||
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c/go.mod h1:Nn5wlyECw3iJrzi0AhIWg+AJUb4PlRQVW4/3XHH1LZA=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
@@ -514,6 +517,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/ks3sdklib/aws-sdk-go v1.8.1 h1:/3mYWujGfr4K/+mAdESbi9u3T4VDuHYMYFk1/OL0JWE=
|
||||
github.com/ks3sdklib/aws-sdk-go v1.8.1/go.mod h1:jGcsV0dJgMmStAyqjkKVUu6F167pAXYZAS3LqoZMmtM=
|
||||
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
||||
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
||||
github.com/lestrrat-go/iter v0.0.0-20200422075355-fc1769541911 h1:FvnrqecqX4zT0wOIbYK1gNgTm0677INEWiFY8UEYggY=
|
||||
@@ -618,6 +623,8 @@ github.com/openzipkin/zipkin-go-opentracing v0.3.4/go.mod h1:js2AbwmHW0YD9DwIw2J
|
||||
github.com/oracle/oci-go-sdk v24.3.0+incompatible h1:x4mcfb4agelf1O4/1/auGlZ1lr97jXRSSN5MxTgG/zU=
|
||||
github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb h1:3PrKuO92dUTMrQ9dx0YNejC6U/Si6jqKmyQ9vWjwqR4=
|
||||
github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
|
||||
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
||||
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
@@ -792,8 +799,12 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
|
||||
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
github.com/zexi/influxql-to-metricsql v0.0.9 h1:IVT4w4OvYvUJvj5c1TvH0G/ueM4ZZsfHGMoXtzC5rQE=
|
||||
github.com/zexi/influxql-to-metricsql v0.0.9/go.mod h1:JlC5FY+6De9ZPxG47G5DOgva8P9X1VaKS4ExzCmhSCc=
|
||||
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
|
||||
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
|
||||
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
|
||||
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
|
||||
github.com/zexi/influxql-to-metricsql v0.1.1 h1:dXnVzlxVLuo88zGkDca7erEnmvprGWjzsBcs8qIoQGQ=
|
||||
github.com/zexi/influxql-to-metricsql v0.1.1/go.mod h1:JlC5FY+6De9ZPxG47G5DOgva8P9X1VaKS4ExzCmhSCc=
|
||||
github.com/zexi/promql/v2 v2.12.1 h1:crHKpULdLLsBZ9b78Rg6qQkugzlk6BHeCj93tw/F5RU=
|
||||
github.com/zexi/promql/v2 v2.12.1/go.mod h1:2UtzWZGmth95n2qdIZWpJ5yQ0cE5hEvz0dGsajI1Sqg=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw=
|
||||
@@ -1108,7 +1119,6 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
@@ -1127,7 +1137,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.4/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
|
||||
@@ -1204,8 +1213,6 @@ google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
@@ -1220,8 +1227,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
|
||||
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ldap.v3 v3.0.3 h1:YKRHW/2sIl05JsCtx/5ZuUueFuJyoj/6+DGXe3wp6ro=
|
||||
gopkg.in/ldap.v3 v3.0.3/go.mod h1:oxD7NyBuxchC+SgJDE1Q5Od05eGt29SDQVBmV+HYbzw=
|
||||
gopkg.in/mail.v2 v2.3.1 h1:WYFn/oANrAGP2C0dcV6/pbkPzv8yGzqTjPmTeO7qoXk=
|
||||
gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw=
|
||||
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
||||
@@ -1274,13 +1279,13 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240926044403-b549642e9ab3 h1:Ee7IeQHhfzA6wuutvWkidNpp65dWjlLXJahapW3L0tA=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240926044403-b549642e9ab3/go.mod h1:rj/pb3DitJlQaQD8UW1oxx/KD+PzDZqoywzqRJaFE9A=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251015023252-07f4567eae95 h1:RcTzopo22fQvKnJSJSBUvlP2jEqoVVJD9EGW3IeTJ3s=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251015023252-07f4567eae95/go.mod h1:S9o/TRZsnYWGaGe7o3PpeOv6CgMY8ZJwITYsEnGfOgQ=
|
||||
yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 h1:msG4SiDSVU7CrXH06WuHlNEZXIooTcmNbfrIGHuIHBU=
|
||||
yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401 h1:4l6ELFSQ0MBVInscZ8/yOtSWF0cwH5BT1ATN6dCtAqc=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1 h1:/+THlvf/MvgCW+7KeCDCr33e81KSRa5JmdZ1IIyLOXQ=
|
||||
yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
|
||||
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 h1:inY5o3LDa/zgsIZuPN0HmpzKIsu/lLgsBmMttuDPGj4=
|
||||
@@ -1289,11 +1294,11 @@ yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 h1:Hu/4ERvoWaN6aiFs4h4/yvVB
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v1.10.1-0.20240905110705-77c46e716318 h1:Fm7I8ypXHxeObY4u/VUGz78NsambemzTZ9fECyGKNi8=
|
||||
yunion.io/x/pkg v1.10.1-0.20240905110705-77c46e716318/go.mod h1:0Bwxqd9MA3ACi119/l02FprY/o9gHahmYC2bsSbnVpM=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240926163039-d41512b264e1 h1:HWPqY1I5JSmM6Sks6FyK9hnq/MjL7FDghM6M8DXHob0=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240926163039-d41512b264e1/go.mod h1:vCIZpqhZ5Jzaq3tFyrti/vv8BijQKtkzSgNT/uH4H5A=
|
||||
yunion.io/x/pkg v1.10.4-0.20250820035218-6008459eb4f0 h1:/vHcYqzQInxqR1jjS+e7A0owRXj+/rvrIgES6uadUqs=
|
||||
yunion.io/x/pkg v1.10.4-0.20250820035218-6008459eb4f0/go.mod h1:0Bwxqd9MA3ACi119/l02FprY/o9gHahmYC2bsSbnVpM=
|
||||
yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1 h1:1KJ3YYinydPHpDEQRXdr/T8SYcKZ5Er+m489H+PnaQ4=
|
||||
yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20250925091009-4ca0766fc8f0 h1:L4zE6kTD1PEki1jQnLLBiYnEYFKWa/weoful0Sl4tKw=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20250925091009-4ca0766fc8f0/go.mod h1:vCIZpqhZ5Jzaq3tFyrti/vv8BijQKtkzSgNT/uH4H5A=
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ=
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
@@ -232,5 +232,5 @@ func taskCompleted(ctx context.Context, data jsonutils.JSONObject) {
|
||||
}
|
||||
|
||||
func InitPlaybookWorker() {
|
||||
PlaybookWorker = workmanager.NewWorkManger(taskFailed, taskCompleted, options.Options.PlaybookWorkerCount)
|
||||
PlaybookWorker = workmanager.NewWorkManger("PlaybookWorker", taskFailed, taskCompleted, options.Options.PlaybookWorkerCount)
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/md5"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/http"
|
||||
@@ -25,6 +26,7 @@ import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/util/httputils"
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
"yunion.io/x/pkg/util/rbacscope"
|
||||
@@ -34,7 +36,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/apigateway/options"
|
||||
policytool "yunion.io/x/onecloud/pkg/apigateway/policy"
|
||||
agapi "yunion.io/x/onecloud/pkg/apis/apigateway"
|
||||
"yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
@@ -44,6 +45,8 @@ import (
|
||||
compute_modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/identity"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/notify"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
"yunion.io/x/onecloud/pkg/util/hashcache"
|
||||
"yunion.io/x/onecloud/pkg/util/logclient"
|
||||
"yunion.io/x/onecloud/pkg/util/netutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/seclib2"
|
||||
@@ -75,6 +78,7 @@ func (h *AuthHandlers) AddMethods() {
|
||||
NewHP(h.handleSsoLogin, "ssologin"),
|
||||
NewHP(h.handleIdpInitSsoLogin, "ssologin", "<idp_id>"),
|
||||
NewHP(h.postLogoutHandler, "logout"),
|
||||
NewHP(h.getScopedPolicyBindings, "scopedpolicybindings"),
|
||||
// oidc auth
|
||||
NewHP(handleOIDCAuth, "oidc", "auth"),
|
||||
NewHP(handleOIDCConfiguration, "oidc", ".well-known", "openid-configuration"),
|
||||
@@ -213,6 +217,38 @@ func (h *AuthHandlers) getRegions(ctx context.Context, w http.ResponseWriter, re
|
||||
appsrv.SendJSON(w, jsonutils.Marshal(resp))
|
||||
}
|
||||
|
||||
var (
|
||||
bindingCache = hashcache.NewCache(1024, time.Minute)
|
||||
)
|
||||
|
||||
func (h *AuthHandlers) getScopedPolicyBindings(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
_, _params, _ := appsrv.FetchEnv(ctx, w, req)
|
||||
if gotypes.IsNil(_params) {
|
||||
_params = jsonutils.NewDict()
|
||||
}
|
||||
params := _params.(*jsonutils.JSONDict)
|
||||
token, _, err := fetchAuthInfo(ctx, req)
|
||||
if err != nil {
|
||||
httperrors.GeneralServerError(ctx, w, err)
|
||||
return
|
||||
}
|
||||
params.Set("project_id", jsonutils.NewString(token.GetProjectId()))
|
||||
hash := fmt.Sprintf("%x", md5.Sum([]byte(params.String())))
|
||||
cache := bindingCache.Get(hash)
|
||||
if cache != nil {
|
||||
appsrv.SendJSON(w, jsonutils.Marshal(cache))
|
||||
return
|
||||
}
|
||||
s := auth.GetAdminSession(ctx, options.Options.Region)
|
||||
resp, err := yunionconf.ScopedPolicyBindings.List(s, params)
|
||||
if err != nil {
|
||||
httperrors.GeneralServerError(ctx, w, err)
|
||||
return
|
||||
}
|
||||
bindingCache.AtomicSet(hash, resp)
|
||||
appsrv.SendJSON(w, jsonutils.Marshal(resp))
|
||||
}
|
||||
|
||||
func (h *AuthHandlers) getUser(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
data, err := getUserInfo(ctx, req)
|
||||
if err != nil {
|
||||
@@ -1070,25 +1106,6 @@ func getUserInfo2(s *mcclient.ClientSession, uid string, pid string, loginIp str
|
||||
menus.Add(item)
|
||||
}
|
||||
|
||||
log.Infof("getUserInfo modules.Hosts.Get")
|
||||
// s2 := auth.GetSession(ctx, token, FetchRegion(req), "v2")
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString("host_type"), "field")
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
params.Add(jsonutils.JSONTrue, "usable")
|
||||
params.Add(jsonutils.JSONTrue, "show_emulated")
|
||||
cap, err := compute_modules.Hosts.Get(s, "distinct-field", params)
|
||||
if err != nil {
|
||||
log.Errorf("modules.Servers.Get distinct-field fail %s", err)
|
||||
} else {
|
||||
hostTypes, _ := jsonutils.GetStringArray(cap, "host_type")
|
||||
hypervisors := make([]string, len(hostTypes))
|
||||
for i, hostType := range hostTypes {
|
||||
hypervisors[i] = compute.HOSTTYPE_HYPERVISOR[hostType]
|
||||
}
|
||||
data.Add(jsonutils.NewStringArray(hypervisors), "hypervisors")
|
||||
}
|
||||
|
||||
data.Add(menus, "menus")
|
||||
data.Add(k8s, "k8sdashboard")
|
||||
data.Add(services, "services")
|
||||
|
||||
@@ -108,6 +108,8 @@ func (h *MiscHandler) Bind(app *appsrv.Application) {
|
||||
// syslog webservice handlers
|
||||
app.AddHandler(POST, prefix+"syslog/token", handleSyslogWebServiceToken)
|
||||
app.AddHandler(POST, prefix+"syslog/message", handleSyslogWebServiceMessage)
|
||||
// service settings
|
||||
app.AddHandler(GET, prefix+"service_settings", h.getServiceSettings)
|
||||
}
|
||||
|
||||
func UploadHandlerInfo(method, prefix string, handler func(context.Context, http.ResponseWriter, *http.Request)) *appsrv.SHandlerInfo {
|
||||
|
||||
81
pkg/apigateway/handler/service_setting.go
Normal file
81
pkg/apigateway/handler/service_setting.go
Normal file
@@ -0,0 +1,81 @@
|
||||
// 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 handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"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/identity"
|
||||
)
|
||||
|
||||
var settingNames = map[string][]string{
|
||||
"identity": []string{"no_action_logout_seconds"},
|
||||
"yunionapi": []string{"enable_organization", "totp_issuer"},
|
||||
"image": []string{"enable_pending_delete"},
|
||||
"compute_v2": []string{"enable_pending_delete"},
|
||||
"meter": []string{"cost_conversion_available", "enable_prediction", "share_resource_type"},
|
||||
"common": []string{"api_server", "enable_quota_check", "enable_watermark", "enable_cloud_shell"},
|
||||
}
|
||||
|
||||
func (mh *MiscHandler) getServiceSettings(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
s := auth.GetAdminSession(ctx, FetchRegion(req))
|
||||
types := []string{}
|
||||
for typ := range settingNames {
|
||||
types = append(types, typ)
|
||||
}
|
||||
params := map[string]interface{}{
|
||||
"limit": 20,
|
||||
"scope": "system",
|
||||
"type": types,
|
||||
}
|
||||
resp, err := identity.ServicesV3.List(s, jsonutils.Marshal(params))
|
||||
if err != nil {
|
||||
e := httperrors.NewInternalServerError(err.Error())
|
||||
httperrors.JsonClientError(ctx, w, e)
|
||||
return
|
||||
}
|
||||
services := []struct {
|
||||
Id string
|
||||
Type string
|
||||
}{}
|
||||
err = jsonutils.Update(&services, resp.Data)
|
||||
if err != nil {
|
||||
e := httperrors.NewInternalServerError(err.Error())
|
||||
httperrors.JsonClientError(ctx, w, e)
|
||||
return
|
||||
}
|
||||
result := map[string]map[string]interface{}{}
|
||||
for _, service := range services {
|
||||
result[service.Type] = map[string]interface{}{}
|
||||
data, err := identity.ServicesV3.GetSpecific(s, service.Id, "config", nil)
|
||||
if err != nil {
|
||||
e := httperrors.NewInternalServerError(err.Error())
|
||||
httperrors.JsonClientError(ctx, w, e)
|
||||
return
|
||||
}
|
||||
names, _ := settingNames[service.Type]
|
||||
for _, name := range names {
|
||||
v, _ := data.Get("config", "default", name)
|
||||
result[service.Type][name] = v
|
||||
}
|
||||
}
|
||||
appsrv.SendJSON(w, jsonutils.Marshal(result))
|
||||
}
|
||||
@@ -16,10 +16,19 @@ package service
|
||||
|
||||
import (
|
||||
_ "yunion.io/x/onecloud/pkg/cloudevent/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/compute/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/image/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/keystone/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/logger/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/notify/policy"
|
||||
_ "yunion.io/x/onecloud/pkg/yunionconf/policy"
|
||||
compute "yunion.io/x/onecloud/pkg/compute/policy"
|
||||
image "yunion.io/x/onecloud/pkg/image/policy"
|
||||
keystone "yunion.io/x/onecloud/pkg/keystone/policy"
|
||||
logger "yunion.io/x/onecloud/pkg/logger/policy"
|
||||
notify "yunion.io/x/onecloud/pkg/notify/policy"
|
||||
yunionconf "yunion.io/x/onecloud/pkg/yunionconf/policy"
|
||||
)
|
||||
|
||||
func InitDefaultPolicy() {
|
||||
compute.Init()
|
||||
image.Init()
|
||||
keystone.Init()
|
||||
logger.Init()
|
||||
notify.Init()
|
||||
yunionconf.Init()
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ func StartService() {
|
||||
baseOpts := &opts.BaseOptions
|
||||
commonOpts := &opts.CommonOptions
|
||||
common_options.ParseOptions(opts, os.Args, "apigateway.conf", api.SERVICE_TYPE)
|
||||
InitDefaultPolicy()
|
||||
app_common.InitAuth(commonOpts, func() {
|
||||
log.Infof("Auth complete.")
|
||||
})
|
||||
@@ -57,7 +58,7 @@ func StartService() {
|
||||
// log.Infof("Modules: %s", jsonutils.Marshal(jmods).PrettyString())
|
||||
|
||||
if !options.Options.DisableReporting {
|
||||
cron := cronman.InitCronJobManager(true, 1)
|
||||
cron := cronman.InitCronJobManager(true, 1, opts.TimeZone)
|
||||
rand.Seed(time.Now().Unix())
|
||||
cron.AddJobEveryFewDays("AutoReport", 1, rand.Intn(23), rand.Intn(59), 0, report.Report, true)
|
||||
go cron.Start()
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
@@ -172,6 +174,10 @@ type DiskConfig struct {
|
||||
// requried: false
|
||||
Fs string `json:"fs"`
|
||||
|
||||
// 关机后自动重置磁盘
|
||||
// required: false
|
||||
AutoReset bool `json:"auto_reset"`
|
||||
|
||||
// 磁盘存储格式
|
||||
// enum: qcow2, raw, docker, iso, vmdk, vmdkflatver1, vmdkflatver2, vmdkflat, vmdksparse, vmdksparsever1, vmdksparsever2, vmdksepsparse vhd
|
||||
// requried: false
|
||||
@@ -630,6 +636,8 @@ type ServerCreateInput struct {
|
||||
BillingType string `json:"billing_type"`
|
||||
// swagger:ignore
|
||||
BillingCycle string `json:"billing_cycle"`
|
||||
// 到期释放时间
|
||||
ReleaseAt time.Time `json:"release_at"`
|
||||
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
|
||||
@@ -189,6 +189,8 @@ type SBackupStorageAccessInfo struct {
|
||||
ObjectAccessKey string `json:"object_access_key"`
|
||||
// description: secret of object storage
|
||||
ObjectSecret string `json:"object_secret"`
|
||||
// description: signing version, can be v2/v4, default is v4
|
||||
ObjectSignVer string `json:"object_sign_ver"`
|
||||
}
|
||||
|
||||
func (ba *SBackupStorageAccessInfo) String() string {
|
||||
|
||||
@@ -80,6 +80,8 @@ func (self BucketDetails) GetMetricTags() map[string]string {
|
||||
"status": self.Status,
|
||||
"tenant": self.Project,
|
||||
"tenant_id": self.ProjectId,
|
||||
"account": self.Account,
|
||||
"account_id": self.AccountId,
|
||||
"external_id": self.ExternalId,
|
||||
}
|
||||
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
|
||||
|
||||
@@ -86,4 +86,7 @@ type CachedimageListInput struct {
|
||||
|
||||
// valid cachedimage
|
||||
Valid bool `json:"valid"`
|
||||
|
||||
// enum: [public, private]
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
}
|
||||
|
||||
@@ -72,12 +72,6 @@ type CloudenvResourceListInput struct {
|
||||
// Deprecated
|
||||
Provider []string `json:"provider" yunion-deprecated-by:"providers"`
|
||||
|
||||
// 列出指定云平台品牌的资源,一般来说brand和provider相同,除了以上支持的provider之外,还支持以下band
|
||||
//
|
||||
// | Brand | Provider | 说明 |
|
||||
// |----------|----------|------------|
|
||||
// | DStack | ZStack | 滴滴云私有云 |
|
||||
//
|
||||
Brands []string `json:"brands"`
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
@@ -169,7 +163,7 @@ type CloudaccountCreateInput struct {
|
||||
// | Huawei | Huawei |
|
||||
// | OpenStack | OpenStack |
|
||||
// | Ucloud | Ucloud |
|
||||
// | ZStack | ZStack, DStack |
|
||||
// | ZStack | ZStack |
|
||||
// | Google | Google |
|
||||
// | Ctyun | Ctyun |
|
||||
Brand string `json:"brand"`
|
||||
@@ -344,7 +338,7 @@ type CloudaccountDetail struct {
|
||||
SyncIntervalSeconds int `json:"sync_interval_seconds"`
|
||||
|
||||
// 同步状态
|
||||
SyncStatus2 string `json:"sync_stauts2"`
|
||||
SyncStatus2 string `json:"sync_status2"`
|
||||
|
||||
// 云账号环境类型
|
||||
// public: 公有云
|
||||
@@ -571,7 +565,7 @@ type SyncRangeInput struct {
|
||||
|
||||
// 按资源类型同步,可输入多个
|
||||
// enmu: project, compute, network, eip, loadbalancer, objectstore, rds, cache, event, cloudid, dnszone, public_ip, intervpcnetwork, saml_auth, quota, nat, nas, waf, mongodb, es, kafka, app, cdn, container, ipv6_gateway, tablestore, modelarts, vpcpeer, misc
|
||||
Resources []string `json:"resources" choices:"project|compute|network|eip|loadbalancer|objectstore|rds|cache|event|cloudid|dnszone|public_ip|intervpcnetwork|saml_auth|quota|nat|nas|waf|mongodb|es|kafka|app|cdn|container|ipv6_gateway|tablestore|modelarts|vpcpeer|misc"`
|
||||
Resources []string `json:"resources" choices:"project|compute|network|eip|loadbalancer|objectstore|rds|cache|event|cloudid|dnszone|public_ip|intervpcnetwork|saml_auth|quota|nat|nas|waf|mongodb|es|kafka|app|cdn|container|ipv6_gateway|tablestore|modelarts|vpcpeer|misc|image"`
|
||||
}
|
||||
|
||||
type iRes interface {
|
||||
|
||||
@@ -83,7 +83,6 @@ const (
|
||||
CLOUD_PROVIDER_HEALTH_UNKNOWN = compute.CLOUD_PROVIDER_HEALTH_UNKNOWN // 未知状态,查询失败
|
||||
CLOUD_PROVIDER_HEALTH_NO_PERMISSION = compute.CLOUD_PROVIDER_HEALTH_NO_PERMISSION // 没有权限获取账单信息
|
||||
|
||||
ZSTACK_BRAND_DSTACK = compute.ZSTACK_BRAND_DSTACK
|
||||
ONECLOUD_BRAND_ONECLOUD = "OneCloud"
|
||||
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_VCENTER = "vcenter"
|
||||
|
||||
@@ -82,8 +82,8 @@ type DBInstanceCreateInput struct {
|
||||
// default: false
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
|
||||
// swagger:ignore
|
||||
ExpiredAt time.Time `json:"expired_at"`
|
||||
// 到期释放时间
|
||||
ReleaseAt time.Time `json:"release_at"`
|
||||
|
||||
// 计费方式
|
||||
// enum: postpaid, prepaid
|
||||
@@ -342,6 +342,8 @@ func (self DBInstanceDetails) GetMetricTags() map[string]string {
|
||||
"tenant_id": self.ProjectId,
|
||||
"brand": self.Brand,
|
||||
"domain_id": self.DomainId,
|
||||
"account": self.Account,
|
||||
"account_id": self.AccountId,
|
||||
"project_domain": self.ProjectDomain,
|
||||
"external_id": self.ExternalId,
|
||||
}
|
||||
|
||||
@@ -163,6 +163,9 @@ type DiskListInput struct {
|
||||
|
||||
// 根据虚拟机状态过滤
|
||||
GuestStatus string `json:"guest_status"`
|
||||
|
||||
// 根据是否绑定快照策略过滤
|
||||
BindingSnapshotpolicy *bool `json:"binding_snapshotpolicy"`
|
||||
}
|
||||
|
||||
type DiskResourceInput struct {
|
||||
@@ -201,6 +204,12 @@ type SimpleGuest struct {
|
||||
Driver string `json:"driver"`
|
||||
// 缓存模式
|
||||
CacheMode string `json:"cache_mode"`
|
||||
// 磁盘并发数
|
||||
Iops int `json:"iops"`
|
||||
// 磁盘吞吐
|
||||
Bps int `json:"bps"`
|
||||
// 计费类型
|
||||
BillingType string `json:"billing_type"`
|
||||
}
|
||||
|
||||
type SimpleSnapshotPolicy struct {
|
||||
@@ -225,6 +234,8 @@ type DiskDetails struct {
|
||||
GuestCount int `json:"guest_count"`
|
||||
// 所挂载虚拟机状态
|
||||
GuestStatus string `json:"guest_status"`
|
||||
// 所挂载虚拟机计费类型
|
||||
GuestBillingType string `json:"guest_billing_type"`
|
||||
|
||||
// 自动清理时间
|
||||
AutoDeleteAt time.Time `json:"auto_delete_at"`
|
||||
@@ -257,6 +268,8 @@ type DiskUpdateInput struct {
|
||||
|
||||
// 磁盘类型
|
||||
DiskType string `json:"disk_type"`
|
||||
// 关机自动重置
|
||||
AutoReset *bool `json:"auto_reset"`
|
||||
}
|
||||
|
||||
type DiskSaveInput struct {
|
||||
@@ -329,8 +342,21 @@ type DiskMigrateInput struct {
|
||||
TargetStorageId string `json:"target_storage_id"`
|
||||
}
|
||||
|
||||
type DiskChagneStorageTypeInput struct {
|
||||
// 目标存储类型
|
||||
StorageType string `json:"storage_type"`
|
||||
}
|
||||
|
||||
type DiskSnapshotpolicyInput struct {
|
||||
SnapshotpolicyId string `json:"snapshotpolicy_id"`
|
||||
}
|
||||
|
||||
type DiskRebuildInput struct{}
|
||||
|
||||
type DiskChangeBillingTypeInput struct {
|
||||
// 仅在磁盘挂载在虚拟机上时调用
|
||||
// 目前支持阿里云
|
||||
// enmu: [postpaid, prepaid]
|
||||
// required: true
|
||||
BillingType string `json:"billing_type"`
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ func (self ElasticcacheDetails) GetMetricTags() map[string]string {
|
||||
"tenant": self.Project,
|
||||
"tenant_id": self.ProjectId,
|
||||
"brand": self.Brand,
|
||||
"account": self.Account,
|
||||
"account_id": self.AccountId,
|
||||
"domain_id": self.DomainId,
|
||||
"project_domain": self.ProjectDomain,
|
||||
"external_id": self.ExternalId,
|
||||
@@ -244,13 +246,13 @@ type ElasticcacheCreateInput struct {
|
||||
// 包年包月时间周期
|
||||
Duration string `json:"duration"`
|
||||
|
||||
// 到期释放时间
|
||||
ReleaseAt time.Time `json:"release_at"`
|
||||
|
||||
// 是否自动续费(仅包年包月时生效)
|
||||
// default: false
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
|
||||
// swagger:ignore
|
||||
ExpiredAt time.Time `json:"expired_at"`
|
||||
|
||||
// 计费方式
|
||||
// enum: postpaid, prepaid
|
||||
BillingType string
|
||||
|
||||
@@ -87,8 +87,8 @@ type FileSystemCreateInput struct {
|
||||
// default: false
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
|
||||
// 到期释放时间,仅后付费支持
|
||||
ExpiredAt time.Time `json:"expired_at"`
|
||||
// 到期释放时间
|
||||
ReleaseAt time.Time `json:"release_at"`
|
||||
|
||||
// 计费方式
|
||||
// enum: postpaid, prepaid
|
||||
|
||||
@@ -420,23 +420,24 @@ const (
|
||||
VM_AZURE_DEFAULT_LOGIN_USER = compute.VM_AZURE_DEFAULT_LOGIN_USER
|
||||
VM_ZSTACK_DEFAULT_LOGIN_USER = compute.VM_ZSTACK_DEFAULT_LOGIN_USER
|
||||
|
||||
VM_METADATA_APP_TAGS = "app_tags"
|
||||
VM_METADATA_CREATE_PARAMS = "create_params"
|
||||
VM_METADATA_LOGIN_ACCOUNT = "login_account"
|
||||
VM_METADATA_LOGIN_KEY = "login_key"
|
||||
VM_METADATA_LAST_LOGIN_KEY = "last_login_key"
|
||||
VM_METADATA_LOGIN_KEY_TIMESTAMP = "login_key_timestamp"
|
||||
VM_METADATA_OS_ARCH = "os_arch"
|
||||
VM_METADATA_OS_DISTRO = "os_distribution"
|
||||
VM_METADATA_OS_NAME = "os_name"
|
||||
VM_METADATA_OS_VERSION = "os_version"
|
||||
VM_METADATA_CGROUP_CPUSET = "cgroup_cpuset"
|
||||
VM_METADATA_ENABLE_MEMCLEAN = "enable_memclean"
|
||||
VM_METADATA_HOTPLUG_CPU_MEM = "hotplug_cpu_mem"
|
||||
VM_METADATA_HOT_REMOVE_NIC = "hot_remove_nic"
|
||||
VM_METADATA_START_VMEM_MB = "start_vmem_mb"
|
||||
VM_METADATA_START_VCPU_COUNT = "start_vcpu_count"
|
||||
VM_METADATA_CPU_NUMA_PIN = "__cpu_numa_pin"
|
||||
VM_METADATA_APP_TAGS = "app_tags"
|
||||
VM_METADATA_CREATE_PARAMS = "create_params"
|
||||
VM_METADATA_LOGIN_ACCOUNT = "login_account"
|
||||
VM_METADATA_LOGIN_KEY = "login_key"
|
||||
VM_METADATA_LAST_LOGIN_KEY = "last_login_key"
|
||||
VM_METADATA_LOGIN_KEY_TIMESTAMP = "login_key_timestamp"
|
||||
VM_METADATA_OS_ARCH = "os_arch"
|
||||
VM_METADATA_OS_DISTRO = "os_distribution"
|
||||
VM_METADATA_OS_NAME = "os_name"
|
||||
VM_METADATA_OS_VERSION = "os_version"
|
||||
VM_METADATA_CGROUP_CPUSET = "cgroup_cpuset"
|
||||
VM_METADATA_ENABLE_MEMCLEAN = "enable_memclean"
|
||||
VM_METADATA_HOTPLUG_CPU_MEM = "hotplug_cpu_mem"
|
||||
VM_METADATA_HOT_REMOVE_NIC = "hot_remove_nic"
|
||||
VM_METADATA_START_VMEM_MB = "start_vmem_mb"
|
||||
VM_METADATA_START_VCPU_COUNT = "start_vcpu_count"
|
||||
VM_METADATA_CPU_NUMA_PIN = "__cpu_numa_pin"
|
||||
VM_METADATA_DISABLE_AUTO_MERGE_SNAPSHOT = "disable_auto_merge_snapshot"
|
||||
)
|
||||
|
||||
func Hypervisors2HostTypes(hypervisors []string) []string {
|
||||
|
||||
@@ -34,6 +34,8 @@ type GuestDiskDetails struct {
|
||||
// 磁盘类型
|
||||
// example: data
|
||||
DiskType string `json:"disk_type"`
|
||||
// 关机自动重置
|
||||
AutoReset bool `json:"auto_reset"`
|
||||
// 介质类型
|
||||
// example: ssd
|
||||
MediumType string `json:"medium_type"`
|
||||
@@ -91,6 +93,7 @@ type GuestdiskJsonDesc struct {
|
||||
Dev string `json:"dev"`
|
||||
IsSSD bool `json:"is_ssd"`
|
||||
NumQueues uint8 `json:"num_queues"`
|
||||
AutoReset bool `json:"auto_reset"`
|
||||
|
||||
// esxi
|
||||
ImageInfo struct {
|
||||
|
||||
@@ -27,3 +27,26 @@ type SImagesInGuest struct {
|
||||
RootImage SSubImage
|
||||
DataImages []SSubImage
|
||||
}
|
||||
|
||||
type SGuestScreenDump struct {
|
||||
S3AccessKey string
|
||||
S3SecretKey string
|
||||
S3Endpoint string
|
||||
S3BucketName string
|
||||
S3ObjectName string
|
||||
S3UseSSL bool
|
||||
}
|
||||
|
||||
type GuestScreenDumpListInput struct {
|
||||
Server string
|
||||
}
|
||||
|
||||
type GetDetailsGuestScreenDumpInput struct {
|
||||
ObjectName string
|
||||
}
|
||||
|
||||
type GetDetailsGuestScreenDumpOutput struct {
|
||||
GuestId string
|
||||
Name string
|
||||
ScreenDump string
|
||||
}
|
||||
|
||||
@@ -127,8 +127,13 @@ type ServerListInput struct {
|
||||
// 根据镜像发行版排序
|
||||
OrderByOsDist string `json:"order_by_os_dist"`
|
||||
|
||||
SnapshotpolicyId string `json:"snapshotpolicy_id"`
|
||||
|
||||
// 是否调度到宿主机上
|
||||
WithHost *bool `json:"with_host"`
|
||||
|
||||
// 根据是否绑定快照策略过滤
|
||||
BindingSnapshotpolicy *bool `json:"binding_snapshotpolicy"`
|
||||
}
|
||||
|
||||
func (input *ServerListInput) AfterUnmarshal() {
|
||||
@@ -313,6 +318,8 @@ func (self ServerDetails) GetMetricTags() map[string]string {
|
||||
"paltform": self.Hypervisor,
|
||||
"host": self.Host,
|
||||
"host_id": self.HostId,
|
||||
"ips": self.IPs,
|
||||
"vm_ip": self.IPs,
|
||||
"vm_id": self.Id,
|
||||
"vm_name": self.Name,
|
||||
"zone": self.Zone,
|
||||
@@ -359,9 +366,11 @@ type GuestDiskInfo struct {
|
||||
Driver string `json:"driver"`
|
||||
CacheMode string `json:"cache_mode"`
|
||||
AioMode string `json:"aio_mode"`
|
||||
AutoReset bool `json:"auto_reset"`
|
||||
MediumType string `json:"medium_type"`
|
||||
StorageType string `json:"storage_type"`
|
||||
Iops int `json:"iops"`
|
||||
Throughput int `json:"throughput"`
|
||||
Bps int `json:"bps"`
|
||||
ImageId string `json:"image_id,omitempty"`
|
||||
Image string `json:"image,omitemtpy"`
|
||||
@@ -624,6 +633,7 @@ type ServerStopInput struct {
|
||||
TimeoutSecs int `json:"timeout_secs"`
|
||||
|
||||
// 是否关机停止计费, 若平台不支持停止计费,此参数无作用
|
||||
// 若包年包月机器关机设置此参数,则先转换计费模式到按量计费,再关机不收费
|
||||
// 目前仅阿里云,腾讯云此参数生效
|
||||
StopCharging bool `json:"stop_charging"`
|
||||
}
|
||||
@@ -912,6 +922,7 @@ type GuestJsonDesc struct {
|
||||
InstanceSnapshotId string `json:"instance_snapshot_id"`
|
||||
InstanceId string `json:"instance_id"`
|
||||
} `json:"instance_snapshot_info"`
|
||||
EnableEsxiSwap bool `json:"enable_esxi_swap"`
|
||||
|
||||
EncryptKeyId string `json:"encrypt_key_id,omitempty"`
|
||||
|
||||
@@ -977,6 +988,13 @@ type ServerChangeDiskStorageInternalInput struct {
|
||||
CloneDiskCount int `json:"disk_count"`
|
||||
}
|
||||
|
||||
type ServerCopyDiskToStorageInput struct {
|
||||
KeepOriginDisk bool `json:"keep_origin_disk"`
|
||||
GuestRunning bool `json:"guest_running"`
|
||||
CompletedDiskCount int `json:"completed_disk_count"`
|
||||
CloneDiskCount int `json:"disk_count"`
|
||||
}
|
||||
|
||||
type ServerSetExtraOptionInput struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
@@ -1162,7 +1180,7 @@ type ServerQgaGetNetworkInput struct {
|
||||
}
|
||||
|
||||
type ServerQgaTimeoutInput struct {
|
||||
// qga execute timeout millisecond
|
||||
// qga execute timeout second
|
||||
Timeout int
|
||||
}
|
||||
|
||||
@@ -1246,6 +1264,8 @@ type GuestPerformStartInput struct {
|
||||
// 指定启动虚拟机的Qemu版本,可选值:2.12.1, 4.2.0
|
||||
// 仅适用于KVM虚拟机
|
||||
QemuVersion string `json:"qemu_version"`
|
||||
// 按量机器自动转换为包年包月
|
||||
AutoPrepaid bool `json:"auto_prepaid"`
|
||||
}
|
||||
|
||||
type ServerSetOSInfoInput struct {
|
||||
@@ -1331,6 +1351,10 @@ func (conf ServerChangeConfigSettings) MemChanged() bool {
|
||||
return conf.VmemSize != conf.Old.VmemSize
|
||||
}
|
||||
|
||||
func (conf ServerChangeConfigSettings) InstanceTypeChanged() bool {
|
||||
return len(conf.InstanceType) > 0 && conf.InstanceType != conf.Old.InstanceType
|
||||
}
|
||||
|
||||
func (conf ServerChangeConfigSettings) AddedMem() int {
|
||||
addMem := conf.VmemSize - conf.Old.VmemSize
|
||||
if addMem < 0 {
|
||||
@@ -1349,3 +1373,10 @@ func (conf ServerChangeConfigSettings) AddedDisk() int {
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
type ServerChangeBillingTypeInput struct {
|
||||
// 仅在虚拟机开机或关机状态下调用
|
||||
// enmu: [postpaid, prepaid]
|
||||
// required: true
|
||||
BillingType string `json:"billing_type"`
|
||||
}
|
||||
|
||||
@@ -151,6 +151,42 @@ type HostListInput struct {
|
||||
// 按内存超分率排序
|
||||
// enmu: asc,desc
|
||||
OrderByMemCommitRate string `json:"order_by_mem_commit_rate"`
|
||||
|
||||
// 按本地存储分配大小排序
|
||||
// enmu: asc,desc
|
||||
OrderByStorageUsed string `json:"order_by_storage_used"`
|
||||
|
||||
// 按cpu分配大小排序
|
||||
// enmu: asc,desc
|
||||
OrderByCpuCommit string `json:"order_by_cpu_commit"`
|
||||
|
||||
// 按内存分配大小排序
|
||||
// enmu: asc,desc
|
||||
OrderByMemCommit string `json:"order_by_mem_commit"`
|
||||
|
||||
// 按物理cpu使用率排序
|
||||
// enmu: asc,desc
|
||||
OrderByCpuUsage string `json:"order_by_cpu_usage"`
|
||||
|
||||
// 按物理内存使用率排序
|
||||
// enmu: asc,desc
|
||||
OrderByMemUsage string `json:"order_by_mem_usage"`
|
||||
|
||||
// 按物理存储使用率排序
|
||||
// enmu: asc,desc
|
||||
OrderByStorageUsage string `json:"order_by_storage_usage"`
|
||||
|
||||
// 按虚拟内存使用率排序
|
||||
// enmu: asc,desc
|
||||
OrderByVirtualMemUsage string `json:"order_by_virtual_mem_usage"`
|
||||
|
||||
// 按虚拟cpu使用率排序
|
||||
// enmu: asc,desc
|
||||
OrderByVirtualCpuUsage string `json:"order_by_virtual_cpu_usage"`
|
||||
|
||||
// 按虚拟存储使用率排序
|
||||
// enmu: asc,desc
|
||||
OrderByVirtualStorageUsage string `json:"order_by_virtual_storage_usage"`
|
||||
}
|
||||
|
||||
type HostDetails struct {
|
||||
@@ -301,6 +337,8 @@ type HostResourceInfo struct {
|
||||
|
||||
// 宿主机类型
|
||||
HostType string `json:"host_type"`
|
||||
|
||||
HostAccessIp string `json:"host_access_ip"`
|
||||
}
|
||||
|
||||
type HostFilterListInput struct {
|
||||
@@ -531,7 +569,8 @@ type SHostStorageStat struct {
|
||||
type SHostPingInput struct {
|
||||
WithData bool `json:"with_data"`
|
||||
|
||||
MemoryUsedMb int `json:"memory_used_mb"`
|
||||
MemoryUsedMb int `json:"memory_used_mb"`
|
||||
CpuUsagePercent float64 `json:"cpu_usage_percent"`
|
||||
|
||||
RootPartitionUsedCapacityMb int `json:"root_partition_used_capacity_mb"`
|
||||
|
||||
@@ -641,3 +680,8 @@ type HostLoginInfoOutput struct {
|
||||
|
||||
type HostPerformStartInput struct {
|
||||
}
|
||||
|
||||
type HostSetCommitBoundInput struct {
|
||||
CpuCmtbound *float32
|
||||
MemCmtbound *float32
|
||||
}
|
||||
|
||||
@@ -119,6 +119,11 @@ const (
|
||||
HostResourceTypeDedicated = "dedicated"
|
||||
)
|
||||
|
||||
const (
|
||||
HOST_METADATA_CPU_USAGE_PERCENT = "cpu_usage_percent"
|
||||
HOST_METADATA_MEMORY_USED_MB = "memory_used_mb"
|
||||
)
|
||||
|
||||
var HOST_TYPES = []string{
|
||||
HOST_TYPE_BAREMETAL,
|
||||
HOST_TYPE_HYPERVISOR,
|
||||
|
||||
@@ -147,6 +147,8 @@ type SnapshotPolicyListInput struct {
|
||||
// 按绑定的磁盘数量排序
|
||||
// pattern:asc|desc
|
||||
OrderByBindDiskCount string `json:"order_by_bind_disk_count"`
|
||||
// 按类型过滤
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
type HostnameInput struct {
|
||||
|
||||
@@ -23,6 +23,10 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
const (
|
||||
ErrMsgIsolatedDeviceUsedByServer = "Isolated device used by server"
|
||||
)
|
||||
|
||||
type IsolateDeviceDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
HostResourceInfo
|
||||
@@ -58,9 +62,15 @@ type IsolatedDeviceListInput struct {
|
||||
// # pci address of `Bus:Device.Function` format, or usb bus address of `bus.addr`
|
||||
Addr []string `json:"addr"`
|
||||
|
||||
// 设备路径
|
||||
DevicePath []string `json:"device_path"`
|
||||
|
||||
// 设备VENDOE编号
|
||||
VendorDeviceId []string `json:"vendor_device_id"`
|
||||
|
||||
// NUMA节点序号
|
||||
NumaNode []uint8 `json:"numa_node"`
|
||||
|
||||
// 展示物理机的上的设备
|
||||
ShowBaremetalIsolatedDevices bool `json:"show_baremetal_isolated_devices"`
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
var KEYPAIR_SCHEMAS = []string{
|
||||
KEYPAIRE_SCHEME_RSA,
|
||||
// OpenSSH deprecated DSA keys
|
||||
//KEYPAIRE_SCHEME_DSA,
|
||||
KEYPAIRE_SCHEME_ECDSA,
|
||||
KEYPAIRE_SCHEME_ED25519,
|
||||
}
|
||||
|
||||
type KeypairCreateInput struct {
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
package compute
|
||||
|
||||
const (
|
||||
KEYPAIRE_SCHEME_RSA = "RSA"
|
||||
KEYPAIRE_SCHEME_DSA = "DSA"
|
||||
KEYPAIRE_SCHEME_RSA = "RSA"
|
||||
KEYPAIRE_SCHEME_DSA = "DSA"
|
||||
KEYPAIRE_SCHEME_ECDSA = "ECDSA"
|
||||
KEYPAIRE_SCHEME_ED25519 = "ED25519"
|
||||
)
|
||||
|
||||
@@ -96,6 +96,12 @@ type LoadbalancerDetails struct {
|
||||
|
||||
// 关联安全组列表
|
||||
Secgroups []SimpleSecurityGroup `json:"secgroups"`
|
||||
LoadbalancerUsage
|
||||
}
|
||||
|
||||
type LoadbalancerUsage struct {
|
||||
BackendGroupCount int `json:"backend_group_count"`
|
||||
ListenerCount int `json:"listener_count"`
|
||||
}
|
||||
|
||||
type SimpleSecurityGroup struct {
|
||||
@@ -255,6 +261,8 @@ func (self LoadbalancerDetails) GetMetricTags() map[string]string {
|
||||
"status": self.Status,
|
||||
"tenant": self.Project,
|
||||
"tenant_id": self.ProjectId,
|
||||
"account": self.Account,
|
||||
"account_id": self.AccountId,
|
||||
"external_id": self.ExternalId,
|
||||
}
|
||||
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
|
||||
|
||||
@@ -144,7 +144,7 @@ type LoadbalancerListenerCreateInput struct {
|
||||
HealthCheck string `json:"health_check"`
|
||||
// enum: tcp, udp, http
|
||||
HealthCheckType string `json:"health_check_type"`
|
||||
HealthCheckDomain string `json:"string"`
|
||||
HealthCheckDomain string `json:"health_check_domain"`
|
||||
HealthCheckPath string `json:"health_check_path"`
|
||||
// default: http_2xx,http_3xx
|
||||
HealthCheckHttpCode string `json:"health_check_http_code"`
|
||||
|
||||
@@ -117,8 +117,8 @@ type NatgatewayCreateInput struct {
|
||||
// default: false
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
|
||||
// 到期释放时间,仅后付费支持
|
||||
ExpiredAt time.Time `json:"expired_at"`
|
||||
// 到期释放时间
|
||||
ReleaseAt time.Time `json:"release_at"`
|
||||
|
||||
// 计费方式
|
||||
// enum: postpaid, prepaid
|
||||
|
||||
@@ -255,6 +255,8 @@ type SecgroupResourceInput struct {
|
||||
|
||||
type SecgroupFilterListInput struct {
|
||||
SecgroupResourceInput
|
||||
RegionalFilterListInput
|
||||
ManagedResourceListInput
|
||||
|
||||
// 以安全组排序
|
||||
OrderBySecgroup string `json:"order_by_secgroup"`
|
||||
@@ -291,6 +293,16 @@ type SecgroupDetails struct {
|
||||
type SecurityGroupResourceInfo struct {
|
||||
// 安全组名称
|
||||
Secgroup string `json:"secgroup"`
|
||||
|
||||
// VPC归属区域ID
|
||||
CloudregionId string `json:"cloudregion_id"`
|
||||
|
||||
CloudregionResourceInfo
|
||||
|
||||
// VPC归属云订阅ID
|
||||
ManagerId string `json:"manager_id"`
|
||||
|
||||
ManagedResourceInfo
|
||||
}
|
||||
|
||||
type GuestsecgroupListInput struct {
|
||||
|
||||
@@ -74,6 +74,12 @@ type SnapshotListInput struct {
|
||||
// list server snapshots
|
||||
ServerId string `json:"server_id"`
|
||||
|
||||
// 未关联任何磁盘
|
||||
Unused bool `json:"unused"`
|
||||
|
||||
// 按存储过滤
|
||||
StorageId string `json:"storage_id"`
|
||||
|
||||
// 按虚拟机名称排序
|
||||
// pattern:asc|desc
|
||||
OrderByGuest string `json:"order_by_guest"`
|
||||
|
||||
@@ -30,6 +30,9 @@ const (
|
||||
SNAPSHOT_POLICY_APPLY_FAILED = "apply_failed"
|
||||
SNAPSHOT_POLICY_CANCEL = "canceling"
|
||||
SNAPSHOT_POLICY_CANCEL_FAILED = "cancel_failed"
|
||||
|
||||
SNAPSHOT_POLICY_TYPE_DISK = "disk"
|
||||
SNAPSHOT_POLICY_TYPE_SERVER = "server"
|
||||
)
|
||||
|
||||
type SnapshotPolicyDetails struct {
|
||||
@@ -41,7 +44,8 @@ type SnapshotPolicyDetails struct {
|
||||
|
||||
RetentionDays int `json:"retention_days"`
|
||||
|
||||
BindingDiskCount int `json:"binding_disk_count"`
|
||||
BindingDiskCount int `json:"binding_disk_count"`
|
||||
BindingResourceCount int `json:"binding_resource_count"`
|
||||
}
|
||||
|
||||
type SSnapshotPolicyCreateInput struct {
|
||||
@@ -49,7 +53,10 @@ type SSnapshotPolicyCreateInput struct {
|
||||
CloudproviderResourceInput
|
||||
CloudregionResourceInput
|
||||
|
||||
RetentionDays int `json:"retention_days"`
|
||||
RetentionDays int `json:"retention_days"`
|
||||
RetentionCount int `json:"retention_count"`
|
||||
// 快照类型, 目前支持 disk, server
|
||||
Type string `json:"type"`
|
||||
|
||||
RepeatWeekdays []int `json:"repeat_weekdays"`
|
||||
|
||||
@@ -92,7 +99,8 @@ func (self *SSnapshotPolicyCreateInput) Validate() error {
|
||||
type SSnapshotPolicyUpdateInput struct {
|
||||
apis.VirtualResourceBaseUpdateInput
|
||||
|
||||
RetentionDays *int
|
||||
RetentionDays *int
|
||||
RegentionCount *int
|
||||
|
||||
RepeatWeekdays *[]int `json:"repeat_weekdays"`
|
||||
TimePoints *[]int `json:"time_points"`
|
||||
@@ -131,6 +139,13 @@ type SnapshotPolicyDisksInput struct {
|
||||
Disks []string `json:"disk"`
|
||||
}
|
||||
|
||||
type SnapshotPolicyResourcesInput struct {
|
||||
Resources []struct {
|
||||
Id string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
} `json:"resources"`
|
||||
}
|
||||
|
||||
type RepeatWeekdays []int
|
||||
|
||||
func (days RepeatWeekdays) String() string {
|
||||
|
||||
@@ -77,6 +77,12 @@ type StorageCreateInput struct {
|
||||
// example: 192.168.222.3,192.168.222.4,192.168.222.99
|
||||
RbdMonHost string `json:"rbd_mon_host"`
|
||||
|
||||
// enable ceph messenger v2
|
||||
EnableMessengerV2 *bool `json:"enable_messenger_v2"`
|
||||
|
||||
// rbd storage auto cache glance images
|
||||
AutoCacheImages *bool `json:"auto_cache_images"`
|
||||
|
||||
// swagger:ignore
|
||||
MonHost string
|
||||
|
||||
@@ -117,7 +123,6 @@ type StorageCreateInput struct {
|
||||
CLVMVgName string
|
||||
// SLVM VG Name
|
||||
SLVMVgName string
|
||||
MasterHost string
|
||||
Lvmlockd bool
|
||||
}
|
||||
|
||||
@@ -180,6 +185,9 @@ type StorageDetails struct {
|
||||
|
||||
// 超分比
|
||||
CommitBound float32 `json:"commit_bound"`
|
||||
|
||||
// master host name
|
||||
MasterHostName string `json:"master_host_name"`
|
||||
}
|
||||
|
||||
func (self StorageDetails) GetMetricTags() map[string]string {
|
||||
@@ -239,6 +247,11 @@ type StorageUpdateInput struct {
|
||||
// example: AQDigB9dtnDAKhAAxS6X4zi4BPR/lIle4nf4Dw==
|
||||
RbdKey string `json:"rbd_key"`
|
||||
|
||||
// enable ceph messenger v2
|
||||
EnableMessengerV2 *bool `json:"enable_messenger_v2"`
|
||||
// rbd storage auto cache glance images
|
||||
AutoCacheImages *bool `json:"auto_cache_images"`
|
||||
|
||||
RbdTimeoutInput
|
||||
|
||||
// swagger:ignore
|
||||
@@ -250,3 +263,19 @@ type StorageUpdateInput struct {
|
||||
HardwareInfo *StorageHardwareInfo `json:"hardware_info"`
|
||||
MasterHost string
|
||||
}
|
||||
|
||||
type RbdStorageConf struct {
|
||||
RadosMonOpTimeout int `json:"rados_mon_op_timeout"`
|
||||
RadosOsdOpTimeout int `json:"rados_osd_op_timeout"`
|
||||
ClientMountTimeout int `json:"client_mount_timeout"`
|
||||
|
||||
MonHost string `json:"mon_host"`
|
||||
Pool string `json:"pool"`
|
||||
Key string `json:"key"`
|
||||
EnableMessengerV2 bool `json:"enable_messenger_v2"`
|
||||
AutoCacheImages bool `json:"auto_cache_images"`
|
||||
}
|
||||
|
||||
type StorageSetCmtBoundInput struct {
|
||||
Cmtbound *float32
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ const (
|
||||
STORAGE_CLOUD_BASIC = compute.STORAGE_CLOUD_BASIC
|
||||
STORAGE_CLOUD_PREMIUM = compute.STORAGE_CLOUD_PREMIUM //高性能云硬盘
|
||||
STORAGE_CLOUD_HSSD = compute.STORAGE_CLOUD_HSSD //增强型SSD云硬盘
|
||||
STORAGE_CLOUD_BSSD = compute.STORAGE_CLOUD_BSSD //增强型SSD云硬盘
|
||||
STORAGE_CLOUD_TSSD = compute.STORAGE_CLOUD_TSSD //极速型SSD云硬盘
|
||||
|
||||
// huawei storage type
|
||||
STORAGE_HUAWEI_SSD = compute.STORAGE_HUAWEI_SSD // 超高IO云硬盘
|
||||
@@ -104,10 +106,15 @@ const (
|
||||
STORAGE_ZSTACK_SHARED_BLOCK = compute.STORAGE_ZSTACK_SHARED_BLOCK
|
||||
|
||||
// Google storage type
|
||||
STORAGE_GOOGLE_LOCAL_SSD = compute.STORAGE_GOOGLE_LOCAL_SSD //本地SSD暂存盘 (最多8个)
|
||||
STORAGE_GOOGLE_PD_STANDARD = compute.STORAGE_GOOGLE_PD_STANDARD //标准永久性磁盘
|
||||
STORAGE_GOOGLE_PD_SSD = compute.STORAGE_GOOGLE_PD_SSD //SSD永久性磁盘
|
||||
STORAGE_GOOGLE_PD_BALANCED = compute.STORAGE_GOOGLE_PD_BALANCED //平衡永久性磁盘
|
||||
STORAGE_GOOGLE_LOCAL_SSD = compute.STORAGE_GOOGLE_LOCAL_SSD //本地SSD暂存盘 (最多8个)
|
||||
STORAGE_GOOGLE_PD_STANDARD = compute.STORAGE_GOOGLE_PD_STANDARD //标准永久性磁盘
|
||||
STORAGE_GOOGLE_PD_SSD = compute.STORAGE_GOOGLE_PD_SSD //SSD永久性磁盘
|
||||
STORAGE_GOOGLE_PD_BALANCED = compute.STORAGE_GOOGLE_PD_BALANCED //平衡永久性磁盘
|
||||
STORAGE_GOOGLE_PD_EXTREME = compute.STORAGE_GOOGLE_PD_EXTREME //极端永久性磁盘
|
||||
STORAGE_GOOGLE_HYPERDISK_BALANCED = compute.STORAGE_GOOGLE_HYPERDISK_BALANCED //平衡 Hyperdisk
|
||||
STORAGE_GOOGLE_HYPERDISK_EXTREME = compute.STORAGE_GOOGLE_HYPERDISK_EXTREME //Hyperdisk Extreme
|
||||
STORAGE_GOOGLE_HYPERDISK_THROUGHPUT = compute.STORAGE_GOOGLE_HYPERDISK_THROUGHPUT //Hyperdisk Throughput
|
||||
STORAGE_GOOGLE_HYPERDISK_ML = compute.STORAGE_GOOGLE_HYPERDISK_ML //Hyperdisk ML
|
||||
|
||||
// ctyun storage type
|
||||
STORAGE_CTYUN_SSD = compute.STORAGE_CTYUN_SSD // 超高IO云硬盘
|
||||
@@ -126,6 +133,21 @@ const (
|
||||
STORAGE_ECLOUD_SSD = compute.STORAGE_ECLOUD_SSD // 高性能盘
|
||||
STORAGE_ECLOUD_SSDEBS = compute.STORAGE_ECLOUD_SSDEBS // 性能优化盘
|
||||
STORAGE_ECLOUD_SYSTEM = compute.STORAGE_ECLOUD_SYSTEM // 系统盘
|
||||
|
||||
STORAGE_BAIDU_SSD = compute.STORAGE_BAIDU_SSD
|
||||
STORAGE_BAIDU_PREMIUM_SSD = compute.STORAGE_BAIDU_PREMIUM_SSD
|
||||
STORAGE_BAIDU_HDD = compute.STORAGE_BAIDU_HDD
|
||||
STORAGE_BAIDU_ENHANCED_SSD_PL1 = compute.STORAGE_BAIDU_ENHANCED_SSD_PL1
|
||||
STORAGE_BAIDU_ENHANCED_SSD_PL2 = compute.STORAGE_BAIDU_ENHANCED_SSD_PL2
|
||||
STORAGE_BAIDU_ENHANCED_SSD_PL3 = compute.STORAGE_BAIDU_ENHANCED_SSD_PL3
|
||||
|
||||
// ksyun storage type
|
||||
STORAGE_KSYUN_ESSD_AUTO_PL = compute.STORAGE_KSYUN_ESSD_AUTO_PL
|
||||
STORAGE_KSYUN_SSD3_0 = compute.STORAGE_KSYUN_SSD3_0
|
||||
STORAGE_KSYUN_EHDD = compute.STORAGE_KSYUN_EHDD
|
||||
STORAGE_KSYUN_ESSD_PL1 = compute.STORAGE_KSYUN_ESSD_PL1
|
||||
STORAGE_KSYUN_ESSD_PL2 = compute.STORAGE_KSYUN_ESSD_PL2
|
||||
STORAGE_KSYUN_ESSD_PL3 = compute.STORAGE_KSYUN_ESSD_PL3
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -162,7 +184,7 @@ var (
|
||||
}
|
||||
STORAGE_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_SHEEPDOG,
|
||||
STORAGE_RBD, STORAGE_DOCKER, STORAGE_NAS, STORAGE_VSAN, STORAGE_NFS,
|
||||
STORAGE_PUBLIC_CLOUD, STORAGE_CLOUD_SSD, STORAGE_CLOUD_ESSD, STORAGE_CLOUD_ESSD_PL2, STORAGE_CLOUD_ESSD_PL3,
|
||||
STORAGE_PUBLIC_CLOUD, STORAGE_CLOUD_SSD, STORAGE_CLOUD_ESSD_PL0, STORAGE_CLOUD_ESSD, STORAGE_CLOUD_ESSD_PL2, STORAGE_CLOUD_ESSD_PL3,
|
||||
STORAGE_EPHEMERAL_SSD, STORAGE_CLOUD_EFFICIENCY,
|
||||
STORAGE_STANDARD_LRS, STORAGE_STANDARDSSD_LRS, STORAGE_PREMIUM_LRS,
|
||||
STORAGE_GP2_SSD, STORAGE_GP3_SSD, STORAGE_IO1_SSD, STORAGE_ST1_HDD, STORAGE_SC1_HDD, STORAGE_STANDARD_HDD,
|
||||
@@ -181,6 +203,7 @@ var (
|
||||
|
||||
SHARED_FILE_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS}
|
||||
FIEL_STORAGE = []string{STORAGE_LOCAL, STORAGE_NFS, STORAGE_GPFS, STORAGE_LVM, STORAGE_CLVM, STORAGE_SLVM}
|
||||
LVM_STORAGE = []string{STORAGE_LVM, STORAGE_CLVM, STORAGE_SLVM}
|
||||
|
||||
// supported shared storage types
|
||||
SHARED_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS, STORAGE_RBD, STORAGE_CLVM, STORAGE_SLVM}
|
||||
@@ -223,6 +246,9 @@ type StorageResourceInput struct {
|
||||
type StorageFilterListInputBase struct {
|
||||
StorageResourceInput
|
||||
|
||||
// 以host过滤
|
||||
StorageHostId string `json:"storage_host_id"`
|
||||
|
||||
// 以存储名称排序
|
||||
// pattern:asc|desc
|
||||
OrderByStorage string `json:"order_by_storage"`
|
||||
@@ -269,4 +295,7 @@ type StorageListInput struct {
|
||||
|
||||
// filter storages of baremetal host
|
||||
IsBaremetal *bool `json:"is_baremetal"`
|
||||
|
||||
// filter by storage type
|
||||
StorageType string `json:"storage_type"`
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ const (
|
||||
STATUS_UPDATE_TAGS = "update_tags"
|
||||
STATUS_UPDATE_TAGS_FAILED = "update_tags_fail"
|
||||
|
||||
STATUS_START_SYNC_STATUS = "start_sync_status"
|
||||
|
||||
STATUS_SYNC_STATUS = "sync_status"
|
||||
STATUS_DELETING = "deleting"
|
||||
STATUS_DELETE_FAILED = "delete_failed"
|
||||
@@ -56,6 +58,10 @@ const (
|
||||
STATUS_AVAILABLE = "available"
|
||||
STATUS_CREATE_FAILED = "create_failed"
|
||||
|
||||
// 更改计费模式
|
||||
STATUS_CHANGE_BILLING_TYPE = "change_billing_type"
|
||||
STATUS_CHANGE_BILLING_TYPE_FAILED = "change_billing_type_failed"
|
||||
|
||||
CLOUD_TAG_PREFIX = "ext:"
|
||||
USER_TAG_PREFIX = "user:"
|
||||
SYS_CLOUD_TAG_PREFIX = "sys:"
|
||||
@@ -142,3 +148,28 @@ var (
|
||||
func IsARM(osArch string) bool {
|
||||
return utils.IsInStringArray(osArch, ARCH_ARM)
|
||||
}
|
||||
|
||||
func IsX86(osArch string) bool {
|
||||
return utils.IsInStringArray(osArch, ARCH_X86)
|
||||
}
|
||||
|
||||
func IsIllegalSearchDomain(domain string) bool {
|
||||
switch domain {
|
||||
case "cloud.onecloud.io":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func IsSameArch(arch1, arch2 string) bool {
|
||||
if arch1 == arch2 {
|
||||
return true
|
||||
}
|
||||
if IsARM(arch1) && IsARM(arch2) {
|
||||
return true
|
||||
}
|
||||
if IsX86(arch1) && IsX86(arch2) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -236,6 +236,7 @@ var (
|
||||
// kubeserver blacklist options
|
||||
// ############################
|
||||
"running_mode",
|
||||
"enable_default_policy",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -44,6 +44,10 @@ type IdentityProviderDetails struct {
|
||||
// 该认证源关联的所有域的组数量
|
||||
GroupCount int `json:"group_count,allowempty"`
|
||||
|
||||
// 该认证源的URL, 可以区分ladp是否使用TLS
|
||||
// example: ldaps://192.168.100.10, ldap://192.168.100.10
|
||||
URL string `json:"url,allowempty"`
|
||||
|
||||
SIdentityProvider
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ const (
|
||||
IMAGE_STATUS_DELETED = "deleted"
|
||||
IMAGE_STATUS_PENDING_DELETE = "pending_delete"
|
||||
|
||||
IMAGE_STATUS_UNKNOWN = "unkown"
|
||||
|
||||
IMAGE_STATUS_SYNC_CLASS_METADATA_FAILEd = "sync_class_metadata_failed"
|
||||
|
||||
ImageTypeTemplate = TImageType("image")
|
||||
@@ -59,6 +61,7 @@ const (
|
||||
IMAGE_OS_VERSION = "os_version"
|
||||
IMAGE_DISK_FORMAT = "disk_format"
|
||||
IMAGE_UEFI_SUPPORT = "uefi_support"
|
||||
IMAGE_BIOS_SUPPORT = "bios_support"
|
||||
IMAGE_IS_LVM_PARTITION = "is_lvm_partition"
|
||||
IMAGE_IS_READONLY = "is_readonly"
|
||||
IMAGE_PARTITION_TYPE = "partition_type"
|
||||
|
||||
@@ -111,6 +111,25 @@ type ImageCreateInput struct {
|
||||
Properties map[string]string `json:"properties"`
|
||||
}
|
||||
|
||||
type ImageUpdateInput struct {
|
||||
apis.SharableVirtualResourceBaseUpdateInput
|
||||
|
||||
// 最小系统盘要求
|
||||
MinDiskMB *int32 `json:"min_disk"`
|
||||
// 最小内存要求
|
||||
MinRamMB *int32 `json:"min_ram"`
|
||||
// 是否有删除保护
|
||||
Protected *bool `json:"protected"`
|
||||
// 是否是标准镜像
|
||||
IsStandard *bool `json:"is_standard"`
|
||||
|
||||
// 是否是数据盘镜像
|
||||
IsData *bool `json:"is_data"`
|
||||
|
||||
// 镜像属性
|
||||
Properties map[string]string `json:"properties"`
|
||||
}
|
||||
|
||||
type ImageUpdateStatusInput struct {
|
||||
apis.Meta
|
||||
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
|
||||
package apis
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/pkg/util/billing"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
)
|
||||
|
||||
type DomainizedResourceInput struct {
|
||||
// 指定项目归属域名称或ID
|
||||
@@ -390,8 +396,25 @@ type DistinctFieldsInput struct {
|
||||
}
|
||||
|
||||
type PostpaidExpireInput struct {
|
||||
Duration string `json:"duration"`
|
||||
ExpireTime time.Time `json:"expire_time"`
|
||||
Duration string `json:"duration"`
|
||||
// swagger:ignore
|
||||
ExpireTime time.Time `json:"expire_time" yunion-deprecated-by:"release_at"`
|
||||
// 到期释放时间
|
||||
ReleaseAt time.Time `json:"release_at"`
|
||||
}
|
||||
|
||||
func (input *PostpaidExpireInput) GetReleaseAt() (time.Time, error) {
|
||||
if !input.ReleaseAt.IsZero() {
|
||||
return input.ReleaseAt, nil
|
||||
}
|
||||
if len(input.Duration) == 0 {
|
||||
return time.Time{}, httperrors.NewInputParameterError("missing duration/expire_time")
|
||||
}
|
||||
bc, err := billing.ParseBillingCycle(input.Duration)
|
||||
if err != nil {
|
||||
return time.Time{}, httperrors.NewInputParameterError("invalid duration: %s", input.Duration)
|
||||
}
|
||||
return bc.EndAt(time.Now()), nil
|
||||
}
|
||||
|
||||
type AutoRenewInput struct {
|
||||
|
||||
@@ -168,6 +168,8 @@ type ModelBaseListInput struct {
|
||||
ExportKeys string `json:"export_keys" help:"Export field keys"`
|
||||
// 返回结果携带delete_fail_reason和update_fail_reason字段
|
||||
ShowFailReason *bool `json:"show_fail_reason"`
|
||||
// 是否返回状态统计信息,默认为False
|
||||
SummaryStats *bool `json:"summary_stats"`
|
||||
}
|
||||
|
||||
func (o ModelBaseListInput) GetExportKeys() string {
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
@@ -84,20 +86,37 @@ type AlertSetting struct {
|
||||
Conditions []AlertCondition `json:"conditions"`
|
||||
}
|
||||
|
||||
type AlertCondition struct {
|
||||
Type string `json:"type"`
|
||||
Query AlertQuery `json:"query"`
|
||||
Reducer Condition `json:"reducer"`
|
||||
Evaluator Condition `json:"evaluator"`
|
||||
Operator string `json:"operator"`
|
||||
func (s AlertSetting) String() string {
|
||||
return jsonutils.Marshal(s).String()
|
||||
}
|
||||
|
||||
func (s AlertSetting) IsZero() bool {
|
||||
return len(s.Conditions) == 0
|
||||
}
|
||||
|
||||
type AlertCondition struct {
|
||||
Type string `json:"type"`
|
||||
Query AlertQuery `json:"query"`
|
||||
Reducer Condition `json:"reducer"`
|
||||
ReducerOrder ResultReducerOrder `json:"reducer_order"`
|
||||
Evaluator Condition `json:"evaluator"`
|
||||
Operator string `json:"operator"`
|
||||
}
|
||||
|
||||
type ResultReducerOrder string
|
||||
|
||||
const (
|
||||
RESULT_REDUCER_ORDER_ASC ResultReducerOrder = "asc"
|
||||
RESULT_REDUCER_ORDER_DESC ResultReducerOrder = "desc"
|
||||
)
|
||||
|
||||
type AlertQuery struct {
|
||||
Model MetricQuery `json:"model"`
|
||||
From string `json:"from"`
|
||||
To string `json:"to"`
|
||||
// 查询结果 reducer,执行 p95 这些操作
|
||||
ResultReducer *Condition `json:"result_reducer"`
|
||||
ResultReducer *Condition `json:"result_reducer"`
|
||||
ResultReducerOrder ResultReducerOrder `json:"result_reducer_order"`
|
||||
}
|
||||
|
||||
type AlertCreateInput struct {
|
||||
@@ -188,6 +207,7 @@ type EvalMatch struct {
|
||||
Tags map[string]string `json:"tags"`
|
||||
Unit string `json:"unit"`
|
||||
AlertDetails jsonutils.JSONObject `json:"alert_details"`
|
||||
IsRecovery bool `json:"is_recovery"`
|
||||
}
|
||||
|
||||
type AlertTestRunOutput struct {
|
||||
@@ -212,3 +232,9 @@ type AlertPauseInput struct {
|
||||
|
||||
Paused bool `json:"paused"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
gotypes.RegisterSerializable(reflect.TypeOf(&AlertSetting{}), func() gotypes.ISerializable {
|
||||
return &AlertSetting{}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
@@ -41,7 +39,7 @@ type AlertPanelDetail struct {
|
||||
PanelName string `json:"panel_name"`
|
||||
PanelId string `json:"panel_id"`
|
||||
Refresh string `json:"refresh"`
|
||||
Setting jsonutils.JSONObject
|
||||
Setting *AlertSetting
|
||||
PanelDetails
|
||||
}
|
||||
|
||||
@@ -53,3 +51,10 @@ type AlertClonePanelInput struct {
|
||||
type AlertCloneDashboardInput struct {
|
||||
CloneName string `json:"clone_name"`
|
||||
}
|
||||
|
||||
type AlertPanelSetOrderInput struct {
|
||||
Order []struct {
|
||||
PanelId string `json:"panel_id"`
|
||||
Index int `json:"index"`
|
||||
} `json:"order"`
|
||||
}
|
||||
|
||||
28
pkg/apis/monitor/alertjoint.go
Normal file
28
pkg/apis/monitor/alertjoint.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package monitor
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type AlertJointCreateInput struct {
|
||||
apis.Meta
|
||||
|
||||
AlertId string `json:"alert_id"`
|
||||
}
|
||||
|
||||
type AlertJointListInput struct {
|
||||
apis.JointResourceBaseListInput
|
||||
AlertIds []string `json:"alert_ids"`
|
||||
}
|
||||
@@ -36,12 +36,7 @@ type AlertJointResourceBaseDetails struct {
|
||||
type AlertnotificationDetails struct {
|
||||
AlertJointResourceBaseDetails
|
||||
Notification string `json:"notification"`
|
||||
}
|
||||
|
||||
type AlertJointCreateInput struct {
|
||||
apis.Meta
|
||||
|
||||
AlertId string `json:"alert_id"`
|
||||
Frequency int64 `json:"frequency"`
|
||||
}
|
||||
|
||||
type AlertnotificationCreateInput struct {
|
||||
@@ -51,3 +46,7 @@ type AlertnotificationCreateInput struct {
|
||||
UsedBy string `json:"used_by"`
|
||||
Params jsonutils.JSONObject `json:"params"`
|
||||
}
|
||||
|
||||
type AlertNotificationListInput struct {
|
||||
AlertJointListInput
|
||||
}
|
||||
|
||||
@@ -39,12 +39,13 @@ type AlertRecordListInput struct {
|
||||
ResType string `json:"res_type"`
|
||||
Alerting bool `json:"alerting"`
|
||||
ResName string `json:"res_name"`
|
||||
ResId string `json:"res_id"`
|
||||
}
|
||||
|
||||
type AlertRecordDetails struct {
|
||||
SAlertRecord
|
||||
|
||||
apis.StatusStandaloneResourceDetails
|
||||
apis.StandaloneAnonResourceDetails
|
||||
apis.ScopedResourceBaseInfo
|
||||
|
||||
ResNum int64 `json:"res_num"`
|
||||
@@ -52,20 +53,6 @@ type AlertRecordDetails struct {
|
||||
TriggerTime time.Time
|
||||
}
|
||||
|
||||
func (self AlertRecordDetails) GetMetricTags() map[string]string {
|
||||
ret := map[string]string{
|
||||
"id": self.Id,
|
||||
"alert_id": self.AlertId,
|
||||
"alert_name": self.AlertName,
|
||||
"domain_id": self.DomainId,
|
||||
"project_domain": self.ProjectDomain,
|
||||
"res_type": self.ResType,
|
||||
"tenant": self.Tenant,
|
||||
"tenant_id": self.TenantId,
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
type AlertRecordCreateInput struct {
|
||||
apis.StandaloneResourceCreateInput
|
||||
|
||||
@@ -98,3 +85,26 @@ type AlertRecordRule struct {
|
||||
SilentPeriod string `json:"silent_period"`
|
||||
Reducer string `json:"reducer"`
|
||||
}
|
||||
|
||||
type AlertRecordHistoryAlertData struct {
|
||||
ProjectId string `json:"project_id"`
|
||||
Project string `json:"project"`
|
||||
DomainId string `json:"domain_id"`
|
||||
Domain string `json:"domain"`
|
||||
ResType string `json:"res_type"`
|
||||
ResNum int64 `json:"res_num"`
|
||||
}
|
||||
|
||||
func (self AlertRecordHistoryAlertData) GetMetricTags() map[string]string {
|
||||
return map[string]string{
|
||||
"tenant_id": self.ProjectId,
|
||||
"domain_id": self.DomainId,
|
||||
"domain": self.Domain,
|
||||
"tenant": self.Project,
|
||||
"res_type": self.ResType,
|
||||
}
|
||||
}
|
||||
|
||||
type AlertRecordHistoryAlert struct {
|
||||
Data []AlertRecordHistoryAlertData `json:"data"`
|
||||
}
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
|
||||
package monitor
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
import (
|
||||
"yunion.io/x/pkg/util/sets"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
const EXT_PREFIX = "ext"
|
||||
|
||||
@@ -56,6 +60,18 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
MetricCloudResTypes = sets.NewString(
|
||||
METRIC_RES_TYPE_HOST,
|
||||
METRIC_RES_TYPE_AGENT,
|
||||
METRIC_RES_TYPE_GUEST,
|
||||
METRIC_RES_TYPE_OSS,
|
||||
METRIC_RES_TYPE_RDS,
|
||||
METRIC_RES_TYPE_REDIS,
|
||||
METRIC_RES_TYPE_TENANT,
|
||||
METRIC_RES_TYPE_DOMAIN,
|
||||
METRIC_RES_TYPE_STORAGE,
|
||||
METRIC_RES_TYPE_CLOUDACCOUNT)
|
||||
|
||||
MetricResType = []string{METRIC_RES_TYPE_GUEST, METRIC_RES_TYPE_HOST, METRIC_RES_TYPE_REDIS, METRIC_RES_TYPE_OSS,
|
||||
METRIC_RES_TYPE_RDS, METRIC_RES_TYPE_CLOUDACCOUNT}
|
||||
MetricUnit = []string{METRIC_UNIT_PERCENT, METRIC_UNIT_BPS, METRIC_UNIT_MBPS, METRIC_UNIT_BYTEPS, "count/s",
|
||||
|
||||
@@ -39,9 +39,10 @@ type MonitorResourceListInput struct {
|
||||
apis.EnabledResourceBaseListInput
|
||||
compute.ManagedResourceListInput
|
||||
|
||||
ResId []string `json:"res_id"`
|
||||
ResType string `json:"res_type"`
|
||||
OnlyResId bool `json:"only_res_id"`
|
||||
ResId []string `json:"res_id"`
|
||||
ResType string `json:"res_type"`
|
||||
OnlyResId bool `json:"only_res_id"`
|
||||
AlertStates []string `json:"alert_states"`
|
||||
|
||||
ResName string `json:"res_name"`
|
||||
}
|
||||
|
||||
@@ -19,10 +19,12 @@ type NotificationTemplateCreateInput struct {
|
||||
}
|
||||
|
||||
type NotificationTemplateConfig struct {
|
||||
Title string `json:"title"`
|
||||
Name string `json:"name"`
|
||||
ResourceName string `json:"resource_name"`
|
||||
Matches []EvalMatch `json:"matches"`
|
||||
Title string `json:"title"`
|
||||
Name string `json:"name"`
|
||||
ResourceName string `json:"resource_name"`
|
||||
Matches []*EvalMatch `json:"matches"`
|
||||
MatchTags []map[string]string `json:"match_tags"`
|
||||
MatchTagsStr []string `json:"match_tags_str"`
|
||||
// PrevAlertState AlertStateType `json:"prev_alert_state"`
|
||||
// State AlertStateType `json:"state"`
|
||||
NoDataFound bool `json:"no_data"`
|
||||
|
||||
@@ -23,7 +23,7 @@ var (
|
||||
UNIFIED_MONITOR_FIELD_OPT_TYPE = []string{"Aggregations", "Selectors"}
|
||||
UNIFIED_MONITOR_GROUPBY_OPT_TYPE = []string{"time", "tag", "fill"}
|
||||
UNIFIED_MONITOR_FIELD_OPT_VALUE = map[string][]string{
|
||||
"Aggregations": {"MEAN", "SUM"}, // {"COUNT", "DISTINCT", "INTEGRAL", "MEAN", "MEDIAN", "MODE", "STDDEV", "SUM"},
|
||||
"Aggregations": {"MEAN", "SUM", "MAX", "MIN"}, // {"COUNT", "DISTINCT", "INTEGRAL", "MEAN", "MEDIAN", "MODE", "STDDEV", "SUM"},
|
||||
"Selectors": {"BOTTOM", "FIRST", "LAST", "MAX", "MIN", "TOP"},
|
||||
}
|
||||
UNIFIED_MONITOR_GROUPBY_OPT_VALUE = map[string][]string{
|
||||
@@ -65,6 +65,27 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func GetMeasurementTagIdKeyByResType(resType string) string {
|
||||
return MEASUREMENT_TAG_ID[resType]
|
||||
}
|
||||
|
||||
func GetMeasurementTagIdKeyByResTypeWithDefault(resType string) string {
|
||||
tagId := GetMeasurementTagIdKeyByResType(resType)
|
||||
if len(tagId) == 0 {
|
||||
tagId = "host_id"
|
||||
}
|
||||
return tagId
|
||||
}
|
||||
|
||||
func GetMeasurementResourceId(tags map[string]string, resType string) string {
|
||||
return tags[GetMeasurementTagIdKeyByResType(resType)]
|
||||
}
|
||||
|
||||
func GetResourceIdFromTagWithDefault(tags map[string]string, resType string) string {
|
||||
tagId := GetMeasurementTagIdKeyByResTypeWithDefault(resType)
|
||||
return tags[tagId]
|
||||
}
|
||||
|
||||
type MetricFunc struct {
|
||||
FieldOptType []string `json:"field_opt_type"`
|
||||
FieldOptValue map[string][]string `json:"field_opt_value"`
|
||||
@@ -86,6 +107,9 @@ type SimpleQueryInput struct {
|
||||
EndTime time.Time `json:"end_time"`
|
||||
// 指定标签
|
||||
Tags map[string]string `json:"tag_pairs"`
|
||||
// 间隔周期
|
||||
// default: 5m
|
||||
Interval string `json:"interval"`
|
||||
}
|
||||
|
||||
type SimpleQueryOutput struct {
|
||||
@@ -107,11 +131,12 @@ type TimeSeriesSlice []*TimeSeries
|
||||
|
||||
type TimeSeries struct {
|
||||
// RawName is used to frontend displaying the curve name
|
||||
RawName string `json:"raw_name"`
|
||||
Columns []string `json:"columns"`
|
||||
Name string `json:"name"`
|
||||
Points TimeSeriesPoints `json:"points"`
|
||||
Tags map[string]string `json:"tags,omitempty"`
|
||||
RawName string `json:"raw_name"`
|
||||
Columns []string `json:"columns"`
|
||||
Name string `json:"name"`
|
||||
Points TimeSeriesPoints `json:"points"`
|
||||
Tags map[string]string `json:"tags,omitempty"`
|
||||
CloudTags map[string]string `json:"cloud_tags,omitempty"`
|
||||
}
|
||||
|
||||
type TimePoint []interface{}
|
||||
@@ -145,11 +170,35 @@ func (p TimePoint) IsValids() bool {
|
||||
}
|
||||
|
||||
func (p TimePoint) Value() float64 {
|
||||
return *(p[0].(*float64))
|
||||
v := p[0]
|
||||
if fval, ok := v.(*float64); ok {
|
||||
return *fval
|
||||
}
|
||||
if ival, ok := v.(*int64); ok {
|
||||
return float64(*ival)
|
||||
}
|
||||
if t, ok := v.(float64); ok {
|
||||
return t
|
||||
}
|
||||
if t, ok := v.(int64); ok {
|
||||
return float64(t)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (p TimePoint) Timestamp() float64 {
|
||||
return p[len(p)-1].(float64)
|
||||
v := p[len(p)-1]
|
||||
if t, ok := v.(float64); ok {
|
||||
return t
|
||||
}
|
||||
if t, ok := v.(int64); ok {
|
||||
return float64(t)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (p TimePoint) Time() time.Time {
|
||||
return time.UnixMilli(int64(p.Timestamp()))
|
||||
}
|
||||
|
||||
func (p TimePoint) Values() []float64 {
|
||||
|
||||
@@ -29,11 +29,11 @@ type SAlert struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
SMonitorScopedResource
|
||||
// Frequency is evaluate period
|
||||
Frequency int64 `json:"frequency"`
|
||||
Settings jsonutils.JSONObject `json:"settings"`
|
||||
Level string `json:"level"`
|
||||
Message string `json:"message"`
|
||||
UsedBy string `json:"used_by"`
|
||||
Frequency int64 `json:"frequency"`
|
||||
Settings *AlertSetting `json:"settings"`
|
||||
Level string `json:"level"`
|
||||
Message string `json:"message"`
|
||||
UsedBy string `json:"used_by"`
|
||||
// Silenced bool
|
||||
ExecutionError string `json:"execution_error"`
|
||||
// If an alert rule has a configured `For` and the query violates the configured threshold
|
||||
|
||||
@@ -214,9 +214,10 @@ type SNotifyConfigContent struct {
|
||||
Username string
|
||||
SenderAddress string
|
||||
//Lark
|
||||
AppId string
|
||||
AppSecret string
|
||||
AccessToken string
|
||||
AppId string
|
||||
AppSecret string
|
||||
AccessToken string
|
||||
AccessTokenExpireTime time.Time
|
||||
// workwx
|
||||
AgentId string
|
||||
CorpId string
|
||||
|
||||
@@ -66,6 +66,7 @@ var (
|
||||
ActionIsolatedDeviceUpdate SAction = "isolated_device_update"
|
||||
ActionIsolatedDeviceDelete SAction = "isolated_device_delete"
|
||||
ActionStatusChanged SAction = "status_changed"
|
||||
ActionRunTask SAction = "run_task"
|
||||
|
||||
ResultFailed SResult = "failed"
|
||||
ResultSucceed SResult = "succeed"
|
||||
|
||||
@@ -102,6 +102,8 @@ type NotificationManagerEventNotifyInput struct {
|
||||
// description: direct contact, admin privileges required
|
||||
// required: false
|
||||
Contacts []SContact `json:"contacts"`
|
||||
// 消息机器人列表
|
||||
RobotIds []string `json:"robot_ids"`
|
||||
// description: contact types
|
||||
// required: false
|
||||
// example: email
|
||||
|
||||
@@ -90,6 +90,9 @@ type ScheduleInput struct {
|
||||
// For Migrate
|
||||
CpuNumaPin []SCpuNumaPin `json:"cpu_numa_pin"`
|
||||
|
||||
// GuestIds
|
||||
GuestIds []string `json:"guest_ids"`
|
||||
|
||||
HostMemPageSizeKB int `json:"host_mem_page_size"`
|
||||
SkipKernelCheck *bool `json:"skip_kernel_check"`
|
||||
TargetHostKernel string `json:"target_host_kernel"`
|
||||
|
||||
@@ -38,4 +38,8 @@ const (
|
||||
CLOUDPODS = "cloudpods"
|
||||
PROXMOX = "proxmox"
|
||||
VOLC_ENGINE = "volcengine"
|
||||
BAIDU = "baidu"
|
||||
SANGFOR = "sangfor"
|
||||
CNWARE = "cnware"
|
||||
KSYUN = "ksyun"
|
||||
)
|
||||
|
||||
@@ -23,7 +23,6 @@ import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
olog "log"
|
||||
"math/rand"
|
||||
"net"
|
||||
@@ -78,6 +77,8 @@ type Application struct {
|
||||
isTLS bool
|
||||
|
||||
enableProfiling bool
|
||||
|
||||
allowTLS1x bool
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -92,13 +93,13 @@ const (
|
||||
|
||||
var quitHandlerRegisted bool
|
||||
|
||||
func NewApplication(name string, connMax int, db bool) *Application {
|
||||
func NewApplication(name string, connMax int, queueSize int, db bool) *Application {
|
||||
app := Application{name: name,
|
||||
context: ctx.CtxWithTime(),
|
||||
connMax: connMax,
|
||||
session: NewWorkerManager("HttpRequestWorkerManager", connMax, DEFAULT_BACKLOG, db),
|
||||
readSession: NewWorkerManager("HttpGetRequestWorkerManager", connMax, DEFAULT_BACKLOG, db),
|
||||
systemSession: NewWorkerManager("InternalHttpRequestWorkerManager", 1, DEFAULT_BACKLOG, false),
|
||||
session: NewWorkerManager("HttpRequestWorkerManager", connMax, connMax*queueSize, db),
|
||||
readSession: NewWorkerManager("HttpGetRequestWorkerManager", connMax, connMax*queueSize, db),
|
||||
systemSession: NewWorkerManager("InternalHttpRequestWorkerManager", 1, queueSize, false),
|
||||
roots: make(map[string]*RadixNode),
|
||||
rootLock: &sync.RWMutex{},
|
||||
idleTimeout: DEFAULT_IDLE_TIMEOUT,
|
||||
@@ -139,6 +140,12 @@ func (app *Application) SetDefaultTimeout(to time.Duration) *Application {
|
||||
return app
|
||||
}
|
||||
|
||||
func (app *Application) AllowTLS1x() *Application {
|
||||
log.Infof("Allow TLS1.0&1.1")
|
||||
app.allowTLS1x = true
|
||||
return app
|
||||
}
|
||||
|
||||
func SplitPath(path string) []string {
|
||||
ret := make([]string, 0)
|
||||
for _, seg := range strings.Split(path, "/") {
|
||||
@@ -361,6 +368,7 @@ func (app *Application) defaultHandle(w http.ResponseWriter, r *http.Request, ri
|
||||
w.Header().Set("Server", "Yunion AppServer/Go/2018.4")
|
||||
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
|
||||
w.Header().Set("X-XSS-Protection", "1; mode=block")
|
||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
if app.isTLS {
|
||||
w.Header().Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains")
|
||||
}
|
||||
@@ -406,11 +414,11 @@ func (app *Application) defaultHandle(w http.ResponseWriter, r *http.Request, ri
|
||||
task.appParams.Request = r
|
||||
task.appParams.Response = w
|
||||
if r.Body != nil && r.ContentLength > 0 && getContentType(r) == ContentTypeJson {
|
||||
data, _ := ioutil.ReadAll(r.Body)
|
||||
data, _ := io.ReadAll(r.Body)
|
||||
task.appParams.Body, _ = jsonutils.Parse(data)
|
||||
r.Body = ioutil.NopCloser(bytes.NewBuffer(data))
|
||||
r.Body = io.NopCloser(bytes.NewBuffer(data))
|
||||
}
|
||||
session.Run(
|
||||
inqueue := session.Run(
|
||||
task,
|
||||
currentWorker,
|
||||
func(err error) {
|
||||
@@ -418,13 +426,17 @@ func (app *Application) defaultHandle(w http.ResponseWriter, r *http.Request, ri
|
||||
task.fw.closeChannels()
|
||||
},
|
||||
)
|
||||
runErr := task.fw.wait(task.ctx, currentWorker)
|
||||
if runErr != nil {
|
||||
switch je := runErr.(type) {
|
||||
case *httputils.JSONClientError:
|
||||
httperrors.GeneralServerError(task.ctx, w, je)
|
||||
default:
|
||||
httperrors.InternalServerError(task.ctx, w, "Internal server error")
|
||||
if !inqueue {
|
||||
httperrors.TooManyRequestsError(task.ctx, w, "Request queue is full")
|
||||
} else {
|
||||
runErr := task.fw.wait(task.ctx, currentWorker)
|
||||
if runErr != nil {
|
||||
switch je := runErr.(type) {
|
||||
case *httputils.JSONClientError:
|
||||
httperrors.GeneralServerError(task.ctx, w, je)
|
||||
default:
|
||||
httperrors.InternalServerError(task.ctx, w, "Internal server error")
|
||||
}
|
||||
}
|
||||
}
|
||||
task.fw.closeChannels()
|
||||
@@ -469,6 +481,10 @@ func timeoutHandle(h http.Handler) http.HandlerFunc {
|
||||
}
|
||||
|
||||
func (app *Application) initServer(addr string) *http.Server {
|
||||
return InitHTTPServer(app, addr)
|
||||
}
|
||||
|
||||
func InitHTTPServer(app *Application, addr string) *http.Server {
|
||||
/* db := AppContextDB(app.context)
|
||||
if db != nil {
|
||||
db.SetMaxIdleConns(app.connMax + 1)
|
||||
@@ -478,7 +494,18 @@ func (app *Application) initServer(addr string) *http.Server {
|
||||
|
||||
cipherSuites := []uint16{}
|
||||
for _, suite := range tls.CipherSuites() {
|
||||
cipherSuites = append(cipherSuites, suite.ID)
|
||||
if !strings.HasSuffix(suite.Name, "_SHA") {
|
||||
cipherSuites = append(cipherSuites, suite.ID)
|
||||
}
|
||||
}
|
||||
|
||||
minTLSVer := uint16(tls.VersionTLS12)
|
||||
if app.allowTLS1x {
|
||||
minTLSVer = tls.VersionTLS10
|
||||
}
|
||||
tlsConf := &tls.Config{
|
||||
CipherSuites: cipherSuites,
|
||||
MinVersion: minTLSVer,
|
||||
}
|
||||
|
||||
s := &http.Server{
|
||||
@@ -493,9 +520,7 @@ func (app *Application) initServer(addr string) *http.Server {
|
||||
// issue like: https://github.com/megaease/easegress/issues/481
|
||||
ErrorLog: olog.New(io.Discard, "", olog.LstdFlags),
|
||||
|
||||
TLSConfig: &tls.Config{
|
||||
CipherSuites: cipherSuites,
|
||||
},
|
||||
TLSConfig: tlsConf,
|
||||
}
|
||||
return s
|
||||
}
|
||||
@@ -603,22 +628,6 @@ func (app *Application) listenAndServeInternal(s *http.Server, certFile, keyFile
|
||||
}
|
||||
}
|
||||
|
||||
func isJsonContentType(r *http.Request) bool {
|
||||
contType := strings.ToLower(r.Header.Get("Content-Type"))
|
||||
if strings.HasPrefix(contType, "application/json") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func isFormContentType(r *http.Request) bool {
|
||||
contType := strings.ToLower(r.Header.Get("Content-Type"))
|
||||
if strings.HasPrefix(contType, "application/json") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type TContentType string
|
||||
|
||||
const (
|
||||
|
||||
@@ -49,7 +49,7 @@ type ApplicationTestSuit struct {
|
||||
}
|
||||
|
||||
func (suite *ApplicationTestSuit) SetupTest() {
|
||||
suite.app = NewApplication("test", 4, false)
|
||||
suite.app = NewApplication("test", 4, 10, false)
|
||||
suite.app.AddHandler("GET", "/delay", func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
time.Sleep(time.Second * 1)
|
||||
Send(w, "delay pong")
|
||||
|
||||
@@ -20,6 +20,8 @@ import (
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
"yunion.io/x/pkg/util/version"
|
||||
)
|
||||
|
||||
@@ -85,3 +87,26 @@ func profSymbol(_ context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
func profTrace(_ context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
pprof.Trace(w, r)
|
||||
}
|
||||
|
||||
func AddMiscHandlersToMuxRouter(app *Application, root *mux.Router, enableProfiling bool) {
|
||||
adapterF := func(appHandleFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request)) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
appHandleFunc(app.GetContext(), w, r)
|
||||
}
|
||||
}
|
||||
root.HandleFunc("/version", adapterF(VersionHandler))
|
||||
root.HandleFunc("/stats", adapterF(StatisticHandler))
|
||||
root.HandleFunc("/ping", adapterF(PingHandler))
|
||||
root.HandleFunc("/worker_stats", adapterF(WorkerStatsHandler))
|
||||
if enableProfiling {
|
||||
pp := "/debug/pprof"
|
||||
ppPath := func(sufix string) string {
|
||||
return fmt.Sprintf("%s/%s", pp, sufix)
|
||||
}
|
||||
root.HandleFunc(ppPath(""), pprof.Index)
|
||||
root.HandleFunc(ppPath("cmdline"), pprof.Cmdline)
|
||||
root.HandleFunc(ppPath("profile"), pprof.Profile)
|
||||
root.HandleFunc(ppPath("symbol"), pprof.Symbol)
|
||||
root.HandleFunc(ppPath("trace"), pprof.Trace)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +188,12 @@ func NewWorkerManager(name string, workerCount int, backlog int, dbWorker bool)
|
||||
}
|
||||
|
||||
func NewWorkerManagerIgnoreOverflow(name string, workerCount int, backlog int, dbWorker bool, ignoreOverflow bool) *SWorkerManager {
|
||||
if workerCount <= 0 {
|
||||
workerCount = 1
|
||||
}
|
||||
if backlog <= 0 {
|
||||
backlog = 128
|
||||
}
|
||||
manager := SWorkerManager{name: name,
|
||||
queue: NewRing(workerCount * backlog),
|
||||
workerCount: workerCount,
|
||||
@@ -292,15 +298,14 @@ func (wm *SWorkerManager) scheduleWithLock() {
|
||||
log.Debugf("no enough worker, add new worker %s", worker)
|
||||
}
|
||||
go worker.run()
|
||||
} else if queueSize > 10 {
|
||||
log.Warningf("[%s] BUSY activeWork %d detachedWork %d max %d queue: %d", wm, wm.ActiveWorkerCount(), wm.DetachedWorkerCount(), wm.workerCount, wm.queue.Size())
|
||||
} else if queueSize > 50 {
|
||||
w := wm.activeWorker.list.Front()
|
||||
for w != nil {
|
||||
if w != nil {
|
||||
worker := w.Value.(*SWorker)
|
||||
log.Warningf("work [%s]%s stucking for a while", worker.task.start, worker.task.task.Dump())
|
||||
w = w.Next()
|
||||
}
|
||||
} else if queueSize > 10 {
|
||||
log.Warningf("[%s] BUSY activeWork %d detachedWork %d max %d queue: %d", wm, wm.ActiveWorkerCount(), wm.DetachedWorkerCount(), wm.workerCount, wm.queue.Size())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -630,8 +630,10 @@ func (b *SBaremetalInstance) SaveDesc(ctx context.Context, desc jsonutils.JSONOb
|
||||
b.descLock.Lock()
|
||||
defer b.descLock.Unlock()
|
||||
if desc != nil {
|
||||
if desc != nil && b.desc != nil && b.desc.Contains("server_id") && !desc.Contains("server_id") {
|
||||
desc.(*jsonutils.JSONDict).Set("server_id", jsonutils.NewString(b.server.GetId()))
|
||||
if b.desc != nil && b.desc.Contains("server_id") && !desc.Contains("server_id") {
|
||||
if b.server != nil {
|
||||
desc.(*jsonutils.JSONDict).Set("server_id", jsonutils.NewString(b.server.GetId()))
|
||||
}
|
||||
}
|
||||
b.desc = desc.(*jsonutils.JSONDict)
|
||||
if b.desc.Contains("sys_info") {
|
||||
@@ -1309,10 +1311,17 @@ func (b *SBaremetalInstance) GetTask() tasks.ITask {
|
||||
}
|
||||
|
||||
func (b *SBaremetalInstance) SetTask(task tasks.ITask) {
|
||||
// hack: clear exist tasks if task is server destroy task
|
||||
if task.GetName() == tasks.BAREMETAL_SERVER_DESTROY_TASK {
|
||||
log.Infof("clear tasks of baremetal %s before executing %s", b.GetName(), task.GetName())
|
||||
b.taskQueue.ClearTasks()
|
||||
}
|
||||
b.taskQueue.AppendTask(task)
|
||||
if reflect.DeepEqual(task, b.taskQueue.GetTask()) {
|
||||
log.Infof("Set task equal, ExecuteTask %s", task.GetName())
|
||||
log.Infof("Execute task %s of baremetal %s", task.GetName(), b.GetName())
|
||||
tasks.ExecuteTask(task, nil)
|
||||
} else {
|
||||
log.Warningf("Append task %s of baremetal %s before executing %s", task.GetName(), b.GetName(), b.taskQueue.DebugString())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ func (s *BaremetalService) StartService() {
|
||||
|
||||
s.startAgent(app)
|
||||
|
||||
cron := cronman.InitCronJobManager(false, o.Options.CronJobWorkerCount)
|
||||
cron := cronman.InitCronJobManager(false, o.Options.CronJobWorkerCount, o.Options.TimeZone)
|
||||
cron.AddJobAtIntervals("BaremetalCronJobs", 10*time.Second, baremetal.DoCronJobs)
|
||||
cron.Start()
|
||||
defer cron.Stop()
|
||||
|
||||
@@ -180,6 +180,25 @@ func (q *TaskQueue) AppendTask(task ITask) *TaskQueue {
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *TaskQueue) ClearTasks() {
|
||||
for {
|
||||
existTask := q.PopTask()
|
||||
if existTask != nil {
|
||||
log.Warningf("Clear task %s", existTask.GetName())
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (q *TaskQueue) DebugString() string {
|
||||
str := ""
|
||||
for e := q.objList.Front(); e != nil; e = e.Next() {
|
||||
str += fmt.Sprintf("%s, ", e.Value.(ITask).GetName())
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
type TaskFactory func(userCred mcclient.TokenCredential, bm IBaremetal, taskId string, data jsonutils.JSONObject) ITask
|
||||
|
||||
type SBaremetalTaskBase struct {
|
||||
|
||||
@@ -26,6 +26,10 @@ import (
|
||||
|
||||
var _ IServerBaseDeployTask = new(SBaremetalServerDestroyTask)
|
||||
|
||||
const (
|
||||
BAREMETAL_SERVER_DESTROY_TASK = "BaremetalServerDestroyTask"
|
||||
)
|
||||
|
||||
type SBaremetalServerDestroyTask struct {
|
||||
SBaremetalServerBaseDeployTask
|
||||
}
|
||||
@@ -45,7 +49,7 @@ func NewBaremetalServerDestroyTask(
|
||||
}
|
||||
|
||||
func (self *SBaremetalServerDestroyTask) GetName() string {
|
||||
return "BaremetalServerDestroyTask"
|
||||
return BAREMETAL_SERVER_DESTROY_TASK
|
||||
}
|
||||
|
||||
func (self *SBaremetalServerDestroyTask) RemoveEFIOSEntry() bool {
|
||||
|
||||
@@ -40,7 +40,13 @@ menuentry 'YunionOS for PXE' --class os {
|
||||
`, sleepTime, kernel, kernel, kernelArgs, initrd, initrd)
|
||||
}
|
||||
|
||||
// REF: https://github.com/bluebanquise/infrastructure/blob/master/packages/ipxe-bluebanquise/grub2-efi-autofind.cfg
|
||||
var (
|
||||
BOOT_EFI_MATCHER = "(hd*,gpt*)/EFI/BOOT/BOOTX64.EFI (hd*,msdos*)/EFI/BOOT/BOOTX64.EFI (hd*,gpt*)/EFI/BOOT/BOOTAA64.EFI (hd*,msdos*)/EFI/BOOT/BOOTAA64.EFI"
|
||||
GRUB_EFI_MATCHER = "(md*)/EFI/*/shimx64.efi (md*)/EFI/*/grubx64.efi (hd*,gpt*)/EFI/*/shimx64.efi (hd*,msdos*)/EFI/*/shimx64.efi (hd*,gpt*)/EFI/*/grubx64.efi (hd*,mosdos*)/EFI/*/grubx64.efi (hd*,gpt*)/EFI/*/shimaa64.efi (hd*,msdos*)/EFI/*/shimaa64.efi (hd*,gpt*)/EFI/*/grubaa64.efi (hd*,mosdos*)/EFI/*/grubaa64.efi"
|
||||
GRUB_CFG_MATCHER = "(md*)/boot/*/grub.cfg (md*)/*/grub.cfg (md*)/grub.cfg (md*)/EFI/*/grub.cfg (md*)/EFI/*/*/grub.cfg (hd*,gpt*)/boot/*/grub.cfg (hd*,gpt*)/*/grub.cfg (hd*,gpt*)/grub.cfg (hd*,gpt*)/EFI/*/grub.cfg (hd*,gpt*)/EFI/*/*/grub.cfg (hd*,mosdos*)/boot/*/grub.cfg (hd*,mosdos*)/*/grub.cfg (hd*,mosdos*)/grub.cfg (hd*,mosdos*)/EFI/*/grub.cfg (hd*,mosdos*)/EFI/*/*/grub.cfg"
|
||||
)
|
||||
|
||||
// REF: https://github.com/bluebanquise/infrastructure/blob/master/packages/bluebanquise-ipxe/grub2-efi-autofind.cfg
|
||||
const autoFindCfg = `
|
||||
echo "Loading modules..."
|
||||
insmod part_gpt
|
||||
@@ -48,34 +54,114 @@ insmod fat
|
||||
insmod chain
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
insmod regexp
|
||||
insmod xfs
|
||||
insmod mdraid1x
|
||||
insmod mdraid09
|
||||
|
||||
echo
|
||||
echo "Scanning, first pass..."
|
||||
for cfg in (*,gpt*)/efi/*/grub.cfg (*,gpt*)/efi/*/*/grub.cfg (*,gpt*)/grub.cfg (*,gpt*)/*/grub.cfg (*,gpt*)/*/*/grub.cfg (*,msdos*)/grub.cfg (*,msdos*)/*/grub.cfg (*,mosdos*)/*/*/grub.cfg; do
|
||||
regexp --set=1:cfg_device '^\((.*)\)/' "${cfg}"
|
||||
echo "======================= lsmod ======================================="
|
||||
lsmod
|
||||
|
||||
echo
|
||||
echo "======================= devices ====================================="
|
||||
ls
|
||||
|
||||
echo
|
||||
echo "======================= Searching for the BOOT EFI executable ======="
|
||||
echo "Scanning, 1st pass"
|
||||
for efi in %s; do
|
||||
regexp --set=1:root '^\(([^)]+)\)/' "${efi}"
|
||||
echo "- Scanning: $efi"
|
||||
if [ -e "$efi" ] ; then
|
||||
echo " Found: $efi"
|
||||
else
|
||||
echo " $efi does not exist"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Scanning, second pass..."
|
||||
for cfg in (*,gpt*)/efi/*/grub.cfg (*,gpt*)/efi/*/*/grub.cfg (*,gpt*)/grub.cfg (*,gpt*)/*/grub.cfg (*,gpt*)/*/*/grub.cfg (*,msdos*)/grub.cfg (*,msdos*)/*/grub.cfg (*,mosdos*)/*/*/grub.cfg; do
|
||||
regexp --set=1:cfg_device '^\((.*)\)/' "${cfg}"
|
||||
echo "Try configfile ${cfg}"
|
||||
if [ -e "${cfg}" ]; then
|
||||
cfg_found=true
|
||||
echo " >> Found operating system grub config! <<"
|
||||
echo " Path: ${cfg}"
|
||||
echo " Booting in 5s..."
|
||||
sleep --interruptible --verbose 5
|
||||
configfile "${cfg}"
|
||||
echo
|
||||
echo "Scanning, 2nd pass..."
|
||||
for efi in %s; do
|
||||
echo "- Scanning: $efi"
|
||||
if [ -e "$efi" ] ; then
|
||||
regexp --set 1:root '^\(([^)]+)\)/' "${efi}"
|
||||
echo " Found: $efi"
|
||||
echo " Root: $root"
|
||||
echo " Chainloading $efi"
|
||||
chainloader "$efi"
|
||||
boot
|
||||
fi
|
||||
done
|
||||
|
||||
echo "No grub.cfg known OS found. Fall back on shell after 5s."
|
||||
sleep 5s
|
||||
echo
|
||||
echo " Found no BOOT EFI executable. Falling back to shell..."
|
||||
|
||||
echo
|
||||
echo "======================= Searching for Grub EFI executables =========="
|
||||
echo "Scanning, 1st pass"
|
||||
for efi in %s ; do
|
||||
regexp --set=1:root '^\(([^)]+)\)/' "${efi}"
|
||||
echo "- Scanning: $efi"
|
||||
if [ -e "$efi" ] ; then
|
||||
echo " Found: $efi"
|
||||
else
|
||||
echo " $efi does not exist"
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
echo "Scanning, 2nd pass..."
|
||||
for efi in %s ; do
|
||||
echo "- Scanning: $efi"
|
||||
if [ -e "$efi" ] ; then
|
||||
regexp --set 1:root '^\(([^)]+)\)/' "${efi}"
|
||||
echo " Found: $efi"
|
||||
echo " Root: $root"
|
||||
echo " Chainloading $efi"
|
||||
chainloader "$efi"
|
||||
boot
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
echo " Found no Grub EFI executable to load an OS."
|
||||
|
||||
echo
|
||||
echo "======================= Searching for grub.cfg on local disks ======="
|
||||
echo "Scanning, 1st pass..."
|
||||
for grubcfg in %s ; do
|
||||
regexp --set=1:root '^\(([^)]+)\)/' "${grubcfg}"
|
||||
if [ -e "$grubcfg" ] ; then
|
||||
echo " Found: $grubcfg"
|
||||
else
|
||||
echo " $grubcfg does not exist"
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
echo "Scanning, 2nd pass..."
|
||||
for grubcfg in %s ; do
|
||||
echo "- Scanning: $grubcfg"
|
||||
if [ -e "${grubcfg}" ]; then
|
||||
regexp --set=1:root '^\(([^)]+)\)/' "${grubcfg}"
|
||||
echo " Found: $grubcfg"
|
||||
echo " Root: $root"
|
||||
# echo " Contents:"
|
||||
# cat "$grubcfg"
|
||||
configfile "${grubcfg}"
|
||||
boot
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
echo " Found no grub.cfg configuration file to load."
|
||||
|
||||
sleep 4s
|
||||
`
|
||||
|
||||
func GetAutoFindConfig() string {
|
||||
return autoFindCfg
|
||||
return fmt.Sprintf(autoFindCfg, BOOT_EFI_MATCHER, BOOT_EFI_MATCHER, GRUB_EFI_MATCHER, GRUB_EFI_MATCHER, GRUB_CFG_MATCHER, GRUB_CFG_MATCHER)
|
||||
}
|
||||
|
||||
// REF: https://archived.forum.manjaro.org/t/detecting-efi-files-and-booting-them-from-grub/38083
|
||||
|
||||
@@ -445,13 +445,13 @@ func (adapter *MegaRaidAdaptor) GetDevices() []*baremetal.BaremetalStorage {
|
||||
|
||||
func (adapter *MegaRaidAdaptor) GetLogicVolumes() ([]*raiddrivers.RaidLogicalVolume, error) {
|
||||
errs := make([]error, 0)
|
||||
megaLvs, err := adapter.getMegacliLogicVolumes()
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
megaLvs, megacliErr := adapter.getMegacliLogicVolumes()
|
||||
if megacliErr != nil {
|
||||
errs = append(errs, megacliErr)
|
||||
}
|
||||
storeLvs, err := adapter.getStorcliLogicVolums()
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
storeLvs, storcliErr := adapter.getStorcliLogicVolums()
|
||||
if storcliErr != nil {
|
||||
errs = append(errs, storcliErr)
|
||||
}
|
||||
if len(megaLvs) > 0 {
|
||||
return megaLvs, nil
|
||||
@@ -459,7 +459,7 @@ func (adapter *MegaRaidAdaptor) GetLogicVolumes() ([]*raiddrivers.RaidLogicalVol
|
||||
if len(storeLvs) > 0 {
|
||||
return storeLvs, nil
|
||||
}
|
||||
if len(errs) == 0 {
|
||||
if len(errs) == 0 || megacliErr == nil || storcliErr == nil {
|
||||
// no error, no volume
|
||||
return []*raiddrivers.RaidLogicalVolume{}, nil
|
||||
}
|
||||
|
||||
@@ -54,6 +54,6 @@ func performImageCache(
|
||||
return
|
||||
}
|
||||
|
||||
hostutils.DelayTask(ctx, performTask, disk)
|
||||
hostutils.DelayImageCacheTask(ctx, performTask, disk)
|
||||
hostutils.ResponseOk(ctx, w)
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user