mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-21 00:24:07 +08:00
Compare commits
447 Commits
master
...
v4.0.2-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81a336ea41 | ||
|
|
0c9d242f34 | ||
|
|
db2932e20c | ||
|
|
2d4a3da562 | ||
|
|
0cbdf68df3 | ||
|
|
28bbdd3061 | ||
|
|
8c20fb7e3d | ||
|
|
5904eaf042 | ||
|
|
378177ad2f | ||
|
|
86a6a816af | ||
|
|
a321c89e5f | ||
|
|
dd76886d51 | ||
|
|
29809ce265 | ||
|
|
eb33cdbe4a | ||
|
|
cfde0396c3 | ||
|
|
a640fb3d60 | ||
|
|
f1f66fbed1 | ||
|
|
35649ce641 | ||
|
|
0ff02020e7 | ||
|
|
e1e91c0248 | ||
|
|
f9c73f53c3 | ||
|
|
7bd4869998 | ||
|
|
97becd57ba | ||
|
|
399bfcb2e2 | ||
|
|
3eba59982c | ||
|
|
5e50483cbc | ||
|
|
317497d6c2 | ||
|
|
e7dee4e9a0 | ||
|
|
2a82c99942 | ||
|
|
35b17d1d7c | ||
|
|
518f81ba69 | ||
|
|
8fb0236de5 | ||
|
|
c1cd91e01c | ||
|
|
27500ca14e | ||
|
|
ec0d44e1bc | ||
|
|
0137096ba8 | ||
|
|
6c66130f16 | ||
|
|
cb155ebcbb | ||
|
|
89c836518b | ||
|
|
62ab0616ff | ||
|
|
572d83f146 | ||
|
|
e2bd696ac6 | ||
|
|
faeb5685be | ||
|
|
49088da817 | ||
|
|
dd5dc038cd | ||
|
|
b8e70e1142 | ||
|
|
29dc02f484 | ||
|
|
4dd9e26225 | ||
|
|
17882cca3f | ||
|
|
d0383ff1ab | ||
|
|
3293def16a | ||
|
|
e20f46f7ed | ||
|
|
a8e8641c75 | ||
|
|
2085d9dfa5 | ||
|
|
2c45df0895 | ||
|
|
5a15d84685 | ||
|
|
3e49aac8f6 | ||
|
|
09b5ecbce0 | ||
|
|
8554c93b0f | ||
|
|
6b6147777c | ||
|
|
ddcd72716c | ||
|
|
67d743296d | ||
|
|
4fbe43192d | ||
|
|
16f15ac0fc | ||
|
|
eca000b52e | ||
|
|
3a2ab9e73d | ||
|
|
7a5a2c549a | ||
|
|
9ac509e55b | ||
|
|
4ca1fbfda5 | ||
|
|
80287d6b4d | ||
|
|
7015962121 | ||
|
|
1a87bb18c9 | ||
|
|
af85cca1d6 | ||
|
|
8d9740f149 | ||
|
|
2dd1d6fc26 | ||
|
|
ce338f180a | ||
|
|
6869eca040 | ||
|
|
4666b00bda | ||
|
|
154673e6a3 | ||
|
|
0cd633046f | ||
|
|
f0980d7817 | ||
|
|
2b0a7ac265 | ||
|
|
79166f9aaa | ||
|
|
0ec78aaa8a | ||
|
|
8622137834 | ||
|
|
4a7b6af08a | ||
|
|
41ba24f4b5 | ||
|
|
11dc0d46a2 | ||
|
|
fbdf305ff5 | ||
|
|
2d30cb862f | ||
|
|
c712a848a5 | ||
|
|
01c97c0df6 | ||
|
|
c3f9b88faa | ||
|
|
a49e7437bd | ||
|
|
491cde2257 | ||
|
|
b28bdf43e4 | ||
|
|
4afbf46da1 | ||
|
|
6a0c361ea3 | ||
|
|
80b5a7c04a | ||
|
|
729a523260 | ||
|
|
3e7c73677e | ||
|
|
f12c22e7b6 | ||
|
|
2fee1b6aea | ||
|
|
32d4820a63 | ||
|
|
15c7a825bf | ||
|
|
985995c684 | ||
|
|
52f2d801c1 | ||
|
|
a0f9484770 | ||
|
|
19b0997ab6 | ||
|
|
6274e21053 | ||
|
|
3ba6c1b3ff | ||
|
|
9099f682fb | ||
|
|
a0d28c214f | ||
|
|
fccf389a53 | ||
|
|
8a68f5d7d4 | ||
|
|
51fddda1bd | ||
|
|
65e0f4414e | ||
|
|
c33dc74019 | ||
|
|
705fe7a5d9 | ||
|
|
91617dc81b | ||
|
|
f668f496dc | ||
|
|
69831485a3 | ||
|
|
8d4595be87 | ||
|
|
fcb72e304b | ||
|
|
30b7deb9f5 | ||
|
|
a191da0a77 | ||
|
|
dfbd89c9db | ||
|
|
f53caeb6d1 | ||
|
|
bf4f1755c8 | ||
|
|
9bb6e3eb1b | ||
|
|
33938c6c01 | ||
|
|
4f1bb2a871 | ||
|
|
7abcd04f16 | ||
|
|
2cae726280 | ||
|
|
16aa081789 | ||
|
|
45de538d15 | ||
|
|
a05b793b81 | ||
|
|
7df775f07c | ||
|
|
ec3c9f3a20 | ||
|
|
e2e79cd7cc | ||
|
|
68675541ff | ||
|
|
9ee0e83747 | ||
|
|
4068843773 | ||
|
|
c4b719628b | ||
|
|
66afa2f141 | ||
|
|
51bdf0c655 | ||
|
|
5fc5c5b330 | ||
|
|
1c61483bc1 | ||
|
|
79c45568c7 | ||
|
|
002b37f6a1 | ||
|
|
6a18b70168 | ||
|
|
bbf0991bb3 | ||
|
|
1052eb4451 | ||
|
|
07ce88c828 | ||
|
|
29585a8af6 | ||
|
|
06258859d8 | ||
|
|
2bbd1f792c | ||
|
|
56b41893ec | ||
|
|
cb0729f672 | ||
|
|
e6ec61cab1 | ||
|
|
35e34f019a | ||
|
|
b352d0cc92 | ||
|
|
56e938ee2e | ||
|
|
a9649db617 | ||
|
|
b1ef423c2a | ||
|
|
8da753833d | ||
|
|
16b3d220f4 | ||
|
|
dc5884b361 | ||
|
|
77c471322a | ||
|
|
584b3291cd | ||
|
|
f5a6465629 | ||
|
|
de05e8cc4a | ||
|
|
a839607802 | ||
|
|
6251e28e52 | ||
|
|
3591e9a15f | ||
|
|
84e8b83aab | ||
|
|
cd3190d80f | ||
|
|
b60346b97f | ||
|
|
d3c64b8054 | ||
|
|
914c1a1971 | ||
|
|
13ce2252ce | ||
|
|
3bdfb00850 | ||
|
|
bc7cc1ad07 | ||
|
|
dd7602e628 | ||
|
|
7fe4ac72fe | ||
|
|
55e586121d | ||
|
|
144ee48cec | ||
|
|
b3a3d170e2 | ||
|
|
ebdcabe330 | ||
|
|
e504d0d4e3 | ||
|
|
00ee68c716 | ||
|
|
c6bf60722b | ||
|
|
8e6e30d57f | ||
|
|
1f31c00819 | ||
|
|
a704ab1cea | ||
|
|
b90abee236 | ||
|
|
ee471da787 | ||
|
|
4e1d8f2a98 | ||
|
|
65492d196c | ||
|
|
af73e7e93a | ||
|
|
59089c6792 | ||
|
|
9a19621da0 | ||
|
|
85ad508d83 | ||
|
|
e67f8392a7 | ||
|
|
c9ece3e7de | ||
|
|
b6329b5c23 | ||
|
|
b7a3ed9e27 | ||
|
|
d591b7991b | ||
|
|
e05112b3f6 | ||
|
|
bef839cc7b | ||
|
|
6c7bb1a1b1 | ||
|
|
efe0d135b2 | ||
|
|
185332fa28 | ||
|
|
64fa9f1675 | ||
|
|
60a57b1e1b | ||
|
|
8ac435af8e | ||
|
|
c436fde002 | ||
|
|
f4bcb7ffdf | ||
|
|
38d1d0f766 | ||
|
|
f8001de546 | ||
|
|
bd731ca958 | ||
|
|
6c4a1a3628 | ||
|
|
5387fc03f8 | ||
|
|
37c3db52b9 | ||
|
|
976f0f0bf4 | ||
|
|
f446f86e9f | ||
|
|
4428791397 | ||
|
|
314fb8f08e | ||
|
|
331231ce1a | ||
|
|
a8e4ecfa5a | ||
|
|
51bec5644e | ||
|
|
092a0c2239 | ||
|
|
82bfb4cea1 | ||
|
|
e35ca851a7 | ||
|
|
aba6378177 | ||
|
|
abda8b0400 | ||
|
|
606112ea44 | ||
|
|
aca997796d | ||
|
|
df7d2d3d80 | ||
|
|
42fb3e1327 | ||
|
|
031e54b81e | ||
|
|
f990fe0ba3 | ||
|
|
28dff24e44 | ||
|
|
932e12ae87 | ||
|
|
7e60f49d4a | ||
|
|
cbe77a29e2 | ||
|
|
9ea05affbf | ||
|
|
56825a3cd9 | ||
|
|
0e04ce4371 | ||
|
|
fe36e13dc7 | ||
|
|
fdf9195e8c | ||
|
|
f72104ce60 | ||
|
|
73ddbd4048 | ||
|
|
2f474ff911 | ||
|
|
3edd8dd65b | ||
|
|
cbf4310cab | ||
|
|
f2d77ad487 | ||
|
|
f491efc498 | ||
|
|
bd719d99c0 | ||
|
|
9f037c1baf | ||
|
|
9b6a13037c | ||
|
|
3b6949fe78 | ||
|
|
023309c1cf | ||
|
|
7bfdae3c45 | ||
|
|
6ea9447a92 | ||
|
|
cef3b9effb | ||
|
|
e30d669d19 | ||
|
|
38872edae2 | ||
|
|
cff38d74ec | ||
|
|
f1f01ea823 | ||
|
|
66587b4e52 | ||
|
|
206a4b5b19 | ||
|
|
90f479bafc | ||
|
|
1df9c11501 | ||
|
|
79561cd8ef | ||
|
|
435344ee1d | ||
|
|
15d079f966 | ||
|
|
90aef7ef0c | ||
|
|
390feec8ec | ||
|
|
911694c9fe | ||
|
|
73199002c3 | ||
|
|
0dc21f1b69 | ||
|
|
f593f7f660 | ||
|
|
046a6ac6cb | ||
|
|
7733907f9b | ||
|
|
b43953fc29 | ||
|
|
5f708fe816 | ||
|
|
69056db01a | ||
|
|
d48bab9ddd | ||
|
|
d10a322aec | ||
|
|
f694fead2e | ||
|
|
d4b04f3f2e | ||
|
|
6d633b5647 | ||
|
|
b7870e0453 | ||
|
|
4eb90fc442 | ||
|
|
35093fb7a7 | ||
|
|
9a3871014e | ||
|
|
b4e3d17178 | ||
|
|
4fa4cadb69 | ||
|
|
d0ec6885d6 | ||
|
|
634bdf7b90 | ||
|
|
117efad40d | ||
|
|
35aaafc09f | ||
|
|
421a3e9e87 | ||
|
|
fbefeae06f | ||
|
|
ef04ac2dac | ||
|
|
52d54cfc00 | ||
|
|
33936c937c | ||
|
|
3b2632fb26 | ||
|
|
412413c2f5 | ||
|
|
0970725598 | ||
|
|
1012991176 | ||
|
|
120725c311 | ||
|
|
ea88b81f3f | ||
|
|
c26ad31c8d | ||
|
|
4b0f3b4dd1 | ||
|
|
5a3bc2acb6 | ||
|
|
4080c2ddfb | ||
|
|
10a2c41d37 | ||
|
|
a196b19b0c | ||
|
|
50519e9099 | ||
|
|
44c487eeb1 | ||
|
|
1a7327c244 | ||
|
|
f5839b560e | ||
|
|
3e0231ae31 | ||
|
|
003de57c91 | ||
|
|
ddb64eaf2e | ||
|
|
8248bcd67e | ||
|
|
39a3918bb8 | ||
|
|
47d9f2f434 | ||
|
|
5bdf4d1d30 | ||
|
|
3e5e6e175c | ||
|
|
42e58b4996 | ||
|
|
a071cd2287 | ||
|
|
66748dbfcd | ||
|
|
d27c9be330 | ||
|
|
ea8f6c8221 | ||
|
|
c6f84dfa94 | ||
|
|
382c2bc6cd | ||
|
|
598f68a7e9 | ||
|
|
967d52f874 | ||
|
|
d1dcfc9ed3 | ||
|
|
ebd7298d0d | ||
|
|
992c5f498e | ||
|
|
570b371290 | ||
|
|
0b6a23e2fb | ||
|
|
da501a34d8 | ||
|
|
34fd2c5ca4 | ||
|
|
afe4afe095 | ||
|
|
9121720e21 | ||
|
|
b527b1ad6b | ||
|
|
bdcbc15cf5 | ||
|
|
397f165d37 | ||
|
|
f29a1d8567 | ||
|
|
47a9fa3505 | ||
|
|
7df2a43d22 | ||
|
|
826f4df8f7 | ||
|
|
7cee63907b | ||
|
|
0e50049ab1 | ||
|
|
975f4ed864 | ||
|
|
5643619a7c | ||
|
|
3e35ea56df | ||
|
|
1ba251f053 | ||
|
|
25d1b699c9 | ||
|
|
19143c134a | ||
|
|
27a8e098d6 | ||
|
|
cb12c9fe1c | ||
|
|
fc2603ce4d | ||
|
|
d9c5d5657e | ||
|
|
b6b5c6041b | ||
|
|
c1345560bb | ||
|
|
8448395003 | ||
|
|
5058f02538 | ||
|
|
31b766a7d6 | ||
|
|
650acf4ea9 | ||
|
|
1322a21445 | ||
|
|
fb26af0566 | ||
|
|
af0559ac35 | ||
|
|
72f68dd541 | ||
|
|
ae09aa3c82 | ||
|
|
b677cef407 | ||
|
|
9ae9879c56 | ||
|
|
2f8c719f03 | ||
|
|
712059cedb | ||
|
|
4bbc651732 | ||
|
|
24e525926b | ||
|
|
119140fe93 | ||
|
|
1b45c3d174 | ||
|
|
9675f1d4e4 | ||
|
|
e7e13552d9 | ||
|
|
91ad8f038e | ||
|
|
c5e70ed1aa | ||
|
|
cdd46c490d | ||
|
|
1d69a15372 | ||
|
|
5237beb197 | ||
|
|
ffdf7a3a6e | ||
|
|
c835c87afc | ||
|
|
58e2ea41af | ||
|
|
addbe7f9ea | ||
|
|
618722bc16 | ||
|
|
fd0c96e6f9 | ||
|
|
5a17a9e37b | ||
|
|
44ed13473a | ||
|
|
d8b00188a0 | ||
|
|
0b61ca0432 | ||
|
|
b9a9151555 | ||
|
|
17db7be134 | ||
|
|
892431d5b9 | ||
|
|
3d36c293e5 | ||
|
|
3ff50f0d11 | ||
|
|
6144325daf | ||
|
|
bf3b83870c | ||
|
|
62b7eea828 | ||
|
|
4e07811e2f | ||
|
|
f819e021b3 | ||
|
|
3224eac821 | ||
|
|
a1fce125da | ||
|
|
aa0a6b58d3 | ||
|
|
0c9a44e279 | ||
|
|
4dd92825a8 | ||
|
|
30a319fe5e | ||
|
|
faf35a6879 | ||
|
|
4520b54a5b | ||
|
|
fa53aea075 | ||
|
|
36b5532b04 | ||
|
|
01ab43941e | ||
|
|
249569be9f | ||
|
|
db0b275772 | ||
|
|
e6bb86c934 | ||
|
|
c53f707089 | ||
|
|
ef36176130 | ||
|
|
edd11ea1cd | ||
|
|
4ad7d635bc | ||
|
|
18604b46b1 | ||
|
|
4609c543c9 | ||
|
|
779559dbdc | ||
|
|
27c6c82b82 | ||
|
|
fa99905bf6 | ||
|
|
608e4edb4e | ||
|
|
43c646b537 | ||
|
|
ad798d7bbe | ||
|
|
238458066a | ||
|
|
90a8b10401 | ||
|
|
46195f72ee | ||
|
|
05829a225a | ||
|
|
f0858ce4d2 | ||
|
|
cc3477415d |
2
.github/workflows/ci-pr-build-test.yml
vendored
2
.github/workflows/ci-pr-build-test.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Install check tools
|
||||
shell: bash
|
||||
|
||||
2
.github/workflows/docker_apigateway.yml
vendored
2
.github/workflows/docker_apigateway.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_climc.yml
vendored
2
.github/workflows/docker_climc.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_cloudmon.yml
vendored
2
.github/workflows/docker_cloudmon.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_esxi_agent.yml
vendored
2
.github/workflows/docker_esxi_agent.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_glance.yml
vendored
2
.github/workflows/docker_glance.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_host.yml
vendored
2
.github/workflows/docker_host.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_keystone.yml
vendored
2
.github/workflows/docker_keystone.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_logger.yml
vendored
2
.github/workflows/docker_logger.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_notify.yml
vendored
2
.github/workflows/docker_notify.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_region.yml
vendored
2
.github/workflows/docker_region.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_scheduler.yml
vendored
2
.github/workflows/docker_scheduler.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/docker_webconsole.yml
vendored
2
.github/workflows/docker_webconsole.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.26.3'
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
42
.github/workflows/issue-check-inactive.yml
vendored
42
.github/workflows/issue-check-inactive.yml
vendored
@@ -4,42 +4,14 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
issue-check-inactive:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Label inactive issues as stale
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
INACTIVE_DAY: "30"
|
||||
INACTIVE_LABEL: "stale"
|
||||
EXCLUDE_LABEL: "announcement"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cutoff="$(date -u -d "${INACTIVE_DAY} days ago" +%Y-%m-%dT%H:%M:%SZ)"
|
||||
|
||||
gh issue list \
|
||||
--repo "${{ github.repository }}" \
|
||||
--state open \
|
||||
--limit 1000 \
|
||||
--json number,labels,updatedAt \
|
||||
| jq -c \
|
||||
--arg cutoff "$cutoff" \
|
||||
--arg inactive "$INACTIVE_LABEL" \
|
||||
--arg exclude "$EXCLUDE_LABEL" \
|
||||
'
|
||||
.[]
|
||||
| select(.updatedAt < $cutoff)
|
||||
| select([.labels[].name] | index($exclude) | not)
|
||||
| select([.labels[].name] | index($inactive) | not)
|
||||
' \
|
||||
| while IFS= read -r issue; do
|
||||
number="$(echo "$issue" | jq -r .number)"
|
||||
echo "Marking issue #${number} as ${INACTIVE_LABEL}"
|
||||
gh issue edit "$number" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--add-label "$INACTIVE_LABEL"
|
||||
done
|
||||
- name: check-inactive
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'check-inactive'
|
||||
inactive-label: 'stale'
|
||||
inactive-day: 30
|
||||
exclude-labels: 'announcement'
|
||||
|
||||
42
.github/workflows/issue-close-require.yml
vendored
42
.github/workflows/issue-close-require.yml
vendored
@@ -4,41 +4,17 @@ on:
|
||||
schedule:
|
||||
- cron: "0 1 * * *"
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
issue-close-require:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Close inactive issues awaiting user feedback
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
INACTIVE_DAY: "7"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cutoff="$(date -u -d "${INACTIVE_DAY} days ago" +%Y-%m-%dT%H:%M:%SZ)"
|
||||
body="$(cat <<'EOF'
|
||||
If you do not provide feedback for more than 37 days, we will close the issue and you can either reopen it or submit a new issue.
|
||||
- name: need reproduce
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'close-issues'
|
||||
labels: 'stale,state/awaiting user feedback'
|
||||
inactive-day: 7
|
||||
body: |
|
||||
If you do not provide feedback for more than 37 days, we will close the issue and you can either reopen it or submit a new issue.
|
||||
|
||||
您超过 37 天未反馈信息,我们将关闭该 issue,如有需求您可以重新打开或者提交新的 issue。
|
||||
EOF
|
||||
)"
|
||||
# Trim leading indentation from heredoc lines for a cleaner comment.
|
||||
body="$(printf '%s\n' "$body" | sed 's/^[[:space:]]*//')"
|
||||
|
||||
gh issue list \
|
||||
--repo "${{ github.repository }}" \
|
||||
--state open \
|
||||
--label "stale" \
|
||||
--label "state/awaiting user feedback" \
|
||||
--limit 1000 \
|
||||
--json number,updatedAt \
|
||||
| jq -c --arg cutoff "$cutoff" '.[] | select(.updatedAt < $cutoff)' \
|
||||
| while IFS= read -r issue; do
|
||||
number="$(echo "$issue" | jq -r .number)"
|
||||
echo "Closing issue #${number}"
|
||||
gh issue close "$number" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--comment "$body"
|
||||
done
|
||||
您超过 37 天未反馈信息,我们将关闭该 issue,如有需求您可以重新打开或者提交新的 issue。
|
||||
|
||||
16
.github/workflows/issue-close.yml
vendored
16
.github/workflows/issue-close.yml
vendored
@@ -4,19 +4,13 @@ on:
|
||||
issues:
|
||||
types: [closed]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
issue-closed-remove-labels:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.issue.labels.*.name, 'stale')"
|
||||
steps:
|
||||
- name: Remove state labels when issue that hasn't stale label is closed
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--remove-label "state/awaiting processing" \
|
||||
--remove-label "state/awaiting user feedback" || true
|
||||
- name: Remove statle labels when issue that hasn't stale label is closed
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
labels: 'state/awaiting processing,state/awaiting user feedback'
|
||||
|
||||
47
.github/workflows/issue-comment.yml
vendored
47
.github/workflows/issue-comment.yml
vendored
@@ -4,48 +4,35 @@ on:
|
||||
|
||||
name: Add issues workflow labels
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
add-label-if-is-author:
|
||||
runs-on: ubuntu-latest
|
||||
if: (github.event.issue.user.id == github.event.comment.user.id) && !github.event.issue.pull_request && (github.event.issue.state == 'open')
|
||||
steps:
|
||||
- name: Add require handle label
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--add-label "state/awaiting processing"
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
labels: 'state/awaiting processing'
|
||||
|
||||
- name: Remove require reply label
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--remove-label "state/awaiting user feedback" \
|
||||
--remove-label "stale" || true
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
labels: 'state/awaiting user feedback,stale'
|
||||
|
||||
add-label-if-not-author:
|
||||
runs-on: ubuntu-latest
|
||||
if: (github.event.issue.user.id != github.event.comment.user.id) && !github.event.issue.pull_request && (github.event.issue.state == 'open') && (!contains(github.event.comment.body, '/keep-state'))
|
||||
steps:
|
||||
- name: Add require reply label
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--add-label "state/awaiting user feedback"
|
||||
- name: Add require replay label
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
labels: 'state/awaiting user feedback'
|
||||
|
||||
- name: Remove require handle label
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--remove-label "state/awaiting processing" \
|
||||
--remove-label "stale" || true
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
labels: 'state/awaiting processing,stale'
|
||||
|
||||
26
.github/workflows/issue-open.yml
vendored
26
.github/workflows/issue-open.yml
vendored
@@ -4,30 +4,22 @@ on:
|
||||
issues:
|
||||
types: [opened, reopened]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
issue-open-add-labels:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !github.event.issue.pull_request }}
|
||||
steps:
|
||||
- name: Add labels
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--add-label "state/awaiting processing"
|
||||
uses: actions-cool/issues-helper@v2
|
||||
if: ${{ !github.event.comment.pull_request.pull_request }}
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
labels: 'state/awaiting processing'
|
||||
|
||||
- name: Remove require reply label
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--remove-label "state/awaiting user feedback" \
|
||||
--remove-label "stale" || true
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
labels: 'state/awaiting user feedback,stale'
|
||||
|
||||
notify-author-comment:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
3
Makefile
3
Makefile
@@ -185,7 +185,6 @@ y18n-lang := en-US,zh-CN
|
||||
y18n-packages := \
|
||||
yunion.io/x/onecloud/cmd/apigateway \
|
||||
yunion.io/x/onecloud/cmd/keystone \
|
||||
yunion.io/x/onecloud/cmd/llm \
|
||||
yunion.io/x/onecloud/cmd/monitor \
|
||||
yunion.io/x/onecloud/cmd/region \
|
||||
yunion.io/x/onecloud/cmd/yunionconf \
|
||||
@@ -261,7 +260,7 @@ dep:
|
||||
@echo "$$depDeprecated"
|
||||
@$(MAKE) mod
|
||||
|
||||
RELEASE_BRANCH:=master
|
||||
RELEASE_BRANCH:=release/4.0.2
|
||||
GOPROXY ?= direct
|
||||
|
||||
mod:
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
ModBaseName:=$(notdir $(ModName))
|
||||
|
||||
DockerImageRegistry?=registry.cn-beijing.aliyuncs.com
|
||||
DockerImageAlpineBuild?=$(DockerImageRegistry)/yunionio/alpine-build:3.23-go-1.26.3-0
|
||||
DockerImageAlpineBuild?=$(DockerImageRegistry)/yunionio/alpine-build:3.22.2-go-1.24.9-0
|
||||
|
||||
EnvIf=$(if $($(1)),$(1)=$($(1)))
|
||||
|
||||
|
||||
52
README-CN.md
52
README-CN.md
@@ -9,9 +9,7 @@
|
||||
|
||||
<img src="https://v1.cloudpods.org/images/cloudpods_logo_green.png" alt="Cloudpods" height="100">
|
||||
|
||||
Cloudpods是一个开源的Golang实现的云原生的融合多云/混合云的云平台,也就是一个”云上之云”。Cloudpods不仅可以管理本地的虚拟机和物理机资源,还可以管理多个云平台和云账号。Cloudpods隐藏了这些异构基础设施资源的数据模型和API的差异,对外暴露了一套统一的API,允许用户就像用一个云一样地访问多云。从而大大降低了访问多云的复杂度,提升了管理多云的效率。
|
||||
|
||||
Cloudpods还提供了 **AI 云**,一个面向大语言模型(LLM)推理与 AI 容器应用的统一管理平台,帮助企业在同一平台完成 AI 工作负载的部署、调度与运维,与 Cloudpods 私有云/多云资源体系无缝集成。
|
||||
Cloudpods是一个开源的Golang实现的云原生的融合多云/混合云的云平台,也就是一个“云上之云”。Cloudpods不仅可以管理本地的虚拟机和物理机资源,还可以管理多个云平台和云账号。Cloudpods隐藏了这些异构基础设施资源的数据模型和API的差异,对外暴露了一套统一的API,允许用户就像用一个云一样地访问多云。从而大大降低了访问多云的复杂度,提升了管理多云的效率。
|
||||
|
||||
## 谁需要Cloudpods?
|
||||
|
||||
@@ -20,25 +18,12 @@ Cloudpods还提供了 **AI 云**,一个面向大语言模型(LLM)推理与
|
||||
* 将VMware vSphere虚拟化集群转换为一个可以自服务的私有云平台
|
||||
* 在混合云的场景,能够在一个界面访问私有云和公有云
|
||||
* 通过一个集中的入口访问分布在多个公有云平台上的多个账号
|
||||
* 当前只使用一个公有云账号但希望将来使用多云的用户
|
||||
* 需要部署和管理 LLM 推理服务及 AI 容器应用,并需要 GPU 调度支持的用户
|
||||
* 当前只使用一个云公有云账号但希望将来使用多云的用户
|
||||
|
||||
## 功能
|
||||
|
||||
请访问[产品介绍](https://www.cloudpods.org/docs/introduction/)页面了解详细信息。
|
||||
|
||||
### AI 云
|
||||
|
||||
* **AI 推理服务**:部署和管理 LLM 推理实例(支持 Ollama、vLLM、SGLang 等),支持 GPU 调度、模型挂载与推理服务地址分配。
|
||||
* **AI 应用管理**:一站式部署 LLM 应用编排、智能体助手、图像生成等 AI 容器应用。
|
||||
* **模型库**:统一管理模型来源、版本与缓存,支持多实例复用、离线分发,避免重复下载。
|
||||
* **模板与镜像**:通过模板定义 CPU/内存/GPU 等资源规格,通过镜像管理容器运行环境,实现标准化交付。
|
||||
* **GPU 运维**:GPU 设备自动探测与注册,支持 NVIDIA/CUDA 环境的统一配置与管理。
|
||||
|
||||
支持的 AI 工作负载:
|
||||
* AI 推理:Ollama、vLLM、SGLang
|
||||
* AI 应用:OpenClaw、Dify、ComfyUI、Hermes Agent
|
||||
|
||||
### 支持的云平台
|
||||
|
||||
* 公有云:
|
||||
@@ -52,38 +37,29 @@ Cloudpods还提供了 **AI 云**,一个面向大语言模型(LLM)推理与
|
||||
* 天翼云
|
||||
* 移动云
|
||||
* 京东云
|
||||
* 火山引擎
|
||||
* 百度云
|
||||
* 金山云
|
||||
* 青云
|
||||
* Oracle Cloud
|
||||
* 联通云
|
||||
* 私有云:
|
||||
* OpenStack
|
||||
* ZStack
|
||||
* Alibaba Cloud Apsara (阿里飞天)
|
||||
* Alibaba Cloud Aspara (阿里飞天)
|
||||
* Huawei HCSO (华为HCSO)
|
||||
* Nutanix
|
||||
* BingoCloud
|
||||
* OceanBase
|
||||
* 本地基础设施资源:
|
||||
* 基于 KVM 实现的轻量级私有云
|
||||
* VMware vSphere vCenter/ESXi
|
||||
* Proxmox VE
|
||||
* 裸金属 (IPMI, Redfish API)
|
||||
* 对象存储 (Minio, Ceph, XSky)
|
||||
* VMWare vSphere vCenter/ESXi
|
||||
* Baremetals (IPMI, Redfish API)
|
||||
* Object storages (Minio, Ceph, XSky)
|
||||
* NAS (Ceph)
|
||||
|
||||
### 支持的云资源
|
||||
|
||||
* 服务器:实例、磁盘、网卡、网络、VPC、存储、宿主机、二层网络、快照、快照策略、安全组、弹性 IP、SSH 密钥对、镜像
|
||||
* 负载均衡:实例、监听、后端服务器组、后端服务器、TLS 证书、访问控制
|
||||
* 对象存储:存储桶、对象
|
||||
* NAS:文件系统、权限组、挂载点
|
||||
* RDS:实例、账号、备份、数据库、参数、权限
|
||||
* 弹性缓存:实例、账号、备份、参数
|
||||
* DNS:DNS 区域、DNS 记录
|
||||
* VPC:VPC、VPC 对等连接、跨 VPC 网络、NAT 网关、DNAT/SNAT 规则、路由表、路由条目
|
||||
* Servers: instances, disks, network interfaces, networks, vpcs, storages, hosts, wires, snapshots, snapshot policies, security groups, elastic IPs, SSH keypairs, images
|
||||
* Load Balancers: instances, listeners, backend groups, backends, TLS certificates, ACLs
|
||||
* Object Storage: buckets, objects
|
||||
* NAS: file_systems, access_groups, mount_targets
|
||||
* RDS: instances, accounts, backups, databases, parameters, privileges
|
||||
* Elastic Cache: instances, accounts, backups, parameters
|
||||
* DNS: DNS zones, DNS records
|
||||
* VPC: VPCs, VPC peering, inter-VPC network, NAT gateway, DNAT/SNAT rules, route tables, route entries
|
||||
|
||||
## 安装部署
|
||||
|
||||
|
||||
33
README.md
33
README.md
@@ -11,34 +11,19 @@
|
||||
|
||||
Cloudpods is a cloud-native open source unified multi/hybrid-cloud platform developed with Golang, i.e. Cloudpods is *a cloud on clouds*. Cloudpods is able to manage not only on-premise KVM/baremetals, but also resources from many cloud accounts across many cloud providers. It hides the differences of underlying cloud providers and exposes one set of APIs that allow programatically interacting with these many clouds.
|
||||
|
||||
Cloudpods also provides **AI Cloud**, a unified management platform for large language model (LLM) inference and AI container applications, helping enterprises deploy, schedule, and operate AI workloads on a single platform, seamlessly integrated with the Cloudpods private cloud / multi-cloud resource ecosystem.
|
||||
|
||||
## Who needs Cloudpods?
|
||||
|
||||
* Those who need a simple solution to virtualize a few physical servers into a private cloud
|
||||
* Those who need a compact and fully automatic baremetal lift-cycle management solution
|
||||
* Those who want to turn a VMware vSphere virtualization cluster into a private cloud
|
||||
* Those who need a cohesive view of both public and private cloud in a hybrid cloud setup
|
||||
* Those who need a centric portal to access multiple accounts from multiple public clouds
|
||||
* Those who need a centric portal to access multiple acccounts from multiple public clouds
|
||||
* Those who is currently using a single cloud account, but will not lose the possibility to adopt multicloud strategy
|
||||
* Those who need to deploy and manage LLM inference services and AI container applications with GPU support
|
||||
|
||||
## Features
|
||||
|
||||
See [Introduction](https://www.cloudpods.org/docs/introduction/) for details.
|
||||
|
||||
### AI Cloud
|
||||
|
||||
* **AI Inference Services**: Deploy and manage LLM inference instances (Ollama, vLLM, SGLang, and more) with GPU scheduling, model mounting, and inference service address allocation.
|
||||
* **AI Application Management**: One-stop deployment of LLM application orchestration, agent assistants, image generation, and other AI container applications.
|
||||
* **Model Library**: Unified management of model sources, versions, and caches, supporting multi-instance reuse and offline distribution.
|
||||
* **Templates and Images**: Define resource specifications (CPU/memory/GPU) through templates, manage container runtime environments through images.
|
||||
* **GPU Operations**: Automatic GPU device detection and registration, unified NVIDIA/CUDA environment configuration and management.
|
||||
|
||||
Supported AI workloads:
|
||||
* AI Inference: Ollama, vLLM, SGLang
|
||||
* AI Applications: OpenClaw, Dify, ComfyUI, Hermes Agent
|
||||
|
||||
### Supported cloud providers
|
||||
|
||||
* Public Clouds:
|
||||
@@ -52,24 +37,15 @@ Supported AI workloads:
|
||||
* Ctyun (China Telecom)
|
||||
* ECloud (China Mobile)
|
||||
* JDCloud
|
||||
* Volcengine
|
||||
* Baidu Cloud
|
||||
* Kingsoft Cloud
|
||||
* QingCloud
|
||||
* Oracle Cloud
|
||||
* China Unicom Cloud
|
||||
* Private Clouds:
|
||||
* OpenStack
|
||||
* ZStack
|
||||
* Alibaba Cloud Apsara
|
||||
* Alibaba Cloud Aspara
|
||||
* Huawei HCSO
|
||||
* Nutanix
|
||||
* BingoCloud
|
||||
* OceanBase
|
||||
* On-premise resources:
|
||||
* Lightweight private cloud built on KVM
|
||||
* VMware vSphere vCenter/ESXi
|
||||
* Proxmox VE
|
||||
* VMWare vSphere vCenter/ESXi
|
||||
* Baremetals (IPMI, Redfish API)
|
||||
* Object storages (Minio, Ceph, XSky)
|
||||
* NAS (Ceph)
|
||||
@@ -108,7 +84,7 @@ Please check this [issue](https://github.com/yunionio/cloudpods/issues/11427) fo
|
||||
|
||||
## Changelog
|
||||
|
||||
See [Release Notes](https://www.cloudpods.org/en/docs/release-notes/) and [Changelog](https://www.cloudpods.org/en/docs/development/changelog/) for details.
|
||||
See [Relase Notes](https://www.cloudpods.org/en/docs/release-notes/) and [Changelog](https://www.cloudpods.org/en/docs/development/changelog/) for details.
|
||||
|
||||
## Contribution
|
||||
|
||||
@@ -121,3 +97,4 @@ Apache License 2.0. See [LICENSE](./LICENSE).
|
||||
## AI-generated doc
|
||||
|
||||
[DeepWiki](https://deepwiki.com/yunionio/cloudpods) provides an amazing AI-generated doc of this project, you may refer to it for more detailed and comprehensive understanding of codes.
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
DESCRIPTION="Yunion Cloud AI Proxy Service"
|
||||
@@ -79,8 +79,6 @@ echo "# Yunion RPM spec
|
||||
%global pkgname yunion-$PKG
|
||||
%global homedir /var/run/%{owner}
|
||||
%global use_systemd $SERVICE
|
||||
%global debug_package %{nil}
|
||||
%global __strip /usr/bin/eu-strip
|
||||
|
||||
Name: %{pkgname}
|
||||
Version: $VERSION
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v3.22.2-0
|
||||
|
||||
ADD ./_output/alpine-build/bin/aiproxy /opt/yunion/bin/aiproxy
|
||||
@@ -2,7 +2,7 @@ FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:3.22.2-0
|
||||
|
||||
# https://github.com/yunionio/telegraf/blob/yn-release-1.36/Makefile.yn#L28
|
||||
# install playbook and telegraf install pkg
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.5 /opt/yunion/playbook /opt/yunion/playbook
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.5 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/playbook /opt/yunion/playbook
|
||||
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
|
||||
|
||||
ADD ./_output/alpine-build/bin/ansibleserver /opt/yunion/bin/ansibleserver
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:v0.3.9-20260724.0
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:v0.3.9-20251215.0
|
||||
|
||||
LABEL maintainer="Zexi Li <lizexi@yunionyun.com>"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#RUN yum install -y https://iso.yunion.cn/vm-images/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
|
||||
#RUN yum install -y http://192.168.23.50:8083/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/yunionos:v4.0.0-20251203.0 as yunionos
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/yunionos:v4.0.0-20251201.0 as yunionos
|
||||
|
||||
FROM registry.cn-beijing.aliyuncs.com/cloudpods/centos:8 as grub-stage
|
||||
FROM centos:8 as grub-stage
|
||||
|
||||
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
|
||||
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.5.11
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.5.3
|
||||
|
||||
LABEL maintainer="Yaoqi Wan wanyaoqi@yunionyun.com"
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
REGISTRY ?= "registry.cn-beijing.aliyuncs.com/yunionio"
|
||||
DOCKER_BUILD = docker build -t $(REGISTRY)
|
||||
DOCKER_BUILDX = docker buildx build --platform linux/arm64,linux/amd64,linux/riscv64 --push -t $(REGISTRY)
|
||||
DOCKER_BUILDX_BM = docker buildx build --platform linux/arm64,linux/amd64 --push -t $(REGISTRY)
|
||||
|
||||
|
||||
debian10-base:
|
||||
@@ -41,7 +40,7 @@ WEBCONSOLE_BASE_VERSION_3-22-2 = 3.22.2-1
|
||||
webconsole-base:
|
||||
$(DOCKER_BUILDX)/webconsole-base:$(WEBCONSOLE_BASE_VERSION_3-22-2) -f ./Dockerfile.webconsole-base .
|
||||
|
||||
BAREMETAL_BASE_VERSION = v0.3.9-20260724.0
|
||||
BAREMETAL_BASE_VERSION = v0.3.9-20251112.1
|
||||
|
||||
FEDORA_RISCV64_VERSION = 42
|
||||
fedora-riscv64-base:
|
||||
@@ -54,9 +53,8 @@ baremetal-base-riscv: fedora-riscv64-base
|
||||
$(DOCKER_BUILDX)/baremetal-base:$(BAREMETAL_BASE_VERSION) -f ./Dockerfile.baremetal-base-riscv .
|
||||
#docker push $(REGISTRY)/baremetal-base:$(BAREMETAL_BASE_VERSION)
|
||||
|
||||
# TODO: support riscv64 for baremetal-base
|
||||
baremetal-base:
|
||||
$(DOCKER_BUILDX_BM)/baremetal-base:$(BAREMETAL_BASE_VERSION) -f ./Dockerfile.baremetal-base .
|
||||
$(DOCKER_BUILDX)/baremetal-base:$(BAREMETAL_BASE_VERSION) -f ./Dockerfile.baremetal-base .
|
||||
#docker push $(REGISTRY)/baremetal-base:$(BAREMETAL_BASE_VERSION)
|
||||
|
||||
TORRENT_VERSION = 20210815.0
|
||||
@@ -73,6 +71,18 @@ glance-base-3-22-2:
|
||||
$(DOCKER_BUILDX)/glance-base:$(GLANCE_BASE_VERSION_3-22-2) -f ./Dockerfile.glance-base .
|
||||
|
||||
|
||||
HOST_IMAGE_VERSION ?= v1.0.2
|
||||
HOST_IMAGE_NAME = $(REGISTRY)/host-image:$(HOST_IMAGE_VERSION)
|
||||
host-image:
|
||||
docker pull $(HOST_IMAGE_NAME)-amd64 --platform amd64
|
||||
docker pull $(HOST_IMAGE_NAME)-arm64 --platform arm64
|
||||
docker manifest create $(HOST_IMAGE_NAME) \
|
||||
$(HOST_IMAGE_NAME)-amd64 \
|
||||
$(HOST_IMAGE_NAME)-arm64
|
||||
docker manifest annotate $(HOST_IMAGE_NAME) $(HOST_IMAGE_NAME)-amd64 --arch amd64
|
||||
docker manifest annotate $(HOST_IMAGE_NAME) $(HOST_IMAGE_NAME)-arm64 --arch arm64
|
||||
docker manifest push $(HOST_IMAGE_NAME)
|
||||
|
||||
LBAGENT_BASE_VERSION = v0.0.5
|
||||
lbagent-base:
|
||||
$(DOCKER_BUILDX)/lbagent-base:$(LBAGENT_BASE_VERSION) -f ./Dockerfile.lbagent-base .
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
触发时间: {{.start_time}}
|
||||
报警级别: {{.level}}
|
||||
触发条件: {{.description | unescaped}}
|
||||
{{if .reason}}报警原因: {{.reason}}
|
||||
{{end}}报警数量:{{len .matches}}
|
||||
报警数量:{{len .matches}}
|
||||
资源名称:{{.resource_name}}
|
||||
|
||||
详情地址: {{.web_url}}
|
||||
@@ -88,19 +88,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td">策略详情:</td>
|
||||
<td>
|
||||
{{- range $i, $m := .matches -}}
|
||||
{{- if $i}}<br/>{{end -}}
|
||||
{{- $m.condition | unescaped -}}
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td>{{.description}}</td>
|
||||
</tr>
|
||||
{{if .reason}}
|
||||
<tr>
|
||||
<td class="td">报警原因:</td>
|
||||
<td>{{.reason}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
<table class="table" style="padding-top: 6px; padding-bottom: 10px;">
|
||||
<tr>
|
||||
|
||||
@@ -2,8 +2,7 @@ AlertName: {{.name}}
|
||||
Time: {{.start_time}}
|
||||
Level: {{.level}}
|
||||
TriggerCondition: {{.description | unescaped}}
|
||||
{{if .reason}}Reason: {{.reason}}
|
||||
{{end}}AlertCount: {{len .matches}}
|
||||
AlertCount: {{len .matches}}
|
||||
ResourceName: {{.resource_name}}
|
||||
|
||||
WebUrl: {{.web_url}}
|
||||
|
||||
@@ -88,19 +88,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td">Strategy details:</td>
|
||||
<td>
|
||||
{{- range $i, $m := .matches -}}
|
||||
{{- if $i}}<br/>{{end -}}
|
||||
{{- $m.condition | unescaped -}}
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td>{{.description}}</td>
|
||||
</tr>
|
||||
{{if .reason}}
|
||||
<tr>
|
||||
<td class="td">Reason:</td>
|
||||
<td>{{.reason}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
<table class="table" style="padding-top: 6px; padding-bottom: 10px;">
|
||||
<tr>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/aiproxy/service"
|
||||
"yunion.io/x/onecloud/pkg/util/atexit"
|
||||
)
|
||||
|
||||
func main() {
|
||||
defer atexit.Handle()
|
||||
|
||||
service.StartService()
|
||||
}
|
||||
@@ -17,7 +17,6 @@ package main
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/entry"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/aiproxy"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/ansible"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/apimap"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/cloudevent"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AiKeys)
|
||||
cmd.Create(new(apoptions.AiKeyCreateOptions))
|
||||
cmd.List(new(apoptions.AiKeyListOptions))
|
||||
cmd.Show(new(apoptions.AiKeyShowOptions))
|
||||
cmd.Update(new(apoptions.AiKeyUpdateOptions))
|
||||
cmd.Delete(new(apoptions.AiKeyDeleteOptions))
|
||||
registerEnableDisable(cmd)
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AiModels)
|
||||
cmd.Create(new(apoptions.AiModelCreateOptions))
|
||||
cmd.List(new(apoptions.AiModelListOptions))
|
||||
cmd.Show(new(apoptions.AiModelShowOptions))
|
||||
cmd.Update(new(apoptions.AiModelUpdateOptions))
|
||||
cmd.Delete(new(apoptions.AiModelDeleteOptions))
|
||||
registerEnableDisable(cmd)
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AiProviders)
|
||||
cmd.Create(new(apoptions.AiProviderCreateOptions))
|
||||
cmd.List(new(apoptions.AiProviderListOptions))
|
||||
cmd.Show(new(apoptions.AiProviderShowOptions))
|
||||
cmd.Update(new(apoptions.AiProviderUpdateOptions))
|
||||
cmd.Delete(new(apoptions.AiProviderDeleteOptions))
|
||||
cmd.PerformClass("test-connectivity", new(apoptions.AiProviderTestConnectivityOptions))
|
||||
cmd.Perform("test-connectivity", new(options.BaseIdOptions))
|
||||
cmd.Perform("set-models", new(apoptions.AiProviderSetModelsOptions))
|
||||
registerEnableDisable(cmd)
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AiProxyNodes)
|
||||
cmd.Create(new(apoptions.AiProxyNodeCreateOptions))
|
||||
cmd.List(new(apoptions.AiProxyNodeListOptions))
|
||||
cmd.Show(new(apoptions.AiProxyNodeShowOptions))
|
||||
cmd.Update(new(apoptions.AiProxyNodeUpdateOptions))
|
||||
cmd.Delete(new(apoptions.AiProxyNodeDeleteOptions))
|
||||
registerEnableDisable(cmd)
|
||||
cmd.PerformClass("register", new(apoptions.AiProxyNodeRegisterOptions))
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AIProxyUsage)
|
||||
cmd.ClassShow(new(apoptions.AiProxyUsageOverviewOptions))
|
||||
cmd.ClassShow(new(apoptions.AiProxyUsageAnalysisOptions))
|
||||
cmd.RunWithDesc("event-list", "List ai_proxy_usage events", new(apoptions.AiProxyUsageEventListOptions),
|
||||
func(s *mcclient.ClientSession, args *apoptions.AiProxyUsageEventListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := apmodules.AIProxyUsage.Get(s, args.GetId(), params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
shell.PrintList(modulebase.JSON2ListResult(ret), []string{
|
||||
"id",
|
||||
"timestamp",
|
||||
"model",
|
||||
"provider",
|
||||
"source",
|
||||
"api_key_label",
|
||||
"input_tokens",
|
||||
"output_tokens",
|
||||
"total_tokens",
|
||||
"latency_ms",
|
||||
"result",
|
||||
"status_code",
|
||||
})
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AiRoutings)
|
||||
cmd.Create(new(apoptions.AiRoutingCreateOptions))
|
||||
cmd.List(new(apoptions.AiRoutingListOptions))
|
||||
cmd.Show(new(apoptions.AiRoutingShowOptions))
|
||||
cmd.Update(new(apoptions.AiRoutingUpdateOptions))
|
||||
cmd.Delete(new(apoptions.AiRoutingDeleteOptions))
|
||||
cmd.Perform("set-models", new(apoptions.AiRoutingSetModelsOptions))
|
||||
registerEnableDisable(cmd)
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AiRoutingModels)
|
||||
cmd.Create(new(apoptions.AiRoutingModelCreateOptions))
|
||||
cmd.List(new(apoptions.AiRoutingModelListOptions))
|
||||
cmd.Show(new(apoptions.AiRoutingModelShowOptions))
|
||||
cmd.Update(new(apoptions.AiRoutingModelUpdateOptions))
|
||||
cmd.Delete(new(apoptions.AiRoutingModelDeleteOptions))
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
||||
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&apmodules.AiVirtualKeys)
|
||||
cmd.Create(new(apoptions.AiVirtualKeyCreateOptions))
|
||||
cmd.List(new(apoptions.AiVirtualKeyListOptions))
|
||||
cmd.Show(new(apoptions.AiVirtualKeyShowOptions))
|
||||
cmd.Update(new(apoptions.AiVirtualKeyUpdateOptions))
|
||||
cmd.Delete(new(apoptions.AiVirtualKeyDeleteOptions))
|
||||
registerEnableDisable(cmd)
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/aiproxy/codexconfig"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
func init() {
|
||||
R(&codexconfig.Options{}, "ai-codex-config", "Generate Codex CLI config for aiproxy", func(s *mcclient.ClientSession, args *codexconfig.Options) error {
|
||||
return codexconfig.Run(s, args)
|
||||
})
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
)
|
||||
|
||||
var R = shell.R
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package aiproxy registers climc commands for the aiproxy service.
|
||||
package aiproxy // import "yunion.io/x/onecloud/cmd/climc/shell/aiproxy"
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func registerEnableDisable(cmd *shell.ResourceCmd) {
|
||||
cmd.Perform("enable", new(baseoptions.BaseIdOptions))
|
||||
cmd.Perform("disable", new(baseoptions.BaseIdOptions))
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/aiproxy/ft"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
func init() {
|
||||
R(&ft.AnthropicOptions{}, "ai-test-anthropic", "Run aiproxy Anthropic Messages API E2E test", func(s *mcclient.ClientSession, args *ft.AnthropicOptions) error {
|
||||
return ft.RunAnthropicTest(s, args)
|
||||
})
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/aiproxy/ft"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
func init() {
|
||||
R(&ft.ChatOptions{}, "ai-test-chat", "Run aiproxy OpenAI chat E2E test", func(s *mcclient.ClientSession, args *ft.ChatOptions) error {
|
||||
return ft.RunChatTest(s, args)
|
||||
})
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package aiproxy
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/aiproxy/ft"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
func init() {
|
||||
R(&ft.ProviderCreateOptions{}, "ai-test-provider-create", "Create custom ai_provider and verify", func(s *mcclient.ClientSession, args *ft.ProviderCreateOptions) error {
|
||||
return ft.RunProviderCreateTest(s, args)
|
||||
})
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/ansible"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/ansible"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -56,9 +56,6 @@ func init() {
|
||||
})
|
||||
R(&options.MeshNetworkUpdateOptions{}, "meshnetwork-update", "Update mesh network", func(s *mcclient.ClientSession, opts *options.MeshNetworkUpdateOptions) error {
|
||||
params, err := base_options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
mn, err := modules.MeshNetworks.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -56,9 +56,6 @@ func init() {
|
||||
})
|
||||
R(&options.RouterUpdateOptions{}, "router-update", "Update router", func(s *mcclient.ClientSession, opts *options.RouterUpdateOptions) error {
|
||||
params, err := base_options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
router, err := modules.Routers.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -56,9 +56,6 @@ func init() {
|
||||
})
|
||||
R(&options.RouteUpdateOptions{}, "router-route-update", "Update router route", func(s *mcclient.ClientSession, opts *options.RouteUpdateOptions) error {
|
||||
params, err := base_options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
router, err := modules.Routes.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -56,9 +56,6 @@ func init() {
|
||||
})
|
||||
R(&options.RuleUpdateOptions{}, "router-rule-update", "Update router rule", func(s *mcclient.ClientSession, opts *options.RuleUpdateOptions) error {
|
||||
params, err := base_options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
router, err := modules.Rules.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -103,5 +103,4 @@ func init() {
|
||||
cmd.Perform("enable-image-cache", new(AgentEnableImageCacheOpt))
|
||||
cmd.Perform("disable-image-cache", new(AgentDisableImageCacheOpt))
|
||||
cmd.Delete(new(AgentDeleteOpt))
|
||||
cmd.Get("app-options", &options.BaseIdOptions{})
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ func init() {
|
||||
|
||||
type HostNetworkDetailOptions struct {
|
||||
HOST string `help:"ID or Name of Host"`
|
||||
NETWORK string `help:"ID or Name of Network"`
|
||||
NETWORK string `help:"ID or Name of Wire"`
|
||||
}
|
||||
R(&HostNetworkDetailOptions{}, "host-network-show", "Show baremetal network details", func(s *mcclient.ClientSession, args *HostNetworkDetailOptions) error {
|
||||
result, err := modules.Baremetalnetworks.Get(s, args.HOST, args.NETWORK, nil)
|
||||
|
||||
@@ -24,7 +24,7 @@ func init() {
|
||||
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudaccounts).WithKeyword("cloud-account")
|
||||
cmd.List(&options.CloudaccountListOptions{})
|
||||
cmd.Show(&options.CloudaccountShowOptions{})
|
||||
cmd.Show(&options.SCloudAccountIdOptions{})
|
||||
cmd.Delete(&options.SCloudAccountIdOptions{})
|
||||
cmd.Update(&options.SCloudAccountUpdateBaseOptions{})
|
||||
// cmd.PerformClassWithKeyword("preparenets-vmware", "prepare-nets", &options.SVMwareCloudAccountPrepareNetsOptions{})
|
||||
@@ -41,7 +41,6 @@ func init() {
|
||||
cmd.CreateWithKeyword("create-hcs", &options.SHCSAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-hcsop", &options.SHcsOpCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-ucloud", &options.SUcloudCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-rockbase", &options.SRockbaseAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-volcengine", &options.SVolcengineCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-zstack", &options.SZStackCloudAccountCreateOptions{})
|
||||
cmd.CreateWithKeyword("create-s3", &options.SS3CloudAccountCreateOptions{})
|
||||
@@ -77,7 +76,6 @@ func init() {
|
||||
cmd.UpdateWithKeyword("update-hcso", &options.SHCSOAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-hcs", &options.SHCSAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-ucloud", &options.SUcloudCloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-rockbase", &options.SRockbaseAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-volcengine", &options.SVolcengineCloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-zstack", &options.SZStackCloudAccountUpdateOptions{})
|
||||
cmd.UpdateWithKeyword("update-s3", &options.SS3CloudAccountUpdateOptions{})
|
||||
@@ -109,7 +107,6 @@ func init() {
|
||||
cmd.PerformWithKeyword("update-credential-hcso", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-hcs", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-ucloud", "update-credential", &options.SUcloudCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-rockbase", "update-credential", &options.SRockbaseAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-volcengine", "update-credential", &options.SVolcengineCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-zstack", "update-credential", &options.SZStackCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-s3", "update-credential", &options.SS3CloudAccountUpdateCredentialOptions{})
|
||||
@@ -135,7 +132,6 @@ func init() {
|
||||
cmd.PerformWithKeyword("test-connectivity-openstack", "test-connectivity", &options.SOpenStackCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-huawei", "test-connectivity", &options.SHuaweiCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-ucloud", "test-connectivity", &options.SUcloudCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-rockbase", "test-connectivity", &options.SRockbaseAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-volcengine", "test-connectivity", &options.SVolcengineCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-zstack", "test-connectivity", &options.SZStackCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("test-connectivity-s3", "test-connectivity", &options.SS3CloudAccountUpdateCredentialOptions{})
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
func init() {
|
||||
type CloudproviderRegionListOptions struct {
|
||||
options.BaseListOptions
|
||||
Region string `help:"ID or Name of Region"`
|
||||
Region string `help:"ID or Name of Host"`
|
||||
|
||||
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
|
||||
}
|
||||
|
||||
@@ -34,18 +34,15 @@ func init() {
|
||||
cmd.Perform("purge", &compute.CloudregionPurgeOptions{})
|
||||
|
||||
type CloudregionListOptions struct {
|
||||
_ struct{} `mcp-desc:"【创建流程中的中间步骤】本工具不能完成创建。指定云厂商时必须传 provider,例如创建阿里云:provider=[\"Aliyun\"]。创建虚拟机时必须 usable=true(MCP 默认注入)。查完后继续 capability/镜像/sku,最后 climc_server_create。严禁只查区域后停止"`
|
||||
|
||||
options.BaseListOptions
|
||||
|
||||
Usable *bool `help:"只列网络可用的区域;创建虚拟机时必须为 true(MCP 默认注入 usable=true)" mcp:"true"`
|
||||
UsableVpc *bool `help:"List regions where VPC are usable" mcp:"true"`
|
||||
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers|elasticcaches" mcp:"true"`
|
||||
ReadOnly *bool `help:"List regions with read only account"`
|
||||
Usable *bool `help:"List regions where networks are usable"`
|
||||
UsableVpc *bool `help:"List regions where VPC are usable"`
|
||||
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers|elasticcaches"`
|
||||
|
||||
City string `help:"List regions in the specified city" mcp:"true"`
|
||||
City string `help:"List regions in the specified city"`
|
||||
|
||||
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event" mcp:"true"`
|
||||
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
|
||||
|
||||
DistinctField string `help:"list the specified distinct field, e.g. city, region"`
|
||||
|
||||
@@ -151,7 +148,7 @@ func init() {
|
||||
Desc string `help:"Description" json:"description" token:"desc"`
|
||||
Latitude float32 `help:"region geographical location - latitude"`
|
||||
Longitude float32 `help:"region geographical location - longitude"`
|
||||
City string `help:"region geographical location - city, e.g. Beijing, Frankfurt"`
|
||||
City string `help:"region geograpical location - city, e.g. Beijing, Frankfurt"`
|
||||
CountryCode string `help:"region geographical location - ISO country code, e.g. CN"`
|
||||
}
|
||||
R(&CloudregionCreateOptions{}, "cloud-region-create", "Create a cloud region", func(s *mcclient.ClientSession, args *CloudregionCreateOptions) error {
|
||||
@@ -194,7 +191,7 @@ func init() {
|
||||
Desc string `help:"Description of the region" json:"description" token:"desc"`
|
||||
Latitude float32 `help:"region geographical location - latitude"`
|
||||
Longitude float32 `help:"region geographical location - longitude"`
|
||||
City string `help:"region geographical location - city, e.g. Beijing, Frankfurt"`
|
||||
City string `help:"region geograpical location - city, e.g. Beijing, Frankfurt"`
|
||||
CountryCode string `help:"region geographical location - ISO country code, e.g. CN"`
|
||||
}
|
||||
R(&CloudregionUpdateOptions{}, "cloud-region-update", "Update a cloud region", func(s *mcclient.ClientSession, args *CloudregionUpdateOptions) error {
|
||||
@@ -226,18 +223,13 @@ func init() {
|
||||
})
|
||||
|
||||
type CloudregionCapabiltyOptions struct {
|
||||
_ struct{} `mcp-desc:"【创建流程中的中间步骤】查询区域能力,尤其是可用磁盘存储类型(storage_types2 / system_storage_types)。公有云创建前必须调用:ID 用 climc_cloud_region_list 返回的 id。从返回中选系统盘 backend(如 cloud_essd、cloud_ssd),写入 disk 的 backend=。查完继续镜像/网络/sku,最后 climc_server_create"`
|
||||
|
||||
ID string `help:"ID or name of cloud region to check;必须用 cloud-region-list 的 id" json:"-" mcp:"required"`
|
||||
Domain string `help:"cloud region domain" mcp:"true"`
|
||||
ID string `help:"ID or name of cloud region to check" json:"-"`
|
||||
Domain string `help:"cloud region domain"`
|
||||
|
||||
ShowEmulated bool `help:"show emulated cloud region"`
|
||||
}
|
||||
R(&CloudregionCapabiltyOptions{}, "cloud-region-capability", "Show region's capacibilities", func(s *mcclient.ClientSession, args *CloudregionCapabiltyOptions) error {
|
||||
query, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Cloudregions.GetSpecific(s, args.ID, "capability", query)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -24,7 +24,7 @@ var (
|
||||
R = shell.R
|
||||
printList = shell.PrintList
|
||||
printObject = shell.PrintObject
|
||||
printBatchResults = shell.PrintBatchResults
|
||||
printBatchResults = printutils.PrintJSONBatchResults
|
||||
|
||||
InvalidUpdateError = shell.InvalidUpdateError
|
||||
printObjectRecursive = printutils.PrintJSONObjectRecursive
|
||||
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/ghodss/yaml"
|
||||
@@ -32,7 +31,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/pod/stream/cp"
|
||||
)
|
||||
|
||||
@@ -139,18 +137,15 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
copyToContainer := func(s *mcclient.ClientSession, src, dst string, rawFile bool) error {
|
||||
parts := strings.Split(dst, ":")
|
||||
R(new(options.ContainerCopyOptions), "container-cp", "Container copy", func(s *mcclient.ClientSession, opts *options.ContainerCopyOptions) error {
|
||||
parts := strings.Split(opts.CONTAINER_ID_FILE, ":")
|
||||
if len(parts) != 2 {
|
||||
return fmt.Errorf("invalid container id: %s", dst)
|
||||
return fmt.Errorf("invalid container id: %s", opts.CONTAINER_ID_FILE)
|
||||
}
|
||||
if rawFile {
|
||||
if fileutils2.IsDir(src) {
|
||||
return fmt.Errorf("source path cannot be a directory when raw file is true: %s", src)
|
||||
}
|
||||
fr, err := os.Open(src)
|
||||
if opts.RawFile {
|
||||
fr, err := os.Open(opts.SRC_FILE)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "open file: %v", src)
|
||||
return errors.Wrapf(err, "open file: %v", opts.SRC_FILE)
|
||||
}
|
||||
defer fr.Close()
|
||||
if err := modules.Containers.CopyTo(s, parts[0], parts[1], fr); err != nil {
|
||||
@@ -158,24 +153,22 @@ func init() {
|
||||
}
|
||||
return nil
|
||||
} else {
|
||||
return cp.NewCopy().CopyToContainer(s, src, cp.ContainerFileOpt{
|
||||
return cp.NewCopy().CopyToContainer(s, opts.SRC_FILE, cp.ContainerFileOpt{
|
||||
ContainerId: parts[0],
|
||||
File: parts[1],
|
||||
})
|
||||
}
|
||||
}
|
||||
copyFromContainer := func(s *mcclient.ClientSession, src, dst string, rawFile bool) error {
|
||||
parts := strings.Split(src, ":")
|
||||
})
|
||||
|
||||
R(new(options.ContainerCopyOptions), "container-cp-from", "Container copy", func(s *mcclient.ClientSession, opts *options.ContainerCopyOptions) error {
|
||||
parts := strings.Split(opts.SRC_FILE, ":")
|
||||
if len(parts) != 2 {
|
||||
return fmt.Errorf("invalid container id: %s", src)
|
||||
return fmt.Errorf("invalid container id: %s", opts.CONTAINER_ID_FILE)
|
||||
}
|
||||
ctrId := parts[0]
|
||||
ctrFile := parts[1]
|
||||
destFile := dst
|
||||
if fileutils2.IsDir(destFile) {
|
||||
destFile = path.Join(destFile, path.Base(ctrFile))
|
||||
}
|
||||
if rawFile {
|
||||
destFile := opts.CONTAINER_ID_FILE
|
||||
if opts.RawFile {
|
||||
fw, err := os.Create(destFile)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "open file: %v", destFile)
|
||||
@@ -191,37 +184,5 @@ func init() {
|
||||
File: ctrFile,
|
||||
}, destFile)
|
||||
}
|
||||
}
|
||||
|
||||
R(new(options.ContainerCopyOptions), "container-cp", "Container copy", func(s *mcclient.ClientSession, opts *options.ContainerCopyOptions) error {
|
||||
if strings.Contains(opts.SRC, ":") && !strings.Contains(opts.DST, ":") {
|
||||
// copy from container to host
|
||||
err := copyFromContainer(s, opts.SRC, opts.DST, opts.RawFile)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "copy from container to host")
|
||||
}
|
||||
return nil
|
||||
} else if !strings.Contains(opts.SRC, ":") && strings.Contains(opts.DST, ":") {
|
||||
// copy from host to container
|
||||
err := copyToContainer(s, opts.SRC, opts.DST, opts.RawFile)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "copy to container")
|
||||
}
|
||||
return nil
|
||||
} else if strings.Contains(opts.SRC, ":") && strings.Contains(opts.DST, ":") {
|
||||
// copy from container to container
|
||||
return fmt.Errorf("copy from container to container is not supported")
|
||||
} else {
|
||||
return fmt.Errorf("copy between local files is not supported")
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
R(new(options.ContainerCopyFromOptions), "container-cp-from", "Container copy", func(s *mcclient.ClientSession, opts *options.ContainerCopyFromOptions) error {
|
||||
err := copyFromContainer(s, opts.CONTAINER_ID_PATH, opts.DST_PATH, opts.RawFile)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "copy from container to host")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ func init() {
|
||||
cmd.List(&compute.DBInstanceListOptions{})
|
||||
cmd.Create(&compute.DBInstanceCreateOptions{})
|
||||
cmd.Update(&compute.DBInstanceUpdateOptions{})
|
||||
cmd.Show(&compute.DBInstanceShowOptions{})
|
||||
cmd.Show(&compute.DBInstanceIdOptions{})
|
||||
cmd.Delete(&compute.DBInstanceDeleteOptions{})
|
||||
cmd.Perform("renew", &compute.DBInstanceRenewOptions{})
|
||||
cmd.Perform("change-config", &compute.DBInstanceChangeConfigOptions{})
|
||||
|
||||
@@ -42,12 +42,6 @@ import (
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Disks)
|
||||
cmd.List(&compute_options.DiskListOptions{})
|
||||
cmd.Show(&compute_options.DiskShowOptions{})
|
||||
cmd.Perform("public", &compute_options.DiskIdOptions{})
|
||||
cmd.Perform("private", &compute_options.DiskIdOptions{})
|
||||
cmd.Perform("syncstatus", &compute_options.DiskIdOptions{})
|
||||
cmd.Perform("change-owner-candidate-domains", &compute_options.DiskIdOptions{})
|
||||
cmd.Perform("disk-cancel-delete", &compute_options.DiskIdOptions{})
|
||||
cmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.Perform("rebuild", &compute_options.DiskRebuildOptions{})
|
||||
cmd.Perform("migrate", &compute_options.DiskMigrateOptions{})
|
||||
@@ -55,7 +49,33 @@ func init() {
|
||||
cmd.Perform("change-billing-type", new(compute_options.DiskChangeBillingTypeOptions))
|
||||
cmd.Perform("change-storage-type", &compute_options.DiskChangeStorageTypeOptions{})
|
||||
|
||||
R(&compute_options.DiskDeleteOptions{}, "disk-delete", "Delete a disk", func(s *mcclient.ClientSession, args *compute_options.DiskDeleteOptions) error {
|
||||
type DiskDetailOptions struct {
|
||||
ID string `help:"ID or Name of disk"`
|
||||
}
|
||||
R(&DiskDetailOptions{}, "disk-show", "Show details of disk", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
disk, e := modules.Disks.Get(s, args.ID, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(disk)
|
||||
return nil
|
||||
})
|
||||
R(&DiskDetailOptions{}, "disk-cancel-delete", "Cancel pending delete disks", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
disk, e := modules.Disks.PerformAction(s, args.ID, "cancel-delete", nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(disk)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DiskDeleteOptions struct {
|
||||
ID []string `help:"ID of disks to delete" metavar:"DISK"`
|
||||
OverridePendingDelete bool `help:"Delete disk directly instead of pending delete" short-token:"f"`
|
||||
DeleteSnapshots bool `help:"Delete disk snapshots before delete disk"`
|
||||
}
|
||||
|
||||
R(&DiskDeleteOptions{}, "disk-delete", "Delete a disk", func(s *mcclient.ClientSession, args *DiskDeleteOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if args.OverridePendingDelete {
|
||||
params.Add(jsonutils.JSONTrue, "override_pending_delete")
|
||||
@@ -77,7 +97,25 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&compute_options.DiskIdOptions{}, "disk-metadata", "Get metadata of a disk", func(s *mcclient.ClientSession, args *compute_options.DiskIdOptions) error {
|
||||
R(&DiskDetailOptions{}, "disk-public", "Make a disk public", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
disk, e := modules.Disks.PerformAction(s, args.ID, "public", nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(disk)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DiskDetailOptions{}, "disk-private", "Make a disk private", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
disk, e := modules.Disks.PerformAction(s, args.ID, "private", nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(disk)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DiskDetailOptions{}, "disk-metadata", "Get metadata of a disk", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
meta, e := modules.Disks.GetMetadata(s, args.ID, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
@@ -86,15 +124,24 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DiskDetailOptions{}, "disk-syncstatus", "Sync status for disk", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
ret, e := modules.Disks.PerformAction(s, args.ID, "syncstatus", nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DiskUpdateOptions struct {
|
||||
ID string `help:"ID or name of disk"`
|
||||
Name string `help:"New name of disk"`
|
||||
Desc string `help:"Description" metavar:"DESCRIPTION"`
|
||||
AutoDelete string `help:"Set disk auto_delete (true/false or enable/disable)" choices:"true|false|enable|disable"`
|
||||
AutoDelete string `help:"enable/disable auto delete of disk" choices:"enable|disable"`
|
||||
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 guest shutdown"`
|
||||
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()
|
||||
@@ -105,7 +152,7 @@ func init() {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if len(args.AutoDelete) > 0 {
|
||||
if args.AutoDelete == "enable" || args.AutoDelete == "true" {
|
||||
if args.AutoDelete == "enable" {
|
||||
params.Add(jsonutils.JSONTrue, "auto_delete")
|
||||
} else {
|
||||
params.Add(jsonutils.JSONFalse, "auto_delete")
|
||||
@@ -167,7 +214,11 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&compute_options.DiskResizeOptions{}, "disk-resize", "Resize a disk", func(s *mcclient.ClientSession, args *compute_options.DiskResizeOptions) error {
|
||||
type DiskResizeOptions struct {
|
||||
DISK string `help:"ID or name of disk"`
|
||||
SIZE string `help:"Size of disk"`
|
||||
}
|
||||
R(&DiskResizeOptions{}, "disk-resize", "Resize a disk", func(s *mcclient.ClientSession, args *DiskResizeOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.SIZE), "size")
|
||||
disk, err := modules.Disks.PerformAction(s, args.DISK, "resize", params)
|
||||
@@ -179,7 +230,7 @@ func init() {
|
||||
})
|
||||
type DiskResetOptions struct {
|
||||
DISK string `help:"ID or name of disk"`
|
||||
SNAPSHOT string `help:"Snapshot ID of disk"`
|
||||
SNAPSHOT string `help:"snapshots ID of disk"`
|
||||
AutoStart bool `help:"Autostart guest"`
|
||||
}
|
||||
R(&DiskResetOptions{}, "disk-reset", "Resize a disk", func(s *mcclient.ClientSession, args *DiskResetOptions) error {
|
||||
@@ -235,9 +286,9 @@ func init() {
|
||||
|
||||
type DiskChangeOwnerOptions struct {
|
||||
ID string `help:"Disk to change owner" json:"-"`
|
||||
PROJECT string `help:"Project ID or name" json:"tenant"`
|
||||
PROJECT string `help:"Project ID or change" json:"tenant"`
|
||||
}
|
||||
R(&DiskChangeOwnerOptions{}, "disk-change-owner", "Change owner project of a disk", func(s *mcclient.ClientSession, opts *DiskChangeOwnerOptions) error {
|
||||
R(&DiskChangeOwnerOptions{}, "disk-change-owner", "Change owner porject of a disk", func(s *mcclient.ClientSession, opts *DiskChangeOwnerOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -250,7 +301,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&compute_options.DiskIdOptions{}, "disk-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *compute_options.DiskIdOptions) error {
|
||||
R(&DiskDetailOptions{}, "disk-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
|
||||
result, err := modules.Disks.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.ElasticCache).WithKeyword("elastic-cache")
|
||||
cmd.List(&compute.ElasticCacheListOptions{})
|
||||
cmd.Show(&compute.ElasticCacheShowOptions{})
|
||||
cmd.Show(&compute.ElasticCacheIdOption{})
|
||||
cmd.Create(&compute.ElasticCacheCreateOptions{})
|
||||
cmd.Delete(&compute.ElasticCacheIdOption{})
|
||||
cmd.Perform("restart", &compute.ElasticCacheIdOption{})
|
||||
|
||||
@@ -27,7 +27,7 @@ func init() {
|
||||
cmd.Create(&compute.EipCreateOptions{})
|
||||
cmd.Delete(&options.BaseIdOptions{})
|
||||
cmd.Update(&compute.EipUpdateOptions{})
|
||||
cmd.Show(&compute.EipShowOptions{})
|
||||
cmd.Show(&options.BaseShowOptions{})
|
||||
cmd.Perform("purge", &options.BaseIdOptions{})
|
||||
cmd.Perform("associate", &compute.EipAssociateOptions{})
|
||||
cmd.Perform("dissociate", &compute.EipDissociateOptions{})
|
||||
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Hosts)
|
||||
cmd.List(&compute.HostListForMcpOptions{})
|
||||
cmd.List(&compute.HostListOptions{})
|
||||
cmd.GetMetadata(&options.BaseIdOptions{})
|
||||
cmd.GetProperty(&compute.HostStatusStatisticsOptions{})
|
||||
cmd.Update(&compute.HostUpdateOptions{})
|
||||
@@ -77,7 +77,6 @@ func init() {
|
||||
stats, _ := data.GetArray("workers")
|
||||
printList(&printutils.ListResult{Data: stats}, nil)
|
||||
}, &options.BaseIdOptions{})
|
||||
cmd.Get("api-stats", &options.BaseIdOptions{})
|
||||
cmd.Get("tap-config", &options.BaseIdOptions{})
|
||||
cmd.GetWithCustomShow("nics", func(data jsonutils.JSONObject) {
|
||||
results := printutils.ListResult{}
|
||||
@@ -268,7 +267,6 @@ func init() {
|
||||
Ip6Addr string `help:"IPv6 address"`
|
||||
Bridge string `help:"Bridge of hostwire"`
|
||||
Interface string `help:"Interface name, eg:eth0, en0"`
|
||||
VlanId int `help:"Vlan ID"`
|
||||
}
|
||||
R(&HostAddNetIfOptions{}, "host-add-netif", "Host add a NIC", func(s *mcclient.ClientSession, args *HostAddNetIfOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -291,7 +289,6 @@ func init() {
|
||||
if len(args.Interface) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Interface), "interface")
|
||||
}
|
||||
addVlanIdToParams(params, args.VlanId)
|
||||
result, err := modules.Hosts.PerformAction(s, args.ID, "add-netif", params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -301,14 +298,12 @@ func init() {
|
||||
})
|
||||
|
||||
type HostRemoveNetIfOptions struct {
|
||||
ID string `help:"ID or Name of host"`
|
||||
MAC string `help:"MAC of NIC to remove"`
|
||||
VlanId int `help:"Vlan Id"`
|
||||
ID string `help:"ID or Name of host"`
|
||||
MAC string `help:"MAC of NIC to remove"`
|
||||
}
|
||||
R(&HostRemoveNetIfOptions{}, "host-remove-netif", "Remove NIC from host", func(s *mcclient.ClientSession, args *HostRemoveNetIfOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.MAC), "mac")
|
||||
addVlanIdToParams(params, args.VlanId)
|
||||
result, err := modules.Hosts.PerformAction(s, args.ID, "remove-netif", params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -324,7 +319,6 @@ func init() {
|
||||
Ip6 string `help:"IPv6 address"`
|
||||
Network string `help:"network to connect"`
|
||||
Reserved bool `help:"fetch IP from reserved pool"`
|
||||
VlanId int `help:"Vlan ID"`
|
||||
}
|
||||
R(&HostEnableNetIfOptions{}, "host-enable-netif", "Enable a network interface for a host", func(s *mcclient.ClientSession, args *HostEnableNetIfOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -343,7 +337,6 @@ func init() {
|
||||
if len(args.Network) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Network), "network")
|
||||
}
|
||||
addVlanIdToParams(params, args.VlanId)
|
||||
result, err := modules.Hosts.PerformAction(s, args.ID, "enable-netif", params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -356,7 +349,6 @@ func init() {
|
||||
ID string `help:"ID or Name of host"`
|
||||
MAC string `help:"MAC of NIC to disable"`
|
||||
Reserve bool `help:"Reserve the IP address"`
|
||||
VlanId int `help:"Vlan Id"`
|
||||
}
|
||||
R(&HostDisableNetIfOptions{}, "host-disable-netif", "Disable a network interface", func(s *mcclient.ClientSession, args *HostDisableNetIfOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -364,7 +356,6 @@ func init() {
|
||||
if args.Reserve {
|
||||
params.Add(jsonutils.JSONTrue, "reserve")
|
||||
}
|
||||
addVlanIdToParams(params, args.VlanId)
|
||||
result, err := modules.Hosts.PerformAction(s, args.ID, "disable-netif", params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -706,9 +697,3 @@ func init() {
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func addVlanIdToParams(params *jsonutils.JSONDict, vlanId int) {
|
||||
if vlanId > 1 {
|
||||
params.Add(jsonutils.NewInt(int64(vlanId)), "vlan_id")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.IpSets)
|
||||
cmd.List(&compute.IpSetListOptions{})
|
||||
cmd.Show(&compute.IpSetIdOptions{})
|
||||
cmd.Create(&compute.IpSetCreateOptions{})
|
||||
cmd.Update(&compute.IpSetUpdateOptions{})
|
||||
cmd.Delete(&compute.IpSetIdOptions{})
|
||||
cmd.Perform("syncstatus", &compute.IpSetIdOptions{})
|
||||
}
|
||||
@@ -26,12 +26,8 @@ func init() {
|
||||
cmd.List(&compute.DeviceListOptions{})
|
||||
cmd.Update(&compute.DeviceUpdateOptions{})
|
||||
cmd.Show(&compute.DeviceShowOptions{})
|
||||
cmd.Create(&compute.DeviceCreateOptions{})
|
||||
cmd.BatchDelete(&compute.DeviceDeleteOptions{})
|
||||
cmd.BatchPerform("purge", &compute.DevicePurgeOptions{})
|
||||
cmd.Perform("public", &options.SharableResourcePublicOptions{})
|
||||
cmd.Perform("private", &options.BaseIdOptions{})
|
||||
|
||||
scmd := shell.NewResourceCmd(&modules.ServerIsolatedDevices)
|
||||
scmd.List(&compute.ServerDeviceListOptions{})
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Kafkas)
|
||||
cmd.List(&compute.KafkaListOptions{})
|
||||
cmd.Update(&compute.KafkaUpdateOptions{})
|
||||
cmd.Show(&compute.KafkaShowOptions{})
|
||||
cmd.Show(&compute.KafkaIdOption{})
|
||||
cmd.Get("topics", &options.BaseIdOptions{})
|
||||
cmd.Delete(&compute.KafkaIdOption{})
|
||||
cmd.Perform("syncstatus", &compute.KafkaIdOption{})
|
||||
|
||||
@@ -97,9 +97,6 @@ func init() {
|
||||
})
|
||||
R(&options.LoadbalancerAgentUpdateOptions{}, "lbagent-update", "Update lbagent", func(s *mcclient.ClientSession, opts *options.LoadbalancerAgentUpdateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lbagent, err := modules.LoadbalancerAgents.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -55,9 +55,6 @@ func init() {
|
||||
})
|
||||
R(&options.LoadbalancerBackendUpdateOptions{}, "lbbackend-update", "Update lbbackend", func(s *mcclient.ClientSession, opts *options.LoadbalancerBackendUpdateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lbbackend, err := modules.LoadbalancerBackends.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -54,9 +54,6 @@ func init() {
|
||||
})
|
||||
R(&options.LoadbalancerListenerRuleUpdateOptions{}, "lblistenerrule-update", "Update lblistenerrule", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerRuleUpdateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lblistenerrule, err := modules.LoadbalancerListenerRules.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -87,9 +87,6 @@ func init() {
|
||||
})
|
||||
R(&options.LoadbalancerListenerUpdateOptions{}, "lblistener-update", "Update lblistener", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerUpdateOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lblistener, err := modules.LoadbalancerListeners.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -37,7 +37,7 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.TagListOptions{}, "service-metadata-list", "List service metadata", func(s *mcclient.ClientSession, opts *options.TagListOptions) error {
|
||||
R(&options.TagListOptions{}, "tag-list", "List tags", func(s *mcclient.ClientSession, opts *options.TagListOptions) error {
|
||||
var mod modulebase.IResourceManager
|
||||
switch opts.Service {
|
||||
case "compute":
|
||||
|
||||
@@ -25,7 +25,7 @@ func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.MongoDB)
|
||||
cmd.List(&compute.MongoDBListOptions{})
|
||||
cmd.Update(&compute.MongoDBUpdateOptions{})
|
||||
cmd.Show(&compute.MongoDBShowOptions{})
|
||||
cmd.Show(&options.BaseIdOptions{})
|
||||
cmd.Delete(&options.BaseIdOptions{})
|
||||
cmd.Get("backups", &options.BaseIdOptions{})
|
||||
cmd.Perform("syncstatus", &options.BaseIdOptions{})
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
func init() {
|
||||
|
||||
type NetworkinterfaceNetworkListOptions struct {
|
||||
Networkinterface string `help:"ID or Name of Networkinterface"`
|
||||
Networkinterface string `help:"ID or Name of Server"`
|
||||
Network string `help:"Network ID or name"`
|
||||
}
|
||||
R(&NetworkinterfaceNetworkListOptions{}, "networkinterface-network-list", "List server network pairs", func(s *mcclient.ClientSession, args *NetworkinterfaceNetworkListOptions) error {
|
||||
|
||||
@@ -98,22 +98,6 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkCreate3Options struct {
|
||||
compute_options.NetworkCreateOptions `start_ip->positional:"false" end_ip->positional:"false" net_mask->positional:"false"`
|
||||
}
|
||||
R(&NetworkCreate3Options{}, "network-create3", "Create a dual-stack virtual network", func(s *mcclient.ClientSession, args *NetworkCreate3Options) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
net, err := modules.Networks.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(net)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkSplitOptions struct {
|
||||
NETWORK string `help:"ID or name of network to split"`
|
||||
IP string `help:"Start ip of the split network"`
|
||||
@@ -212,7 +196,7 @@ func init() {
|
||||
|
||||
type NetworkChangeOwnerOptions struct {
|
||||
ID string `help:"Network to change owner" json:"-"`
|
||||
PROJECT string `help:"Project ID or name" json:"tenant"`
|
||||
PROJECT string `help:"Project ID or change" json:"tenant"`
|
||||
}
|
||||
R(&NetworkChangeOwnerOptions{}, "network-change-owner", "Change owner project of a network", func(s *mcclient.ClientSession, args *NetworkChangeOwnerOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
|
||||
@@ -57,9 +57,6 @@ func init() {
|
||||
})
|
||||
R(&options.ProxySettingUpdateOptions{}, "proxysetting-update", "Update proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingUpdateOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
proxysetting, err := modules.ProxySettings.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -24,10 +24,10 @@ import (
|
||||
|
||||
func init() {
|
||||
type NetworkReserveIPOptions struct {
|
||||
NETWORK string `help:"ID or name of network"`
|
||||
NETWORK string `help:"IP or name of network"`
|
||||
NOTES string `help:"Why reserve this IP"`
|
||||
IPS []string `help:"IPs to reserve"`
|
||||
Duration string `help:"reservation duration, e.g. 1D, 1H, 2M"`
|
||||
Duration string `help:"reservation duration, e.g. 1I, 1H, 2M"`
|
||||
Status string `help:"ip status"`
|
||||
}
|
||||
R(&NetworkReserveIPOptions{}, "network-reserve-ip", "Reserve an IP address from pool", func(s *mcclient.ClientSession, args *NetworkReserveIPOptions) error {
|
||||
@@ -49,7 +49,7 @@ func init() {
|
||||
})
|
||||
|
||||
type NetworkReleaseReservedIPOptions struct {
|
||||
NETWORK string `help:"ID or name of network"`
|
||||
NETWORK string `help:"IP or name of network"`
|
||||
IP string `help:"IP to release"`
|
||||
}
|
||||
R(&NetworkReleaseReservedIPOptions{}, "network-release-reserved-ip", "Release a reserved IP into pool", func(s *mcclient.ClientSession, args *NetworkReleaseReservedIPOptions) error {
|
||||
|
||||
@@ -49,9 +49,6 @@ func init() {
|
||||
R(&ScalingPolicyListOptions{}, "scaling-policy-list", "List Scaling Policy", func(s *mcclient.ClientSession,
|
||||
args *ScalingPolicyListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
policies, err := modules.ScalingPolicy.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -17,14 +17,15 @@ package compute
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.SecGroupRules).WithKeyword("secgroup-rule")
|
||||
cmd.List(&compute.SecGroupRulesListOptions{})
|
||||
cmd.Show(&compute.SecGroupRuleShowOptions{})
|
||||
cmd.Delete(&compute.SecGroupRuleDeleteOptions{})
|
||||
cmd.Show(&options.BaseShowOptions{})
|
||||
cmd.Delete(&options.BaseIdOptions{})
|
||||
cmd.Create(&compute.SecGroupRulesCreateOptions{})
|
||||
cmd.Update(&compute.SecGroupRulesUpdateOptions{})
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.SecGroups)
|
||||
cmd.List(&options.SecgroupListOptions{})
|
||||
cmd.Create(&options.SecgroupCreateOptions{})
|
||||
cmd.Show(&options.SecgroupShowOptions{})
|
||||
cmd.Show(&options.SecgroupIdOptions{})
|
||||
cmd.Update(&baseoptions.BaseUpdateOptions{})
|
||||
cmd.Delete(&options.SecgroupDeleteOptions{})
|
||||
cmd.Delete(&options.SecgroupIdOptions{})
|
||||
cmd.Perform("public", &options.SecgroupIdOptions{})
|
||||
cmd.Perform("syncstatus", &options.SecgroupIdOptions{})
|
||||
cmd.Perform("private", &options.SecgroupIdOptions{})
|
||||
@@ -36,7 +36,4 @@ func init() {
|
||||
cmd.Perform("change-owner", &options.SecgroupChangeOwnerOptions{})
|
||||
cmd.Perform("import-rules", &options.SecgroupImportRulesOptions{})
|
||||
cmd.PerformClass("clean", &options.SecgroupCleanOptions{})
|
||||
|
||||
scmd := shell.NewResourceCmd(&modules.Servernetworksecgroups)
|
||||
scmd.List(&options.ServerNetworkSecgroupListOptions{})
|
||||
}
|
||||
|
||||
@@ -77,10 +77,22 @@ 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|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"`
|
||||
}
|
||||
R(&ServerDiskUpdateOptions{}, "server-disk-update", "Update details of a virtual disk of a virtual server", func(s *mcclient.ClientSession, args *ServerDiskUpdateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if len(args.Driver) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Driver), "driver")
|
||||
}
|
||||
if len(args.Cache) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Cache), "cache_mode")
|
||||
}
|
||||
if len(args.Aio) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Aio), "aio_mode")
|
||||
}
|
||||
if args.Index >= 0 {
|
||||
params.Add(jsonutils.NewInt(args.Index), "index")
|
||||
}
|
||||
@@ -113,12 +125,10 @@ func init() {
|
||||
})
|
||||
|
||||
type ServerAttachDiskOptions struct {
|
||||
_ struct{} `mcp-desc:"将已有硬盘挂载到虚机。SERVER/DISK 为 id/name;可选 driver。先 climc_server_list + climc_disk_list"`
|
||||
|
||||
SERVER string `help:"ID or name of server"`
|
||||
DISK string `help:"ID or name of disk to attach"`
|
||||
Driver string `help:"Disk driver" choices:"virtio|ide|scsi" mcp:"true"`
|
||||
Cache string `help:"Cache mode" choices:"writeback|none|writethrough" mcp:"true"`
|
||||
DISK string `help:"ID of name of disk to attach"`
|
||||
Driver string `help:"Driver" choices:"virtio|ide|scsi"`
|
||||
Cache string `help:"Cache mode" choices:"writeback|none|writethrought"`
|
||||
}
|
||||
R(&ServerAttachDiskOptions{}, "server-attach-disk", "Attach an existing virtual disks to a virtual server", func(s *mcclient.ClientSession, args *ServerAttachDiskOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -138,11 +148,9 @@ func init() {
|
||||
})
|
||||
|
||||
type ServerDetachDiskOptions struct {
|
||||
_ struct{} `mcp-desc:"从虚机卸载硬盘。SERVER/DISK 为 id/name;可选 delete-disk。先 climc_server_list / climc_disk_list"`
|
||||
|
||||
SERVER string `help:"ID or name of server"`
|
||||
DISK string `help:"ID or name of disk to detach"`
|
||||
DeleteDisk bool `help:"Delete the disk after detach (ignored if disk has auto_delete)" mcp:"true"`
|
||||
DeleteDisk bool `help:"Delete disk if the disk not has flag of auto_delete when detached"`
|
||||
}
|
||||
R(&ServerDetachDiskOptions{}, "server-detach-disk", "Detach a disk from a virtual server", func(s *mcclient.ClientSession, args *ServerDetachDiskOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
|
||||
@@ -23,15 +23,15 @@ import (
|
||||
|
||||
func init() {
|
||||
type ServerAttachDeviceOptions struct {
|
||||
SERVER string `help:"ID or name of server"`
|
||||
DEVICE string `help:"ID of isolated device to attach"`
|
||||
GpuType string `help:"Type of GPU to attach to" choices:"HPC|VGA"`
|
||||
SERVER string `help:"ID or name of server"`
|
||||
DEVICE string `help:"ID of isolated device to attach"`
|
||||
Type string `help:"Device type" choices:"GPU-HPC|GPU-VGA|PCI"`
|
||||
}
|
||||
R(&ServerAttachDeviceOptions{}, "server-attach-isolated-device", "Attach an existing isolated device to a virtual server", func(s *mcclient.ClientSession, args *ServerAttachDeviceOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.DEVICE), "device")
|
||||
if args.GpuType != "" {
|
||||
params.Add(jsonutils.NewString(args.GpuType), "gpu_type")
|
||||
if len(args.Type) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Type), "dev_type")
|
||||
}
|
||||
srv, err := modules.Servers.PerformAction(s, args.SERVER, "attach-isolated-device", params)
|
||||
if err != nil {
|
||||
@@ -42,18 +42,12 @@ func init() {
|
||||
})
|
||||
|
||||
type ServerDetachDeviceOptions struct {
|
||||
SERVER string `help:"ID or name of server"`
|
||||
DEVICE string `help:"ID of isolated device to detach"`
|
||||
INDEX int `help:"Index of isolated device to detach"`
|
||||
IsForce bool `help:"Force detach isolated device"`
|
||||
SERVER string `help:"ID or name of server"`
|
||||
DEVICE string `help:"ID of isolated device to attach"`
|
||||
}
|
||||
R(&ServerDetachDeviceOptions{}, "server-detach-isolated-device", "Detach a isolated device from a virtual server", func(s *mcclient.ClientSession, args *ServerDetachDeviceOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.DEVICE), "device")
|
||||
params.Add(jsonutils.NewInt(int64(args.INDEX)), "index")
|
||||
if args.IsForce {
|
||||
params.Set("is_force", jsonutils.JSONTrue)
|
||||
}
|
||||
srv, err := modules.Servers.PerformAction(s, args.SERVER, "detach-isolated-device", params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -23,20 +23,14 @@ import (
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
"yunion.io/x/pkg/util/regutils"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/cmdline"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
compute_options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
cmd := shell.NewResourceCmd(&modules.ServerNetworkTrafficLogs)
|
||||
cmd.List(new(compute_options.ServerNetworkTrafficLogListOptions))
|
||||
|
||||
type ServerNetworkListOptions struct {
|
||||
options.BaseListOptions
|
||||
Server string `help:"ID or Name of Server"`
|
||||
@@ -96,7 +90,7 @@ func init() {
|
||||
|
||||
type ServerNetworkUpdateOptions struct {
|
||||
SERVER string `help:"ID or Name of Server"`
|
||||
NETWORK string `help:"ID or Name of Network"`
|
||||
NETWORK string `help:"ID or Name of Wire"`
|
||||
Mac string `help:"Mac of NIC"`
|
||||
Driver string `help:"Driver model of vNIC" choices:"virtio|e1000|vmxnet3|rtl8139"`
|
||||
Index int64 `help:"Index of NIC" default:"-1"`
|
||||
@@ -144,10 +138,7 @@ func init() {
|
||||
type ServerNetworkBWOptions struct {
|
||||
SERVER string `help:"ID or Name of server"`
|
||||
MACORIP string `help:"IP, Mac, or Index of NIC"`
|
||||
|
||||
BW int64 `help:"Bandwidth in Mbps"`
|
||||
Tx int64 `help:"Tx bandwidth in Mbps"`
|
||||
Rx int64 `help:"Rx bandwidth in Mbps"`
|
||||
BW int64 `help:"Bandwidth in Mbps"`
|
||||
}
|
||||
R(&ServerNetworkBWOptions{}, "server-change-bandwidth", "Change server network bandwidth in Mbps", func(s *mcclient.ClientSession, args *ServerNetworkBWOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -165,8 +156,6 @@ func init() {
|
||||
return fmt.Errorf("Please specify Ip or Mac")
|
||||
}
|
||||
params.Add(jsonutils.NewInt(args.BW), "bandwidth")
|
||||
params.Add(jsonutils.NewInt(args.Tx), "tx_bw_limit")
|
||||
params.Add(jsonutils.NewInt(args.Rx), "rx_bw_limit")
|
||||
server, err := modules.Servers.PerformAction(s, args.SERVER, "change-bandwidth", params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -205,7 +194,7 @@ func init() {
|
||||
Reserve bool `help:"Put the release IP address into reserved address pool"`
|
||||
Force bool `help:"detach server network by force"`
|
||||
}
|
||||
R(&ServerDetachNetworkOptions{}, "server-detach-network", "Detach the virtual network from a virtual server", func(s *mcclient.ClientSession, args *ServerDetachNetworkOptions) error {
|
||||
R(&ServerDetachNetworkOptions{}, "server-detach-network", "Detach the virtual network fron a virtual server", func(s *mcclient.ClientSession, args *ServerDetachNetworkOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
// params.Add(jsonutils.NewString(args.NETWORK), "net_id")
|
||||
if args.Reserve {
|
||||
|
||||
@@ -30,7 +30,6 @@ import (
|
||||
"yunion.io/x/pkg/util/printutils"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
billing_api "yunion.io/x/onecloud/pkg/apis/billing"
|
||||
"yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
@@ -127,19 +126,13 @@ func init() {
|
||||
cmd.Perform("update-sub-ips", &options.ServerUpdateSubIpsOptions{})
|
||||
cmd.BatchPerform("restore-virtual-isolated-devices", &options.ServerIdsOptions{})
|
||||
cmd.BatchPerform("set-os-info", &options.ServerSetOSInfoOptions{})
|
||||
// 与 server-start 复用参数时单独包一层,避免继承 mcp-desc 被注册为 MCP tool
|
||||
cmd.BatchPerform("start-rescue", &options.ServerStartRescueOptions{})
|
||||
cmd.BatchPerform("stop-rescue", &options.ServerStopRescueOptions{})
|
||||
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.BatchPerform("set-tpm", &options.ServerSetTpmOptions{})
|
||||
cmd.Perform("set-kickstart", &options.ServerKickstartConfigOptions{})
|
||||
cmd.Perform("delete-kickstart", &options.ServerIdOptions{})
|
||||
cmd.Perform("kickstart-complete", &options.ServerKickstartCompleteOptions{})
|
||||
cmd.Get("kickstart", new(options.ServerIdOptions))
|
||||
cmd.Get("vnc", new(options.ServerVncOptions))
|
||||
cmd.Get("modification-types", new(options.ServerIdOptions))
|
||||
cmd.Get("desc", new(options.ServerIdOptions))
|
||||
cmd.Get("status", new(options.ServerIdOptions))
|
||||
cmd.Get("iso", new(options.ServerIdOptions))
|
||||
@@ -155,11 +148,6 @@ func init() {
|
||||
cmd.Get("screen-dump-show", new(options.ServerScreenDumpOptions))
|
||||
cmd.Get("numa-info", new(options.ServerIdOptions))
|
||||
cmd.BatchPerform("screen-dump", new(options.ServerIdsOptions))
|
||||
cmd.Perform("set-network-num-queues", new(options.ServerSetNetworkNumQueues))
|
||||
cmd.Perform("set-network-secgroup", new(options.ServerNetworkSecGroupsOptions))
|
||||
cmd.Perform("add-network-secgroup", new(options.ServerNetworkSecGroupsOptions))
|
||||
cmd.Perform("revoke-network-secgroup", new(options.ServerNetworkSecGroupsOptions))
|
||||
cmd.Perform("change-disk-driver", new(options.ServerChangeDiskDriverOptions))
|
||||
|
||||
cmd.GetProperty(&options.ServerStatusStatisticsOptions{})
|
||||
cmd.GetProperty(&options.ServerProjectStatisticsOptions{})
|
||||
@@ -221,10 +209,8 @@ func init() {
|
||||
params.Name = opts.NAME
|
||||
params.AutoStart = opts.AutoStart
|
||||
params.Eip = opts.Eip
|
||||
params.EipChargeType = billing_api.ParseNetChargeType(opts.EipChargeType)
|
||||
params.EipChargeType = opts.EipChargeType
|
||||
params.EipBw = opts.EipBw
|
||||
params.EipTxBw = opts.EipTxBw
|
||||
params.EipRxBw = opts.EipRxBw
|
||||
|
||||
server, err := modules.Servers.Create(s, params.JSON(params))
|
||||
if err != nil {
|
||||
@@ -294,7 +280,7 @@ func init() {
|
||||
|
||||
type ServerDiskSnapshotOptions struct {
|
||||
SERVER string `help:"server ID or Name"`
|
||||
DISK string `help:"Disk ID for snapshot creation"`
|
||||
DISK string `help:"create snapshot disk id"`
|
||||
SNAPSHOTNAME string `help:"Snapshot name"`
|
||||
}
|
||||
R(&ServerDiskSnapshotOptions{}, "server-disk-create-snapshot", "Task server disk snapshot", func(s *mcclient.ClientSession, args *ServerDiskSnapshotOptions) error {
|
||||
@@ -734,7 +720,7 @@ func init() {
|
||||
|
||||
type ServerSnapshotAndClone struct {
|
||||
ID string `help:"ID or name of VM" json:"-"`
|
||||
NAME string `help:"New instance name" json:"name"`
|
||||
NAME string `help:"Newly instance name" json:"name"`
|
||||
AutoStart bool `help:"Auto start new guest"`
|
||||
AllowDelete bool `help:"Allow new guest delete" json:"-"`
|
||||
Count int `help:"Guest count"`
|
||||
@@ -773,7 +759,7 @@ func init() {
|
||||
ID string `help:"ID or name of server"`
|
||||
Save string `help:"save xml into this file"`
|
||||
}
|
||||
R(&ServerJnlpOptions{}, "server-jnlp", "Get baremetal server jnlp file content", func(s *mcclient.ClientSession, args *ServerJnlpOptions) error {
|
||||
R(&ServerJnlpOptions{}, "server-jnlp", "Get baremetal server jnlp file contentn", func(s *mcclient.ClientSession, args *ServerJnlpOptions) error {
|
||||
spec, err := modules.Servers.GetSpecific(s, args.ID, "jnlp", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -30,5 +30,4 @@ func init() {
|
||||
cmd.Create(&options.ServerSkusCreateOptions{})
|
||||
cmd.Update(&options.ServerSkusUpdateOptions{})
|
||||
cmd.ClassShow(&options.ServerSkusListOptions{})
|
||||
cmd.PerformClass("batch-update-price", &options.ServerSkusBatchUpdatePriceOptions{})
|
||||
}
|
||||
|
||||
@@ -24,18 +24,16 @@ import (
|
||||
|
||||
func init() {
|
||||
type SnapshotsListOptions struct {
|
||||
_ struct{} `mcp-desc:"列出磁盘快照。可用 disk/server/disk-type 过滤"`
|
||||
|
||||
options.BaseListOptions
|
||||
|
||||
Disk string `help:"Disk snapshots" json:"disk_id" mcp:"true"`
|
||||
FakeDeleted bool `help:"Show fake deleted snapshot or not" mcp:"true"`
|
||||
Disk string `help:"Disk snapshots" json:"disk_id"`
|
||||
FakeDeleted bool `help:"Show fake deleted snapshot or not"`
|
||||
Local *bool `help:"Show local snapshots"`
|
||||
Share *bool `help:"Show shared snapshots"`
|
||||
DiskType string `help:"Filter by disk type" choices:"sys|data" mcp:"true"`
|
||||
Server string `help:"Filter by server" json:"server_id" mcp:"true"`
|
||||
Unused bool `mcp:"true"`
|
||||
StorageId string `help:"Filter by storage id" mcp:"true"`
|
||||
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
|
||||
|
||||
@@ -32,7 +32,7 @@ func init() {
|
||||
HostType string `help:"Host type filter" choices:"baremetal|hypervisor|esxi|kubelet|hyperv"`
|
||||
Gpu bool `help:"Only show gpu devices"`
|
||||
Zone string `help:"Filter by zone id or name"`
|
||||
Occupied bool `help:"show occupied host" json:"-"`
|
||||
Occupied bool `help:"show occupid host" json:"-"`
|
||||
}
|
||||
R(&ListOptions{}, "spec", "List all kinds of model specs", func(s *mcclient.ClientSession, args *ListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
@@ -76,7 +76,7 @@ func init() {
|
||||
DiskSpec []string `help:"Disk spec string, like 'Linux_adapter0_HDD_111Gx4'"`
|
||||
Nic int64 `help:"#Nics count of host" metavar:"<NIC_COUNT>"`
|
||||
GpuModel []string `help:"GPU model, like 'GeForce GTX 1050 Ti'"`
|
||||
Occupied bool `help:"Show occupied host" json:"-"`
|
||||
Occupied bool `help:"Show occupid host" json:"-"`
|
||||
Manufacture string `help:"Manufacture of host"`
|
||||
Model string `help:"Model of host"`
|
||||
}
|
||||
|
||||
@@ -31,19 +31,17 @@ import (
|
||||
)
|
||||
|
||||
type GeneralUsageOptions struct {
|
||||
_ struct{} `mcp-desc:"资源用量汇总(usages/general-usage)。报表「资源概览」用本工具,不要用各资源 list 凑。项目级传 project=项目名/id;域级传 project-domain;平台级 scope=system。返回 servers/rds/cache/loadbalancer/buckets/eip/snapshot/vpcs/networks/ports 及 running_servers、disks.attached 等"`
|
||||
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun|cnware"`
|
||||
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun|CNWare"`
|
||||
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun|CNWare"`
|
||||
Project string `help:"show usage of specified project"`
|
||||
|
||||
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun|cnware" mcp:"true"`
|
||||
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun|CNWare" mcp:"true"`
|
||||
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun|CNWare" mcp:"true"`
|
||||
Project string `help:"show usage of specified project" mcp:"true"`
|
||||
ProjectDomain string `help:"show usage of specified domain"`
|
||||
|
||||
ProjectDomain string `help:"show usage of specified domain" mcp:"true"`
|
||||
CloudEnv string `help:"show usage of specified cloudenv" choices:"public|private|onpremise"`
|
||||
Scope string `help:"show usage of specified privilege scope" choices:"system|domain|project"`
|
||||
|
||||
CloudEnv string `help:"show usage of specified cloudenv" choices:"public|private|onpremise" mcp:"true"`
|
||||
Scope string `help:"show usage of specified privilege scope" choices:"system|domain|project" mcp:"true"`
|
||||
|
||||
Refresh bool `help:"force refresh usage statistics" mcp:"true"`
|
||||
Refresh bool `help:"force refresh usage statistics"`
|
||||
}
|
||||
|
||||
func fetchHostTypeOptions(args *GeneralUsageOptions) *jsonutils.JSONDict {
|
||||
|
||||
@@ -57,9 +57,6 @@ func init() {
|
||||
}
|
||||
var result *printutils.ListResult
|
||||
result, err = modules.DevToolCronjobs.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.DevToolCronjobs.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -50,9 +50,6 @@ func init() {
|
||||
}
|
||||
var result *printutils.ListResult
|
||||
result, err = modules.DevToolTemplates.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.DevToolTemplates.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -25,15 +25,15 @@ import (
|
||||
)
|
||||
|
||||
type BaseEventListOptions struct {
|
||||
Scope string `help:"RBAC scope" choices:"project|domain|system"`
|
||||
Scope string `help:"scope" choices:"project|domain|system"`
|
||||
Since string `help:"Show logs since specific date" metavar:"DATETIME"`
|
||||
Until string `help:"Show logs until specific date" metavar:"DATETIME"`
|
||||
Limit int64 `help:"Limit number of logs" default:"20"`
|
||||
Offset int64 `help:"Offset for pagination"`
|
||||
Offset int64 `help:"Offset"`
|
||||
Ascending bool `help:"Ascending order"`
|
||||
Descending bool `help:"Descending order"`
|
||||
OrderBy string `help:"order by specific field"`
|
||||
Action []string `help:"Filter by log action"`
|
||||
Action []string `help:"Log action"`
|
||||
|
||||
User string `help:"filter by operator user"`
|
||||
Project string `help:"filter by operator user's project"`
|
||||
|
||||
@@ -22,9 +22,9 @@ import (
|
||||
|
||||
var (
|
||||
R = shell.R
|
||||
printList = shell.PrintList
|
||||
printObject = shell.PrintObject
|
||||
printBatchResults = shell.PrintBatchResults
|
||||
printList = printutils.PrintJSONList
|
||||
printObject = printutils.PrintJSONObject
|
||||
printBatchResults = printutils.PrintJSONBatchResults
|
||||
|
||||
InvalidUpdateError = shell.InvalidUpdateError
|
||||
printObjectRecursive = printutils.PrintJSONObjectRecursive
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
|
||||
func init() {
|
||||
type CredentialListOptions struct {
|
||||
Scope string `help:"RBAC scope" choices:"project|domain|system"`
|
||||
Scope string `help:"scope" choices:"project|domain|system"`
|
||||
Type string `help:"credential type" choices:"totp|recovery_secret|aksk|enc_key|container_image"`
|
||||
User string `help:"filter by user"`
|
||||
UserDomain string `help:"the domain of user"`
|
||||
|
||||
@@ -32,12 +32,10 @@ func init() {
|
||||
cmd.GetProperty(&identity_options.DomainGetPropertyTagValuePairOptions{})
|
||||
cmd.GetProperty(&identity_options.DomainGetPropertyTagValueTreeOptions{})
|
||||
|
||||
type DomainShowOptions struct {
|
||||
_ struct{} `mcp-desc:"查询域详情。ID 可用 climc_domain_list 返回的 id/name"`
|
||||
|
||||
type DomainDetailOptions struct {
|
||||
ID string `help:"ID or domain"`
|
||||
}
|
||||
R(&DomainShowOptions{}, "domain-show", "Show detail of domain", func(s *mcclient.ClientSession, args *DomainShowOptions) error {
|
||||
R(&DomainDetailOptions{}, "domain-show", "Show detail of domain", func(s *mcclient.ClientSession, args *DomainDetailOptions) error {
|
||||
result, err := modules.Domains.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -45,12 +43,7 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
type DomainDeleteOptions struct {
|
||||
_ struct{} `mcp-desc:"删除域。若尚不知 id,先用 climc_domain_list 定位;确认域下无项目/用户后再删"`
|
||||
|
||||
ID string `help:"ID or domain"`
|
||||
}
|
||||
R(&DomainDeleteOptions{}, "domain-delete", "Delete a domain", func(s *mcclient.ClientSession, args *DomainDeleteOptions) error {
|
||||
R(&DomainDetailOptions{}, "domain-delete", "Delete a domain", func(s *mcclient.ClientSession, args *DomainDetailOptions) error {
|
||||
objId, err := modules.Domains.GetId(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -79,14 +72,12 @@ func init() {
|
||||
}) */
|
||||
|
||||
type DomainCreateOptions struct {
|
||||
_ struct{} `mcp-desc:"创建域。NAME 必填;可选 displayname/desc/enabled"`
|
||||
|
||||
NAME string `help:"Name of domain"`
|
||||
Desc string `help:"Description" mcp:"true"`
|
||||
Enabled bool `help:"Set the domain enabled" mcp:"true"`
|
||||
Disabled bool `help:"Set the domain disabled" mcp:"true"`
|
||||
Desc string `help:"Description"`
|
||||
Enabled bool `help:"Set the domain enabled"`
|
||||
Disabled bool `help:"Set the domain disabled"`
|
||||
|
||||
Displayname string `help:"display name" mcp:"true"`
|
||||
Displayname string `help:"display name"`
|
||||
}
|
||||
R(&DomainCreateOptions{}, "domain-create", "Create a new domain", func(s *mcclient.ClientSession, args *DomainCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
|
||||
@@ -775,17 +775,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type IdentityProviderGetPropertyAttributeNamesOptions struct {
|
||||
DRIVER string `help:"driver of idp to query" json:"driver" choices:"oidc|oauth2|saml|cas"`
|
||||
TEMPLATE string `help:"template of idp to query" json:"template"`
|
||||
}
|
||||
R(&IdentityProviderGetPropertyAttributeNamesOptions{}, "idp-attribute-names", "Get property attribute names of a idp", func(s *mcclient.ClientSession, args *IdentityProviderGetPropertyAttributeNamesOptions) error {
|
||||
result, err := modules.IdentityProviders.Get(s, "attribute-names", jsonutils.Marshal(args))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -43,10 +43,8 @@ func init() {
|
||||
cmd.PerformClass("clean", &identity_options.ProjectCleanOptions{})
|
||||
|
||||
type ProjectShowOptions struct {
|
||||
_ struct{} `mcp-desc:"查询项目详情。ID 可用 climc_project_list 返回的 id/name;跨域时可传 domain"`
|
||||
|
||||
ID string `help:"ID or Name of project"`
|
||||
Domain string `help:"Domain" mcp:"true"`
|
||||
Domain string `help:"Domain"`
|
||||
}
|
||||
R(&ProjectShowOptions{}, "project-show", "Show details of project", func(s *mcclient.ClientSession, args *ProjectShowOptions) error {
|
||||
query := jsonutils.NewDict()
|
||||
@@ -64,13 +62,7 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
type ProjectDeleteOptions struct {
|
||||
_ struct{} `mcp-desc:"删除项目。若尚不知 id,先用 climc_project_list 定位;跨域时可传 domain"`
|
||||
|
||||
ID string `help:"ID or Name of project"`
|
||||
Domain string `help:"Domain" mcp:"true"`
|
||||
}
|
||||
R(&ProjectDeleteOptions{}, "project-delete", "Delete a project", func(s *mcclient.ClientSession, args *ProjectDeleteOptions) error {
|
||||
R(&ProjectShowOptions{}, "project-delete", "Delete a project", func(s *mcclient.ClientSession, args *ProjectShowOptions) error {
|
||||
query := jsonutils.NewDict()
|
||||
if len(args.Domain) > 0 {
|
||||
domainId, err := modules.Domains.GetId(s, args.Domain, nil)
|
||||
@@ -91,14 +83,12 @@ func init() {
|
||||
})
|
||||
|
||||
type ProjectCreateOptions struct {
|
||||
_ struct{} `mcp-desc:"创建项目。NAME 必填;可选 domain/displayname/desc"`
|
||||
|
||||
NAME string `help:"Name of new project"`
|
||||
Displayname string `help:"display name" mcp:"true"`
|
||||
Domain string `help:"Domain" mcp:"true"`
|
||||
Desc string `help:"Description" mcp:"true"`
|
||||
Enabled bool `help:"Project is enabled" mcp:"true"`
|
||||
Disabled bool `help:"Project is disabled" mcp:"true"`
|
||||
Displayname string `help:"display name"`
|
||||
Domain string `help:"Domain"`
|
||||
Desc string `help:"Description"`
|
||||
Enabled bool `help:"Project is enabled"`
|
||||
Disabled bool `help:"Project is disabled"`
|
||||
}
|
||||
R(&ProjectCreateOptions{}, "project-create", "Create a project", func(s *mcclient.ClientSession, args *ProjectCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user