mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-21 00:24:07 +08:00
Compare commits
483 Commits
release/3.
...
release/3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1264fb0835 | ||
|
|
ac09f79dca | ||
|
|
4b6b85a629 | ||
|
|
d3856e26d2 | ||
|
|
bc47ac7d3e | ||
|
|
14afdc74cd | ||
|
|
c4bb8a3323 | ||
|
|
c8eb0d575d | ||
|
|
f0785033a7 | ||
|
|
4f476cb137 | ||
|
|
41d332c43b | ||
|
|
372f23717a | ||
|
|
2945567906 | ||
|
|
9fdcc5db3c | ||
|
|
4f2086896b | ||
|
|
44d420c4e3 | ||
|
|
04f2fce3c1 | ||
|
|
087b7f2c94 | ||
|
|
537f2d5d53 | ||
|
|
a43c3724c1 | ||
|
|
b9d8873277 | ||
|
|
f88350a3ac | ||
|
|
9ec7aa5da2 | ||
|
|
ffa1a5bbe1 | ||
|
|
b260eeff60 | ||
|
|
f157726cc6 | ||
|
|
7a15c502c2 | ||
|
|
e9e53b1c0f | ||
|
|
8ba2b34a67 | ||
|
|
b7518d76d2 | ||
|
|
4e3b2b8334 | ||
|
|
3af2372ebf | ||
|
|
363a2c2e3f | ||
|
|
d0decd7f97 | ||
|
|
d37e2a730e | ||
|
|
5be60745c0 | ||
|
|
db3cf440fc | ||
|
|
d52f3bd8cc | ||
|
|
1253d9187f | ||
|
|
d270983f8a | ||
|
|
f1108cf3e4 | ||
|
|
85e176be8d | ||
|
|
fefb33ab13 | ||
|
|
962021f120 | ||
|
|
89345f0e3f | ||
|
|
61c337e4c0 | ||
|
|
26598ccb15 | ||
|
|
0a8197c144 | ||
|
|
aeb61fa3db | ||
|
|
97ca0dad2b | ||
|
|
442076d554 | ||
|
|
d44a11995c | ||
|
|
4075333492 | ||
|
|
5699ac0595 | ||
|
|
2e5b1288f0 | ||
|
|
b4fbdc8fa4 | ||
|
|
baccc6af2e | ||
|
|
e939acb221 | ||
|
|
7453b5a4aa | ||
|
|
5ddda054d4 | ||
|
|
7815cb0a0c | ||
|
|
a533bdcde8 | ||
|
|
105157dd22 | ||
|
|
c825ebdcc2 | ||
|
|
833a8058dd | ||
|
|
510ba895c3 | ||
|
|
e5e9d54655 | ||
|
|
53bfda4849 | ||
|
|
d99774a3f1 | ||
|
|
709daa66d3 | ||
|
|
2cbb4f9784 | ||
|
|
5696d10300 | ||
|
|
97167be073 | ||
|
|
3a80ccd82f | ||
|
|
0722788a5a | ||
|
|
3673a98fef | ||
|
|
08d969baf4 | ||
|
|
d58a1533ad | ||
|
|
2fe7ba8f20 | ||
|
|
ec9631f992 | ||
|
|
44a135bba4 | ||
|
|
c4031158e3 | ||
|
|
a4f775922e | ||
|
|
1442973d95 | ||
|
|
60dad15824 | ||
|
|
571d2d297e | ||
|
|
f05a913cbb | ||
|
|
7b47c9bb8c | ||
|
|
6f8400a7e5 | ||
|
|
ecb169d9f9 | ||
|
|
ce630362fb | ||
|
|
61d8885b60 | ||
|
|
0b7a4f08e1 | ||
|
|
caa530bd60 | ||
|
|
559d30afa8 | ||
|
|
b8c10b8e7c | ||
|
|
b3285aebce | ||
|
|
ad01c895cf | ||
|
|
b2aa6dd321 | ||
|
|
a4dcc91d0d | ||
|
|
18a751548c | ||
|
|
b53b09ebb5 | ||
|
|
c6941536b7 | ||
|
|
edba3c3dfc | ||
|
|
a66c1aa1ba | ||
|
|
c5dd4389d3 | ||
|
|
0e4ea782e1 | ||
|
|
9b993f1a99 | ||
|
|
8a62c46a92 | ||
|
|
d3ad4967a9 | ||
|
|
37897cadc7 | ||
|
|
9a8111de6c | ||
|
|
9cdd7dd2da | ||
|
|
8549df1a00 | ||
|
|
cd9b632d08 | ||
|
|
ac8ba1e86d | ||
|
|
2add6fc1f5 | ||
|
|
45eda7c703 | ||
|
|
85008a7b0c | ||
|
|
2f9cfae375 | ||
|
|
410782cffc | ||
|
|
9342ccf9c3 | ||
|
|
29c96f2d2b | ||
|
|
df7d68e404 | ||
|
|
869744d1bb | ||
|
|
b01a477cb2 | ||
|
|
1ec3d6ddf0 | ||
|
|
984006ea31 | ||
|
|
1bc2c75e06 | ||
|
|
cf8b548392 | ||
|
|
a898d76094 | ||
|
|
30ee4056e1 | ||
|
|
7d64b9fffc | ||
|
|
3da4dd1953 | ||
|
|
014170e74a | ||
|
|
db60e37c4d | ||
|
|
4ac56f7fc3 | ||
|
|
9494c0939a | ||
|
|
1e1941cd7b | ||
|
|
70d2e5c84d | ||
|
|
4e864a7a86 | ||
|
|
5bce2bd959 | ||
|
|
8089afa122 | ||
|
|
da66f26503 | ||
|
|
8450fe9ea0 | ||
|
|
b0163b6a70 | ||
|
|
b19762e1a9 | ||
|
|
c3fd4937d3 | ||
|
|
77e19e79a0 | ||
|
|
c069179adc | ||
|
|
fdf51560a3 | ||
|
|
9561c0c8d4 | ||
|
|
b0d7d2f912 | ||
|
|
35c0e52de9 | ||
|
|
ec5995da4b | ||
|
|
21567833fd | ||
|
|
159fba33b6 | ||
|
|
5b0247a35f | ||
|
|
62c39c62cd | ||
|
|
995b24c319 | ||
|
|
82e1234ed4 | ||
|
|
208a49e3d4 | ||
|
|
c8388cab1a | ||
|
|
45b538bd2a | ||
|
|
f2e3766bee | ||
|
|
2154e7c18b | ||
|
|
27dc7b6296 | ||
|
|
ae64d437f2 | ||
|
|
8d842b0d2f | ||
|
|
34d0478af1 | ||
|
|
b1bec7337f | ||
|
|
de77edc357 | ||
|
|
2ce7f7b9fe | ||
|
|
e6206944dd | ||
|
|
02bac8b9ae | ||
|
|
78c10c78cc | ||
|
|
433807432a | ||
|
|
0f973234b8 | ||
|
|
58810cde95 | ||
|
|
36a9314427 | ||
|
|
2864b15ecc | ||
|
|
0ee2cbcf60 | ||
|
|
44252983e9 | ||
|
|
532ada4bf9 | ||
|
|
df4a02ac49 | ||
|
|
6d5941eaad | ||
|
|
f77c4d078a | ||
|
|
5364ba5641 | ||
|
|
f4d8225a10 | ||
|
|
9122c7e10d | ||
|
|
3e3d356ffc | ||
|
|
1c86c0d73a | ||
|
|
aa937e6966 | ||
|
|
706980e233 | ||
|
|
47fdfc78c9 | ||
|
|
96d199724e | ||
|
|
50a36e3906 | ||
|
|
3817b9e6ad | ||
|
|
e4c07c0304 | ||
|
|
2ff318a5b8 | ||
|
|
e8605a1758 | ||
|
|
ee391ed98a | ||
|
|
d2702b67f9 | ||
|
|
deae194d43 | ||
|
|
aad036a822 | ||
|
|
16f59a2f2c | ||
|
|
4aec6e7e36 | ||
|
|
c553099588 | ||
|
|
5863e4a73d | ||
|
|
bc3aa5432f | ||
|
|
bd666ee815 | ||
|
|
2ad30a0872 | ||
|
|
c5655ed2ba | ||
|
|
3d99fe914d | ||
|
|
d357f03757 | ||
|
|
28e5b39fff | ||
|
|
2d248612e0 | ||
|
|
0ebde53d20 | ||
|
|
8ac922480e | ||
|
|
212bdc0907 | ||
|
|
31436641cc | ||
|
|
5e3861b28b | ||
|
|
475842e818 | ||
|
|
f3fee11711 | ||
|
|
d1d62de884 | ||
|
|
20f2ed2b1f | ||
|
|
529da18451 | ||
|
|
ee5351b536 | ||
|
|
f82e51af65 | ||
|
|
91680e5fca | ||
|
|
c74b89332d | ||
|
|
b8e6b5db7b | ||
|
|
8471421b87 | ||
|
|
ab6d57afea | ||
|
|
5920af6aee | ||
|
|
df6d774d69 | ||
|
|
5d69ae9a02 | ||
|
|
c3be526988 | ||
|
|
9d1267b0f7 | ||
|
|
e762b2e2e0 | ||
|
|
cfefa015fd | ||
|
|
986fa9881f | ||
|
|
ffe1c9050b | ||
|
|
07bcf6a7a7 | ||
|
|
0e01df9200 | ||
|
|
9e5667c50a | ||
|
|
fd7fe62930 | ||
|
|
eba5bd84df | ||
|
|
9080fdbde3 | ||
|
|
ec76d129f6 | ||
|
|
ee9e59df88 | ||
|
|
c2765f5fda | ||
|
|
8cd9d39155 | ||
|
|
e77ca84876 | ||
|
|
76ca993e8a | ||
|
|
aa96758354 | ||
|
|
8a35ef6bcc | ||
|
|
e2ab5190c6 | ||
|
|
af006498f8 | ||
|
|
b54ebf45f3 | ||
|
|
639e1f045c | ||
|
|
1c68b97c86 | ||
|
|
ec47e47734 | ||
|
|
76fd4945bd | ||
|
|
60ca1f7266 | ||
|
|
220fb5bca5 | ||
|
|
0ea12ffcc6 | ||
|
|
f80c6a214a | ||
|
|
29343a6828 | ||
|
|
b9d08c74a3 | ||
|
|
4b06ee94d0 | ||
|
|
bf625de12d | ||
|
|
60dbb28022 | ||
|
|
43407d3d77 | ||
|
|
9e5018b147 | ||
|
|
43f5c84955 | ||
|
|
91dd66b5a8 | ||
|
|
1615426f29 | ||
|
|
3df0be2fd4 | ||
|
|
7d9a3c04b1 | ||
|
|
1a2204d146 | ||
|
|
ed6c42ae37 | ||
|
|
372c9a393f | ||
|
|
37f648bfb8 | ||
|
|
1818d4853a | ||
|
|
ff5396b909 | ||
|
|
b2854aff23 | ||
|
|
da30ae5efd | ||
|
|
17face8f52 | ||
|
|
9a8277ff20 | ||
|
|
61eaea8099 | ||
|
|
6f0d6cbeac | ||
|
|
09ed698ae8 | ||
|
|
7bf1bef04a | ||
|
|
024a17de83 | ||
|
|
0f5a8b6407 | ||
|
|
cd4ce681b0 | ||
|
|
fc16c37eab | ||
|
|
3dfd086a27 | ||
|
|
8e2cd5112d | ||
|
|
a5d82922bd | ||
|
|
9d19bf34b0 | ||
|
|
e4bf0fa8dc | ||
|
|
6bd82d216d | ||
|
|
60138f6401 | ||
|
|
a43f747bdc | ||
|
|
2560198943 | ||
|
|
6e0d4cb35c | ||
|
|
71535f670e | ||
|
|
5e47566b42 | ||
|
|
c325d8355c | ||
|
|
206dc2a62d | ||
|
|
55a7de9ba6 | ||
|
|
3b2938380a | ||
|
|
3774549979 | ||
|
|
9c2cc664f6 | ||
|
|
42582043ee | ||
|
|
690aef8f4e | ||
|
|
eb7173085e | ||
|
|
b6917c5604 | ||
|
|
47349e71b9 | ||
|
|
3d2b24a351 | ||
|
|
b9565f288a | ||
|
|
6b0ae74acb | ||
|
|
438a0cb0b7 | ||
|
|
3fb97c99b6 | ||
|
|
ad8459053f | ||
|
|
491a9ece55 | ||
|
|
ba2a188f0d | ||
|
|
ea793d9902 | ||
|
|
4b4964e58e | ||
|
|
4a06b38da8 | ||
|
|
96400124ba | ||
|
|
aee0299d71 | ||
|
|
cbea17b4c4 | ||
|
|
4acb237f70 | ||
|
|
3a8e998718 | ||
|
|
bef9af4c3b | ||
|
|
3e17ee7519 | ||
|
|
d3aba7285a | ||
|
|
43f4f5f946 | ||
|
|
4d3c7f3059 | ||
|
|
fd26fc1947 | ||
|
|
b74f61fe1d | ||
|
|
dc19e7b035 | ||
|
|
37272588fa | ||
|
|
029530ac34 | ||
|
|
c047d69a53 | ||
|
|
6f76c5d670 | ||
|
|
71ddac232d | ||
|
|
ca9859f126 | ||
|
|
7db6ad9a01 | ||
|
|
b545066e05 | ||
|
|
befef016dc | ||
|
|
c32ad0ac5b | ||
|
|
ecc75aa231 | ||
|
|
202e0bf266 | ||
|
|
c4d4700d26 | ||
|
|
1fce2ec30c | ||
|
|
dfe7661c61 | ||
|
|
5a28b3c13e | ||
|
|
27c8861b64 | ||
|
|
e9459b4a7d | ||
|
|
5861a18051 | ||
|
|
0bbe2e7590 | ||
|
|
b93d695fe9 | ||
|
|
39fe8b2133 | ||
|
|
c357d61add | ||
|
|
749ca9dc63 | ||
|
|
5aa0bbb091 | ||
|
|
7d35397d50 | ||
|
|
30776fc707 | ||
|
|
ea70090f6b | ||
|
|
e9a4a6380e | ||
|
|
642b137332 | ||
|
|
ce60116ba3 | ||
|
|
1ee8fd05b3 | ||
|
|
e1d1ef0dd8 | ||
|
|
e108d17556 | ||
|
|
fe6cb8a9cf | ||
|
|
9a9f77c9d9 | ||
|
|
35ac1f9fdd | ||
|
|
6927652a65 | ||
|
|
c4afca7187 | ||
|
|
a49d0b280c | ||
|
|
f797f062f8 | ||
|
|
6f60f1a48b | ||
|
|
c3b8e7bbd4 | ||
|
|
edc651a308 | ||
|
|
76b1796c7e | ||
|
|
b5201a352f | ||
|
|
fc4460fa39 | ||
|
|
e975fc6713 | ||
|
|
c8ddd7653f | ||
|
|
827be9167e | ||
|
|
f55022a26d | ||
|
|
aae3da8c2b | ||
|
|
e6828a1665 | ||
|
|
6bfff8b70d | ||
|
|
a3753fc311 | ||
|
|
2b7ba4df63 | ||
|
|
4fde5eab04 | ||
|
|
58c5514a01 | ||
|
|
0c19c21efa | ||
|
|
41dd48e8fa | ||
|
|
3ceb0e2dc1 | ||
|
|
ab479aea26 | ||
|
|
82f5b9ccb0 | ||
|
|
4d7b6ef36d | ||
|
|
83d0a3ce0c | ||
|
|
10b4ebfd01 | ||
|
|
bc5f255bc7 | ||
|
|
c8138c291b | ||
|
|
f290aa5d58 | ||
|
|
a6f97fc759 | ||
|
|
dfeee78717 | ||
|
|
7460ea1461 | ||
|
|
250ad41c7b | ||
|
|
a53a44cb2e | ||
|
|
4cbe931635 | ||
|
|
45fc6d0ff1 | ||
|
|
a1b72712ec | ||
|
|
8e474c5961 | ||
|
|
8f2f78b4ed | ||
|
|
a3f01f1330 | ||
|
|
a0f495db93 | ||
|
|
605f3fea26 | ||
|
|
52a72952c9 | ||
|
|
4eb1292a2d | ||
|
|
b1e91c1c27 | ||
|
|
a1760d7b86 | ||
|
|
c456586860 | ||
|
|
71e759a032 | ||
|
|
96ce64d5f0 | ||
|
|
d31802c87b | ||
|
|
d3964bf0d1 | ||
|
|
57dad6281a | ||
|
|
b74130903e | ||
|
|
44046f2861 | ||
|
|
95f7600b67 | ||
|
|
749b819a62 | ||
|
|
f7f7c7be81 | ||
|
|
6a221dbc1e | ||
|
|
002a2af272 | ||
|
|
1757d3d6a9 | ||
|
|
be5a6a93cc | ||
|
|
bbbe78dbef | ||
|
|
a851e01330 | ||
|
|
29d06d52dd | ||
|
|
1a6d4d1035 | ||
|
|
90d649aef9 | ||
|
|
23b99a6232 | ||
|
|
16c38fe6be | ||
|
|
b43f8b3fac | ||
|
|
8e5b74a3f6 | ||
|
|
b0cd3bf999 | ||
|
|
4a15284684 | ||
|
|
d78068d43a | ||
|
|
80dce5eafb | ||
|
|
950696ddb9 | ||
|
|
e7674116e1 | ||
|
|
3fae388db5 | ||
|
|
8f3b8c7ff1 | ||
|
|
a4b1d3952d | ||
|
|
a5ef16243d | ||
|
|
b0823a09bb | ||
|
|
492920ac7c | ||
|
|
f96ac33175 | ||
|
|
1bc16d6f2e | ||
|
|
0ba8cb7fbd | ||
|
|
93bb4022f2 | ||
|
|
bbfb9db90a | ||
|
|
66c81ee548 | ||
|
|
8f3cb9cdbb | ||
|
|
1ac71d0016 | ||
|
|
e8238a2cf5 | ||
|
|
22349276d9 | ||
|
|
d6a9b5dac2 | ||
|
|
0e3aa96f77 | ||
|
|
5306add70a | ||
|
|
f367f1abef | ||
|
|
93dc36134d | ||
|
|
f706d59ac5 |
@@ -1,7 +0,0 @@
|
||||
_output/alpine-build/_cache
|
||||
pkg
|
||||
vendor
|
||||
cmd
|
||||
locales
|
||||
docs
|
||||
scripts
|
||||
@@ -1,6 +0,0 @@
|
||||
公有云子账号创建成功
|
||||
主账号:{{ .account }}<br>
|
||||
名称:{{ .name }}<br>
|
||||
密码:{{ .password }}<br>
|
||||
登录地址: {{ .iam_login_url }}<br>
|
||||
资源ID: {{ .id }}<br>
|
||||
@@ -1,6 +0,0 @@
|
||||
Clouduser has been created successfully
|
||||
Root Account: {{ .account }}<br>
|
||||
Name:{{ .name }}<br>
|
||||
Password:{{ .password }}<br>
|
||||
IAM Login URL: {{ .iam_login_url }}<br>
|
||||
Resource ID: {{ .id }}<br>
|
||||
@@ -1 +0,0 @@
|
||||
公有云子账号 {{ .name }} 创建成功
|
||||
@@ -1 +0,0 @@
|
||||
The clouduser {{ .name }} created successfully
|
||||
@@ -17,22 +17,22 @@ package cloudid
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudgroups).WithKeyword("cloud-group")
|
||||
cmd.List(&cloudid.CloudgroupListOptions{})
|
||||
cmd.Create(&cloudid.CloudgroupCreateOptions{})
|
||||
cmd.Show(&cloudid.CloudgroupIdOptions{})
|
||||
cmd.Delete(&cloudid.CloudgroupIdOptions{})
|
||||
cmd.Perform("syncstatus", &cloudid.CloudgroupIdOptions{})
|
||||
cmd.Perform("attach-policy", &cloudid.CloudgroupPolicyOptions{})
|
||||
cmd.Perform("detach-policy", &cloudid.CloudgroupPolicyOptions{})
|
||||
cmd.Perform("add-user", &cloudid.CloudgroupUserOptions{})
|
||||
cmd.Perform("remove-user", &cloudid.CloudgroupUserOptions{})
|
||||
cmd.Perform("set-policies", &cloudid.CloudgroupPolicyOptions{})
|
||||
cmd.Perform("set-users", &cloudid.CloudgroupUserOptions{})
|
||||
cmd.Perform("public", &cloudid.CloudgroupPublicOptions{})
|
||||
cmd.Perform("private", &cloudid.CloudgroupIdOptions{})
|
||||
cmd.List(&options.CloudgroupListOptions{})
|
||||
cmd.Create(&options.CloudgroupCreateOptions{})
|
||||
cmd.Show(&options.CloudgroupIdOptions{})
|
||||
cmd.Delete(&options.CloudgroupIdOptions{})
|
||||
cmd.Perform("syncstatus", &options.CloudgroupIdOptions{})
|
||||
cmd.Perform("attach-policy", &options.CloudgroupPolicyOptions{})
|
||||
cmd.Perform("detach-policy", &options.CloudgroupPolicyOptions{})
|
||||
cmd.Perform("add-user", &options.CloudgroupUserOptions{})
|
||||
cmd.Perform("remove-user", &options.CloudgroupUserOptions{})
|
||||
cmd.Perform("set-policies", &options.CloudgroupPolicyOptions{})
|
||||
cmd.Perform("set-users", &options.CloudgroupUserOptions{})
|
||||
cmd.Perform("public", &options.CloudgroupPublicOptions{})
|
||||
cmd.Perform("private", &options.CloudgroupIdOptions{})
|
||||
}
|
||||
|
||||
@@ -15,15 +15,59 @@
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudgroupcaches).WithKeyword("cloud-group-cache")
|
||||
cmd.List(&cloudid.CloudgroupcacheListOptions{})
|
||||
cmd.Show(&cloudid.CloudgroupcacheIdOption{})
|
||||
cmd.Delete(&cloudid.CloudgroupcacheIdOption{})
|
||||
cmd.Perform("syncstatus", &cloudid.CloudgroupcacheIdOption{})
|
||||
type CloudgroupcacheListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
}
|
||||
R(&CloudgroupcacheListOptions{}, "cloud-group-cache-list", "List cloud group caches", func(s *mcclient.ClientSession, opts *CloudgroupcacheListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Cloudgroupcaches.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Cloudgroupcaches.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudgroupcacheIdOption struct {
|
||||
ID string `help:"Cloudgroup Id"`
|
||||
}
|
||||
|
||||
R(&CloudgroupcacheIdOption{}, "cloud-group-cache-show", "Show cloud groupcache details", func(s *mcclient.ClientSession, opts *CloudgroupcacheIdOption) error {
|
||||
result, err := modules.Cloudgroupcaches.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CloudgroupcacheIdOption{}, "cloud-group-cache-syncstatus", "Sync cloudgroupcache", func(s *mcclient.ClientSession, opts *CloudgroupcacheIdOption) error {
|
||||
result, err := modules.Cloudgroupcaches.PerformAction(s, opts.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&CloudgroupcacheIdOption{}, "cloud-group-cache-delete", "Delete cloudgroupcache", func(s *mcclient.ClientSession, opts *CloudgroupcacheIdOption) error {
|
||||
result, err := modules.Cloudgroupcaches.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -15,12 +15,58 @@
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudgrouppolicies).WithKeyword("cloud-group-policy").WithContextManager(&modules.Cloudgroups)
|
||||
cmd.List(&cloudid.CloudgroupPolicyListOptions{})
|
||||
type CloudgroupPolicyListOptions struct {
|
||||
options.BaseListOptions
|
||||
Cloudgroup string `help:"ID or Name of Cloudgroup"`
|
||||
Cloudpolicy string `help:"Policy ID or name"`
|
||||
}
|
||||
R(&CloudgroupPolicyListOptions{}, "cloud-group-policy-list", "List cloudgroup cloudpolicy pairs", func(s *mcclient.ClientSession, args *CloudgroupPolicyListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
var result *modulebase.ListResult
|
||||
var err error
|
||||
if len(args.Cloudgroup) > 0 {
|
||||
result, err = modules.Cloudgrouppolicies.ListDescendent(s, args.Cloudgroup, params)
|
||||
} else if len(args.Cloudpolicy) > 0 {
|
||||
result, err = modules.Cloudgrouppolicies.ListDescendent2(s, args.Cloudpolicy, params)
|
||||
} else {
|
||||
result, err = modules.Cloudgrouppolicies.List(s, params)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Cloudgrouppolicies.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudgroupPolicyDetailOptions struct {
|
||||
CLOUDUSER string `help:"ID or Name of Cloudgroup"`
|
||||
CLOUDPOLICY string `help:"ID or Name of Cloudpolicy"`
|
||||
}
|
||||
R(&CloudgroupPolicyDetailOptions{}, "cloud-group-policy-show", "Show cloudgrouppolicy details", func(s *mcclient.ClientSession, args *CloudgroupPolicyDetailOptions) error {
|
||||
query := jsonutils.NewDict()
|
||||
result, err := modules.Cloudgrouppolicies.Get(s, args.CLOUDUSER, args.CLOUDPOLICY, query)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -15,12 +15,58 @@
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudgroupusers).WithKeyword("cloud-group-user").WithContextManager(&modules.Cloudusers)
|
||||
cmd.List(&cloudid.CloudgroupUserListOptions{})
|
||||
type CloudgroupUserListOptions struct {
|
||||
options.BaseListOptions
|
||||
Cloudgroup string `help:"ID or Name of Cloudgroup"`
|
||||
Clouduser string `help:"User ID or name"`
|
||||
}
|
||||
R(&CloudgroupUserListOptions{}, "cloud-group-user-list", "List cloudgroup clouduser pairs", func(s *mcclient.ClientSession, args *CloudgroupUserListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
var result *modulebase.ListResult
|
||||
var err error
|
||||
if len(args.Cloudgroup) > 0 {
|
||||
result, err = modules.Cloudgroupusers.ListDescendent(s, args.Cloudgroup, params)
|
||||
} else if len(args.Clouduser) > 0 {
|
||||
result, err = modules.Cloudgroupusers.ListDescendent2(s, args.Clouduser, params)
|
||||
} else {
|
||||
result, err = modules.Cloudgroupusers.List(s, params)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Cloudgroupusers.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type CloudgroupUserDetailOptions struct {
|
||||
CLOUDUSER string `help:"ID or Name of Cloudgroup"`
|
||||
CLOUDPOLICY string `help:"ID or Name of Clouduser"`
|
||||
}
|
||||
R(&CloudgroupUserDetailOptions{}, "cloud-group-user-show", "Show cloudgroupuser details", func(s *mcclient.ClientSession, args *CloudgroupUserDetailOptions) error {
|
||||
query := jsonutils.NewDict()
|
||||
result, err := modules.Cloudgroupusers.Get(s, args.CLOUDUSER, args.CLOUDPOLICY, query)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -17,18 +17,18 @@ package cloudid
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudpolicies).WithKeyword("cloud-policy")
|
||||
cmd.Create(&cloudid.CloudpolicyListOptions{})
|
||||
cmd.List(&cloudid.CloudpolicyListOptions{})
|
||||
cmd.Show(&cloudid.CloudpolicyIdOptions{})
|
||||
cmd.Update(&cloudid.CloudpolicyUpdateOption{})
|
||||
cmd.Perform("syncstauts", &cloudid.CloudpolicyIdOptions{})
|
||||
cmd.Perform("lock", &cloudid.CloudpolicyIdOptions{})
|
||||
cmd.Perform("unlock", &cloudid.CloudpolicyIdOptions{})
|
||||
cmd.Perform("assign-group", &cloudid.CloudpolicyGroupOptions{})
|
||||
cmd.Perform("revoke-group", &cloudid.CloudpolicyGroupOptions{})
|
||||
cmd.Create(&options.CloudpolicyListOptions{})
|
||||
cmd.List(&options.CloudpolicyListOptions{})
|
||||
cmd.Show(&options.CloudpolicyIdOptions{})
|
||||
cmd.Update(&options.CloudpolicyUpdateOption{})
|
||||
cmd.Perform("syncstauts", &options.CloudpolicyIdOptions{})
|
||||
cmd.Perform("lock", &options.CloudpolicyIdOptions{})
|
||||
cmd.Perform("unlock", &options.CloudpolicyIdOptions{})
|
||||
cmd.Perform("assign-group", &options.CloudpolicyGroupOptions{})
|
||||
cmd.Perform("revoke-group", &options.CloudpolicyGroupOptions{})
|
||||
}
|
||||
|
||||
@@ -15,12 +15,28 @@
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudpolicycaches).WithKeyword("cloud-policy-cache")
|
||||
cmd.List(&cloudid.CloudpolicycacheListOptions{})
|
||||
type CloudpolicycacheListOptions struct {
|
||||
options.BaseListOptions
|
||||
|
||||
CloudpolyId string
|
||||
CloudaccountId string
|
||||
}
|
||||
R(&CloudpolicycacheListOptions{}, "cloud-policy-cache-list", "List cloud policy caches", func(s *mcclient.ClientSession, opts *CloudpolicycacheListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Cloudpolicycaches.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Cloudpolicycaches.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudroles).WithKeyword("cloud-role")
|
||||
cmd.List(&cloudid.CloudroleListOptions{})
|
||||
cmd.Delete(&cloudid.CloudroleIdOptions{})
|
||||
cmd.Show(&cloudid.CloudroleIdOptions{})
|
||||
cmd.Perform("purge", &cloudid.CloudroleIdOptions{})
|
||||
}
|
||||
@@ -15,12 +15,58 @@
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Clouduserpolicies).WithKeyword("cloud-user-policy").WithContextManager(&modules.Cloudpolicies)
|
||||
cmd.List(&cloudid.ClouduserPolicyListOptions{})
|
||||
type ClouduserPolicyListOptions struct {
|
||||
options.BaseListOptions
|
||||
Clouduser string `help:"ID or Name of Clouduser"`
|
||||
Cloudpolicy string `help:"Policy ID or name"`
|
||||
}
|
||||
R(&ClouduserPolicyListOptions{}, "cloud-user-policy-list", "List clouduser cloudpolicy pairs", func(s *mcclient.ClientSession, args *ClouduserPolicyListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
}
|
||||
var result *modulebase.ListResult
|
||||
var err error
|
||||
if len(args.Clouduser) > 0 {
|
||||
result, err = modules.Clouduserpolicies.ListDescendent(s, args.Clouduser, params)
|
||||
} else if len(args.Cloudpolicy) > 0 {
|
||||
result, err = modules.Clouduserpolicies.ListDescendent2(s, args.Cloudpolicy, params)
|
||||
} else {
|
||||
result, err = modules.Clouduserpolicies.List(s, params)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Clouduserpolicies.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type ClouduserPolicyDetailOptions struct {
|
||||
CLOUDUSER string `help:"ID or Name of Clouduser"`
|
||||
CLOUDPOLICY string `help:"ID or Name of Cloudpolicy"`
|
||||
}
|
||||
R(&ClouduserPolicyDetailOptions{}, "cloud-user-policy-show", "Show clouduserpolicy details", func(s *mcclient.ClientSession, args *ClouduserPolicyDetailOptions) error {
|
||||
query := jsonutils.NewDict()
|
||||
result, err := modules.Clouduserpolicies.Get(s, args.CLOUDUSER, args.CLOUDPOLICY, query)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -17,22 +17,22 @@ package cloudid
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Cloudusers).WithKeyword("cloud-user")
|
||||
cmd.List(&cloudid.ClouduserListOptions{})
|
||||
cmd.Create(&cloudid.ClouduserCreateOptions{})
|
||||
cmd.Show(&cloudid.ClouduserIdOption{})
|
||||
cmd.Custom(shell.CustomActionGet, "login-info", &cloudid.ClouduserIdOption{})
|
||||
cmd.Delete(&cloudid.ClouduserIdOption{})
|
||||
cmd.Perform("sync", &cloudid.ClouduserSyncOptions{})
|
||||
cmd.Perform("syncstatus", &cloudid.ClouduserIdOption{})
|
||||
cmd.Perform("attach-policy", &cloudid.ClouduserPolicyOptions{})
|
||||
cmd.Perform("detach-policy", &cloudid.ClouduserPolicyOptions{})
|
||||
cmd.Perform("change-owner", &cloudid.ClouduserChangeOwnerOptions{})
|
||||
cmd.Perform("reset-password", &cloudid.ClouduserResetPasswordOptions{})
|
||||
cmd.Perform("cloud-user-join-group", &cloudid.ClouduserGroupOptions{})
|
||||
cmd.Perform("cloud-user-leave-group", &cloudid.ClouduserGroupOptions{})
|
||||
cmd.List(&options.ClouduserListOptions{})
|
||||
cmd.Create(&options.ClouduserCreateOptions{})
|
||||
cmd.Show(&options.ClouduserIdOption{})
|
||||
cmd.Custom(shell.CustomActionGet, "login-info", &options.ClouduserIdOption{})
|
||||
cmd.Delete(&options.ClouduserIdOption{})
|
||||
cmd.Perform("sync", &options.ClouduserSyncOptions{})
|
||||
cmd.Perform("syncstatus", &options.ClouduserIdOption{})
|
||||
cmd.Perform("attach-policy", &options.ClouduserPolicyOptions{})
|
||||
cmd.Perform("detach-policy", &options.ClouduserPolicyOptions{})
|
||||
cmd.Perform("change-owner", &options.ClouduserChangeOwnerOptions{})
|
||||
cmd.Perform("reset-password", &options.ClouduserResetPasswordOptions{})
|
||||
cmd.Perform("cloud-user-join-group", &options.ClouduserGroupOptions{})
|
||||
cmd.Perform("cloud-user-leave-group", &options.ClouduserGroupOptions{})
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.SAMLProviders).WithKeyword("saml-provider")
|
||||
cmd.List(&cloudid.SAMLProviderListOptions{})
|
||||
cmd.Create(&cloudid.SAMLProviderCreateOptions{})
|
||||
cmd.Show(&cloudid.SAMLProviderIdOptions{})
|
||||
cmd.Delete(&cloudid.SAMLProviderIdOptions{})
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cloudid
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Samlusers).WithKeyword("saml-user")
|
||||
cmd.List(&cloudid.SamluserListOptions{})
|
||||
cmd.Create(&cloudid.SamluserCreateOptions{})
|
||||
cmd.Show(&cloudid.SamluserIdOptions{})
|
||||
cmd.Delete(&cloudid.SamluserIdOptions{})
|
||||
}
|
||||
@@ -342,213 +342,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketSetWebsiteOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
// 主页
|
||||
Index string `help:"main page"`
|
||||
// 错误时返回的文档
|
||||
ErrorDocument string `help:"error return"`
|
||||
// http或https
|
||||
Protocol string `help:"force https" choices:"http|https"`
|
||||
}
|
||||
R(&BucketSetWebsiteOption{}, "bucket-set-website", "Set bucket website", func(s *mcclient.ClientSession, args *BucketSetWebsiteOption) error {
|
||||
conf := api.BucketWebsiteConf{
|
||||
Index: args.Index,
|
||||
ErrorDocument: args.ErrorDocument,
|
||||
Protocol: args.Protocol,
|
||||
}
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "set-website", jsonutils.Marshal(conf))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketGetWebsiteConfOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
}
|
||||
R(&BucketGetWebsiteConfOption{}, "bucket-get-website", "Get bucket website", func(s *mcclient.ClientSession, args *BucketGetWebsiteConfOption) error {
|
||||
result, err := modules.Buckets.GetSpecific(s, args.ID, "website", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketDeleteWebsiteConfOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
}
|
||||
R(&BucketDeleteWebsiteConfOption{}, "bucket-delete-website", "Delete bucket website", func(s *mcclient.ClientSession, args *BucketDeleteWebsiteConfOption) error {
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "delete-website", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketSetCorsOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
AllowedMethods []string `help:"allowed http method" choices:"PUT|GET|POST|DELETE|HEAD"`
|
||||
// 允许的源站,可以设为*
|
||||
AllowedOrigins []string
|
||||
AllowedHeaders []string
|
||||
MaxAgeSeconds int
|
||||
ExposeHeaders []string
|
||||
RuleId string
|
||||
}
|
||||
R(&BucketSetCorsOption{}, "bucket-set-cors", "Set bucket cors", func(s *mcclient.ClientSession, args *BucketSetCorsOption) error {
|
||||
|
||||
rule := api.BucketCORSRule{
|
||||
AllowedOrigins: args.AllowedOrigins,
|
||||
AllowedMethods: args.AllowedMethods,
|
||||
AllowedHeaders: args.AllowedHeaders,
|
||||
MaxAgeSeconds: args.MaxAgeSeconds,
|
||||
ExposeHeaders: args.ExposeHeaders,
|
||||
Id: args.RuleId,
|
||||
}
|
||||
rules := api.BucketCORSRules{Data: []api.BucketCORSRule{rule}}
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "set-cors", jsonutils.Marshal(rules))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketGetCorsOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
}
|
||||
R(&BucketGetCorsOption{}, "bucket-get-cors", "Get bucket cors", func(s *mcclient.ClientSession, args *BucketGetCorsOption) error {
|
||||
result, err := modules.Buckets.GetSpecific(s, args.ID, "cors", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketDeleteCorsOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
Id []string `"help:Id of rules to delete"`
|
||||
}
|
||||
R(&BucketDeleteCorsOption{}, "bucket-delete-cors", "Delete bucket cors", func(s *mcclient.ClientSession, args *BucketDeleteCorsOption) error {
|
||||
input := api.BucketCORSRuleDeleteInput{}
|
||||
input.Id = args.Id
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "delete-cors", jsonutils.Marshal(input))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketSetRefererOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
// 域名列表
|
||||
DomainList []string
|
||||
// 是否允许空referer 访问
|
||||
AllowEmptyRefer bool `help:"all empty refer access"`
|
||||
Enabled bool
|
||||
RerererType string `help:"Referer type" choices:"Black-List|White-List"`
|
||||
}
|
||||
R(&BucketSetRefererOption{}, "bucket-set-referer", "Set bucket referer", func(s *mcclient.ClientSession, args *BucketSetRefererOption) error {
|
||||
conf := api.BucketRefererConf{
|
||||
Enabled: args.Enabled,
|
||||
AllowEmptyRefer: args.AllowEmptyRefer,
|
||||
RefererType: args.RerererType,
|
||||
DomainList: args.DomainList,
|
||||
}
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "set-referer", jsonutils.Marshal(conf))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketGetRefererOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
}
|
||||
R(&BucketGetRefererOption{}, "bucket-get-referer", "get bucket referer", func(s *mcclient.ClientSession, args *BucketGetRefererOption) error {
|
||||
result, err := modules.Buckets.GetSpecific(s, args.ID, "referer", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketGetCdnDomainOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
}
|
||||
R(&BucketGetRefererOption{}, "bucket-get-cdn-domain", "get bucket cdn domain", func(s *mcclient.ClientSession, args *BucketGetRefererOption) error {
|
||||
result, err := modules.Buckets.GetSpecific(s, args.ID, "cdn-domain", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketGetPolicyOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
}
|
||||
R(&BucketGetPolicyOption{}, "bucket-get-policy", "get bucket policy", func(s *mcclient.ClientSession, args *BucketGetPolicyOption) error {
|
||||
result, err := modules.Buckets.GetSpecific(s, args.ID, "policy", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketSetPolicyOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
// 格式主账号id:子账号id
|
||||
PrincipalId []string `help:"ext account id, accountId:subaccountId"`
|
||||
// Read|ReadWrite|FullControl
|
||||
CannedAction string `help:"authority action" choice:"Read|FullControl"`
|
||||
// Allow|Deny
|
||||
Effect string `help:"allow or deny" choice:"Allow|Deny"`
|
||||
// 被授权的资源地址
|
||||
ResourcePath []string
|
||||
// ip 条件
|
||||
IpEquals []string
|
||||
IpNotEquals []string
|
||||
}
|
||||
R(&BucketSetPolicyOption{}, "bucket-set-policy", "set bucket policy", func(s *mcclient.ClientSession, args *BucketSetPolicyOption) error {
|
||||
opts := api.BucketPolicyStatementInput{}
|
||||
opts.CannedAction = args.CannedAction
|
||||
opts.Effect = args.Effect
|
||||
opts.IpEquals = args.IpEquals
|
||||
opts.IpNotEquals = args.IpNotEquals
|
||||
opts.ResourcePath = args.ResourcePath
|
||||
opts.PrincipalId = args.PrincipalId
|
||||
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "set-policy", jsonutils.Marshal(opts))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type BucketDeletePolicyOption struct {
|
||||
ID string `help:"ID or name of bucket" json:"-"`
|
||||
Id []string
|
||||
}
|
||||
R(&BucketDeletePolicyOption{}, "bucket-delete-policy", "delete bucket policy", func(s *mcclient.ClientSession, args *BucketDeletePolicyOption) error {
|
||||
input := api.BucketPolicyDeleteInput{}
|
||||
input.Id = args.Id
|
||||
result, err := modules.Buckets.PerformAction(s, args.ID, "delete-policy", jsonutils.Marshal(input))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -235,7 +235,7 @@ func init() {
|
||||
return err
|
||||
}
|
||||
for k, v := range rc {
|
||||
fmt.Printf(`export %s="%s"`+"\n", k, v)
|
||||
fmt.Printf("export %s='%s'\n", k, v)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -15,15 +15,50 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.DBInstanceAccounts).WithKeyword("dbinstance-account")
|
||||
cmd.List(&options.DBInstanceAccountListOptions{})
|
||||
cmd.Update(&options.BaseUpdateOptions{})
|
||||
cmd.Show(&options.DBInstanceAccountIdOptions{})
|
||||
cmd.Delete(&options.DBInstanceAccountIdOptions{})
|
||||
type DBInstanceAccountListOptions struct {
|
||||
options.BaseListOptions
|
||||
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
|
||||
}
|
||||
R(&DBInstanceAccountListOptions{}, "dbinstance-account-list", "List DB instance accounts", func(s *mcclient.ClientSession, opts *DBInstanceAccountListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.DBInstanceAccounts.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.DBInstanceAccounts.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceAccountIdOptions struct {
|
||||
ID string `help:"ID or Name of DBInstanceaccount"`
|
||||
}
|
||||
|
||||
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-show", "Show DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
|
||||
account, err := modules.DBInstanceAccounts.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(account)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-delete", "Delete DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
|
||||
account, err := modules.DBInstanceAccounts.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(account)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -15,16 +15,60 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.DBInstanceDatabases).WithKeyword("dbinstance-database")
|
||||
cmd.List(&options.DBInstanceDatabaseListOptions{})
|
||||
cmd.Update(&options.BaseUpdateOptions{})
|
||||
cmd.Delete(&options.DBInstanceDatabaseIdOptions{})
|
||||
cmd.Show(&options.DBInstanceDatabaseIdOptions{})
|
||||
cmd.Create(&options.DBInstanceDatabaseCreateOptions{})
|
||||
type DBInstanceDatabaseListOptions struct {
|
||||
options.BaseListOptions
|
||||
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
|
||||
}
|
||||
R(&DBInstanceDatabaseListOptions{}, "dbinstance-database-list", "List DB instance databases", func(s *mcclient.ClientSession, opts *DBInstanceDatabaseListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.DBInstanceDatabases.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.DBInstanceDatabases.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceDatabaseCreateOptions struct {
|
||||
NAME string
|
||||
DBINSTANCE string `help:"ID or Name of DBInstance" json:"dbinstance"`
|
||||
CharacterSet string `help:"CharacterSet for database"`
|
||||
}
|
||||
|
||||
R(&DBInstanceDatabaseCreateOptions{}, "dbinstance-database-create", "Create DB instance databases", func(s *mcclient.ClientSession, opts *DBInstanceDatabaseCreateOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.DBInstanceDatabases.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceDatabaseIdOptions struct {
|
||||
ID string
|
||||
}
|
||||
|
||||
R(&DBInstanceDatabaseIdOptions{}, "dbinstance-database-delete", "Delete DB instance databases", func(s *mcclient.ClientSession, opts *DBInstanceDatabaseIdOptions) error {
|
||||
result, err := modules.DBInstanceDatabases.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -23,8 +23,6 @@ import (
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.DBInstanceSkus).WithKeyword("dbinstance-sku")
|
||||
cmd.List(&options.DBInstanceSkuListOption{})
|
||||
cmd.Show(&options.DBInstanceSkuIdOption{})
|
||||
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
|
||||
|
||||
R(&options.SkuTaskQueryOptions{}, "dbinstance-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
|
||||
@@ -40,4 +38,38 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceSkuListOption struct {
|
||||
options.BaseListOptions
|
||||
Engine string
|
||||
EngineVersion string
|
||||
Category string
|
||||
StorageType string
|
||||
Cloudregion string
|
||||
}
|
||||
R(&DBInstanceSkuListOption{}, "dbinstance-sku-list", "List dbinstance skus", func(s *mcclient.ClientSession, args *DBInstanceSkuListOption) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.DBInstanceSkus.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.DBInstanceSkus.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceSkuIdOption struct {
|
||||
ID string `help:"DBInstance Id or name"`
|
||||
}
|
||||
|
||||
R(&DBInstanceSkuIdOption{}, "dbinstance-sku-show", "Show dbinstance sku details", func(s *mcclient.ClientSession, args *DBInstanceSkuIdOption) error {
|
||||
result, err := modules.DBInstanceSkus.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,34 +15,280 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.DBInstance) //.WithContextManager(&modules.Networks)
|
||||
cmd.List(&compute.DBInstanceListOptions{})
|
||||
cmd.Create(&compute.DBInstanceCreateOptions{})
|
||||
cmd.Update(&compute.DBInstanceUpdateOptions{})
|
||||
cmd.Show(&compute.DBInstanceIdOptions{})
|
||||
cmd.Delete(&compute.DBInstanceDeleteOptions{})
|
||||
cmd.Perform("renew", &compute.DBInstanceRenewOptions{})
|
||||
cmd.Perform("change-config", &compute.DBInstanceChangeConfigOptions{})
|
||||
cmd.Perform("public-connection", &compute.DBInstancePublicConnectionOptions{})
|
||||
cmd.Perform("recovery", &compute.DBInstanceRecoveryOptions{})
|
||||
cmd.Perform("reboot", &compute.DBInstanceIdOptions{})
|
||||
cmd.Perform("purge", &compute.DBInstanceIdOptions{})
|
||||
cmd.Perform("syncstatus", &compute.DBInstanceIdOptions{})
|
||||
cmd.Perform("sync", &compute.DBInstanceIdOptions{})
|
||||
cmd.Perform("change-owner", &compute.DBInstanceChangeOwnerOptions{})
|
||||
cmd.PerformWithKeyword("add-tag", "user-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.PerformWithKeyword("set-tag", "set-user-metadata", &options.ResourceMetadataOptions{})
|
||||
cmd.Perform("remote-update", &compute.DBInstanceRemoteUpdateOptions{})
|
||||
cmd.Perform("set-secgroup", &compute.DBInstanceSetSecgroupOptions{})
|
||||
type DBInstanceListOptions struct {
|
||||
options.BaseListOptions
|
||||
BillingType string `help:"billing type" choices:"postpaid|prepaid"`
|
||||
}
|
||||
R(&DBInstanceListOptions{}, "dbinstance-list", "List DB instance", func(s *mcclient.ClientSession, opts *DBInstanceListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.DBInstance.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(opts.ExportFile) > 0 {
|
||||
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.DBInstance.GetColumns(s))
|
||||
} else {
|
||||
printList(result, modules.DBInstance.GetColumns(s))
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceCreateOptions struct {
|
||||
NAME string `help:"DBInstance Name"`
|
||||
InstanceType string `help:"InstanceType for DBInstance"`
|
||||
VcpuCount int `help:"Core of cpu for DBInstance"`
|
||||
VmemSizeMb int `help:"Memory size of DBInstance"`
|
||||
Port int `help:"Port of DBInstance"`
|
||||
Category string `help:"Category of DBInstance"`
|
||||
Network string `help:"Network of DBInstance"`
|
||||
Address string `help:"Address of DBInstance"`
|
||||
Engine string `help:"Engine of DBInstance"`
|
||||
EngineVersion string `help:"EngineVersion of DBInstance Engine"`
|
||||
StorageType string `help:"StorageTyep of DBInstance"`
|
||||
Secgroup string `help:"Secgroup name or Id for DBInstance"`
|
||||
Zone string `help:"ZoneId or name for DBInstance"`
|
||||
DiskSizeGB int `help:"Storage size for DBInstance"`
|
||||
Duration string `help:"Duration for DBInstance"`
|
||||
AllowDelete *bool `help:"not lock dbinstance" `
|
||||
}
|
||||
|
||||
R(&DBInstanceCreateOptions{}, "dbinstance-create", "Create DB instance", func(s *mcclient.ClientSession, opts *DBInstanceCreateOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if opts.AllowDelete != nil && *opts.AllowDelete {
|
||||
params.Add(jsonutils.JSONFalse, "disable_delete")
|
||||
}
|
||||
result, err := modules.DBInstance.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceRenewOptions struct {
|
||||
ID string `help:"ID or name of server to renew"`
|
||||
DURATION string `help:"Duration of renew, ADMIN only command"`
|
||||
}
|
||||
R(&DBInstanceRenewOptions{}, "dbinstance-renew", "Renew a dbinstance", func(s *mcclient.ClientSession, args *DBInstanceRenewOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.DURATION), "duration")
|
||||
result, err := modules.DBInstance.PerformAction(s, args.ID, "renew", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceUpdateOptions struct {
|
||||
ID string `help:"ID or name of server to renew"`
|
||||
Name string
|
||||
Description string
|
||||
Delete string `help:"Lock or not lock dbinstance" choices:"enable|disable"`
|
||||
}
|
||||
R(&DBInstanceUpdateOptions{}, "dbinstance-update", "Update a dbinstance", func(s *mcclient.ClientSession, args *DBInstanceUpdateOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(args.Delete) > 0 {
|
||||
if args.Delete == "disable" {
|
||||
params.Add(jsonutils.JSONTrue, "disable_delete")
|
||||
} else {
|
||||
params.Add(jsonutils.JSONFalse, "disable_delete")
|
||||
}
|
||||
}
|
||||
result, err := modules.DBInstance.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceChangeConfigOptions struct {
|
||||
ID string `help:"ID or name of server to renew"`
|
||||
DiskSizeGb int64 `help:"Change DBInstance storage size"`
|
||||
VcpuCount int64 `help:"Change DBInstance vcpu count"`
|
||||
VmemSizeMb int64 `help:"Change DBInstance vmem size mb"`
|
||||
InstanceType string `help:"Change DBInstance instanceType"`
|
||||
Category string `help:"Change DBInstance category"`
|
||||
}
|
||||
R(&DBInstanceChangeConfigOptions{}, "dbinstance-change-config", "ChangeConfig a dbinstance", func(s *mcclient.ClientSession, args *DBInstanceChangeConfigOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if len(args.Category) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Category), "category")
|
||||
}
|
||||
if len(args.InstanceType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.InstanceType), "instance_type")
|
||||
}
|
||||
if args.DiskSizeGb > 0 {
|
||||
params.Add(jsonutils.NewInt(args.DiskSizeGb), "disk_size_gb")
|
||||
}
|
||||
if args.VcpuCount > 0 {
|
||||
params.Add(jsonutils.NewInt(args.VcpuCount), "vcpu_count")
|
||||
}
|
||||
if args.VmemSizeMb > 0 {
|
||||
params.Add(jsonutils.NewInt(args.VmemSizeMb), "vmeme_size_mb")
|
||||
}
|
||||
result, err := modules.DBInstance.PerformAction(s, args.ID, "change-config", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceIdOptions struct {
|
||||
ID string `help:"ID of dbinstance"`
|
||||
}
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-open-public-connection", "Open DB instance public connection", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.JSONTrue, "open")
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "public-connection", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-close-public-connection", "Close DB instance public connection", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.JSONFalse, "open")
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "public-connection", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceRecoveryOptions struct {
|
||||
ID string
|
||||
BACKUP string
|
||||
Databases []string
|
||||
}
|
||||
|
||||
R(&DBInstanceRecoveryOptions{}, "dbinstance-recovery", "Recovery DB instance database from backup", func(s *mcclient.ClientSession, opts *DBInstanceRecoveryOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("dbinstancebackup", jsonutils.NewString(opts.BACKUP))
|
||||
dbs := jsonutils.NewDict()
|
||||
for _, database := range opts.Databases {
|
||||
if len(database) > 0 {
|
||||
dbInfo := strings.Split(database, ":")
|
||||
if len(dbInfo) == 1 {
|
||||
dbs.Add(jsonutils.NewString(dbInfo[0]), dbInfo[0])
|
||||
} else if len(dbInfo) == 2 {
|
||||
dbs.Add(jsonutils.NewString(dbInfo[1]), dbInfo[0])
|
||||
} else {
|
||||
return fmt.Errorf("Invalid dbinfo: %s", database)
|
||||
}
|
||||
}
|
||||
}
|
||||
if dbs.Length() > 0 {
|
||||
params.Add(dbs, "databases")
|
||||
}
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "recovery", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-show", "Show DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-reboot", "Reboot DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "reboot", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceDeleteOptions struct {
|
||||
ID string `help:"DBInstance Id or name"`
|
||||
KeepBackup bool `help:"Keep dbinstance manual backup after delete dbinstance"`
|
||||
}
|
||||
|
||||
R(&DBInstanceDeleteOptions{}, "dbinstance-delete", "Delete DB instance", func(s *mcclient.ClientSession, opts *DBInstanceDeleteOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if opts.KeepBackup {
|
||||
params.Add(jsonutils.JSONTrue, "keep_backup")
|
||||
}
|
||||
result, err := modules.DBInstance.Delete(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-purge", "Purge DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-syncstatus", "Sync status for DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-sync", "Sync conf from cloud dbinstance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "sync", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&DBInstanceIdOptions{}, "dbinstance-sync-status", "Sync status for DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "sync-status", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceNetworkListOptions struct {
|
||||
options.BaseListOptions
|
||||
@@ -108,4 +354,21 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type DBInstanceChangeOwnerOptions struct {
|
||||
ID string `help:"DBInstance to change owner" json:"-"`
|
||||
PROJECT string `help:"Project ID or change" json:"tenant"`
|
||||
}
|
||||
R(&DBInstanceChangeOwnerOptions{}, "dbinstance-change-owner", "Change owner porject of a dbinstance", func(s *mcclient.ClientSession, opts *DBInstanceChangeOwnerOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.DBInstance.PerformAction(s, opts.ID, "change-owner", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,20 @@ func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.ElasticcacheSkus).WithKeyword("elastic-cache-sku")
|
||||
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
|
||||
|
||||
R(&options.SkuTaskQueryOptions{}, "elastic-cache-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.ElasticcacheSkus.Get(s, "sync-tasks", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.BaseListOptions{}, "elastic-cache-list", "List elastisc cache instance", func(s *mcclient.ClientSession, opts *options.BaseListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
@@ -45,15 +59,11 @@ func init() {
|
||||
})
|
||||
|
||||
R(&options.ElasticCacheCreateOptions{}, "elastic-cache-create", "Create elastisc cache instance", func(s *mcclient.ClientSession, opts *options.ElasticCacheCreateOptions) error {
|
||||
params, err := opts.Params()
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(opts.SecgroupIds) > 0 {
|
||||
params.Set("secgroup_ids", jsonutils.NewStringArray(opts.SecgroupIds))
|
||||
}
|
||||
|
||||
result, err := modules.ElasticCache.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -401,107 +411,4 @@ func init() {
|
||||
printList(result, nil)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.SkuTaskQueryOptions{}, "elastic-cache-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.ElasticcacheSkus.Get(s, "sync-tasks", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ResourceMetadataOptions{}, "elastic-cache-add-tag", "Set tag of a server", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "user-metadata", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ResourceMetadataOptions{}, "elastic-cache-set-tag", "Set tag of a server", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "set-user-metadata", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ElasticCacheRemoteUpdateOptions{}, "elastic-cache-remote-update", "Restore elastisc cache backup", func(s *mcclient.ClientSession, opts *options.ElasticCacheRemoteUpdateOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "remote-update", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ElasticCacheAutoRenewOptions{}, "elastic-cache-auto-renew", "Set elastisc cache auto renew", func(s *mcclient.ClientSession, opts *options.ElasticCacheAutoRenewOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "set-auto-renew", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ElasticCacheRenewOptions{}, "elastic-cache-renew", "Renew elastisc cache", func(s *mcclient.ClientSession, opts *options.ElasticCacheRenewOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "renew", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ElasticcacheSecgroupListOptions struct {
|
||||
options.BaseListOptions
|
||||
Elasticcache string `help:"ID or Name of elastic cache" json:"elasticcache"`
|
||||
Secgroup string `help:"Secgroup ID or name"`
|
||||
}
|
||||
|
||||
R(&ElasticcacheSecgroupListOptions{}, "elastic-cache-secgroup-list", "List elastisc cache secgroups", func(s *mcclient.ClientSession, opts *ElasticcacheSecgroupListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result, err := modules.ElasticCacheSecgroup.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printList(result, nil)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ func init() {
|
||||
Bandwidth int `help:"Bandwidth in Mbps"`
|
||||
IpAddr string `help:"IP address of the EIP" json:"ip_addr"`
|
||||
Network string `help:"Network of the EIP"`
|
||||
BgpType string `help:"BgpType of the EIP" positional:"false"`
|
||||
ChargeType string `help:"bandwidth charge type" choices:"traffic|bandwidth"`
|
||||
}
|
||||
R(&EipCreateOptions{}, "eip-create", "Create an EIP", func(s *mcclient.ClientSession, args *EipCreateOptions) error {
|
||||
@@ -75,9 +74,6 @@ func init() {
|
||||
if len(args.Network) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Network), "network")
|
||||
}
|
||||
if len(args.BgpType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
|
||||
}
|
||||
|
||||
if len(args.IpAddr) > 0 {
|
||||
params.Add(jsonutils.NewString(args.IpAddr), "ip_addr")
|
||||
@@ -190,16 +186,12 @@ func init() {
|
||||
type ServerCreateEipOptions struct {
|
||||
ID string `help:"server ID or name"`
|
||||
BW int `help:"EIP bandwidth in Mbps"`
|
||||
BgpType string `help:"desired BGP type"`
|
||||
ChargeType string `help:"bandwidth charge type" choices:"traffic|bandwidth"`
|
||||
}
|
||||
R(&ServerCreateEipOptions{}, "server-create-eip", "allocate an EIP and associate EIP to server", func(s *mcclient.ClientSession, args *ServerCreateEipOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewInt(int64(args.BW)), "bandwidth")
|
||||
|
||||
if args.BgpType != "" {
|
||||
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
|
||||
}
|
||||
if len(args.ChargeType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.ChargeType), "charge_type")
|
||||
}
|
||||
|
||||
@@ -15,44 +15,92 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Loadbalancers).WithKeyword("lb")
|
||||
cmd.Create(&options.LoadbalancerCreateOptions{})
|
||||
cmd.Show(&options.LoadbalancerIdOptions{})
|
||||
cmd.List(&options.LoadbalancerListOptions{})
|
||||
cmd.Update(&options.LoadbalancerUpdateOptions{})
|
||||
cmd.Delete(&options.LoadbalancerIdOptions{})
|
||||
cmd.Perform("purge", &options.LoadbalancerIdOptions{})
|
||||
cmd.Perform("status", &options.LoadbalancerActionStatusOptions{})
|
||||
cmd.Perform("syncstatus", &options.LoadbalancerIdOptions{})
|
||||
cmd.Perform("remote-update", &options.LoadbalancerRemoteUpdateOptions{})
|
||||
cmd.Get("change-owner-candidate-domains", &options.LoadbalancerIdOptions{})
|
||||
|
||||
R(&options.ResourceMetadataOptions{}, "lb-add-tag", "Set tag of a lb", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
|
||||
params, err := opts.Params()
|
||||
R(&options.LoadbalancerCreateOptions{}, "lb-create", "Create lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerCreateOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Loadbalancers.PerformAction(s, opts.ID, "user-metadata", params)
|
||||
lb, err := modules.Loadbalancers.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
printObject(lb)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerGetOptions{}, "lb-show", "Show lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerGetOptions) error {
|
||||
lb, err := modules.Loadbalancers.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lb)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerListOptions{}, "lb-list", "List lbs", func(s *mcclient.ClientSession, opts *options.LoadbalancerListOptions) error {
|
||||
params, err := options.ListStructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Loadbalancers.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Loadbalancers.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerUpdateOptions{}, "lb-update", "Update lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerUpdateOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
lb, err := modules.Loadbalancers.Update(s, opts.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lb)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerDeleteOptions{}, "lb-delete", "Delete lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerDeleteOptions) error {
|
||||
lb, err := modules.Loadbalancers.Delete(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lb)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerPurgeOptions{}, "lb-purge", "Purge lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerPurgeOptions) error {
|
||||
lb, err := modules.Loadbalancers.PerformAction(s, opts.ID, "purge", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lb)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerActionStatusOptions{}, "lb-status", "Change lb status", func(s *mcclient.ClientSession, opts *options.LoadbalancerActionStatusOptions) error {
|
||||
params, err := options.StructToParams(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lb, err := modules.Loadbalancers.PerformAction(s, opts.ID, "status", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lb)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerActionSyncStatusOptions{}, "lb-syncstatus", "Sync lb status", func(s *mcclient.ClientSession, opts *options.LoadbalancerActionSyncStatusOptions) error {
|
||||
lb, err := modules.Loadbalancers.PerformAction(s, opts.ID, "syncstatus", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(lb)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ResourceMetadataOptions{}, "lb-set-tag", "Set tag of a lb", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.Loadbalancers.PerformAction(s, opts.ID, "set-user-metadata", params)
|
||||
R(&options.LoadbalancerGetOptions{}, "lb-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *options.LoadbalancerGetOptions) error {
|
||||
result, err := modules.Loadbalancers.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ func init() {
|
||||
AllocPolicy string `help:"Address allocation policy" choices:"none|stepdown|stepup|random"`
|
||||
ServerType string `help:"Server type" choices:"baremetal|container|eip|guest|ipmi|pxe"`
|
||||
IsAutoAlloc *bool `help:"Auto allocation IP pool"`
|
||||
BgpType string `help:"Internet service provider name" positional:"false"`
|
||||
Desc string `help:"Description" metavar:"DESCRIPTION"`
|
||||
}
|
||||
R(&NetworkCreateOptions{}, "network-create", "Create a virtual network", func(s *mcclient.ClientSession, args *NetworkCreateOptions) error {
|
||||
@@ -96,9 +95,6 @@ func init() {
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if len(args.BgpType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
|
||||
}
|
||||
if args.IsAutoAlloc != nil {
|
||||
params.Add(jsonutils.NewBool(*args.IsAutoAlloc), "is_auto_alloc")
|
||||
}
|
||||
@@ -111,21 +107,17 @@ func init() {
|
||||
})
|
||||
|
||||
type NetworkCreateOptions2 struct {
|
||||
Wire string `help:"ID or Name of wire in which the network is created"`
|
||||
Vpc string `help:"ID or Name of vpc in which the network is created"`
|
||||
Zone string `help:"ID or Name of zone in which the network is created"`
|
||||
NAME string `help:"Name of new network"`
|
||||
PREFIX string `help:"Start of IPv4 address range"`
|
||||
BgpType string `help:"Internet service provider name" positional:"false"`
|
||||
Desc string `help:"Description" metavar:"DESCRIPTION"`
|
||||
Wire string `help:"ID or Name of wire in which the network is created"`
|
||||
Vpc string `help:"ID or Name of vpc in which the network is created"`
|
||||
Zone string `help:"ID or Name of zone in which the network is created"`
|
||||
NAME string `help:"Name of new network"`
|
||||
PREFIX string `help:"Start of IPv4 address range"`
|
||||
Desc string `help:"Description" metavar:"DESCRIPTION"`
|
||||
}
|
||||
R(&NetworkCreateOptions2{}, "network-create2", "Create a virtual network", func(s *mcclient.ClientSession, args *NetworkCreateOptions2) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.NAME), "name")
|
||||
params.Add(jsonutils.NewString(args.PREFIX), "guest_ip_prefix")
|
||||
if len(args.BgpType) > 0 {
|
||||
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
|
||||
}
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
@@ -261,20 +253,4 @@ func init() {
|
||||
printObject(net)
|
||||
return nil
|
||||
})
|
||||
type NetworkSetBgpTypeOptions struct {
|
||||
ID string `help:"Network to set BgpType" json:"-"`
|
||||
BgpType *string `help:"new BgpType name"`
|
||||
}
|
||||
R(&NetworkSetBgpTypeOptions{}, "network-set-bgp-type", "Set BgpType of a network", func(s *mcclient.ClientSession, args *NetworkSetBgpTypeOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
net, err := modules.Networks.PerformAction(s, args.ID, "set-bgp-type", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(net)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -58,8 +58,7 @@ type RegionQuotaOptions struct {
|
||||
|
||||
Eip int64 `help:"Elastic IP count" json:"eip,omitzero"`
|
||||
|
||||
Snapshot int64 `help:"Snapshot count" json:"snapshot,omitzero"`
|
||||
InstanceSnapshot int64 `help:"Instance snapshot count" json:"instance_snapshot,omitzero"`
|
||||
Snapshot int64 `help:"Snapshot count" json:"snapshot,omitzero"`
|
||||
|
||||
Bucket int64 `help:"bucket count" json:"bucket,omitzero"`
|
||||
ObjectGB int64 `help:"object size in GB" json:"object_gb,omitzero"`
|
||||
|
||||
@@ -15,20 +15,142 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.Schedtags)
|
||||
type SchedtagListOptions struct {
|
||||
options.BaseListOptions
|
||||
Type string `help:"Filter by resource type"`
|
||||
}
|
||||
R(&SchedtagListOptions{}, "schedtag-list", "List schedule tags", func(s *mcclient.ClientSession, args *SchedtagListOptions) error {
|
||||
var params *jsonutils.JSONDict
|
||||
{
|
||||
var err error
|
||||
params, err = args.BaseListOptions.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
cmd.List(new(options.SchedtagListOptions))
|
||||
cmd.Show(new(options.SchedtagShowOptions))
|
||||
cmd.Delete(new(options.SchedtagShowOptions))
|
||||
cmd.Create(new(options.SchedtagCreateOptions))
|
||||
cmd.Update(new(options.SchedtagUpdateOptions))
|
||||
cmd.BatchPerform("set-scope", new(options.SchedtagSetScopeOptions))
|
||||
cmd.PerformWithKeyword("set-user-metadata", "user-metadata", new(options.ResourceMetadataOptions))
|
||||
cmd.Perform("set-resource", new(options.SchedtagSetResource))
|
||||
}
|
||||
}
|
||||
if len(args.Type) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Type), "resource_type")
|
||||
}
|
||||
result, err := modules.Schedtags.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.Schedtags.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type SchedtagShowOptions struct {
|
||||
ID string `help:"ID or Name of the scheduler tag to show"`
|
||||
}
|
||||
R(&SchedtagShowOptions{}, "schedtag-show", "Show scheduler tag details", func(s *mcclient.ClientSession, args *SchedtagShowOptions) error {
|
||||
result, err := modules.Schedtags.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&SchedtagShowOptions{}, "schedtag-delete", "Delete a scheduler tag", func(s *mcclient.ClientSession, args *SchedtagShowOptions) error {
|
||||
result, err := modules.Schedtags.Delete(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type SchedtagCreateOptions struct {
|
||||
NAME string `help:"Name of new schedtag"`
|
||||
Strategy string `help:"Policy" choices:"require|exclude|prefer|avoid"`
|
||||
Desc string `help:"Description"`
|
||||
Scope string `help:"Resource scope" choices:"system|domain|project"`
|
||||
Type string `help:"Resource type" choices:"hosts|storages|networks"`
|
||||
}
|
||||
R(&SchedtagCreateOptions{}, "schedtag-create", "Create a schedule tag", func(s *mcclient.ClientSession, args *SchedtagCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.NAME), "name")
|
||||
if len(args.Strategy) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Strategy), "default_strategy")
|
||||
}
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if len(args.Type) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Type), "resource_type")
|
||||
}
|
||||
if len(args.Scope) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Scope), "scope")
|
||||
}
|
||||
schedtag, err := modules.Schedtags.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(schedtag)
|
||||
return nil
|
||||
})
|
||||
|
||||
type SchedtagUpdateOptions struct {
|
||||
ID string `help:"ID or Name of schetag"`
|
||||
Name string `help:"New name of schedtag"`
|
||||
Strategy string `help:"Policy" choices:"require|exclude|prefer|avoid"`
|
||||
Desc string `help:"Description"`
|
||||
ClearStrategy bool `help:"Clear default schedule policy"`
|
||||
}
|
||||
R(&SchedtagUpdateOptions{}, "schedtag-update", "Update a schedule tag", func(s *mcclient.ClientSession, args *SchedtagUpdateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if len(args.Name) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Name), "name")
|
||||
}
|
||||
if len(args.Strategy) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Strategy), "default_strategy")
|
||||
}
|
||||
if len(args.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Desc), "description")
|
||||
}
|
||||
if args.ClearStrategy {
|
||||
params.Add(jsonutils.NewString(""), "default_strategy")
|
||||
}
|
||||
if params.Size() == 0 {
|
||||
return fmt.Errorf("No valid data to update")
|
||||
}
|
||||
schedtag, err := modules.Schedtags.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(schedtag)
|
||||
return nil
|
||||
})
|
||||
|
||||
type SetScopeOptions struct {
|
||||
ID []string `help:"ID or Name of schetag"`
|
||||
Project string `help:"ID or Name of project"`
|
||||
Domain string `help:"ID or Name of domain"`
|
||||
System bool `help:"Set to system scope"`
|
||||
}
|
||||
R(&SetScopeOptions{}, "schedtag-set-scope", "Set schedtag scope", func(s *mcclient.ClientSession, args *SetScopeOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
domainId := args.Domain
|
||||
projectId := args.Project
|
||||
if args.System {
|
||||
domainId = ""
|
||||
projectId = ""
|
||||
}
|
||||
params.Add(jsonutils.NewString(domainId), "domain")
|
||||
params.Add(jsonutils.NewString(projectId), "project")
|
||||
ret := modules.Schedtags.BatchPerformAction(s, args.ID, "set-scope", params)
|
||||
printBatchResults(ret, modules.Schedtags.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -35,5 +35,4 @@ func init() {
|
||||
cmd.Perform("uncache-secgroup", &options.SecurityGroupUncacheSecurityGroup{})
|
||||
cmd.Perform("purge", &options.SecgroupIdOptions{})
|
||||
cmd.Perform("change-owner", &options.SecgroupChangeOwnerOptions{})
|
||||
cmd.Perform("import-rules", &options.SecgroupImportRulesOptions{})
|
||||
}
|
||||
|
||||
@@ -728,7 +728,6 @@ func init() {
|
||||
type ServerRollBackSnapshot struct {
|
||||
ID string `help:"ID or name of VM" json:"-"`
|
||||
InstanceSnapshot string `help:"Instance snapshot id or name" json:"instance_snapshot"`
|
||||
AutoStart bool `help:"Auto start VM"`
|
||||
}
|
||||
R(&ServerRollBackSnapshot{}, "instance-snapshot-reset", "reset instance snapshot", func(s *mcclient.ClientSession, opts *ServerRollBackSnapshot) error {
|
||||
params := jsonutils.Marshal(opts)
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
@@ -23,15 +25,6 @@ import (
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.ServerSkus).WithKeyword("server-sku")
|
||||
cmd.List(&options.ServerSkusListOptions{})
|
||||
cmd.Show(&options.ServerSkusIdOptions{})
|
||||
cmd.Delete(&options.ServerSkusIdOptions{})
|
||||
cmd.Perform("enable", &options.ServerSkusIdOptions{})
|
||||
cmd.Perform("disable", &options.ServerSkusIdOptions{})
|
||||
cmd.Create(&options.ServerSkusCreateOptions{})
|
||||
cmd.Update(&options.ServerSkusUpdateOptions{})
|
||||
cmd.PerformWithKeyword("cache", "cache-sku", &options.ServerSkusCacheOptions{})
|
||||
cmd.ClassShow(&options.ServerSkusListOptions{})
|
||||
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
|
||||
|
||||
R(&options.SkuTaskQueryOptions{}, "server-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
|
||||
@@ -47,4 +40,191 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSkusListOptions struct {
|
||||
options.BaseListOptions
|
||||
Cloudregion string `help:"region Id or name"`
|
||||
Usable bool `help:"Filter usable sku"`
|
||||
Zone string `help:"zone Id or name"`
|
||||
City *string `help:"city name,eg. BeiJing"`
|
||||
Cpu *int `help:"Cpu core count" json:"cpu_core_count"`
|
||||
Mem *int `help:"Memory size in MB" json:"memory_size_mb"`
|
||||
Name string `help:"Name of Sku"`
|
||||
PostpaidStatus string `help:"Postpaid status" choices:"soldout|available"`
|
||||
PrepaidStatus string `help:"Prepaid status" choices:"soldout|available"`
|
||||
}
|
||||
|
||||
R(&ServerSkusListOptions{}, "server-sku-list", "List all avaiable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
results, err := modules.ServerSkus.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(results, modules.ServerSkus.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSkusIdOptions struct {
|
||||
ID string `help:"ID or Name of SKU to show"`
|
||||
}
|
||||
R(&ServerSkusIdOptions{}, "server-sku-show", "show details of a avaiable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusIdOptions) error {
|
||||
result, err := modules.ServerSkus.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&ServerSkusIdOptions{}, "server-sku-enable", "Enable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusIdOptions) error {
|
||||
result, err := modules.ServerSkus.PerformAction(s, args.ID, "enable", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&ServerSkusIdOptions{}, "server-sku-disable", "Disable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusIdOptions) error {
|
||||
result, err := modules.ServerSkus.PerformAction(s, args.ID, "disable", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSkusCacheOptions struct {
|
||||
REGION string `help:"Private cloud region"`
|
||||
ID string `help:"ServerSku Id"`
|
||||
}
|
||||
|
||||
R(&ServerSkusCacheOptions{}, "server-sku-cache", "Cache Server SKU for private cloud", func(s *mcclient.ClientSession, args *ServerSkusCacheOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(jsonutils.NewString(args.REGION), "cloudregion")
|
||||
result, err := modules.ServerSkus.PerformAction(s, args.ID, "cache-sku", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSkusCreateOptions struct {
|
||||
Name string `help:"ServerSku name"`
|
||||
CpuCoreCount int `help:"Cpu Count" required:"true" positional:"true"`
|
||||
MemorySizeMB int `help:"Memory MB" required:"true" positional:"true"`
|
||||
|
||||
OsName *string `help:"OS name/type" choices:"Linux|Windows|Any" default:"Any"`
|
||||
InstanceTypeCategory *string `help:"instance type category" choices:"general_purpose|compute_optimized|memory_optimized|storage_optimized|hardware_accelerated|high_memory|high_storage"`
|
||||
|
||||
SysDiskResizable *bool `help:"system disk is resizable"`
|
||||
SysDiskType *string `help:"system disk type" default:"local" choices:"local"`
|
||||
SysDiskMaxSizeGB *int `help:"system disk maximal size in gb"`
|
||||
|
||||
AttachedDiskType *string `help:"attached data disk type"`
|
||||
AttachedDiskSizeGB *int `help:"attached data disk size in GB"`
|
||||
AttachedDiskCount *int `help:"attached data disk count"`
|
||||
|
||||
MaxDataDiskCount *int `help:"maximal allowed data disk count"`
|
||||
|
||||
NicType *string `help:"nic type"`
|
||||
MaxNicCount *int `help:"maximal nic count"`
|
||||
|
||||
GPUSpec *string `help:"GPU spec"`
|
||||
GPUCount *int `help:"GPU count"`
|
||||
GPUAttachable *bool `help:"Allow attach GPU"`
|
||||
|
||||
Zone *string `help:"Zone ID or name"`
|
||||
Cloudregion *string `help:"Cloudregion ID or name"`
|
||||
Provider string `help:"provider"`
|
||||
Brand string `help:"brand"`
|
||||
}
|
||||
R(&ServerSkusCreateOptions{}, "server-sku-create", "Create a server sku record", func(s *mcclient.ClientSession, args *ServerSkusCreateOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ServerSkus.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSkusUpdateOptions struct {
|
||||
ID string `help:"Name or ID of SKU" json:"-"`
|
||||
|
||||
PostpaidStatus *string `help:"skus available status for postpaid instance" choices:"available|soldout"`
|
||||
PrepaidStatus *string `help:"skus available status for prepaid instance" choices:"available|soldout"`
|
||||
CpuCoreCount *int `help:"Cpu Count"`
|
||||
MemorySizeMB *int `help:"Memory MB"`
|
||||
|
||||
InstanceTypeCategory *string `help:"instance type category" choices:"general_purpose|compute_optimized|memory_optimized|storage_optimized|hardware_accelerated|high_memory|high_storage"`
|
||||
|
||||
SysDiskResizable *bool `help:"system disk is resizable"`
|
||||
SysDiskMaxSizeGB *int `help:"system disk maximal size in gb"`
|
||||
|
||||
AttachedDiskType *string `help:"attached data disk type"`
|
||||
AttachedDiskSizeGB *int `help:"attached data disk size in GB"`
|
||||
AttachedDiskCount *int `help:"attached data disk count"`
|
||||
|
||||
MaxDataDiskCount *int `help:"maximal allowed data disk count"`
|
||||
|
||||
NicType *string `help:"nic type"`
|
||||
MaxNicCount *int `help:"maximal nic count"`
|
||||
|
||||
GPUSpec *string `help:"GPU spec"`
|
||||
GPUCount *int `help:"GPU count"`
|
||||
GPUAttachable *bool `help:"Allow attach GPU"`
|
||||
|
||||
Zone *string `help:"Zone ID or name"`
|
||||
Region *string `help:"Region ID or name"`
|
||||
}
|
||||
R(&ServerSkusUpdateOptions{}, "server-sku-update", "Update server sku attributes", func(s *mcclient.ClientSession, args *ServerSkusUpdateOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ServerSkus.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ServerSkusDeleteOptions struct {
|
||||
ID string `help:"Id or name of server sku"`
|
||||
Purge bool `help:"purge sku"`
|
||||
}
|
||||
R(&ServerSkusDeleteOptions{}, "server-sku-delete", "Delete a server sku", func(s *mcclient.ClientSession, args *ServerSkusDeleteOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
if args.Purge {
|
||||
params.Add(jsonutils.JSONTrue, "purge")
|
||||
}
|
||||
result, err := modules.ServerSkus.Delete(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&ServerSkusListOptions{}, "server-sku-specs-list", "List all avaiable Server SKU specifications", func(s *mcclient.ClientSession, args *ServerSkusListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.ServerSkus.Get(s, "instance-specs", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -32,8 +32,6 @@ type GeneralUsageOptions struct {
|
||||
|
||||
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"`
|
||||
|
||||
Refresh bool `help:"force refresh usage statistics"`
|
||||
}
|
||||
|
||||
func fetchHostTypeOptions(args *GeneralUsageOptions) *jsonutils.JSONDict {
|
||||
@@ -50,9 +48,6 @@ func fetchHostTypeOptions(args *GeneralUsageOptions) *jsonutils.JSONDict {
|
||||
if len(args.CloudEnv) > 0 {
|
||||
params.Add(jsonutils.NewString(args.CloudEnv), "cloud_env")
|
||||
}
|
||||
if args.Refresh {
|
||||
params.Add(jsonutils.JSONTrue, "refresh")
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
|
||||
@@ -134,10 +134,6 @@ func (cmd ResourceCmd) List(args IListOpt) {
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) Create(args ICreateOpt) {
|
||||
cmd.CreateWithKeyworkd("create", args)
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) CreateWithKeyworkd(keyword string, args ICreateOpt) {
|
||||
man := cmd.manager
|
||||
callback := func(s *mcclient.ClientSession, args ICreateOpt) error {
|
||||
params, err := args.Params()
|
||||
@@ -151,7 +147,7 @@ func (cmd ResourceCmd) CreateWithKeyworkd(keyword string, args ICreateOpt) {
|
||||
printObject(ret)
|
||||
return nil
|
||||
}
|
||||
cmd.Run(keyword, args, callback)
|
||||
cmd.Run("create", args, callback)
|
||||
}
|
||||
|
||||
type IIdOpt interface {
|
||||
@@ -285,7 +281,7 @@ type IPerformOpt interface {
|
||||
IIdOpt
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) PerformWithKeyword(keyword, action string, args IPerformOpt) {
|
||||
func (cmd ResourceCmd) Perform(action string, args IPerformOpt) {
|
||||
man := cmd.manager
|
||||
callback := func(s *mcclient.ClientSession, args IPerformOpt) error {
|
||||
params, err := args.Params()
|
||||
@@ -299,28 +295,7 @@ func (cmd ResourceCmd) PerformWithKeyword(keyword, action string, args IPerformO
|
||||
printObject(ret)
|
||||
return nil
|
||||
}
|
||||
cmd.Run(keyword, args, callback)
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) PerformClassWithKeyword(keyword, action string, args IOpt) {
|
||||
man := cmd.manager
|
||||
callback := func(s *mcclient.ClientSession, args IOpt) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := man.(modulebase.Manager).PerformClassAction(s, action, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
}
|
||||
cmd.Run(keyword, args, callback)
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) Perform(action string, args IPerformOpt) {
|
||||
cmd.PerformWithKeyword(action, action, args)
|
||||
cmd.Run(action, args, callback)
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) PerformClass(action string, args IOpt) {
|
||||
@@ -386,18 +361,13 @@ type IUpdateOpt interface {
|
||||
IIdOpt
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) UpdateWithKeyword(keyword string, args IUpdateOpt) {
|
||||
func (cmd ResourceCmd) Update(args IUpdateOpt) {
|
||||
man := cmd.manager
|
||||
callback := func(s *mcclient.ClientSession, args IUpdateOpt) error {
|
||||
_params, err := args.Params()
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
params := _params.(*jsonutils.JSONDict)
|
||||
params.Remove("id")
|
||||
if params.Length() == 0 {
|
||||
return InvalidUpdateError()
|
||||
}
|
||||
ret, err := man.(modulebase.Manager).Update(s, args.GetId(), params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -405,11 +375,7 @@ func (cmd ResourceCmd) UpdateWithKeyword(keyword string, args IUpdateOpt) {
|
||||
printObject(ret)
|
||||
return nil
|
||||
}
|
||||
cmd.Run(keyword, args, callback)
|
||||
}
|
||||
|
||||
func (cmd ResourceCmd) Update(args IUpdateOpt) {
|
||||
cmd.UpdateWithKeyword("update", args)
|
||||
cmd.Run("update", args, callback)
|
||||
}
|
||||
|
||||
type IMetadataOpt interface {
|
||||
|
||||
@@ -25,8 +25,7 @@ import (
|
||||
func init() {
|
||||
type DomainListOptions struct {
|
||||
options.BaseListOptions
|
||||
IdpId string `help:"filter by idp_id"`
|
||||
IdpEntityId string `help:"filter by idp_entity_id"`
|
||||
IdpId string `help:"filter by idp_id"`
|
||||
}
|
||||
R(&DomainListOptions{}, "domain-list", "List domains", func(s *mcclient.ClientSession, args *DomainListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
@@ -156,16 +155,4 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type DomainUnlinkIdpOptions struct {
|
||||
DOMAIN string `help:"ID or name of domain to operate" json:"-"`
|
||||
}
|
||||
R(&DomainUnlinkIdpOptions{}, "domain-unlink-idp", "Unlink domain from an entity in the speicified identity provider", func(s *mcclient.ClientSession, args *DomainUnlinkIdpOptions) error {
|
||||
result, err := modules.Domains.PerformAction(s, args.DOMAIN, "unlink-idp", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -265,12 +265,9 @@ func init() {
|
||||
type IdentityProviderCreateCASOptions struct {
|
||||
NAME string `help:"name of identity provider" json:"-"`
|
||||
|
||||
AutoCreateProject bool `help:"automatically create a project if the default_project not exists" json:"-"`
|
||||
AutoCreateProject bool `help:"automatically create a default project when importing domain" json:"-"`
|
||||
NoAutoCreateProject bool `help:"do not create default project when importing domain" json:"-"`
|
||||
|
||||
AutoCreateUser bool `help:"automatically create a user" json:"-"`
|
||||
NoAutoCreateUser bool `help:"do not automatically create a user" json:"-"`
|
||||
|
||||
TargetDomain string `help:"target domain without creating new domain" json:"-"`
|
||||
|
||||
api.SCASIdpConfigOptions
|
||||
@@ -287,11 +284,6 @@ func init() {
|
||||
} else if args.NoAutoCreateProject {
|
||||
params.Add(jsonutils.JSONFalse, "auto_create_project")
|
||||
}
|
||||
if args.AutoCreateUser {
|
||||
params.Add(jsonutils.JSONTrue, "auto_create_user")
|
||||
} else if args.NoAutoCreateUser {
|
||||
params.Add(jsonutils.JSONFalse, "auto_create_user")
|
||||
}
|
||||
|
||||
params.Add(jsonutils.NewString("cas"), "driver")
|
||||
params.Add(jsonutils.Marshal(args), "config", "cas")
|
||||
@@ -472,9 +464,6 @@ func init() {
|
||||
AutoCreateProject bool `help:"automatically create a default project when importing domain" json:"-"`
|
||||
NoAutoCreateProject bool `help:"do not create default project when importing domain" json:"-"`
|
||||
|
||||
AutoCreateUser bool `help:"automatically create a user" json:"-"`
|
||||
NoAutoCreateUser bool `help:"do not automatically create a user" json:"-"`
|
||||
|
||||
TargetDomain string `help:"target domain without creating new domain" json:"-"`
|
||||
|
||||
api.SOIDCIdpConfigOptions
|
||||
@@ -491,11 +480,6 @@ func init() {
|
||||
} else if args.NoAutoCreateProject {
|
||||
params.Add(jsonutils.JSONFalse, "auto_create_project")
|
||||
}
|
||||
if args.AutoCreateUser {
|
||||
params.Add(jsonutils.JSONTrue, "auto_create_user")
|
||||
} else if args.NoAutoCreateUser {
|
||||
params.Add(jsonutils.JSONFalse, "auto_create_user")
|
||||
}
|
||||
|
||||
params.Add(jsonutils.NewString("oidc"), "driver")
|
||||
params.Add(jsonutils.Marshal(args), "config", "oidc")
|
||||
@@ -722,18 +706,4 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type IdpSetDefaultSsoOptions struct {
|
||||
ID string `help:"id or name of idp to set default Sso" json:"-"`
|
||||
|
||||
api.PerformDefaultSsoInput
|
||||
}
|
||||
R(&IdpSetDefaultSsoOptions{}, "idp-default-sso", "Enable/disable default SSO", func(s *mcclient.ClientSession, args *IdpSetDefaultSsoOptions) error {
|
||||
result, err := modules.IdentityProviders.PerformAction(s, args.ID, "default-sso", jsonutils.Marshal(args))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,34 +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 identity
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
)
|
||||
|
||||
func init() {
|
||||
type ScopeResourceRefreshOptions struct {
|
||||
}
|
||||
R(&ScopeResourceRefreshOptions{}, "scope-resource-refresh", "Refresh scope resource count", func(s *mcclient.ClientSession, args *ScopeResourceRefreshOptions) error {
|
||||
result, err := modules.ScopeResource.PerformClassAction(s, "refresh", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
@@ -31,7 +31,6 @@ func init() {
|
||||
OrderByDomain string `help:"order by domain name" choices:"asc|desc"`
|
||||
Role string `help:"Filter by role"`
|
||||
IdpId string `help:"filter by idp_id"`
|
||||
IdpEntityId string `help:"filter by idp_entity_id"`
|
||||
}
|
||||
R(&UserListOptions{}, "user-list", "List users", func(s *mcclient.ClientSession, args *UserListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
|
||||
@@ -15,21 +15,151 @@
|
||||
package notifyv2
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/notify"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.NotifyReceiver).WithKeyword("notify-receiver")
|
||||
cmd.List(new(options.ReceiverListOptions))
|
||||
cmd.Create(new(options.ReceiverCreateOptions))
|
||||
cmd.Update(new(options.ReceiverUpdateOptions))
|
||||
cmd.Show(new(options.ReceiverOptions))
|
||||
cmd.Delete(new(options.ReceiverOptions))
|
||||
cmd.Perform("enable", new(options.ReceiverOptions))
|
||||
cmd.Perform("disable", new(options.ReceiverOptions))
|
||||
cmd.Perform("trigger-verify", new(options.ReceiverTriggerVerifyOptions))
|
||||
cmd.Perform("verify", new(options.ReceiverVerifyOptions))
|
||||
cmd.PerformClass("intellij-get", new(options.ReceiverIntellijGetOptions))
|
||||
type ReceiverListOptions struct {
|
||||
options.BaseListOptions
|
||||
UId string `help:"user id in keystone"`
|
||||
UName string `help:"user name in keystone"`
|
||||
EnabledContactType string `help:"enabled contact type"`
|
||||
VerifiedContactType string `help:"verified contact type"`
|
||||
}
|
||||
R(&ReceiverListOptions{}, "notify-receiver-list", "List notify receiver", func(s *mcclient.ClientSession, args *ReceiverListOptions) error {
|
||||
params, err := options.ListStructToParams(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := modules.NotifyReceiver.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, modules.NotifyReceiver.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
type ReceiverCreateOptions struct {
|
||||
UID string `help:"user id in keystone"`
|
||||
Email string `help:"email of receiver"`
|
||||
Mobile string `help:"mobile of receiver"`
|
||||
EnabledContactTypes []string `help:"enabled contact type"`
|
||||
}
|
||||
R(&ReceiverCreateOptions{}, "notify-receiver-create", "Create notify receiver", func(s *mcclient.ClientSession, args *ReceiverCreateOptions) error {
|
||||
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
|
||||
receiver, err := modules.NotifyReceiver.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(receiver)
|
||||
return nil
|
||||
})
|
||||
type ReceiverUpdateInput struct {
|
||||
ID string `help:"Id or Name of receiver"`
|
||||
Email string `help:"email of receiver"`
|
||||
Mobile string `help:"mobile of receiver"`
|
||||
EnabledContactType []string `help:"enabled contact type"`
|
||||
}
|
||||
R(&ReceiverUpdateInput{}, "notify-receiver-update", "Update notify receiver", func(s *mcclient.ClientSession, args *ReceiverUpdateInput) error {
|
||||
params := jsonutils.NewDict()
|
||||
if len(args.Email) > 0 {
|
||||
params.Set("email", jsonutils.NewString(args.Email))
|
||||
}
|
||||
if len(args.Mobile) > 0 {
|
||||
params.Set("mobile", jsonutils.NewString(args.Mobile))
|
||||
}
|
||||
if len(args.EnabledContactType) > 0 {
|
||||
params.Set("enabled_contact_types", jsonutils.NewStringArray(args.EnabledContactType))
|
||||
}
|
||||
ret, err := modules.NotifyReceiver.Update(s, args.ID, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
type ReceiverOptions struct {
|
||||
ID string `help:"Id or Name of receiver"`
|
||||
}
|
||||
R(&ReceiverOptions{}, "notify-receiver-show", "Show notify receiver", func(s *mcclient.ClientSession, args *ReceiverOptions) error {
|
||||
ret, err := modules.NotifyReceiver.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ReceiverOptions{}, "notify-receiver-delete", "Delete notify receiver", func(s *mcclient.ClientSession, args *ReceiverOptions) error {
|
||||
receiver, err := modules.NotifyReceiver.Delete(s, args.ID, jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(receiver)
|
||||
return nil
|
||||
})
|
||||
R(&ReceiverOptions{}, "notify-receiver-enable", "Enable notify receiver", func(s *mcclient.ClientSession, args *ReceiverOptions) error {
|
||||
ret, err := modules.NotifyReceiver.PerformAction(s, args.ID, "enable", jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ReceiverOptions{}, "notify-receiver-disable", "Disable notify receiver", func(s *mcclient.ClientSession, args *ReceiverOptions) error {
|
||||
ret, err := modules.NotifyReceiver.PerformAction(s, args.ID, "disable", jsonutils.NewDict())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
type ReceiverTriggerVerifyInput struct {
|
||||
ID string `help:"Id or Name of receiver"`
|
||||
ContactType string `help:"Contact type to trigger verify" choices:"email|mobile"`
|
||||
}
|
||||
R(&ReceiverTriggerVerifyInput{}, "notify-receiver-trigger-verify", "Trigger verification for receiver about some contact", func(s *mcclient.ClientSession, args *ReceiverTriggerVerifyInput) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("contact_type", jsonutils.NewString(args.ContactType))
|
||||
ret, err := modules.NotifyReceiver.PerformAction(s, args.ID, "trigger-verify", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
type ReceiverVerifyInput struct {
|
||||
ID string `help:"Id or Name of receiver"`
|
||||
ContactType string `help:"Contact type to trigger verify" choices:"email|mobile"`
|
||||
Token string `help:"Token from verify message sent to you"`
|
||||
}
|
||||
R(&ReceiverVerifyInput{}, "notify-receiver-verify", "Verify receiver about some contact type", func(s *mcclient.ClientSession, args *ReceiverVerifyInput) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("contact_type", jsonutils.NewString(args.ContactType))
|
||||
params.Set("token", jsonutils.NewString(args.Token))
|
||||
ret, err := modules.NotifyReceiver.PerformAction(s, args.ID, "verify", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ReceiverOptions{}, "notify-receiver-enable", "Enable receiver", func(s *mcclient.ClientSession, args *ReceiverOptions) error {
|
||||
ret, err := modules.NotifyReceiver.PerformAction(s, args.ID, "enable", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ReceiverOptions{}, "notify-receiver-disable", "Disable receiver", func(s *mcclient.ClientSession, args *ReceiverOptions) error {
|
||||
ret, err := modules.NotifyReceiver.PerformAction(s, args.ID, "disable", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
)
|
||||
|
||||
@@ -47,21 +46,21 @@ func init() {
|
||||
if len(args.NamespaceId) > 0 {
|
||||
params.Add(jsonutils.NewString(args.NamespaceId), "namespace_id")
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
result, err = yunionconf.Parameters.List(s, params)
|
||||
result, err = modules.Parameters.List(s, params)
|
||||
} else if len(args.User) > 0 {
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
result, err = yunionconf.Parameters.ListInContext(s, params, &modules.UsersV3, args.User)
|
||||
result, err = modules.Parameters.ListInContext(s, params, &modules.UsersV3, args.User)
|
||||
} else if len(args.Service) > 0 {
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
result, err = yunionconf.Parameters.ListInContext(s, params, &modules.ServicesV3, args.Service)
|
||||
result, err = modules.Parameters.ListInContext(s, params, &modules.ServicesV3, args.Service)
|
||||
} else {
|
||||
result, err = yunionconf.Parameters.List(s, params)
|
||||
result, err = modules.Parameters.List(s, params)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(result, yunionconf.Parameters.GetColumns(s))
|
||||
printList(result, modules.Parameters.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -84,15 +83,15 @@ func init() {
|
||||
if len(args.NamespaceId) > 0 {
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
params.Add(jsonutils.NewString(args.NamespaceId), "namespace_id")
|
||||
parameter, err = yunionconf.Parameters.Get(s, args.NAME, params)
|
||||
parameter, err = modules.Parameters.Get(s, args.NAME, params)
|
||||
} else if len(args.User) > 0 {
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
parameter, err = yunionconf.Parameters.GetInContext(s, args.NAME, params, &modules.UsersV3, args.User)
|
||||
parameter, err = modules.Parameters.GetInContext(s, args.NAME, params, &modules.UsersV3, args.User)
|
||||
} else if len(args.Service) > 0 {
|
||||
params.Add(jsonutils.NewString("system"), "scope")
|
||||
parameter, err = yunionconf.Parameters.GetInContext(s, args.NAME, params, &modules.ServicesV3, args.Service)
|
||||
parameter, err = modules.Parameters.GetInContext(s, args.NAME, params, &modules.ServicesV3, args.Service)
|
||||
} else {
|
||||
parameter, err = yunionconf.Parameters.Get(s, args.NAME, params)
|
||||
parameter, err = modules.Parameters.Get(s, args.NAME, params)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -125,7 +124,7 @@ func init() {
|
||||
params.Add(jsonutils.NewString(args.Service), "service_id")
|
||||
}
|
||||
|
||||
parameter, err := yunionconf.Parameters.Create(s, params)
|
||||
parameter, err := modules.Parameters.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -154,11 +153,11 @@ func init() {
|
||||
}
|
||||
|
||||
if len(args.User) > 0 {
|
||||
parameter, err = yunionconf.Parameters.PutInContext(s, args.NAME, params, &modules.UsersV3, args.User)
|
||||
parameter, err = modules.Parameters.PutInContext(s, args.NAME, params, &modules.UsersV3, args.User)
|
||||
} else if len(args.Service) > 0 {
|
||||
parameter, err = yunionconf.Parameters.PutInContext(s, args.NAME, params, &modules.ServicesV3, args.Service)
|
||||
parameter, err = modules.Parameters.PutInContext(s, args.NAME, params, &modules.ServicesV3, args.Service)
|
||||
} else {
|
||||
parameter, err = yunionconf.Parameters.Put(s, args.NAME, params)
|
||||
parameter, err = modules.Parameters.Put(s, args.NAME, params)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -180,11 +179,11 @@ func init() {
|
||||
var parameter jsonutils.JSONObject
|
||||
var err error
|
||||
if len(args.User) > 0 {
|
||||
parameter, err = yunionconf.Parameters.DeleteInContext(s, args.NAME, params, &modules.UsersV3, args.User)
|
||||
parameter, err = modules.Parameters.DeleteInContext(s, args.NAME, params, &modules.UsersV3, args.User)
|
||||
} else if len(args.Service) > 0 {
|
||||
parameter, err = yunionconf.Parameters.DeleteInContext(s, args.NAME, params, &modules.ServicesV3, args.Service)
|
||||
parameter, err = modules.Parameters.DeleteInContext(s, args.NAME, params, &modules.ServicesV3, args.Service)
|
||||
} else {
|
||||
parameter, err = yunionconf.Parameters.Delete(s, args.NAME, nil)
|
||||
parameter, err = modules.Parameters.Delete(s, args.NAME, nil)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -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 yunionconf
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/yunionconf"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.ScopedPolicies)
|
||||
cmd.List(new(options.ScopedPolicyListOptions))
|
||||
cmd.Show(new(options.ScopedPolicyShowOptions))
|
||||
cmd.Create(new(options.ScopedPolicyCreateOptions))
|
||||
cmd.Update(new(options.ScopedPolicyUpdateOptions))
|
||||
cmd.Delete(new(options.ScopedPolicyIDOptions))
|
||||
cmd.Perform("bind", new(options.ScopedPolicyBindOptions))
|
||||
}
|
||||
@@ -1,28 +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 yunionconf
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
modules "yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/yunionconf"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(&modules.ScopedPolicyBindings)
|
||||
cmd.List(new(options.ScopedPolicyBindingListOptions))
|
||||
cmd.Show(new(options.ScopedPolicyBindingShowOptions))
|
||||
cmd.Delete(new(options.ScopedPolicyBindingIDOptions))
|
||||
}
|
||||
10
go.mod
10
go.mod
@@ -106,7 +106,7 @@ require (
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/stretchr/testify v1.5.1
|
||||
github.com/tencentcloud/tencentcloud-sdk-go v3.0.135+incompatible
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.24
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4
|
||||
github.com/tinylib/msgp v1.1.0 // indirect
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
|
||||
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c
|
||||
@@ -140,13 +140,13 @@ require (
|
||||
k8s.io/client-go v9.0.0+incompatible
|
||||
k8s.io/cluster-bootstrap v0.17.3
|
||||
k8s.io/kubernetes v1.16.0
|
||||
yunion.io/x/executor v0.0.0-20210310041834-3fcd1574f68e
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
|
||||
yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769
|
||||
yunion.io/x/log v0.0.0-20201210064738-43181789dc74
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
|
||||
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
|
||||
yunion.io/x/pkg v0.0.0-20210218105412-13a69f60034c
|
||||
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v0.0.0-20210329171939-2c520f93aee3
|
||||
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
|
||||
)
|
||||
|
||||
|
||||
24
go.sum
24
go.sum
@@ -732,8 +732,8 @@ github.com/syncthing/syncthing v0.14.48-rc.4/go.mod h1:nw3siZwHPA6M8iSfjDCWQ402e
|
||||
github.com/syndtr/gocapability v0.0.0-20160928074757-e7cb7fa329f4/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go v3.0.135+incompatible h1:QIMoFqKCmNp4HPLiTR+couZbHsIZfoOllncHYvtqse8=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go v3.0.135+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.24 h1:ZsZij764lOaPsj7mEAlyxXvslGt6/m312Tzqj/zeRpo=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.24/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4 h1:wVKDVTKxaf0ll8ONv22Q+cazYSSmcWt7JJOeQD0LoKQ=
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk=
|
||||
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e h1:T5PdfK/M1xyrHwynxMIVMWLS7f/qHwfslZphxtGnw7s=
|
||||
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
|
||||
github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM=
|
||||
@@ -1121,25 +1121,29 @@ sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:I
|
||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI=
|
||||
yunion.io/x/executor v0.0.0-20210310041834-3fcd1574f68e h1:uGmKmmHm4zeLXhc/MEbAFtEDtGtyEYhC0OaBRGFi+fQ=
|
||||
yunion.io/x/executor v0.0.0-20210310041834-3fcd1574f68e/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74 h1:A15C6VdVRWvmQ9pAJHrUs9yan5qKlYH7uaRxHg1kRbk=
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v0.0.0-20201105032201-9d0fba742954 h1:gGU3uGxw82voqh3tVrTY4q43lLLooqgF662PqOeEpKY=
|
||||
yunion.io/x/jsonutils v0.0.0-20201105032201-9d0fba742954/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE=
|
||||
yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769 h1:LIQ4hhLGQuQK+XxlV+8JrKBuL37WUT+5ZTVxBwHOTD4=
|
||||
yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE=
|
||||
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d h1:59zrDL7Ft+hDukguJRmLr/Gdu/9V75x+yX99ovZwfaA=
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/log v0.0.0-20201210064738-43181789dc74 h1:7D+sQ/XaUTUEm+NCrKXOhXBKlzEd0RyS2qZ4vBGjx2o=
|
||||
yunion.io/x/log v0.0.0-20201210064738-43181789dc74/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3 h1:5Wc5hkB8PtMudmHuzCyok960RuOa9I55imIGrigSdjs=
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
|
||||
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7 h1:gjqNa2uQzIEXyySsbvVz0UltTEbGsnFFlvnzOpCfHdo=
|
||||
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6 h1:UarEDTBGkgcgc+nc+PZ75uo9M9+jiOGd5P2B90TxDNw=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20210218105412-13a69f60034c h1:J/joqbA1N2mAlOl0Uqd4LpAq3+DK5aoFMdz+p9Ld7pQ=
|
||||
yunion.io/x/pkg v0.0.0-20210218105412-13a69f60034c/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc h1:cgwWI6k9LsXpq6yiOuEIprsXmPyPGUa60sOZu57e8Jo=
|
||||
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v0.0.0-20210329171939-2c520f93aee3 h1:C4yasW3gXronDIlIVUqHSbkA38PM1X9gxUWTYGsuIuI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20210329171939-2c520f93aee3/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b h1:xBAzDPvvmsOBjxAj0PLHMNLVdPNOlYFHAm7T3IZ2ehs=
|
||||
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce h1:kU8xE7O5uZ1GSJVMZHoJ+jrNL7csUQHYGyAPW9QfNpE=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
4005
locales/locales.go
4005
locales/locales.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,6 @@ import (
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/ansibleserver/options"
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
api "yunion.io/x/onecloud/pkg/apis/ansible"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
@@ -200,10 +199,7 @@ func (apb *SAnsiblePlaybookV2) runPlaybook(ctx context.Context, userCred mcclien
|
||||
PrivateKey(privateKey).
|
||||
Requirements(apb.Requirements).
|
||||
Files(files).
|
||||
OutputWriter(&ansiblePlaybookOutputWriter{apb}).
|
||||
KeepTmpdir(options.Options.KeepTmpdir).
|
||||
RolePublic(options.Options.RolePublic).
|
||||
Timeout(options.Options.Timeout)
|
||||
OutputWriter(&ansiblePlaybookOutputWriter{apb})
|
||||
man.sessions.Add(apb.Id, sess)
|
||||
|
||||
// NOTE host state check? run only on online hosts and running guests, skip others
|
||||
|
||||
@@ -19,9 +19,6 @@ import common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
|
||||
type AnsibleServerOptions struct {
|
||||
common_options.CommonOptions
|
||||
common_options.DBOptions
|
||||
KeepTmpdir bool `help:"Whether to save the tmp directory" json:"keep_tmpdir"`
|
||||
RolePublic bool `help:"Download and use the role of the public directory"`
|
||||
Timeout int `help:"Ansible Override the connection timeout in seconds" default:"10"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@@ -23,14 +23,14 @@ import (
|
||||
type Application struct {
|
||||
*appsrv.Application
|
||||
|
||||
AuthHandler handler.IHandler
|
||||
MiscHandler handler.IHandler
|
||||
K8sHandler handler.IHandler
|
||||
ResourceHandler handler.IHandler
|
||||
CSRFResourceHandler handler.IHandler
|
||||
RPCHandler handler.IHandler
|
||||
// InfluxdbProxyHandler handler.IHandler
|
||||
CloudIdSAMLHandler handler.IHandler
|
||||
AuthHandler handler.IHandler
|
||||
MiscHandler handler.IHandler
|
||||
K8sHandler handler.IHandler
|
||||
ResourceHandler handler.IHandler
|
||||
CSRFResourceHandler handler.IHandler
|
||||
RPCHandler handler.IHandler
|
||||
InfluxdbProxyHandler handler.IHandler
|
||||
CloudIdSAMLHandler handler.IHandler
|
||||
}
|
||||
|
||||
func NewApp(app *appsrv.Application) *Application {
|
||||
@@ -66,7 +66,7 @@ func (app *Application) InitHandlers() *Application {
|
||||
AddGet(handler.FetchAuthToken).
|
||||
AddPost(handler.FetchAuthToken)
|
||||
|
||||
// app.InfluxdbProxyHandler = handler.NewInfluxdbProxyHandler("/query")
|
||||
app.InfluxdbProxyHandler = handler.NewInfluxdbProxyHandler("/query")
|
||||
|
||||
app.CloudIdSAMLHandler = handler.NewProxyHandlerWithService(cloudid.SAML_IDP_PREFIX, cloudid.SERVICE_TYPE)
|
||||
|
||||
@@ -76,7 +76,7 @@ func (app *Application) InitHandlers() *Application {
|
||||
func (app *Application) Bind() {
|
||||
for _, h := range []handler.IHandler{
|
||||
app.CloudIdSAMLHandler,
|
||||
// app.InfluxdbProxyHandler,
|
||||
app.InfluxdbProxyHandler,
|
||||
app.MiscHandler,
|
||||
app.AuthHandler,
|
||||
app.K8sHandler,
|
||||
|
||||
@@ -67,7 +67,6 @@ func (h *AuthHandlers) AddMethods() {
|
||||
NewHP(h.getIdpSsoRedirectUri, "sso", "redirect", "<idp_id>"),
|
||||
NewHP(h.listTotpRecoveryQuestions, "recovery"),
|
||||
NewHP(h.handleSsoLogin, "ssologin"),
|
||||
NewHP(h.postLogoutHandler, "logout"),
|
||||
// oidc auth
|
||||
NewHP(handleOIDCAuth, "oidc", "auth"),
|
||||
NewHP(handleOIDCConfiguration, "oidc", ".well-known", "openid-configuration"),
|
||||
@@ -140,7 +139,7 @@ func (h *AuthHandlers) GetRegionsResponse(ctx context.Context, w http.ResponseWr
|
||||
if options.Options.ReturnFullDomainList {
|
||||
filters := jsonutils.NewDict()
|
||||
if len(currentDomain) > 0 {
|
||||
filters.Add(jsonutils.NewString(currentDomain), "name")
|
||||
filters.Add(jsonutils.NewString(currentDomain), "id")
|
||||
}
|
||||
filters.Add(jsonutils.NewInt(1000), "limit")
|
||||
result, e := modules.Domains.List(s, filters)
|
||||
@@ -179,7 +178,7 @@ func (h *AuthHandlers) GetRegionsResponse(ctx context.Context, w http.ResponseWr
|
||||
}
|
||||
retIdps := make([]jsonutils.JSONObject, 0)
|
||||
for i := range idps.Data {
|
||||
retIdp := idps.Data[i].(*jsonutils.JSONDict).CopyIncludes("id", "name", "driver", "template", "icon_uri", "is_default")
|
||||
retIdp := idps.Data[i].(*jsonutils.JSONDict).CopyIncludes("id", "name", "driver", "template", "icon_uri")
|
||||
retIdps = append(retIdps, retIdp)
|
||||
}
|
||||
|
||||
@@ -312,20 +311,9 @@ func (h *AuthHandlers) doCredentialLogin(ctx context.Context, req *http.Request,
|
||||
if err != nil {
|
||||
switch httperr := err.(type) {
|
||||
case *httputils.JSONClientError:
|
||||
if httperr.Code >= 500 {
|
||||
return nil, err
|
||||
}
|
||||
if httperr.Code == 409 || httperr.Code == 429 {
|
||||
return nil, err
|
||||
}
|
||||
switch httperr.Class {
|
||||
case "UserNotFound", "WrongPassword":
|
||||
return nil, httperrors.NewJsonClientError(httperrors.ErrIncorrectUsernameOrPassword, "incorrect username or password")
|
||||
case "UserLocked":
|
||||
return nil, httperrors.NewJsonClientError(httperrors.ErrUserLocked, "The user has been locked, please contact the administrator")
|
||||
case "UserDisabled":
|
||||
return nil, httperrors.NewJsonClientError(httperrors.ErrUserDisabled, "The user has been disabled, please contact the administrator")
|
||||
}
|
||||
}
|
||||
return nil, httperrors.NewInvalidCredentialError("invalid credential")
|
||||
}
|
||||
@@ -566,7 +554,6 @@ func (h *AuthHandlers) doLogin(ctx context.Context, w http.ResponseWriter, req *
|
||||
|
||||
func (h *AuthHandlers) postLogoutHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
clearAuthCookie(w)
|
||||
appsrv.DisableClientCache(w)
|
||||
appsrv.Send(w, "")
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
|
||||
_ "yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
_ "yunion.io/x/onecloud/pkg/mcclient/modules/notify"
|
||||
_ "yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -42,7 +42,8 @@ func NewProxyHandlerWithService(prefix string, serviceName string) *InfluxdbProx
|
||||
}
|
||||
|
||||
func requestManipulator(ctx context.Context, r *http.Request) (*http.Request, error) {
|
||||
token, _, _ := fetchAuthInfo(ctx, r)
|
||||
r.Header.Del("Cookie")
|
||||
token := AppContextToken(ctx)
|
||||
if token != nil {
|
||||
r.Header.Set("X-Auth-Token", token.GetTokenString())
|
||||
}
|
||||
|
||||
@@ -162,13 +162,3 @@ type CloudgroupSyncInput struct {
|
||||
|
||||
type CloudgroupUpdateInput struct {
|
||||
}
|
||||
|
||||
type CloudgroupResourceListInput struct {
|
||||
// 根据权限组Id过滤资源
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
}
|
||||
|
||||
type CloudgroupResourceDetails struct {
|
||||
// 公有云用户名称
|
||||
Cloudgroup string `json:"cloudgroup"`
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
SERVICE_TYPE = apis.SERVICE_TYPE_CLOUDID
|
||||
SAML_IDP_PREFIX = "/api/saml/idp"
|
||||
SAML_IDP_PREFIX = "/saml/idp"
|
||||
SERVICE_VERSION = ""
|
||||
)
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
CLOUD_ROLE_STATUS_CREATING = "creating" // 创建中
|
||||
CLOUD_ROLE_STATUS_AVAILABLE = "available" // 正常
|
||||
CLOUD_ROLE_STATUS_DELETING = "deleting" // 删除中
|
||||
CLOUD_ROLE_STATUS_DELETE_FAILED = "delete_failed" // 删除失败
|
||||
)
|
||||
|
||||
type CloudroleListInput struct {
|
||||
apis.StatusInfrasResourceBaseListInput
|
||||
|
||||
CloudaccountResourceListInput
|
||||
}
|
||||
|
||||
type CloudroleDetails struct {
|
||||
apis.StatusInfrasResourceBaseDetails
|
||||
CloudaccountResourceDetails
|
||||
|
||||
SCloudrole
|
||||
}
|
||||
|
||||
type CloudrolePurgeInput struct {
|
||||
}
|
||||
@@ -82,10 +82,6 @@ type ClouduserCreateInput struct {
|
||||
|
||||
// swagger:ignore
|
||||
ExternalId string `json:"external_id"`
|
||||
|
||||
// 是否发送邮件通知(仅设置email不为空生效)
|
||||
// default: false
|
||||
Notify bool `json:"notify"`
|
||||
}
|
||||
|
||||
type ClouduserListInput struct {
|
||||
|
||||
@@ -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 cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
SAML_PROVIDER_STATUS_AVAILABLE = "available"
|
||||
SAML_PROVIDER_STATUS_NOT_MATCH = "not_match"
|
||||
SAML_PROVIDER_STATUS_DELETING = "deleting"
|
||||
SAML_PROVIDER_STATUS_DELETE_FAILED = "delete_failed"
|
||||
SAML_PROVIDER_STATUS_UNKNOWN = "unknown"
|
||||
SAML_PROVIDER_STATUS_CREATING = "creating"
|
||||
SAML_PROVIDER_STATUS_CREATE_FAILED = "create_failed"
|
||||
SAML_PROVIDER_STATUS_UNVALIABLE = "unavailable"
|
||||
SAML_PROVIDER_STATUS_UPDATE_METADATA = "update_metadata"
|
||||
SAML_PROVIDER_STATUS_UPDATE_METADATA_FAILED = "update_metadata_failed"
|
||||
SAML_PROVIDER_STATUS_SYNC = "sync"
|
||||
)
|
||||
|
||||
type SAMLProviderListInput struct {
|
||||
apis.StatusInfrasResourceBaseListInput
|
||||
CloudaccountResourceListInput
|
||||
}
|
||||
|
||||
type SAMLProviderDetails struct {
|
||||
apis.StatusInfrasResourceBaseDetails
|
||||
CloudaccountResourceDetails
|
||||
|
||||
SSAMLProvider
|
||||
}
|
||||
|
||||
type SAMLProviderCreateInput struct {
|
||||
apis.StatusInfrasResourceBaseCreateInput
|
||||
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
|
||||
// swagger:ignore
|
||||
EntityId string `json:"entity_id"`
|
||||
|
||||
// swagger:ignore
|
||||
MetadataDocument string `json:"metadata_document"`
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cloudid
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
const (
|
||||
SAML_USER_STATUS_AVAILABLE = "available"
|
||||
)
|
||||
|
||||
type SamluserCreateInput struct {
|
||||
apis.StatusDomainLevelUserResourceCreateInput
|
||||
|
||||
// 权限组和账号必须是同一平台
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
|
||||
// 权限组和账号必须是同一平台
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
}
|
||||
|
||||
type SamluserListInput struct {
|
||||
apis.StatusDomainLevelUserResourceListInput
|
||||
CloudgroupResourceListInput
|
||||
CloudaccountResourceListInput
|
||||
}
|
||||
|
||||
type SamluserDetails struct {
|
||||
apis.StatusDomainLevelUserResourceDetails
|
||||
CloudgroupResourceDetails
|
||||
CloudaccountResourceDetails
|
||||
|
||||
SSamluser
|
||||
}
|
||||
@@ -18,20 +18,13 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
// SAMLProviderResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SAMLProviderResourceBase.
|
||||
type SAMLProviderResourceBase struct {
|
||||
SAMLProviderId string `json:"saml_provider_id"`
|
||||
}
|
||||
|
||||
// SCloudaccount is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudaccount.
|
||||
type SCloudaccount struct {
|
||||
apis.SStandaloneResourceBase
|
||||
apis.SDomainizedResourceBase
|
||||
AccountId string `json:"account_id"`
|
||||
Provider string `json:"provider"`
|
||||
Brand string `json:"brand"`
|
||||
IamLoginUrl string `json:"iam_login_url"`
|
||||
SAMLAuth *bool `json:"saml_auth,omitempty"`
|
||||
}
|
||||
|
||||
// SCloudaccountResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudaccountResourceBase.
|
||||
@@ -59,11 +52,6 @@ type SCloudgroupPolicy struct {
|
||||
SCloudpolicyResourceBase
|
||||
}
|
||||
|
||||
// SCloudgroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudgroupResourceBase.
|
||||
type SCloudgroupResourceBase struct {
|
||||
CloudgroupId string `json:"cloudgroup_id"`
|
||||
}
|
||||
|
||||
// SCloudgroupUser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudgroupUser.
|
||||
type SCloudgroupUser struct {
|
||||
SCloudgroupJointsBase
|
||||
@@ -133,16 +121,6 @@ type SCloudproviderResourceBase struct {
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
}
|
||||
|
||||
// SCloudrole is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudrole.
|
||||
type SCloudrole struct {
|
||||
apis.SEnabledStatusInfrasResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
SAMLProviderResourceBase
|
||||
Document interface{} `json:"document"`
|
||||
OwnerId string `json:"owner_id"`
|
||||
}
|
||||
|
||||
// SClouduser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SClouduser.
|
||||
type SClouduser struct {
|
||||
apis.SStatusDomainLevelUserResourceBase
|
||||
@@ -174,20 +152,3 @@ type SClouduserPolicy struct {
|
||||
type SClouduserResourceBase struct {
|
||||
ClouduserId string `json:"clouduser_id"`
|
||||
}
|
||||
|
||||
// SSAMLProvider is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SSAMLProvider.
|
||||
type SSAMLProvider struct {
|
||||
apis.SStatusInfrasResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudaccountResourceBase
|
||||
EntityId string `json:"entity_id"`
|
||||
MetadataDocument string `json:"metadata_document"`
|
||||
AuthUrl string `json:"auth_url"`
|
||||
}
|
||||
|
||||
// SSamluser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SSamluser.
|
||||
type SSamluser struct {
|
||||
apis.SStatusDomainLevelUserResourceBase
|
||||
SCloudgroupResourceBase
|
||||
SCloudaccountResourceBase
|
||||
}
|
||||
|
||||
@@ -448,9 +448,8 @@ type ServerCreateInput struct {
|
||||
// 弹性公网IP带宽
|
||||
// 指定此参数后会创建新的弹性公网IP并绑定到新建的虚拟机
|
||||
// 此参数优先级低于public_ip
|
||||
// 私有云不支持此参数
|
||||
EipBw int `json:"eip_bw,omitzero"`
|
||||
// 弹性公网IP线路类型
|
||||
EipBgpType string `json:"eip_bgp_type,omitzero"`
|
||||
// 弹性公网IP计费类型
|
||||
EipChargeType string `json:"eip_charge_type,omitempty"`
|
||||
// 是否跟随主机删除而自动释放
|
||||
|
||||
@@ -18,8 +18,6 @@ import (
|
||||
"net/http"
|
||||
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/util/regutils"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
@@ -184,154 +182,3 @@ type BucketGetObjectsOutput struct {
|
||||
// 下一页请求的paging_marker标识
|
||||
NextMarker string `json:"next_marker"`
|
||||
}
|
||||
|
||||
type BucketWebsiteRoutingRule struct {
|
||||
ConditionErrorCode string
|
||||
ConditionPrefix string
|
||||
|
||||
RedirectProtocol string
|
||||
RedirectReplaceKey string
|
||||
RedirectReplaceKeyPrefix string
|
||||
}
|
||||
|
||||
type BucketWebsiteConf struct {
|
||||
// 主页
|
||||
Index string
|
||||
// 错误时返回的文档
|
||||
ErrorDocument string
|
||||
// http或https
|
||||
Protocol string
|
||||
|
||||
Rules []BucketWebsiteRoutingRule
|
||||
// 访问网站url
|
||||
Url string
|
||||
}
|
||||
|
||||
func (input *BucketWebsiteConf) Validate() error {
|
||||
if len(input.Index) == 0 {
|
||||
return httperrors.NewMissingParameterError("index")
|
||||
}
|
||||
if len(input.ErrorDocument) == 0 {
|
||||
return httperrors.NewMissingParameterError("error_document")
|
||||
}
|
||||
if len(input.Protocol) == 0 {
|
||||
return httperrors.NewMissingParameterError("protocol")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BucketCORSRule struct {
|
||||
AllowedMethods []string
|
||||
// 允许的源站,可以是*
|
||||
AllowedOrigins []string
|
||||
AllowedHeaders []string
|
||||
MaxAgeSeconds int
|
||||
ExposeHeaders []string
|
||||
// 规则区别标识
|
||||
Id string
|
||||
}
|
||||
|
||||
type BucketCORSRules struct {
|
||||
Data []BucketCORSRule `json:"data"`
|
||||
}
|
||||
|
||||
type BucketCORSRuleDeleteInput struct {
|
||||
Id []string
|
||||
}
|
||||
|
||||
type BucketPolicy struct {
|
||||
Data []BucketPolicyStatement
|
||||
}
|
||||
|
||||
type BucketPolicyStatement struct {
|
||||
// 授权的目标主体
|
||||
Principal map[string][]string `json:"Principal,omitempty"`
|
||||
// 授权的行为
|
||||
Action []string `json:"Action,omitempty"`
|
||||
// Allow|Deny
|
||||
Effect string `json:"Effect,omitempty"`
|
||||
// 被授权的资源地址
|
||||
Resource []string `json:"Resource,omitempty"`
|
||||
// 触发授权的条件
|
||||
Condition map[string]map[string]interface{} `json:"Condition,omitempty"`
|
||||
|
||||
// 解析字段,主账号id:子账号id
|
||||
PrincipalId []string
|
||||
// map[主账号id:子账号id]子账号name
|
||||
PrincipalNames map[string]string
|
||||
|
||||
// Read|ReadWrite|FullControl
|
||||
CannedAction string
|
||||
// 资源路径
|
||||
ResourcePath []string
|
||||
// 根据index 生成
|
||||
Id string
|
||||
}
|
||||
|
||||
type BucketPolicyStatementInput struct {
|
||||
// 主账号id:子账号id
|
||||
PrincipalId []string
|
||||
// Read|ReadWrite|FullControl
|
||||
CannedAction string
|
||||
// Allow|Deny
|
||||
Effect string
|
||||
// 被授权的资源地址,/*
|
||||
ResourcePath []string
|
||||
// ip 条件
|
||||
IpEquals []string
|
||||
IpNotEquals []string
|
||||
}
|
||||
|
||||
func (input *BucketPolicyStatementInput) Validate() error {
|
||||
cannedAction := []string{"Read", "ReadWrite", "FullControl"}
|
||||
if !utils.IsInStringArray(input.CannedAction, cannedAction) {
|
||||
return httperrors.NewInputParameterError("invalid CannedAction %s ", input.CannedAction)
|
||||
}
|
||||
if input.Effect != "Allow" && input.Effect != "Deny" {
|
||||
return httperrors.NewInputParameterError("invalid Effect %s ", input.Effect)
|
||||
}
|
||||
for i := range input.IpEquals {
|
||||
if !regutils.MatchIP4Addr(input.IpEquals[i]) && !regutils.MatchCIDR(input.IpEquals[i]) {
|
||||
return httperrors.NewInputParameterError("invalid ipv4 %s ", input.IpEquals[i])
|
||||
}
|
||||
}
|
||||
for i := range input.IpNotEquals {
|
||||
if !regutils.MatchIP4Addr(input.IpNotEquals[i]) && !regutils.MatchCIDR(input.IpNotEquals[i]) {
|
||||
return httperrors.NewInputParameterError("invalid ipv4 %s ", input.IpNotEquals[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BucketPolicyDeleteInput struct {
|
||||
Id []string
|
||||
}
|
||||
|
||||
func (input *BucketCORSRules) Validate() error {
|
||||
for i := range input.Data {
|
||||
if len(input.Data[i].AllowedOrigins) == 0 {
|
||||
return httperrors.NewMissingParameterError("allowed_origins")
|
||||
}
|
||||
if len(input.Data[i].AllowedMethods) == 0 {
|
||||
return httperrors.NewMissingParameterError("allowed_methods")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BucketRefererConf struct {
|
||||
// Referer Type
|
||||
// enmu: Black-List, White-List
|
||||
RefererType string
|
||||
// 域名列表
|
||||
DomainList []string
|
||||
// 是否允许空referer 访问
|
||||
AllowEmptyRefer bool
|
||||
|
||||
// 是否开启
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func (input *BucketRefererConf) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,47 +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
|
||||
|
||||
const (
|
||||
CDN_DOMAIN_STATUS_ONLINE = "online"
|
||||
CDN_DOMAIN_STATUS_OFFLINE = "offline"
|
||||
CDN_DOMAIN_STATUS_PROCESSING = "processing"
|
||||
CDN_DOMAIN_STATUS_REJECTED = "rejected"
|
||||
CDN_DOMAIN_AREA_MAINLAND = "mainland"
|
||||
CDN_DOMAIN_AREA_OVERSEAS = "overseas"
|
||||
CDN_DOMAIN_AREA_GLOBAL = "global"
|
||||
CDN_DOMAIN_ORIGIN_TYPE_DOMAIN = "domain"
|
||||
CDN_DOMAIN_ORIGIN_TYPE_IP = "ip"
|
||||
CDN_DOMAIN_ORIGIN_TYPE_BUCKET = "bucket"
|
||||
)
|
||||
|
||||
type CdnDomain struct {
|
||||
// cdn加速域名
|
||||
Domain string
|
||||
// 状态 rejected(域名未审核)|processing(部署中)|online|offline
|
||||
Status string
|
||||
// 区域 mainland|overseas|global
|
||||
Area string
|
||||
// cdn Cname
|
||||
Cname string
|
||||
// 源站
|
||||
Origin string
|
||||
// 源站类型 domain|ip|bucket
|
||||
OriginType string
|
||||
}
|
||||
|
||||
type CdnDomains struct {
|
||||
Data []CdnDomain `json:"data"`
|
||||
}
|
||||
@@ -191,10 +191,6 @@ type CloudaccountCreateInput struct {
|
||||
|
||||
cloudprovider.SCloudaccount
|
||||
cloudprovider.SCloudaccountCredential
|
||||
|
||||
// 是否启用SAML认证
|
||||
// default: false
|
||||
SAMLAuth *bool `json:"saml_auth"`
|
||||
}
|
||||
|
||||
type CloudaccountShareModeInput struct {
|
||||
@@ -319,8 +315,6 @@ type CloudaccountUpdateInput struct {
|
||||
// 带删除的options key
|
||||
RemoveOptions []string `json:"remove_options"`
|
||||
|
||||
SAMLAuth *bool `json:"saml_auth"`
|
||||
|
||||
proxyapi.ProxySettingResourceInput
|
||||
}
|
||||
|
||||
@@ -334,33 +328,9 @@ type CloudaccountPerformPublicInput struct {
|
||||
|
||||
type CloudaccountPerformPrepareNetsInput struct {
|
||||
CloudaccountCreateInput
|
||||
|
||||
// description: Recommended network subnet mask
|
||||
// example: 24
|
||||
NetworkBits *int8 `json:"network_bits"`
|
||||
// description: The upper limit of host number
|
||||
// example: 254
|
||||
HostNumberUpperLimit *int `json:"host_number_upper_limit"`
|
||||
// description: The lower limit of host number
|
||||
// example: 2
|
||||
HostNumberLowerLimit *int `json:"host_number_lower_limit"`
|
||||
// enum: vcenter,datacenter,cluster
|
||||
WireLevelForVmware string `json:"wire_level_for_vmware"`
|
||||
// description: Whether to directly create the recommended network
|
||||
Create *bool `json:"create"`
|
||||
// description: It is recommended that the name of the network be the same as the native name of vmware
|
||||
OriginNetworkName *bool `json:"origin_network_name"`
|
||||
// description: Created network ip distribution strategy
|
||||
NetworkIpAllocationPolicy string `json:"network_ip_allocation_policy"`
|
||||
// description: zone of wire created
|
||||
WireZone string `json:"wire_zone"`
|
||||
}
|
||||
|
||||
type CloudaccountPerformPrepareNetsOutput struct {
|
||||
CAWireNets []CAWireNet `json:"wire_networks"`
|
||||
}
|
||||
|
||||
type CAWireNet struct {
|
||||
SuggestedWire CAWireConf `json:"suggested_wire"`
|
||||
SuitableWire string `json:"suitable_wire,allowempty"`
|
||||
Hosts []CAHostNet `json:"hosts"`
|
||||
@@ -434,19 +404,13 @@ type EnrollmentAccountQuery struct {
|
||||
|
||||
type GetCloudaccountSamlOutput struct {
|
||||
// cloudaccount SAML ServiceProvider entity ID
|
||||
EntityId string `json:"entity_id,allowempty"`
|
||||
EntityId string `json:"entity_id"`
|
||||
// redirect login URL for this cloudaccount
|
||||
RedirectLoginUrl string `json:"redirect_login_url,allowempty"`
|
||||
RedirectLoginUrl string `json:"redirect_login_url"`
|
||||
// redirect logout URL for this cloudaccount
|
||||
RedirectLogoutUrl string `json:"redirect_logout_url,allowempty"`
|
||||
RedirectLogoutUrl string `json:"redirect_logout_url"`
|
||||
// metadata URL for this cloudaccount
|
||||
MetadataUrl string `json:"metadata_url,allowempty"`
|
||||
MetadataUrl string `json:"metadata_url"`
|
||||
// initial SAML SSO login URL for this cloudaccount
|
||||
InitLoginUrl string `json:"init_login_url,allowempty"`
|
||||
}
|
||||
|
||||
type CloudaccountEnableAutoSyncInput struct {
|
||||
// 云账号状态必须是connected
|
||||
// 最小值为region服务的minimal_sync_interval_seconds
|
||||
SyncIntervalSeconds int `json:"sync_interval_seconds"`
|
||||
InitLoginUrl string `json:"init_login_url"`
|
||||
}
|
||||
|
||||
@@ -60,10 +60,6 @@ const (
|
||||
|
||||
ZSTACK_BRAND_DSTACK = "DStack"
|
||||
ONECLOUD_BRAND_ONECLOUD = "OneCloud"
|
||||
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_VCENTER = "vcenter"
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_DATACENTER = "datacenter"
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_CLUSTER = "cluster"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -99,47 +95,6 @@ var (
|
||||
CLOUD_PROVIDER_GOOGLE,
|
||||
CLOUD_PROVIDER_CTYUN,
|
||||
}
|
||||
|
||||
CLOUD_PROVIDER_HOST_TYPE_MAP = map[string][]string{
|
||||
CLOUD_PROVIDER_ONECLOUD: []string{
|
||||
HOST_TYPE_KVM,
|
||||
HOST_TYPE_BAREMETAL,
|
||||
HOST_TYPE_HYPERVISOR,
|
||||
},
|
||||
CLOUD_PROVIDER_VMWARE: []string{
|
||||
HOST_TYPE_ESXI,
|
||||
},
|
||||
CLOUD_PROVIDER_ALIYUN: []string{
|
||||
HOST_TYPE_ALIYUN,
|
||||
},
|
||||
CLOUD_PROVIDER_QCLOUD: []string{
|
||||
HOST_TYPE_QCLOUD,
|
||||
},
|
||||
CLOUD_PROVIDER_AZURE: []string{
|
||||
HOST_TYPE_AZURE,
|
||||
},
|
||||
CLOUD_PROVIDER_AWS: []string{
|
||||
HOST_TYPE_AWS,
|
||||
},
|
||||
CLOUD_PROVIDER_HUAWEI: []string{
|
||||
HOST_TYPE_HUAWEI,
|
||||
},
|
||||
CLOUD_PROVIDER_OPENSTACK: []string{
|
||||
HOST_TYPE_OPENSTACK,
|
||||
},
|
||||
CLOUD_PROVIDER_UCLOUD: []string{
|
||||
HOST_TYPE_UCLOUD,
|
||||
},
|
||||
CLOUD_PROVIDER_ZSTACK: []string{
|
||||
HOST_TYPE_ZSTACK,
|
||||
},
|
||||
CLOUD_PROVIDER_GOOGLE: []string{
|
||||
HOST_TYPE_GOOGLE,
|
||||
},
|
||||
CLOUD_PROVIDER_CTYUN: []string{
|
||||
HOST_TYPE_CTYUN,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -162,37 +117,4 @@ var (
|
||||
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM,
|
||||
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN,
|
||||
}
|
||||
|
||||
CLOUD_ENV_MAP = map[string]map[string]string{
|
||||
CLOUD_PROVIDER_AZURE: map[string]string{
|
||||
"AzureGermanCloud": CLOUD_ACCESS_ENV_AZURE_GERMAN,
|
||||
"AzureChinaCloud": CLOUD_ACCESS_ENV_AZURE_CHINA,
|
||||
"AzureUSGovernmentCloud": CLOUD_ACCESS_ENV_AZURE_US_GOVERNMENT,
|
||||
"AzurePublicCloud": CLOUD_ACCESS_ENV_AZURE_GLOBAL,
|
||||
},
|
||||
CLOUD_PROVIDER_AWS: map[string]string{
|
||||
"InternationalCloud": CLOUD_ACCESS_ENV_AWS_GLOBAL,
|
||||
"ChinaCloud": CLOUD_ACCESS_ENV_AWS_CHINA,
|
||||
},
|
||||
CLOUD_PROVIDER_HUAWEI: map[string]string{
|
||||
"InternationalCloud": CLOUD_ACCESS_ENV_HUAWEI_GLOBAL,
|
||||
"ChinaCloud": CLOUD_ACCESS_ENV_HUAWEI_CHINA,
|
||||
},
|
||||
CLOUD_PROVIDER_ALIYUN: map[string]string{
|
||||
"InternationalCloud": CLOUD_PROVIDER_ALIYUN,
|
||||
"FinanceCloud": CLOUD_ACCESS_ENV_ALIYUN_FINANCE,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func GetCloudEnv(provider, accessUrl string) string {
|
||||
envMap, ok := CLOUD_ENV_MAP[provider]
|
||||
if !ok {
|
||||
return provider
|
||||
}
|
||||
env, ok := envMap[accessUrl]
|
||||
if !ok {
|
||||
return provider
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
@@ -24,10 +24,11 @@ type DBInstanceCreateInput struct {
|
||||
apis.VirtualResourceCreateInput
|
||||
DeletePreventableCreateInput
|
||||
|
||||
// Ip子网名称或Id,建议使用Id
|
||||
// Ip子网Id
|
||||
// 谷歌云并不实际使用Ip子网,仅仅通过Ip子网确定Vpc
|
||||
// required: true
|
||||
NetworkId string `json:"network_id"`
|
||||
|
||||
// swagger:ignore
|
||||
Network string `json:"network" yunion-deprecated-by:"network_id"`
|
||||
|
||||
@@ -41,17 +42,11 @@ type DBInstanceCreateInput struct {
|
||||
// swagger:ignore
|
||||
MasterInstanceId string
|
||||
|
||||
// 安全组Id列表
|
||||
//
|
||||
//
|
||||
// | 云平台 | 最大支出安全组数量 |
|
||||
// |-------------|----------|
|
||||
// | 腾讯云 | 5 |
|
||||
// | 华为云 | 1 |
|
||||
// | 阿里云 | 不支持|
|
||||
SecgroupIds []string `json:"secgroup_ids"`
|
||||
// 安全组名称或Id
|
||||
// default: default
|
||||
Secgroup string `json:"secgroup"`
|
||||
// swagger:ignore
|
||||
Secgroup string `json:"secgroup" yunion-deprecated-by:"secgroup_ids"`
|
||||
SecgroupId string
|
||||
|
||||
// 主可用区名称或Id, 此参数从指定的套餐所在的可用区获取
|
||||
Zone1 string `json:"zone1"`
|
||||
@@ -65,22 +60,27 @@ type DBInstanceCreateInput struct {
|
||||
// swagger:ignore
|
||||
ZoneId string
|
||||
|
||||
// 区域名称或Id,建议使用Id
|
||||
// swagger:ignore
|
||||
Cloudregion string `json:"cloudregion"`
|
||||
|
||||
// swagger:ignore
|
||||
CloudregionId string
|
||||
|
||||
VpcId string `json:"vpc_id"`
|
||||
|
||||
// swagger:ignore
|
||||
VpcId string
|
||||
Vpc string `json:"vpc" yunion-deprecated-by:"vpc_id"`
|
||||
|
||||
// swagger:ignore
|
||||
ManagerId string
|
||||
|
||||
// swagger:ignore
|
||||
NetworkExternalId string
|
||||
|
||||
// 包年包月时间周期
|
||||
Duration string `json:"duration"`
|
||||
|
||||
// 是否自动续费(仅包年包月时生效)
|
||||
// default: false
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
|
||||
// swagger:ignore
|
||||
ExpiredAt time.Time `json:"expired_at"`
|
||||
|
||||
@@ -110,10 +110,19 @@ type DBInstanceCreateInput struct {
|
||||
//
|
||||
// | 平台 | 支持类型 | 说明 |
|
||||
// | ----- | ------ | --- |
|
||||
// | 华为云 |ha, single, replica| ha: 高可用, single: 单机, replica: 只读|
|
||||
// | 阿里云 |basic, high_availability, always_on, finance|basic: 基础版, high_availability: 高可用, always_on: 集群版, finance: 金融版, 三节点|
|
||||
// | Google |Zonal, Regional | Zonal: 单区域, Regional: 区域级|
|
||||
// | 腾讯云 |fe, ha, basic | ha: 高可用, basic: 基础版, fe: 金融版|
|
||||
// | 华为云 |ha, single, replica| |
|
||||
// | 阿里云 |basic, high_availability, always_on, finance||
|
||||
// | Google |Zonal, Regional | |
|
||||
// 翻译:
|
||||
// basic: 基础版
|
||||
// high_availability: 高可用
|
||||
// always_on: 集群版
|
||||
// finance: 金融版, 三节点
|
||||
// ha: 高可用
|
||||
// single: 单机
|
||||
// replica: 只读
|
||||
// Zonal: 单区域
|
||||
// Regional: 区域级
|
||||
// required: true
|
||||
Category string `json:"category"`
|
||||
|
||||
@@ -121,12 +130,13 @@ type DBInstanceCreateInput struct {
|
||||
//
|
||||
//
|
||||
//
|
||||
// | 平台 | 支持类型 | 说明 |
|
||||
// | ----- | ------ | --- |
|
||||
// | 华为云 |SSD, SAS, SATA| |
|
||||
// | 阿里云 |local_ssd, cloud_essd, cloud_ssd| |
|
||||
// | Google |PD_SSD, PD_HDD| PD_SSD: SSD, PD_HDD: HDD|
|
||||
// | 腾讯云 |cloud_ssd, local_ssd| |
|
||||
// | 平台 | 支持类型 |
|
||||
// | 华为云 |SSD, SAS, SATA|
|
||||
// | 阿里云 |local_ssd, cloud_essd, cloud_ssd|
|
||||
// | Google |PD_SSD, PD_HDD|
|
||||
// 翻译:
|
||||
// PD_SSD: SSD
|
||||
// PD_HDD: HDD
|
||||
// required: true
|
||||
StorageType string `json:"storage_type"`
|
||||
|
||||
@@ -142,7 +152,6 @@ type DBInstanceCreateInput struct {
|
||||
// 阿里云不需要此参数
|
||||
// 华为云会默认创建一个用户,若不传此参数, 则为随机密码
|
||||
// 谷歌云会默认创建一个用户,若不传此参数, 则为随机密码
|
||||
// 腾讯云会默认创建一个用户,若不传此参数, 则为随机密码
|
||||
Password string `json:"password"`
|
||||
|
||||
// 是否不设置初始密码
|
||||
@@ -158,6 +167,9 @@ type DBInstanceCreateInput struct {
|
||||
// 若指定实例套餐,此参数将根据套餐设置
|
||||
VmemSizeMb int `json:"vmem_size_mb"`
|
||||
|
||||
// swagger:ignore
|
||||
Provider string
|
||||
|
||||
// 从备份中创建新实例
|
||||
DBInstancebackupId string `json:"dbinstancebackup_id"`
|
||||
}
|
||||
@@ -166,7 +178,11 @@ type SDBInstanceChangeConfigInput struct {
|
||||
apis.Meta
|
||||
|
||||
InstanceType string
|
||||
VCpuCount int
|
||||
VmemSizeMb int
|
||||
StorageType string
|
||||
DiskSizeGB int
|
||||
Category string
|
||||
}
|
||||
|
||||
type SDBInstanceRecoveryConfigInput struct {
|
||||
@@ -290,8 +306,6 @@ type DBInstanceDetails struct {
|
||||
|
||||
SDBInstance
|
||||
|
||||
Secgroups []apis.StandaloneShortDesc `json:"secgroups"`
|
||||
|
||||
// 安全组名称
|
||||
// example: Default
|
||||
Secgroup string `json:"secgroup"`
|
||||
@@ -346,27 +360,7 @@ type DBInstanceFilterListInput struct {
|
||||
VpcFilterListInput
|
||||
}
|
||||
|
||||
type DBInstanceJoinListInput struct {
|
||||
type DBInstanceNetworkListInput struct {
|
||||
apis.VirtualJointResourceBaseListInput
|
||||
DBInstanceFilterListInput
|
||||
}
|
||||
|
||||
type DBInstanceRemoteUpdateInput struct {
|
||||
// 是否覆盖替换所有标签
|
||||
ReplaceTags *bool `json:"replace_tags" help:"replace all remote tags"`
|
||||
}
|
||||
|
||||
type DBInstanceNetworkListInput struct {
|
||||
DBInstanceJoinListInput
|
||||
|
||||
NetworkFilterListInput
|
||||
}
|
||||
|
||||
type DBInstanceAutoRenewInput struct {
|
||||
// 是否自动续费
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
}
|
||||
|
||||
type DBInstanceSetSecgroupInput struct {
|
||||
SecgroupIds []string `json:"secgroup_ids"`
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ type DBInstanceAccountCreateInput struct {
|
||||
// | ---- |------- |
|
||||
// | Aliyun |MySQL, MariaBD, SQLServer |
|
||||
// | 华为云 |MySQL, MariaBD |
|
||||
// | 腾讯云 |MySQL |
|
||||
// required: true
|
||||
// 阿里云SQL Server 2017集群版不支持创建账号
|
||||
// 实例状态必须是运行中
|
||||
@@ -92,7 +91,3 @@ type DBInstanceAccountDetails struct {
|
||||
|
||||
ProjectId string `json:"tenant_id"`
|
||||
}
|
||||
|
||||
type DBInstanceAccountUpdateInput struct {
|
||||
apis.StatusStandaloneResourceBaseUpdateInput
|
||||
}
|
||||
|
||||
@@ -16,27 +16,20 @@ package compute
|
||||
|
||||
const (
|
||||
//实例状态
|
||||
DBINSTANCE_INIT = "init" //初始化
|
||||
DBINSTANCE_DEPLOYING = "deploying" //部署中
|
||||
DBINSTANCE_RUNNING = "running" //运行中
|
||||
DBINSTANCE_REBOOTING = "rebooting" //重启中
|
||||
DBINSTANCE_MIGRATING = "migrating" //迁移中
|
||||
DBINSTANCE_BACKING_UP = "backing_up" //备份中
|
||||
DBINSTANCE_BACKING_UP_FAILED = "backing_up_failed" //备份失败
|
||||
DBINSTANCE_RESTORING = "restoring" //备份恢复中
|
||||
DBINSTANCE_RESTORE_FAILED = "restore_failed"
|
||||
DBINSTANCE_IMPORTING = "importing" //数据导入中
|
||||
DBINSTANCE_CLONING = "cloning" //克隆中
|
||||
DBINSTANCE_DELETING = "deleting" //删除中
|
||||
DBINSTANCE_DELETE_FAILED = "delete_failed" //删除失败
|
||||
DBINSTANCE_MAINTENANCE = "maintenance" //维护中
|
||||
DBINSTANCE_ISOLATING = "isolating" //隔离中
|
||||
DBINSTANCE_ISOLATE = "isolate" //已隔离
|
||||
DBINSTANCE_UPGRADING = "upgrading" //升级中
|
||||
DBINSTANCE_SET_AUTO_RENEW = "set_auto_renew" //设置自动续费中
|
||||
DBINSTANCE_SET_AUTO_RENEW_FAILED = "set_auto_renew_failed" //设置自动续费失败
|
||||
DBINSTANCE_UNKNOWN = "unknown"
|
||||
DBINSTANCE_SYNC_SECGROUP_FAILED = "sync_secgroup_failed" // 同步安全组失败
|
||||
DBINSTANCE_DEPLOYING = "deploying" //部署中
|
||||
DBINSTANCE_RUNNING = "running" //运行中
|
||||
DBINSTANCE_REBOOTING = "rebooting" //重启中
|
||||
DBINSTANCE_MIGRATING = "migrating" //迁移中
|
||||
DBINSTANCE_BACKING_UP = "backing_up" //备份中
|
||||
DBINSTANCE_BACKING_UP_FAILED = "backing_up_failed" //备份失败
|
||||
DBINSTANCE_RESTORING = "restoring" //备份恢复中
|
||||
DBINSTANCE_RESTORE_FAILED = "restore_failed"
|
||||
DBINSTANCE_IMPORTING = "importing" //数据导入中
|
||||
DBINSTANCE_CLONING = "cloning" //克隆中
|
||||
DBINSTANCE_DELETING = "deleting" //删除中
|
||||
DBINSTANCE_DELETE_FAILED = "delete_failed" //删除失败
|
||||
DBINSTANCE_MAINTENANCE = "maintenance" //维护中
|
||||
DBINSTANCE_UNKNOWN = "unknown"
|
||||
|
||||
DBINSTANCE_CHANGE_CONFIG = "change_config" //调整配置
|
||||
DBINSTANCE_CHANGE_CONFIG_FAILED = "change_config_failed" //调整配置失败
|
||||
@@ -106,11 +99,6 @@ const (
|
||||
ALIYUN_DBINSTANCE_CATEGORY_ALWAYSON = "always_on" //集群版
|
||||
ALIYUN_DBINSTANCE_CATEGORY_FINANCE = "finance" //金融版
|
||||
|
||||
//腾讯云实例类型
|
||||
QCLOUD_DBINSTANCE_CATEGORY_BASIC = "basic" //基础版
|
||||
QCLOUD_DBINSTANCE_CATEGORY_HA = "ha" //高可用
|
||||
QCLOUD_DBINSTANCE_CATEGORY_FINANCE = "fe" //金融版
|
||||
|
||||
//华为云实例类型
|
||||
HUAWEI_DBINSTANCE_CATEGORY_HA = "ha" //主备
|
||||
HUAWEI_DBINSTANCE_CATEGORY_SINGLE = "single" //单机
|
||||
@@ -130,11 +118,6 @@ const (
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGHPRO = "ULTRAHIGHPRO"
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_COMMON = "COMMON"
|
||||
HUAWEI_DBINSTANCE_STORAGE_TYPE_HIGH = "HIGH"
|
||||
|
||||
//腾讯云
|
||||
QCLOUD_DBINSTANCE_STORAGE_TYPE_LOCAL_SSD = "local_ssd" //本地盘SSD盘
|
||||
QCLOUD_DBINSTANCE_STORAGE_TYPE_CLOUD_SSD = "cloud_ssd" //SSD云盘
|
||||
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -145,20 +128,4 @@ var (
|
||||
ALIYUN_SQL_SERVER_DENY_KEYWORD []string = []string{
|
||||
"root", " admin", " eagleye", " master", " aurora", " sa", " sysadmin", " administrator", " mssqld", " public", " securityadmin", " serveradmin", " setupadmin", " processadmin", " diskadmin", " dbcreator", " bulkadmin", " tempdb", " msdb", " model", " distribution", " mssqlsystemresource", " guest", " add", " except", " percent", " all", " exec", " plan", " alter", " execute", " precision", " and", " exists", " primary", " any", " exit", " print", " as", " fetch", " proc", " asc", " file", " procedure", " authorization", " fillfactor", " public", " backup", " for", " raiserror", " begin", " foreign", " read", " between", " freetext", " readtext", " break", " freetexttable", " reconfigure", " browse", " from", " references", " bulk", " full", " replication", " by", " function", " restore", " cascade", " goto", " restrict", " case", " grant", " return", " check", " group", " revoke", " checkpoint", " having", " right", " close", " holdlock", " rollback", " clustered", " identity", " rowcount", " coalesce", " identity_insert", " rowguidcol", " collate", " identitycol", " rule", " column", " if", " save", " commit", " in", " schema", " compute", " index", " select", " constraint", " inner", " session_user", " contains", " insert", " set", " containstable", " intersect", " setuser", " continue", " into", " shutdown", " convert", " is", " some", " create", " join", " statistics", " cross", " key", " system_user", " current", " kill", " table", " current_date", " left", " textsize", " current_time", " like", " then", " current_timestamp", " lineno", " to", " current_user", " load", " top", " cursor", " national", " tran", " database", " nocheck", " transaction", " dbcc", " nonclustered", " trigger", " deallocate", " not", " truncate", " declare", " null", " tsequal", " default", " nullif", " union", " delete", " of", " unique", " deny", " off", " update", " desc", " offsets", " updatetext", " disk", " on", " use", " distinct", " open", " user", " distributed", " opendatasource", " values", " double", " openquery", " varying", " drop", " openrowset", " view", " dummy", " openxml", " waitfor", " dump", " option", " when", " else", " or", " where", " end", " order", " while", " errlvl", " outer", " with", " escape", " over", " writetext", " galaxy",
|
||||
}
|
||||
|
||||
RW_PRIVILEGE_SET = []string{
|
||||
"SELECT", "INSERT", "UPDATE", "DELETE", "CREATE",
|
||||
"DROP", "REFERENCES", "INDEX", "ALTER", "CREATE TEMPORARY TABLES",
|
||||
"LOCK TABLES", "EXECUTE", "CREATE VIEW", "SHOW VIEW", "CREATE ROUTINE",
|
||||
"ALTER ROUTINE", "EVENT", "TRIGGER", "PROCESS", "REPLICATION SLAVE",
|
||||
"REPLICATION CLIENT",
|
||||
}
|
||||
R_PRIVILEGE_SET = []string{"SELECT", "LOCK TABLES", "SHOW VIEW", "PROCESS", "REPLICATION SLAVE", "REPLICATION CLIENT"}
|
||||
QCLOUD_RW_PRIVILEGE_SET = []string{
|
||||
"SELECT", "INSERT", "UPDATE", "DELETE", "CREATE",
|
||||
"DROP", "REFERENCES", "INDEX", "ALTER", "CREATE TEMPORARY TABLES",
|
||||
"LOCK TABLES", "EXECUTE", "CREATE VIEW", "SHOW VIEW", "CREATE ROUTINE",
|
||||
"ALTER ROUTINE", "EVENT", "TRIGGER",
|
||||
}
|
||||
QCLOUD_R_PRIVILEGE_SET = []string{"SELECT", "LOCK TABLES", "SHOW VIEW"}
|
||||
)
|
||||
|
||||
@@ -44,7 +44,6 @@ type DBInstanceDatabaseCreateInput struct {
|
||||
// | ---- |------- |
|
||||
// | Aliyun |MySQL, MariaBD, SQLServer |
|
||||
// | 华为云 |MySQL, MariaBD |
|
||||
// | 腾讯云 | |
|
||||
// required: true
|
||||
// 阿里云SQL Server 2017集群版不支持创建数据库
|
||||
// 阿里云只读实例不支持创建数据库
|
||||
@@ -80,7 +79,3 @@ type DBInstanceparameterDetails struct {
|
||||
|
||||
SDBInstanceParameter
|
||||
}
|
||||
|
||||
type DBInstanceDatabaseUpdateInput struct {
|
||||
apis.StatusStandaloneResourceBaseUpdateInput
|
||||
}
|
||||
|
||||
@@ -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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type DBInstanceSecgroupListInput struct {
|
||||
DBInstanceJoinListInput
|
||||
|
||||
SecgroupFilterListInput
|
||||
}
|
||||
|
||||
type DBInstanceSecgroupDetails struct {
|
||||
apis.VirtualJointResourceBaseDetails
|
||||
|
||||
// RDS名称
|
||||
DBInstance string `json:"dbinstance"`
|
||||
// 安全组名称
|
||||
Secgroup string `json:"secgroup"`
|
||||
}
|
||||
@@ -21,10 +21,6 @@ type DBInstanceSkuDetails struct {
|
||||
CloudregionResourceInfo
|
||||
|
||||
SDBInstanceSku
|
||||
|
||||
// 云环境
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
|
||||
Zone1Name string `json:"zone1_name"`
|
||||
Zone2Name string `json:"zone2_name"`
|
||||
Zone3Name string `json:"zone3_name"`
|
||||
|
||||
@@ -16,5 +16,4 @@ package compute
|
||||
|
||||
const (
|
||||
DBINSTANCE_SKU_AVAILABLE = "available"
|
||||
DBINSTANCE_SKU_SOLDOUT = "soldout"
|
||||
)
|
||||
|
||||
@@ -124,8 +124,6 @@ type DnsZoneDetails struct {
|
||||
DnsRecordsetCount int `json:"dns_recordset_count"`
|
||||
// 关联vpc数量
|
||||
VpcCount int `json:"vpc_count"`
|
||||
// Cache info
|
||||
CloudCaches []DnsZoneCacheDetails `json:"cloud_caches"`
|
||||
}
|
||||
|
||||
type DnsZoneListInput struct {
|
||||
|
||||
@@ -30,7 +30,6 @@ type DnsZoneCacheCreateInput struct {
|
||||
|
||||
type DnsZoneCacheDetails struct {
|
||||
apis.StatusStandaloneResourceDetails
|
||||
SDnsZoneCache
|
||||
|
||||
Account string
|
||||
Brand string
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type ElasticcacheDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
@@ -29,12 +25,6 @@ type ElasticcacheDetails struct {
|
||||
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
|
||||
// 关联安全组列表
|
||||
Secgroups []apis.StandaloneShortDesc `json:"secgroups"`
|
||||
|
||||
// 备可用区列表
|
||||
SlaveZoneInfos []apis.StandaloneShortDesc `json:"slave_zone_infos"`
|
||||
}
|
||||
|
||||
type ElasticcacheResourceInfo struct {
|
||||
@@ -104,127 +94,3 @@ type ElasticcacheParameterDetails struct {
|
||||
|
||||
type ElasticcacheSyncstatusInput struct {
|
||||
}
|
||||
|
||||
type ElasticcacheRemoteUpdateInput struct {
|
||||
// 是否覆盖替换所有标签
|
||||
ReplaceTags *bool `json:"replace_tags" help:"replace all remote tags"`
|
||||
}
|
||||
|
||||
//type SElasticcacheJointsBase struct {
|
||||
// apis.SVirtualJointResourceBase
|
||||
// // 弹性缓存实例(ID or Name)
|
||||
// ElasticcacheId string `json:"elasticcache_id"`
|
||||
//}
|
||||
|
||||
type ElasticcacheJointResourceDetails struct {
|
||||
apis.VirtualJointResourceBaseDetails
|
||||
|
||||
// 弹性缓存实例名称
|
||||
Elasticcache string `json:"elasticcache"`
|
||||
// 弹性缓存实例ID
|
||||
ElasticcacheId string `json:"elasticcache_id"`
|
||||
}
|
||||
|
||||
type ElasticcacheJointsListInput struct {
|
||||
apis.VirtualJointResourceBaseListInput
|
||||
|
||||
ElasticcacheFilterListInput
|
||||
}
|
||||
|
||||
type ElasticcacheJointBaseUpdateInput struct {
|
||||
apis.VirtualJointResourceBaseUpdateInput
|
||||
}
|
||||
|
||||
type ElasticcacheSecgroupsInput struct {
|
||||
// 安全组Id列表
|
||||
// 实例必须处于运行状态
|
||||
//
|
||||
//
|
||||
// | 平台 | 最多绑定安全组数量 |
|
||||
// |-------------|------------------- |
|
||||
// | 腾讯云 | 10 |
|
||||
// | 华为云 | 不支持安全组 |
|
||||
// | 阿里云 | 不支持安全组 |
|
||||
SecgroupIds []string `json:"secgroup_ids"`
|
||||
}
|
||||
|
||||
type ElasticcacheCreateInput struct {
|
||||
apis.VirtualResourceCreateInput
|
||||
|
||||
// 安全组列表
|
||||
// 腾讯云需要传此参数
|
||||
// required: false
|
||||
ElasticcacheSecgroupsInput
|
||||
|
||||
// 主可用区名称或Id
|
||||
Zone string `json:"zone"`
|
||||
|
||||
// 备可用区名称或Id列表
|
||||
// 默认副本与主可用区一致
|
||||
// 支持此参数的云厂商: 腾讯云
|
||||
// required: false
|
||||
SlaveZones []string `json:"slave_zones"`
|
||||
|
||||
// Ip子网名称或Id,建议使用Id
|
||||
// required: true
|
||||
Network string `json:"network"`
|
||||
|
||||
// 网络类型
|
||||
// enum: vpc, cLassic
|
||||
// required: true
|
||||
NetworkType string `json:"network_type"`
|
||||
|
||||
// 弹性缓存Engine
|
||||
// enum: redis, memcache
|
||||
// required: true
|
||||
Engine string `json:"engine"`
|
||||
|
||||
// 弹性缓存Engine版本
|
||||
// required: false
|
||||
EngineVersion string `json:"engine_version"`
|
||||
|
||||
// 实例规格
|
||||
// required: false
|
||||
InstanceType string `json:"instance_type"`
|
||||
|
||||
// 初始密码
|
||||
// required: false
|
||||
Password string `json:"password"`
|
||||
|
||||
// 安全组名称或Id
|
||||
// default: default
|
||||
Secgroup string `json:"secgroup"`
|
||||
|
||||
// 内网IP
|
||||
// 阿里云、华为云此参数可选,其它公有云该参数无效
|
||||
// required: false
|
||||
PrivateIp string `json:"private_ip"`
|
||||
|
||||
// swagger:ignore
|
||||
VpcId string
|
||||
|
||||
// swagger:ignore
|
||||
ManagerId string
|
||||
|
||||
// 包年包月时间周期
|
||||
Duration string `json:"duration"`
|
||||
|
||||
// 是否自动续费(仅包年包月时生效)
|
||||
// default: false
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
|
||||
// swagger:ignore
|
||||
ExpiredAt time.Time `json:"expired_at"`
|
||||
|
||||
// 计费方式
|
||||
// enum: postpaid, prepaid
|
||||
BillingType string
|
||||
// swagger:ignore
|
||||
BillingCycle string
|
||||
|
||||
// 弹性缓存维护时间段
|
||||
// 华为云此参数可选,其它云该参数无效
|
||||
// enum: 22:00:00, 02:00:00, 06:00:00, 10:00:00, 14:00:00, 18:00:00
|
||||
// required: false
|
||||
MaintainStartTime string `json:"maintain_start_time"`
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ const (
|
||||
ELASTIC_CACHE_STATUS_INACTIVE = "inactive" //(被禁用)
|
||||
ELASTIC_CACHE_STATUS_FLUSHING = "flushing" //(清除中)
|
||||
ELASTIC_CACHE_STATUS_FLUSHING_FAILED = "flushing_failed" //(清除失败)
|
||||
ELASTIC_CACHE_STATUS_RELEASING = "releasing" //(释放中)
|
||||
ELASTIC_CACHE_STATUS_RELEASED = "released" //(已释放)
|
||||
ELASTIC_CACHE_STATUS_RELEASE_FAILED = "release_failed" //(释放失败)
|
||||
ELASTIC_CACHE_STATUS_TRANSFORMING = "transforming" //(转换中)
|
||||
@@ -44,10 +43,6 @@ const (
|
||||
ELASTIC_CACHE_STATUS_UNKNOWN = "unknown" //(未知状态)
|
||||
ELASTIC_CACHE_STATUS_SYNCING = "syncing" //(同步中)
|
||||
ELASTIC_CACHE_STATUS_SYNC_FAILED = "sync_failed" //(同步失败)
|
||||
ELASTIC_CACHE_RENEWING = "renewing" //(续费中)
|
||||
ELASTIC_CACHE_RENEW_FAILED = "renew_failed" //(续费失败)
|
||||
ELASTIC_CACHE_SET_AUTO_RENEW = "set_auto_renew" //(设置自动续费)
|
||||
ELASTIC_CACHE_SET_AUTO_RENEW_FAILED = "set_auto_renew_failed" //(设置自动续费失败)
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -57,7 +52,6 @@ const (
|
||||
ELASTIC_CACHE_ACCOUNT_STATUS_CREATE_FAILED = "create_failed" //(创建失败)
|
||||
ELASTIC_CACHE_ACCOUNT_STATUS_DELETING = "deleting" // 删除中
|
||||
ELASTIC_CACHE_ACCOUNT_STATUS_DELETE_FAILED = "delete_failed" // 删除失败
|
||||
ELASTIC_CACHE_ACCOUNT_STATUS_DELETED = "deleted" // 已删除
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -20,10 +20,6 @@ type ElasticcacheSkuDetails struct {
|
||||
apis.StatusStandaloneResourceDetails
|
||||
CloudregionResourceInfo
|
||||
ZoneResourceInfoBase
|
||||
SlaveZoneResourceInfoBase
|
||||
|
||||
SElasticcacheSku
|
||||
|
||||
// 云环境
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
}
|
||||
|
||||
@@ -69,9 +69,6 @@ type SElasticipCreateInput struct {
|
||||
NetworkId string `json:"network_id"`
|
||||
// 指定新建EIP的地址
|
||||
IpAddr string `json:"ip_addr"`
|
||||
|
||||
// description: BgpType for the new eip
|
||||
BgpType string `json:"bgp_type"`
|
||||
}
|
||||
|
||||
type ElasticipDetails struct {
|
||||
|
||||
@@ -53,10 +53,8 @@ type ServerListInput struct {
|
||||
Hypervisor []string `json:"hypervisor"`
|
||||
// 列出绑定了弹性IP(EIP)的主机
|
||||
WithEip *bool `json:"with_eip"`
|
||||
// 列出未绑定弹性IP(EIP)的主机
|
||||
// 列出未绑定弹性IP(EIO)的主机
|
||||
WithoutEip *bool `json:"without_eip"`
|
||||
// 列出可绑定弹性IP的主机
|
||||
EipAssociable *bool `json:"eip_associable"`
|
||||
// 列出操作系统为指定值的主机
|
||||
// enum: linux,windows,vmware
|
||||
OsType []string `json:"os_type"`
|
||||
@@ -209,8 +207,6 @@ type ServerDetails struct {
|
||||
// IP地址列表字符串
|
||||
// example: 10.165.2.1,172.16.8.1
|
||||
IPs string `json:"ips"`
|
||||
// mac地址信息
|
||||
Macs string `json:"macs"`
|
||||
// 网卡信息
|
||||
Nics []GuestnetworkShortDesc `json:"nics"`
|
||||
|
||||
@@ -441,9 +437,3 @@ type ServerDissociateEipInput struct {
|
||||
// 是否自动释放
|
||||
AudoDelete *bool `json:"auto_delete"`
|
||||
}
|
||||
|
||||
type ServerResetInput struct {
|
||||
InstanceSnapshot string `json:"instance_snapshot"`
|
||||
// 自动启动
|
||||
AutoStart *bool `json:"auto_start"`
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ type SimpleSnapshot struct {
|
||||
|
||||
type InstanceSnapshotDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
ManagedResourceInfo
|
||||
SInstanceSnapshot
|
||||
|
||||
// 云主机状态
|
||||
@@ -58,8 +57,6 @@ type InstanceSnapshotDetails struct {
|
||||
|
||||
type InstanceSnapshotListInput struct {
|
||||
apis.VirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
ManagedResourceListInput
|
||||
|
||||
ServerFilterListInput
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ type LoadbalancerListenerListInput struct {
|
||||
apis.VirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
LoadbalancerFilterListInput
|
||||
// filter by acl
|
||||
LoadbalancerAclResourceInput
|
||||
|
||||
// filter by backend_group
|
||||
BackendGroup string `json:"backend_group"`
|
||||
// filter by acl
|
||||
Acl string `json:"acl"`
|
||||
|
||||
ListenerType []string `json:"listener_type"`
|
||||
ListenerPort []int `json:"listener_port"`
|
||||
@@ -74,7 +74,6 @@ type LoadbalancerListenerRuleListInput struct {
|
||||
type LoadbalancerListInput struct {
|
||||
apis.VirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
apis.DeletePreventableResourceBaseListInput
|
||||
|
||||
VpcFilterListInput
|
||||
ZonalFilterListBase
|
||||
@@ -104,7 +103,7 @@ type LoadbalancerAgentListInput struct {
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateListInput struct {
|
||||
apis.SharableVirtualResourceListInput
|
||||
apis.VirtualResourceListInput
|
||||
apis.ExternalizedResourceBaseListInput
|
||||
|
||||
UsableResourceListInput
|
||||
@@ -175,7 +174,6 @@ type LoadbalancerDetails struct {
|
||||
|
||||
VpcResourceInfoBase
|
||||
ZoneResourceInfoBase
|
||||
Zone1ResourceInfoBase
|
||||
NetworkResourceInfoBase
|
||||
|
||||
SLoadbalancer
|
||||
@@ -245,9 +243,6 @@ type LoadbalancerCreateInput struct {
|
||||
// 计费类型
|
||||
ChargeType string `json:"charge_type"`
|
||||
|
||||
// 出口带宽
|
||||
EgressMbps int `json:"egress_mbps"`
|
||||
|
||||
// 套餐名称
|
||||
LoadbalancerSpec string `json:"loadbalancer_spec"`
|
||||
|
||||
@@ -257,10 +252,6 @@ type LoadbalancerCreateInput struct {
|
||||
// LB的其他配置信息
|
||||
LBInfo jsonutils.JSONObject `json:"lb_info"`
|
||||
|
||||
// 从可用区1
|
||||
// required: false
|
||||
Zone1 string `json:"zone_1"`
|
||||
|
||||
// SLoadbalancer
|
||||
|
||||
VpcResourceInput
|
||||
@@ -274,8 +265,3 @@ type LoadbalancerCreateInput struct {
|
||||
CloudproviderResourceInput
|
||||
// Manager string `json:"manager"`
|
||||
}
|
||||
|
||||
type LoadbalancerRemoteUpdateInput struct {
|
||||
// 是否覆盖替换所有标签
|
||||
ReplaceTags *bool `json:"replace_tags" help:"replace all remote tags"`
|
||||
}
|
||||
|
||||
@@ -17,10 +17,8 @@ package compute
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerCertificateDetails struct {
|
||||
apis.SharableVirtualResourceDetails
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancerCertificate
|
||||
|
||||
LbListenerCount int `json:"lb_listener_count"`
|
||||
}
|
||||
|
||||
type LoadbalancerCertificateResourceInfo struct {
|
||||
|
||||
@@ -69,7 +69,6 @@ type NetworkListInput struct {
|
||||
WireFilterListInput
|
||||
|
||||
HostResourceInput
|
||||
StorageResourceInput
|
||||
|
||||
UsableResourceListInput
|
||||
|
||||
@@ -118,9 +117,6 @@ type NetworkListInput struct {
|
||||
|
||||
// filter by Host schedtag
|
||||
HostSchedtagId string `json:"host_schedtag_id"`
|
||||
|
||||
// filter by BGP types
|
||||
BgpType []string `json:"bgp_type"`
|
||||
}
|
||||
|
||||
type NetworkResourceInfoBase struct {
|
||||
@@ -197,9 +193,6 @@ type NetworkCreateInput struct {
|
||||
|
||||
// deprecated
|
||||
Vlan *int `json:"vlan" yunion-deprecated-by:"vlan_id"`
|
||||
|
||||
// 线路类型
|
||||
BgpType string `json:"bgp_type"`
|
||||
}
|
||||
|
||||
type NetworkDetails struct {
|
||||
@@ -336,12 +329,3 @@ type GetNetworkAddressesOutput struct {
|
||||
// IP子网地址记录
|
||||
Addresses []SNetworkAddress `json:"addresses"`
|
||||
}
|
||||
|
||||
type NetworkSetBgpTypeInput struct {
|
||||
apis.Meta
|
||||
|
||||
// description: new BgpType name
|
||||
// required: true
|
||||
// example: ChinaTelecom, BGP, etc.
|
||||
BgpType string `json:"bgp_type"`
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ type SchedtagFilterListInput struct {
|
||||
type SchedtagListInput struct {
|
||||
apis.StandaloneResourceListInput
|
||||
apis.ScopedResourceBaseListInput
|
||||
CloudproviderResourceInput
|
||||
|
||||
// fitler by resource_type
|
||||
ResourceType []string `json:"resource_type"`
|
||||
@@ -110,7 +109,3 @@ type SchedtagJointsListInput struct {
|
||||
apis.JointResourceBaseListInput
|
||||
SchedtagFilterListInput
|
||||
}
|
||||
|
||||
type SchedtagSetResourceInput struct {
|
||||
ResourceIds []string `json:"resource_ids"`
|
||||
}
|
||||
|
||||
@@ -23,9 +23,6 @@ import (
|
||||
type ScheduledTaskDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SScheduledTask
|
||||
|
||||
// 描述
|
||||
TimerDesc string `json:"timer_desc"`
|
||||
// 定时方式触发
|
||||
Timer TimerDetails `json:"timer"`
|
||||
// 周期方式触发
|
||||
|
||||
@@ -134,9 +134,6 @@ type SecgroupListInput struct {
|
||||
|
||||
ServerFilterListInput
|
||||
|
||||
DBInstanceResourceInput
|
||||
ELasticcacheResourceInput
|
||||
|
||||
// equals
|
||||
Equals string
|
||||
|
||||
@@ -243,11 +240,6 @@ type GuestsecgroupListInput struct {
|
||||
SecgroupFilterListInput
|
||||
}
|
||||
|
||||
type ElasticcachesecgroupListInput struct {
|
||||
ElasticcacheJointsListInput
|
||||
SecgroupFilterListInput
|
||||
}
|
||||
|
||||
type GuestsecgroupDetails struct {
|
||||
GuestJointResourceDetails
|
||||
|
||||
@@ -257,20 +249,6 @@ type GuestsecgroupDetails struct {
|
||||
Secgroup string `json:"secgroup"`
|
||||
}
|
||||
|
||||
//type SElasticcachesecgroup struct {
|
||||
// SElasticcacheJointsBase
|
||||
// SSecurityGroupResourceBase
|
||||
//}
|
||||
|
||||
type ElasticcachesecgroupDetails struct {
|
||||
ElasticcacheJointResourceDetails
|
||||
|
||||
SElasticcachesecgroup
|
||||
|
||||
// 安全组名称
|
||||
Secgroup string `json:"secgroup"`
|
||||
}
|
||||
|
||||
type SecgroupMergeInput struct {
|
||||
// 安全组id列表
|
||||
SecgroupIds []string `json:"secgroup_ids"`
|
||||
@@ -282,12 +260,3 @@ type SecgroupMergeInput struct {
|
||||
|
||||
type SecurityGroupPurgeInput struct {
|
||||
}
|
||||
|
||||
type SecurityGroupCloneInput struct {
|
||||
Name string
|
||||
Description string
|
||||
}
|
||||
|
||||
type SecgroupImportRulesInput struct {
|
||||
Rules []SSecgroupRuleCreateInput `json:"rules"`
|
||||
}
|
||||
|
||||
@@ -19,15 +19,23 @@ import (
|
||||
)
|
||||
|
||||
type ServerSkuCreateInput struct {
|
||||
apis.EnabledStatusStandaloneResourceCreateInput
|
||||
apis.StatusStandaloneResourceCreateInput
|
||||
|
||||
// 区域名称或Id,建议使用Id
|
||||
// default: default
|
||||
CloudregionId string `json:"cloudregion_id"`
|
||||
Cloudregion string `json:"cloudregion"`
|
||||
// swagger:ignore
|
||||
CloudregionId string
|
||||
|
||||
// 可用区名称或Id, 建议使用Id
|
||||
// required: false
|
||||
ZoneId string `json:"zone_id"`
|
||||
Zone string `json:"zone"`
|
||||
// swagger:ignore
|
||||
ZoneId string
|
||||
|
||||
// 是否启用
|
||||
// default: true
|
||||
Enabled *bool `json:"enabled"`
|
||||
|
||||
// swagger:ignore
|
||||
InstanceTypeFamily string
|
||||
@@ -124,28 +132,18 @@ type ServerSkuCreateInput struct {
|
||||
}
|
||||
|
||||
type ServerSkuDetails struct {
|
||||
apis.EnabledStatusStandaloneResourceDetails
|
||||
apis.StatusStandaloneResourceDetails
|
||||
|
||||
ZoneResourceInfo
|
||||
|
||||
SServerSku
|
||||
|
||||
// 云环境
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
|
||||
// 绑定云主机数量
|
||||
TotalGuestCount int `json:"total_guest_count"`
|
||||
}
|
||||
|
||||
type ServerSkuUpdateInput struct {
|
||||
apis.EnabledStatusStandaloneResourceBaseUpdateInput
|
||||
|
||||
// 预付费状态
|
||||
// default: available
|
||||
PrepaidStatus string `json:"prepaid_status"`
|
||||
// 后付费状态
|
||||
// default: available
|
||||
PostpaidStatus string `json:"postpaid_status"`
|
||||
apis.StatusStandaloneResourceBaseUpdateInput
|
||||
|
||||
InstanceTypeFamily string `json:"instance_type_family"`
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ var SKU_FAMILIES = []string{
|
||||
}
|
||||
|
||||
type ServerSkuListInput struct {
|
||||
apis.EnabledStatusStandaloneResourceListInput
|
||||
apis.StatusStandaloneResourceListInput
|
||||
apis.DomainizedResourceListInput
|
||||
|
||||
ManagedResourceListInput
|
||||
|
||||
@@ -19,12 +19,12 @@ import "yunion.io/x/onecloud/pkg/apis"
|
||||
type SnapshotCreateInput struct {
|
||||
apis.VirtualResourceCreateInput
|
||||
|
||||
// 磁盘Id
|
||||
// 磁盘名称或Id,建议使用Id
|
||||
// 目前仅VMware平台不支持创建快照,其余平台磁盘均支持创建快照
|
||||
// required: true
|
||||
DiskId string `json:"disk_id"`
|
||||
Disk string `json:"disk"`
|
||||
// swagger:ignore
|
||||
Disk string `json:"disk" yunion-deprecated-by:"disk_id"`
|
||||
DiskId string `json:"disk_id"`
|
||||
// swagger:ignore
|
||||
StorageId string `json:"storage_id"`
|
||||
// swagger:ignore
|
||||
|
||||
@@ -45,11 +45,9 @@ const (
|
||||
SNAPSHOT_POLICY_DISK_DELETE_FAILED = "delete_failed"
|
||||
|
||||
INSTANCE_SNAPSHOT_READY = "ready"
|
||||
INSTANCE_SNAPSHOT_UNKNOWN = "unknown"
|
||||
INSTANCE_SNAPSHOT_FAILED = "instance_snapshot_create_failed"
|
||||
INSTANCE_SNAPSHOT_START_DELETE = "instance_snapshot_start_delete"
|
||||
INSTANCE_SNAPSHOT_DELETE_FAILED = "instance_snapshot_delete_failed"
|
||||
INSTANCE_SNAPSHOT_RESET = "instance_snapshot_reset"
|
||||
|
||||
SNAPSHOT_POLICY_CACHE_STATUS_READY = "ready"
|
||||
SNAPSHOT_POLICY_CACHE_STATUS_DELETING = "deleting"
|
||||
|
||||
@@ -44,9 +44,7 @@ const (
|
||||
|
||||
// aws storage type
|
||||
STORAGE_GP2_SSD = "gp2" // aws general purpose ssd
|
||||
STORAGE_GP3_SSD = "gp3" // aws General Purpose SSD (gp3)
|
||||
STORAGE_IO1_SSD = "io1" // aws Provisioned IOPS SSD
|
||||
STORAGE_IO2_SSD = "io2" // aws Provisioned IOPS 2 SSD
|
||||
STORAGE_ST1_HDD = "st1" // aws Throughput Optimized HDD
|
||||
STORAGE_SC1_HDD = "sc1" // aws Cold HDD
|
||||
STORAGE_STANDARD_HDD = "standard" // aws Magnetic volumes
|
||||
@@ -126,7 +124,7 @@ var (
|
||||
STORAGE_PUBLIC_CLOUD, STORAGE_CLOUD_SSD, STORAGE_CLOUD_ESSD, STORAGE_CLOUD_ESSD_PL2, STORAGE_CLOUD_ESSD_PL3,
|
||||
STORAGE_EPHEMERAL_SSD, STORAGE_CLOUD_EFFICIENCY,
|
||||
STORAGE_STANDARD_LRS, STORAGE_STANDARDSSD_LRS, STORAGE_PREMIUM_LRS,
|
||||
STORAGE_GP2_SSD, STORAGE_GP3_SSD, STORAGE_IO1_SSD, STORAGE_ST1_HDD, STORAGE_SC1_HDD, STORAGE_STANDARD_HDD,
|
||||
STORAGE_GP2_SSD, STORAGE_IO1_SSD, STORAGE_ST1_HDD, STORAGE_SC1_HDD, STORAGE_STANDARD_HDD,
|
||||
STORAGE_LOCAL_BASIC, STORAGE_LOCAL_SSD, STORAGE_CLOUD_BASIC, STORAGE_CLOUD_PREMIUM,
|
||||
STORAGE_HUAWEI_SSD, STORAGE_HUAWEI_SAS, STORAGE_HUAWEI_SATA,
|
||||
STORAGE_OPENSTACK_ISCSI, STORAGE_UCLOUD_CLOUD_NORMAL, STORAGE_UCLOUD_CLOUD_SSD,
|
||||
@@ -145,25 +143,6 @@ var (
|
||||
SHARED_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS, STORAGE_RBD}
|
||||
)
|
||||
|
||||
func IsDiskTypeMatch(t1, t2 string) bool {
|
||||
switch t1 {
|
||||
case DISK_TYPE_ROTATE:
|
||||
if t2 == DISK_TYPE_SSD {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
case DISK_TYPE_SSD:
|
||||
if t2 == DISK_TYPE_ROTATE {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
type StorageResourceInput struct {
|
||||
// 存储(ID或Name)
|
||||
StorageId string `json:"storage_id"`
|
||||
|
||||
@@ -88,31 +88,13 @@ type ZoneDetails struct {
|
||||
|
||||
type ZoneResourceInfoBase struct {
|
||||
// 可用区名称
|
||||
// example: 北京一区
|
||||
// example: zone1
|
||||
Zone string `json:"zone"`
|
||||
|
||||
// 纳管云的zoneId
|
||||
ZoneExtId string `json:"zone_ext_id"`
|
||||
}
|
||||
|
||||
type Zone1ResourceInfoBase struct {
|
||||
// 可用区名称
|
||||
// example: 北京2区
|
||||
Zone1Name string `json:"zone_1_name"`
|
||||
|
||||
// 纳管云的zoneId
|
||||
Zone1ExtId string `json:"zone_1_ext_id"`
|
||||
}
|
||||
|
||||
type SlaveZoneResourceInfoBase struct {
|
||||
// 可用区名称
|
||||
// example: 北京2区
|
||||
SlaveZone string `json:"slave_zone"`
|
||||
|
||||
// 纳管云的zoneId
|
||||
SlaveZoneExtId string `json:"slave_zone_ext_id"`
|
||||
}
|
||||
|
||||
type ZoneResourceInfo struct {
|
||||
ZoneResourceInfoBase
|
||||
|
||||
|
||||
@@ -202,7 +202,6 @@ type SCloudaccount struct {
|
||||
ProxySettingId string `json:"proxy_setting_id"`
|
||||
// 公有云子账号登录地址
|
||||
IamLoginUrl string `json:"iam_login_url"`
|
||||
SAMLAuth *bool `json:"saml_auth,omitempty"`
|
||||
}
|
||||
|
||||
// SCloudprovider is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudprovider.
|
||||
@@ -258,11 +257,6 @@ type SCloudproviderQuota struct {
|
||||
QuotaType string `json:"quota_type"`
|
||||
}
|
||||
|
||||
// SCloudproviderResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderResourceBase.
|
||||
type SCloudproviderResourceBase struct {
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
}
|
||||
|
||||
// SCloudproviderregion is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderregion.
|
||||
type SCloudproviderregion struct {
|
||||
apis.SJointResourceBase
|
||||
@@ -277,12 +271,6 @@ type SCloudproviderregion struct {
|
||||
LastAutoSyncAt time.Time `json:"last_auto_sync_at"`
|
||||
}
|
||||
|
||||
// SCloudproviderschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderschedtag.
|
||||
type SCloudproviderschedtag struct {
|
||||
SSchedtagJointsBase
|
||||
SCloudproviderResourceBase
|
||||
}
|
||||
|
||||
// SCloudregion is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudregion.
|
||||
type SCloudregion struct {
|
||||
apis.SEnabledStatusStandaloneResourceBase
|
||||
@@ -303,12 +291,6 @@ type SCloudregionResourceBase struct {
|
||||
CloudregionId string `json:"cloudregion_id"`
|
||||
}
|
||||
|
||||
// SCloudregionschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudregionschedtag.
|
||||
type SCloudregionschedtag struct {
|
||||
SSchedtagJointsBase
|
||||
SCloudregionResourceBase
|
||||
}
|
||||
|
||||
// SDBInstance is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstance.
|
||||
type SDBInstance struct {
|
||||
apis.SVirtualResourceBase
|
||||
@@ -348,6 +330,9 @@ type SDBInstance struct {
|
||||
InstanceType string `json:"instance_type"`
|
||||
// 维护时间
|
||||
MaintainTime string `json:"maintain_time"`
|
||||
// 安全组Id
|
||||
// example: default
|
||||
SecgroupId string `json:"secgroup_id"`
|
||||
// 虚拟私有网络Id
|
||||
// example: ed20d84e-3158-41b1-870c-1725e412e8b6
|
||||
VpcId string `json:"vpc_id"`
|
||||
@@ -366,7 +351,7 @@ type SDBInstance struct {
|
||||
// SDBInstanceAccount is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceAccount.
|
||||
type SDBInstanceAccount struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
Host string `json:"host"`
|
||||
apis.SExternalizedResourceBase
|
||||
SDBInstanceResourceBase
|
||||
// 数据库密码
|
||||
Secret string `json:"secret"`
|
||||
@@ -447,12 +432,6 @@ type SDBInstanceResourceBase struct {
|
||||
DBInstanceId string `json:"dbinstance_id"`
|
||||
}
|
||||
|
||||
// SDBInstanceSecgroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceSecgroup.
|
||||
type SDBInstanceSecgroup struct {
|
||||
SDBInstanceJointsBase
|
||||
SSecurityGroupResourceBase
|
||||
}
|
||||
|
||||
// SDBInstanceSku is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstanceSku.
|
||||
type SDBInstanceSku struct {
|
||||
apis.SEnabledStatusStandaloneResourceBase
|
||||
@@ -517,8 +496,6 @@ type SDisk struct {
|
||||
// swap: 交换盘
|
||||
// example: sys
|
||||
DiskType string `json:"disk_type"`
|
||||
// cpu架构
|
||||
OsArch string `json:"os_arch"`
|
||||
// # is persistent
|
||||
Nonpersistent bool `json:"nonpersistent"`
|
||||
// 是否标记为SSD磁盘
|
||||
@@ -701,12 +678,6 @@ type SElasticcacheBackup struct {
|
||||
EndTime time.Time `json:"end_time"`
|
||||
}
|
||||
|
||||
// SElasticcacheJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcacheJointsBase.
|
||||
type SElasticcacheJointsBase struct {
|
||||
apis.SVirtualJointResourceBase
|
||||
SElasticcacheResourceBase
|
||||
}
|
||||
|
||||
// SElasticcacheParameter is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcacheParameter.
|
||||
type SElasticcacheParameter struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
@@ -781,12 +752,6 @@ type SElasticcacheSku struct {
|
||||
Provider string `json:"provider"`
|
||||
}
|
||||
|
||||
// SElasticcachesecgroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticcachesecgroup.
|
||||
type SElasticcachesecgroup struct {
|
||||
SElasticcacheJointsBase
|
||||
SSecurityGroupResourceBase
|
||||
}
|
||||
|
||||
// SElasticip is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SElasticip.
|
||||
type SElasticip struct {
|
||||
apis.SVirtualResourceBase
|
||||
@@ -814,7 +779,7 @@ type SElasticip struct {
|
||||
// 计费类型: 流量、带宽
|
||||
// example: bandwidth
|
||||
ChargeType string `json:"charge_type"`
|
||||
// 线路类型
|
||||
// 目前只有华为云此字段是必需填写的
|
||||
BgpType string `json:"bgp_type"`
|
||||
// 是否跟随主机删除而自动释放
|
||||
AutoDellocate *bool `json:"auto_dellocate,omitempty"`
|
||||
@@ -920,9 +885,6 @@ type SGuest struct {
|
||||
// 虚拟化技术
|
||||
// example: kvm
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
// 虚拟机CPU架构
|
||||
// example: x86 arm
|
||||
OsArch string `json:"os_arch"`
|
||||
// 套餐名称
|
||||
InstanceType string `json:"instance_type"`
|
||||
}
|
||||
@@ -954,7 +916,8 @@ type SGuestTemplate struct {
|
||||
// 计费方式
|
||||
BillingType string `json:"billing_type"`
|
||||
// 其他配置信息
|
||||
Content interface{} `json:"content"`
|
||||
Content interface{} `json:"content"`
|
||||
LastCheckTime time.Time `json:"last_check_time"`
|
||||
}
|
||||
|
||||
// SGuestTemplateResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestTemplateResourceBase.
|
||||
@@ -963,20 +926,6 @@ type SGuestTemplateResourceBase struct {
|
||||
GuestTemplateId string `json:"guest_template_id"`
|
||||
}
|
||||
|
||||
// SGuestcdrom is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestcdrom.
|
||||
type SGuestcdrom struct {
|
||||
Id string `json:"id"`
|
||||
// = Column(VARCHAR(36, charset='ascii'), primary_key=True)
|
||||
ImageId string `json:"image_id"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
Name string `json:"name"`
|
||||
// Column(VARCHAR(64, charset='ascii'), nullable=True)
|
||||
Path string `json:"path"`
|
||||
// Column(VARCHAR(256, charset='ascii'), nullable=True)
|
||||
Size int64 `json:"size"`
|
||||
UpdateVersion int `json:"update_version"`
|
||||
}
|
||||
|
||||
// SGuestdisk is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestdisk.
|
||||
type SGuestdisk struct {
|
||||
SGuestJointsBase
|
||||
@@ -1096,10 +1045,11 @@ type SHost struct {
|
||||
OvnVersion string `json:"ovn_version"`
|
||||
IsBaremetal bool `json:"is_baremetal"`
|
||||
// 是否处于维护状态
|
||||
IsMaintenance bool `json:"is_maintenance"`
|
||||
EnableHealthCheck bool `json:"enable_health_check"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
RealExternalId string `json:"real_external_id"`
|
||||
IsMaintenance bool `json:"is_maintenance"`
|
||||
LastPingAt time.Time `json:"last_ping_at"`
|
||||
EnableHealthCheck bool `json:"enable_health_check"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
RealExternalId string `json:"real_external_id"`
|
||||
// 是否为导入的宿主机
|
||||
IsImport bool `json:"is_import"`
|
||||
// 是否允许PXE启动
|
||||
@@ -1205,8 +1155,6 @@ type SHuaweiCachedLbbg struct {
|
||||
// SInstanceSnapshot is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SInstanceSnapshot.
|
||||
type SInstanceSnapshot struct {
|
||||
apis.SVirtualResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SManagedResourceBase
|
||||
// 云主机Id
|
||||
GuestId string `json:"guest_id"`
|
||||
// 云主机配置
|
||||
@@ -1223,8 +1171,6 @@ type SInstanceSnapshot struct {
|
||||
KeypairId string `json:"keypair_id"`
|
||||
// 操作系统类型
|
||||
OsType string `json:"os_type"`
|
||||
// CPU架构
|
||||
OsArch string `json:"os_arch"`
|
||||
// 套餐名称
|
||||
InstanceType string `json:"instance_type"`
|
||||
}
|
||||
@@ -1280,7 +1226,6 @@ type SLoadbalancer struct {
|
||||
apis.SExternalizedResourceBase
|
||||
SManagedResourceBase
|
||||
SCloudregionResourceBase
|
||||
SDeletePreventableResourceBase
|
||||
// LB might optionally be in a VPC, vpc_id, manager_id, cloudregion_id
|
||||
SVpcResourceBase
|
||||
// zone_id
|
||||
@@ -1288,8 +1233,6 @@ type SLoadbalancer struct {
|
||||
// optional network_id
|
||||
SNetworkResourceBase
|
||||
SLoadbalancerRateLimiter
|
||||
// 备可用区
|
||||
Zone1 string `json:"zone_1"`
|
||||
// IP地址
|
||||
Address string `json:"address"`
|
||||
// 地址类型
|
||||
@@ -1362,9 +1305,12 @@ type SLoadbalancerAgentDeployment struct {
|
||||
|
||||
// SLoadbalancerAgentParams is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParams.
|
||||
type SLoadbalancerAgentParams struct {
|
||||
KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"`
|
||||
HaproxyConfTmpl string `json:"haproxy_conf_tmpl"`
|
||||
TelegrafConfTmpl string `json:"telegraf_conf_tmpl"`
|
||||
KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"`
|
||||
HaproxyConfTmpl string `json:"haproxy_conf_tmpl"`
|
||||
TelegrafConfTmpl string `json:"telegraf_conf_tmpl"`
|
||||
Vrrp SLoadbalancerAgentParamsVrrp `json:"vrrp"`
|
||||
Haproxy SLoadbalancerAgentParamsHaproxy `json:"haproxy"`
|
||||
Telegraf SLoadbalancerAgentParamsTelegraf `json:"telegraf"`
|
||||
}
|
||||
|
||||
// SLoadbalancerAgentParamsHaproxy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParamsHaproxy.
|
||||
@@ -1606,16 +1552,6 @@ type SManagedResourceBase struct {
|
||||
ManagerId string `json:"manager_id"`
|
||||
}
|
||||
|
||||
// SNatDEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatDEntry.
|
||||
type SNatDEntry struct {
|
||||
SNatEntry
|
||||
ExternalIP string `json:"external_ip"`
|
||||
ExternalPort int `json:"external_port"`
|
||||
InternalIP string `json:"internal_ip"`
|
||||
InternalPort int `json:"internal_port"`
|
||||
IpProtocol string `json:"ip_protocol"`
|
||||
}
|
||||
|
||||
// SNatEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatEntry.
|
||||
type SNatEntry struct {
|
||||
apis.SStatusInfrasResourceBase
|
||||
@@ -1646,25 +1582,6 @@ type SNatgatewayResourceBase struct {
|
||||
NatgatewayId string `json:"natgateway_id"`
|
||||
}
|
||||
|
||||
// SNetInterface is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetInterface.
|
||||
type SNetInterface struct {
|
||||
Mac string `json:"mac"`
|
||||
// Column(VARCHAR(36, charset='ascii'), primary_key=True)
|
||||
BaremetalId string `json:"baremetal_id"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
WireId string `json:"wire_id"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
Rate int `json:"rate"`
|
||||
// Column(Integer, nullable=True) # Mbps
|
||||
NicType string `json:"nic_type"`
|
||||
// Column(VARCHAR(36, charset='ascii'), nullable=True)
|
||||
Index byte `json:"index"`
|
||||
// Column(TINYINT, nullable=True)
|
||||
LinkUp bool `json:"link_up"`
|
||||
// Column(Boolean, nullable=True)
|
||||
Mtu int16 `json:"mtu"`
|
||||
}
|
||||
|
||||
// SNetwork is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetwork.
|
||||
type SNetwork struct {
|
||||
apis.SSharableVirtualResourceBase
|
||||
@@ -1700,8 +1617,6 @@ type SNetwork struct {
|
||||
// 该网段是否用于自动分配IP地址,如果为false,则用户需要明确选择该网段,才会使用该网段分配IP,
|
||||
// 如果为true,则用户不指定网段时,则自动从该值为true的网络中选择一个分配地址
|
||||
IsAutoAlloc *bool `json:"is_auto_alloc,omitempty"`
|
||||
// 线路类型
|
||||
BgpType string `json:"bgp_type"`
|
||||
}
|
||||
|
||||
// SNetworkInterface is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetworkInterface.
|
||||
@@ -1842,33 +1757,6 @@ type SRouteTable struct {
|
||||
Routes *SRoutes `json:"routes"`
|
||||
}
|
||||
|
||||
// SRouteTableAssociation is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SRouteTableAssociation.
|
||||
type SRouteTableAssociation struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SRouteTableResourceBase
|
||||
AssociationType string `json:"association_type"`
|
||||
AssociatedResourceId string `json:"associated_resource_id"`
|
||||
ExtAssociatedResourceId string `json:"ext_associated_resource_id"`
|
||||
}
|
||||
|
||||
// SRouteTableResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SRouteTableResourceBase.
|
||||
type SRouteTableResourceBase struct {
|
||||
RouteTableId string `json:"route_table_id"`
|
||||
}
|
||||
|
||||
// SRouteTableRouteSet is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SRouteTableRouteSet.
|
||||
type SRouteTableRouteSet struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SRouteTableResourceBase
|
||||
Type string `json:"type"`
|
||||
Cidr string `json:"cidr"`
|
||||
NextHopType string `json:"next_hop_type"`
|
||||
NextHopId string `json:"next_hop_id"`
|
||||
ExtNextHopId string `json:"ext_next_hop_id"`
|
||||
}
|
||||
|
||||
// SScalingActivity is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingActivity.
|
||||
type SScalingActivity struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
@@ -1899,6 +1787,8 @@ type SScalingAlarm struct {
|
||||
Value float64 `json:"value"`
|
||||
// Real-time cumulate number
|
||||
RealCumulate int `json:"real_cumulate"`
|
||||
// Last trigger time
|
||||
LastTriggerTime time.Time `json:"last_trigger_time"`
|
||||
}
|
||||
|
||||
// SScalingGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroup.
|
||||
@@ -1929,6 +1819,10 @@ type SScalingGroup struct {
|
||||
HealthCheckGov int `json:"health_check_gov"`
|
||||
LoadbalancerBackendPort int `json:"loadbalancer_backend_port"`
|
||||
LoadbalancerBackendWeight int `json:"loadbalancer_backend_weight"`
|
||||
// Time to allow scale
|
||||
AllowScaleTime time.Time `json:"allow_scale_time"`
|
||||
// NextCheckTime descripe the next time to check instance's health
|
||||
NextCheckTime time.Time `json:"next_check_time"`
|
||||
}
|
||||
|
||||
// SScalingGroupGuest is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroupGuest.
|
||||
@@ -2016,6 +1910,7 @@ type SScheduledTask struct {
|
||||
apis.SEnabledResourceBase
|
||||
ScheduledType string `json:"scheduled_type"`
|
||||
STimer
|
||||
TimerDesc string `json:"timer_desc"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
Operation string `json:"operation"`
|
||||
LabelType string `json:"label_type"`
|
||||
@@ -2139,7 +2034,6 @@ type SSnapshot struct {
|
||||
DiskType string `json:"disk_type"`
|
||||
// 操作系统类型
|
||||
OsType string `json:"os_type"`
|
||||
OsArch string `json:"os_arch"`
|
||||
// create disk from snapshot, snapshot as disk backing file
|
||||
RefCount int `json:"ref_count"`
|
||||
BackingDiskId string `json:"backing_disk_id"`
|
||||
@@ -2171,6 +2065,8 @@ type SSnapshotPolicyDisk struct {
|
||||
apis.SVirtualJointResourceBase
|
||||
SSnapshotPolicyResourceBase
|
||||
SDiskResourceBase
|
||||
// SnapshotpolicyId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
|
||||
// DiskId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
@@ -2268,7 +2164,13 @@ type STimer struct {
|
||||
WeekDays byte `json:"week_days"`
|
||||
// 0-31 0 is unlimited
|
||||
MonthDays uint32 `json:"month_days"`
|
||||
IsExpired bool `json:"is_expired"`
|
||||
// StartTime represent the start time of this timer
|
||||
StartTime time.Time `json:"start_time"`
|
||||
// EndTime represent deadline of this timer
|
||||
EndTime time.Time `json:"end_time"`
|
||||
// NextTime represent the time timer should bell
|
||||
NextTime time.Time `json:"next_time"`
|
||||
IsExpired bool `json:"is_expired"`
|
||||
}
|
||||
|
||||
// SVCenter is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVCenter.
|
||||
@@ -2303,18 +2205,6 @@ type SVpc struct {
|
||||
ExternalAccessMode string `json:"external_access_mode"`
|
||||
}
|
||||
|
||||
// SVpcPeeringConnection is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVpcPeeringConnection.
|
||||
type SVpcPeeringConnection struct {
|
||||
apis.SEnabledStatusInfrasResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SVpcResourceBase
|
||||
ExtPeerVpcId string `json:"ext_peer_vpc_id"`
|
||||
ExtPeerAccountId string `json:"ext_peer_account_id"`
|
||||
PeerVpcId string `json:"peer_vpc_id"`
|
||||
PeerAccountId string `json:"peer_account_id"`
|
||||
Bandwidth int `json:"bandwidth"`
|
||||
}
|
||||
|
||||
// SVpcResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SVpcResourceBase.
|
||||
type SVpcResourceBase struct {
|
||||
VpcId string `json:"vpc_id"`
|
||||
@@ -2357,9 +2247,3 @@ type SZone struct {
|
||||
type SZoneResourceBase struct {
|
||||
ZoneId string `json:"zone_id"`
|
||||
}
|
||||
|
||||
// SZoneschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SZoneschedtag.
|
||||
type SZoneschedtag struct {
|
||||
SSchedtagJointsBase
|
||||
SZoneResourceBase
|
||||
}
|
||||
|
||||
@@ -41,21 +41,3 @@ const (
|
||||
SERVICE_TYPE_ETCD = "etcd"
|
||||
SERVICE_TYPE_INFLUXDB = "influxdb"
|
||||
)
|
||||
|
||||
var (
|
||||
NO_RESOURCE_SERVICES = []string{
|
||||
SERVICE_TYPE_OFFLINE_CLOUDMETA,
|
||||
SERVICE_TYPE_CLOUDMETA,
|
||||
SERVICE_TYPE_WEBSOCKET,
|
||||
SERVICE_TYPE_AUTOUPDATE,
|
||||
SERVICE_TYPE_YUNIONAGENT,
|
||||
SERVICE_TYPE_SCHEDULER,
|
||||
SERVICE_TYPE_ITSM,
|
||||
SERVICE_TYPE_VNCPROXY,
|
||||
SERVICE_TYPE_KEYSTONE,
|
||||
SERVICE_TYPE_CLOUDWATCHER,
|
||||
SERVICE_TYPE_SERVICETREE,
|
||||
SERVICE_TYPE_ETCD,
|
||||
SERVICE_TYPE_INFLUXDB,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -106,8 +106,6 @@ var (
|
||||
"time_zone",
|
||||
"domainized_namespace",
|
||||
"api_server",
|
||||
"global_http_proxy",
|
||||
"global_https_proxy",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,3 @@ type GetIdpSsoRedirectUriOutput struct {
|
||||
// Driver
|
||||
Driver string `json:"driver"`
|
||||
}
|
||||
|
||||
type PerformDefaultSsoInput struct {
|
||||
Enable *bool `json:"enable" help:"enable default sso" negative:"disable"`
|
||||
}
|
||||
|
||||
@@ -166,9 +166,6 @@ type DomainListInput struct {
|
||||
|
||||
// 按IDP过滤
|
||||
IdpId string `json:"idp_id"`
|
||||
|
||||
// 按IDP_ENTITY_ID过滤
|
||||
IdpEntityId string `json:"idp_entity_id"`
|
||||
}
|
||||
|
||||
type UserListInput struct {
|
||||
@@ -193,9 +190,6 @@ type UserListInput struct {
|
||||
|
||||
// 关联IDP
|
||||
IdpId string `json:"idp_id"`
|
||||
|
||||
// 按IDP_ENTITY_ID过滤
|
||||
IdpEntityId string `json:"idp_entity_id"`
|
||||
}
|
||||
|
||||
type EndpointListInput struct {
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
package identity
|
||||
|
||||
type SIdpAttributeOptions struct {
|
||||
DomainNameAttribute string `json:"domain_name_attribute"`
|
||||
DomainIdAttribute string `json:"domain_id_attribute"`
|
||||
|
||||
UserNameAttribute string `json:"user_name_attribute"`
|
||||
UserIdAttribute string `json:"user_id_attribute"`
|
||||
|
||||
|
||||
@@ -31,12 +31,11 @@ type SUserExtended struct {
|
||||
Email string
|
||||
Mobile string
|
||||
|
||||
LocalId int
|
||||
LocalName string
|
||||
LocalFailedAuthCount int
|
||||
DomainName string
|
||||
DomainEnabled bool
|
||||
IsLocal bool
|
||||
LocalId int
|
||||
LocalName string
|
||||
DomainName string
|
||||
DomainEnabled bool
|
||||
IsLocal bool
|
||||
// IdpId string
|
||||
// IdpName string
|
||||
}
|
||||
|
||||
@@ -92,20 +92,6 @@ type SFederatedUser struct {
|
||||
DisplayName string `json:"display_name"`
|
||||
}
|
||||
|
||||
// SFederationProtocol is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFederationProtocol.
|
||||
type SFederationProtocol struct {
|
||||
Id string `json:"id"`
|
||||
IdpId string `json:"idp_id"`
|
||||
MappingId string `json:"mapping_id"`
|
||||
}
|
||||
|
||||
// SFernetKey is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFernetKey.
|
||||
type SFernetKey struct {
|
||||
Type string `json:"type"`
|
||||
Index int `json:"index"`
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
// SGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SGroup.
|
||||
type SGroup struct {
|
||||
SIdentityBaseResource
|
||||
@@ -140,8 +126,6 @@ type SIdentityProvider struct {
|
||||
IconUri string `json:"icon_uri"`
|
||||
// 是否是SSO登录方式
|
||||
IsSso *bool `json:"is_sso,omitempty"`
|
||||
// 是否是缺省SSO登录方式
|
||||
IsDefault *bool `json:"is_default,omitempty"`
|
||||
}
|
||||
|
||||
// SIdmapping is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SIdmapping.
|
||||
@@ -153,60 +137,36 @@ type SIdmapping struct {
|
||||
EntityType string `json:"entity_type"`
|
||||
}
|
||||
|
||||
// SIdpRemoteIds is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SIdpRemoteIds.
|
||||
type SIdpRemoteIds struct {
|
||||
IdpId string `json:"idp_id"`
|
||||
RemoteId string `json:"remote_id"`
|
||||
}
|
||||
|
||||
// SImpliedRole is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SImpliedRole.
|
||||
type SImpliedRole struct {
|
||||
PriorRoleId string `json:"prior_role_id"`
|
||||
ImpliedRoleId string `json:"implied_role_id"`
|
||||
}
|
||||
|
||||
// SLocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SLocalUser.
|
||||
type SLocalUser struct {
|
||||
apis.SResourceBase
|
||||
Id int `json:"id"`
|
||||
UserId string `json:"user_id"`
|
||||
DomainId string `json:"domain_id"`
|
||||
Name string `json:"name"`
|
||||
FailedAuthCount int `json:"failed_auth_count"`
|
||||
}
|
||||
|
||||
// SNonlocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SNonlocalUser.
|
||||
type SNonlocalUser struct {
|
||||
DomainId string `json:"domain_id"`
|
||||
Name string `json:"name"`
|
||||
UserId string `json:"user_id"`
|
||||
Id int `json:"id"`
|
||||
UserId string `json:"user_id"`
|
||||
DomainId string `json:"domain_id"`
|
||||
Name string `json:"name"`
|
||||
FailedAuthCount int `json:"failed_auth_count"`
|
||||
FailedAuthAt time.Time `json:"failed_auth_at"`
|
||||
}
|
||||
|
||||
// SPassword is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPassword.
|
||||
type SPassword struct {
|
||||
apis.SResourceBase
|
||||
Id int `json:"id"`
|
||||
LocalUserId int `json:"local_user_id"`
|
||||
Password string `json:"password"`
|
||||
SelfService bool `json:"self_service"`
|
||||
PasswordHash string `json:"password_hash"`
|
||||
CreatedAtInt int64 `json:"created_at_int"`
|
||||
ExpiresAtInt int64 `json:"expires_at_int"`
|
||||
Id int `json:"id"`
|
||||
LocalUserId int `json:"local_user_id"`
|
||||
Password string `json:"password"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
SelfService bool `json:"self_service"`
|
||||
PasswordHash string `json:"password_hash"`
|
||||
CreatedAtInt int64 `json:"created_at_int"`
|
||||
ExpiresAtInt int64 `json:"expires_at_int"`
|
||||
}
|
||||
|
||||
// SPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPolicy.
|
||||
type SPolicy struct {
|
||||
SEnabledIdentityBaseResource
|
||||
apis.SSharableBaseResource
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
Type string `json:"type"`
|
||||
// 权限定义
|
||||
Type string `json:"type"`
|
||||
Blob interface{} `json:"blob"`
|
||||
// 权限范围
|
||||
Scope string `json:"scope"`
|
||||
// 是否为系统权限
|
||||
IsSystem *bool `json:"is_system,omitempty"`
|
||||
}
|
||||
|
||||
// SProject is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SProject.
|
||||
@@ -216,12 +176,6 @@ type SProject struct {
|
||||
IsDomain *bool `json:"is_domain,omitempty"`
|
||||
}
|
||||
|
||||
// SProjectExtended is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SProjectExtended.
|
||||
type SProjectExtended struct {
|
||||
SProject
|
||||
DomainName string `json:"domain_name"`
|
||||
}
|
||||
|
||||
// SRegion is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRegion.
|
||||
type SRegion struct {
|
||||
apis.SStandaloneResourceBase
|
||||
@@ -235,32 +189,6 @@ type SRole struct {
|
||||
apis.SSharableBaseResource
|
||||
}
|
||||
|
||||
// SRolePolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRolePolicy.
|
||||
type SRolePolicy struct {
|
||||
apis.SResourceBase
|
||||
// 角色ID, 主键
|
||||
RoleId string `json:"role_id"`
|
||||
// 项目ID,主键
|
||||
ProjectId string `json:"project_id"`
|
||||
// 权限ID, 主键
|
||||
PolicyId string `json:"policy_id"`
|
||||
// 是否需要认证
|
||||
Auth *bool `json:"auth,omitempty"`
|
||||
// 匹配的IP白名单
|
||||
Ips string `json:"ips"`
|
||||
}
|
||||
|
||||
// SScopeResource is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SScopeResource.
|
||||
type SScopeResource struct {
|
||||
DomainId string `json:"domain_id"`
|
||||
ProjectId string `json:"project_id"`
|
||||
OwnerId string `json:"owner_id"`
|
||||
RegionId string `json:"region_id"`
|
||||
ServiceId string `json:"service_id"`
|
||||
Resource string `json:"resource"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
// SService is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SService.
|
||||
type SService struct {
|
||||
apis.SStandaloneResourceBase
|
||||
@@ -294,13 +222,6 @@ type SUser struct {
|
||||
EnableMfa *bool `json:"enable_mfa,omitempty"`
|
||||
}
|
||||
|
||||
// SUserOption is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUserOption.
|
||||
type SUserOption struct {
|
||||
UserId string `json:"user_id"`
|
||||
OptionId string `json:"option_id"`
|
||||
OptionValue string `json:"option_value"`
|
||||
}
|
||||
|
||||
// SUsergroupMembership is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUsergroupMembership.
|
||||
type SUsergroupMembership struct {
|
||||
apis.SResourceBase
|
||||
|
||||
@@ -22,8 +22,6 @@ import (
|
||||
type SGuestImage struct {
|
||||
apis.SSharableVirtualResourceBase
|
||||
Protected *bool `json:"protected,omitempty"`
|
||||
// 操作系统CPU架构
|
||||
OsArch string `json:"os_arch"`
|
||||
}
|
||||
|
||||
// SGuestImageJoint is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SGuestImageJoint.
|
||||
@@ -59,51 +57,14 @@ type SImage struct {
|
||||
IsGuestImage *bool `json:"is_guest_image,omitempty"`
|
||||
// 是否是数据盘镜像
|
||||
IsData *bool `json:"is_data,omitempty"`
|
||||
// 操作系统CPU架构
|
||||
OsArch string `json:"os_arch"`
|
||||
// image copy from url, save origin checksum before probe
|
||||
// 从镜像时长导入的镜像校验和
|
||||
OssChecksum string `json:"oss_checksum"`
|
||||
}
|
||||
|
||||
// SImageMember is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageMember.
|
||||
type SImageMember struct {
|
||||
SImagePeripheral
|
||||
Member string `json:"member"`
|
||||
CanShare bool `json:"can_share"`
|
||||
}
|
||||
|
||||
// SImagePeripheral is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImagePeripheral.
|
||||
type SImagePeripheral struct {
|
||||
apis.SResourceBase
|
||||
Id int `json:"id"`
|
||||
ImageId string `json:"image_id"`
|
||||
}
|
||||
|
||||
// SImageProperty is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageProperty.
|
||||
type SImageProperty struct {
|
||||
SImagePeripheral
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// SImageSubformat is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageSubformat.
|
||||
type SImageSubformat struct {
|
||||
SImagePeripheral
|
||||
Format string `json:"format"`
|
||||
Size int64 `json:"size"`
|
||||
Location string `json:"location"`
|
||||
Checksum string `json:"checksum"`
|
||||
FastHash string `json:"fast_hash"`
|
||||
Status string `json:"status"`
|
||||
TorrentSize int64 `json:"torrent_size"`
|
||||
TorrentLocation string `json:"torrent_location"`
|
||||
TorrentChecksum string `json:"torrent_checksum"`
|
||||
TorrentStatus string `json:"torrent_status"`
|
||||
}
|
||||
|
||||
// SImageTag is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageTag.
|
||||
type SImageTag struct {
|
||||
SImagePeripheral
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user