Compare commits

..

483 Commits

Author SHA1 Message Date
Zexi Li
1264fb0835 Merge pull request #11410 from yousong/automated-cherry-pick-of-#11406-upstream-release-3.4
Automated cherry pick of #11406: webconsole: wait zombies
2021-06-16 20:09:15 +08:00
Yousong Zhou
ac09f79dca webconsole: wait zombies 2021-06-16 19:35:09 +08:00
Yousong Zhou
4b6b85a629 Merge pull request #11271 from yousong/automated-cherry-pick-of-#10849-upstream-release-3.4
Automated cherry pick of #10849: Feature/yousong zombie
2021-06-16 19:30:14 +08:00
Zexi Li
d3856e26d2 Merge pull request #11345 from ioito/automated-cherry-pick-of-#11340-upstream-release-3.4
Automated cherry pick of #11340: fix(cloudid): huawei group role attach and detach
2021-06-08 23:15:29 +08:00
Qu Xuan
bc47ac7d3e fix(cloudid): huawei group role attach and detach 2021-06-07 18:19:28 +08:00
Zexi Li
14afdc74cd Merge pull request #11287 from ioito/automated-cherry-pick-of-#11286-upstream-release-3.4
Automated cherry pick of #11286: fix(region): avoid region service restart
2021-06-03 11:44:10 +08:00
Qu Xuan
c4bb8a3323 fix(region): avoid region service restart 2021-06-02 20:00:50 +08:00
Yousong Zhou
c8eb0d575d treewide: wait possible zombies 2021-05-31 10:17:16 +08:00
Yousong Zhou
f0785033a7 procutils: WaitZombieLoop: remove unneeded info request 2021-05-31 10:17:16 +08:00
Yousong Zhou
4f476cb137 procutils: WaitZombieLoop: less verbose iota 2021-05-31 10:17:16 +08:00
Yousong Zhou
41d332c43b procutils: WaitZombieLoop: use const str "1" for my pid 2021-05-31 10:17:16 +08:00
Yousong Zhou
372f23717a procutils: add WaitZombieLoop 2021-05-31 10:17:16 +08:00
Zexi Li
2945567906 Merge pull request #11004 from ioito/automated-cherry-pick-of-#11000-upstream-release-3.4
Automated cherry pick of #11000: fix(region): wire sql fix
2021-05-08 16:10:29 +08:00
Qu Xuan
9fdcc5db3c fix(region): wire sql fix 2021-05-08 15:52:51 +08:00
Zexi Li
4f2086896b Merge pull request #10947 from zexi/automated-cherry-pick-of-#10941-upstream-release-3.4
Automated cherry pick of #10941: fix(region): download cached image from source host before migrating
2021-04-27 20:09:36 +08:00
Zexi Li
44d420c4e3 fix(region): download cached image from source host before migrating 2021-04-27 17:16:09 +08:00
Zexi Li
04f2fce3c1 Merge pull request #10910 from rainzm/automated-cherry-pick-of-#10906-upstream-release-3.4
Automated cherry pick of #10906: fix(region): use special localtask to run time-consuming provider synchronization task
2021-04-23 17:39:35 +08:00
rainzm
087b7f2c94 fix(region): use special localtask to run time-consuming provider synchronization task
CloudProviderSyncInfoTask will local cloudprovider. Make locaktask run
time-consuming task can avoid holding locks for a long time.
2021-04-23 17:06:03 +08:00
yunion-ci-robot
537f2d5d53 Merge pull request #10833 from zexi/fix/image-cache-from-host
fix(region): fetch cached image from glance by default
2021-04-21 10:53:50 +08:00
Zexi Li
a43c3724c1 Merge pull request #10859 from rainzm/automated-cherry-pick-of-#10851-upstream-release-3.4
Automated cherry pick of #10851: fix(region): avoid using LocalTaskworker in time-consuming synchronization of cloudaccount
2021-04-21 10:32:24 +08:00
rainzm
b9d8873277 fix(region): avoid using LocalTaskworker in time-consuming synchronization of cloudaccount 2021-04-21 10:10:24 +08:00
Zexi Li
f88350a3ac fix(region): fetch cached image from glance by default 2021-04-20 17:51:11 +08:00
Zexi Li
9ec7aa5da2 Merge pull request #10769 from yousong/automated-cherry-pick-of-#10765-upstream-release-3.4
Automated cherry pick of #10765: ansibleserver: wait zombie subprocesses
2021-04-16 13:15:43 +08:00
Zexi Li
ffa1a5bbe1 Merge pull request #10754 from yousong/automated-cherry-pick-of-#10750-upstream-release-3.4
Automated cherry pick of #10750: vpcagent: ovn: fix port match condition formation
2021-04-16 10:07:20 +08:00
Yousong Zhou
b260eeff60 ansibleserver: wait zombie subprocesses 2021-04-16 09:56:45 +08:00
Yousong Zhou
f157726cc6 vpcagent: ovn: fix port match condition formation 2021-04-15 16:10:40 +08:00
yunion-ci-robot
7a15c502c2 Merge pull request #10719 from zexi/automated-cherry-pick-of-#10718-upstream-release-3.4
Automated cherry pick of #10718: fix(baremetal): use command timeout context replace timeout command
2021-04-14 17:42:48 +08:00
Zexi Li
e9e53b1c0f fix(baremetal): use command timeout context replace timeout command 2021-04-14 17:15:27 +08:00
Zexi Li
8ba2b34a67 Merge pull request #10687 from swordqiu/automated-cherry-pick-of-#10683-upstream-release-3.4
Automated cherry pick of #10683: fix(baremetal-agent): baremetal will probe status in status unknown
2021-04-12 13:15:30 +08:00
Qiu Jian
b7518d76d2 fix(baremetal-agent): baremetal will probe status in status unknown 2021-04-12 00:24:21 +08:00
yunion-ci-robot
4e3b2b8334 Merge pull request #10640 from tb365/automated-cherry-pick-of-#10637-upstream-release-3.4
Automated cherry pick of #10637: fix(region): guest associate eip checking fix
2021-04-07 16:14:47 +08:00
TangBin
3af2372ebf make format 2021-04-06 18:53:25 +08:00
tangbin
363a2c2e3f fix(region): guest sync eip fix 2021-04-06 18:51:02 +08:00
tangbin
d0decd7f97 fix(region): guest associate eip checking fix 2021-04-06 18:51:02 +08:00
Zexi Li
d37e2a730e Merge pull request #10626 from swordqiu/automated-cherry-pick-of-#10622-upstream-release-3.4
Automated cherry pick of #10622: fix(keystone): role_assignment effective list ignore groups without user
2021-04-06 10:18:38 +08:00
Qiu Jian
5be60745c0 fix(keystone): role_assignment effective list ignore groups without user 2021-04-05 17:22:27 +08:00
Zexi Li
db3cf440fc Merge pull request #10607 from zexi/automated-cherry-pick-of-#10603-upstream-release-3.4
Automated cherry pick of #10603: fix(baremetal): sas2iru parse line
2021-04-02 20:04:09 +08:00
Zexi Li
d52f3bd8cc Merge pull request #10585 from swordqiu/automated-cherry-pick-of-#10581-upstream-release-3.4
Automated cherry pick of #10581: fix(hostman): recycle local disk file when rebuilding root
2021-04-02 19:43:10 +08:00
Zexi Li
1253d9187f fix(baremetal): sas2iru parse line 2021-04-02 19:29:25 +08:00
Qiu Jian
d270983f8a fix(hostman): recycle local disk file when rebuilding root 2021-04-02 02:40:39 +08:00
Zexi Li
f1108cf3e4 Merge pull request #10503 from yousong/automated-cherry-pick-of-#10499-upstream-release-3.4
Automated cherry pick of #10499: vpcagent: ovn: fix qos for eip upload
2021-03-26 15:18:25 +08:00
Zexi Li
85e176be8d Merge pull request #10509 from swordqiu/automated-cherry-pick-of-#10505-upstream-release-3.4
Automated cherry pick of #10505: fix(baremetal): megactl driver fail to find device by key
2021-03-26 15:16:57 +08:00
Yousong Zhou
fefb33ab13 vpcagent: ovn: fix qos for eip upload 2021-03-26 10:29:06 +08:00
Qiu Jian
962021f120 fix(baremetal): megactl driver fail to find device by key 2021-03-26 03:29:05 +08:00
Zexi Li
89345f0e3f Merge pull request #10478 from yousong/automated-cherry-pick-of-#10477-release-3.4
Automated cherry pick of #10477: Automated cherry pick of #10474: Bugfix/yousong guestnic
2021-03-23 10:40:06 +08:00
Yousong Zhou
61c337e4c0 region: fix setting nic index
When a guest has two nics, changing ip address of the 1st will cause
the new nic after detach then attach to be "1", colliding with the
original nic of index 1
2021-03-22 19:37:19 +08:00
Yousong Zhou
26598ccb15 region: attachnetwork: allow attach by network name
isValidNetworkInfo allows names.  Otherwise the code will panic when
a named was passed and nil was returned by the fetch call
2021-03-22 19:37:19 +08:00
Zexi Li
0a8197c144 Merge pull request #10406 from swordqiu/automated-cherry-pick-of-#10402-upstream-release-3.4
Automated cherry pick of #10402: fix(region): cloud provider filter by domain_id ignore private case
2021-03-12 21:17:28 +08:00
Qiu Jian
aeb61fa3db fix(region): cloud provider filter by domain_id ignore private case 2021-03-12 20:15:51 +08:00
Zexi Li
97ca0dad2b Merge pull request #10386 from swordqiu/automated-cherry-pick-of-#10382-upstream-release-3.4
Automated cherry pick of #10382: fix(region): cloud provider filter by domain
2021-03-11 11:39:28 +08:00
Qiu Jian
442076d554 fix(region): cloud provider filter by domain 2021-03-11 01:09:14 +08:00
Zexi Li
d44a11995c Merge pull request #10344 from yousong/automated-cherry-pick-of-#10340-upstream-release-3.4
Automated cherry pick of #10340: etcd: fix "fatal error: concurrent map writes"
2021-03-08 14:20:48 +08:00
Yousong Zhou
4075333492 etcd: fix "fatal error: concurrent map writes"
Trace

	goroutine 1270434 [running]:
	runtime.throw(0x4b0cc5e, 0x15)
		/home/yousong/.usr/go/goroot-1.15.6/src/runtime/panic.go:1116 +0x72 fp=0xc0011151f8 sp=0xc0011151c8 pc=0x439292
	runtime.mapdelete_faststr(0x40876e0, 0xc0006a54a0, 0xc001e84200, 0x3e)
		/home/yousong/.usr/go/goroot-1.15.6/src/runtime/map_faststr.go:377 +0x34c fp=0xc001115260 sp=0xc0011151f8 pc=0x41664c
	yunion.io/x/onecloud/pkg/cloudcommon/etcd.(*SEtcdClient).Unwatch(0xc0003130e0, 0xc001e84200, 0x3e)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/cloudcommon/etcd/etcd.go:353 +0x134 fp=0xc0011152d0 sp=0xc001115260 pc=0x10031f4
	yunion.io/x/onecloud/pkg/compute/models.(*SHostHealthChecker).WatchHost(0xc000c222a0, 0x5229ca0, 0xc000122000, 0xc001fbc4e0, 0x24)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/compute/models/host_health.go:149 +0xd5 fp=0xc001115338 sp=0xc0011152d0 pc=0x1816395
	yunion.io/x/onecloud/pkg/compute/models.(*SHost).PerformOnline(0xc001fd8400, 0x5229d20, 0xc001c4d440, 0x52a0c60, 0xc000957c40, 0x5298900, 0xc001629aa0, 0x5298900, 0xc001629ae0, 0xc000957c40, ...)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/compute/models/hosts.go:3829 +0x227 fp=0xc0011153a0 sp=0xc001115338 pc=0x185a387
	yunion.io/x/onecloud/pkg/compute/models.(*SHost).PerformPing(0xc001fd8400, 0x5229d20, 0xc001c4d440, 0x52a0c60, 0xc000957c40, 0x5298900, 0xc001629aa0, 0x5298900, 0xc001629ae0, 0x0, ...)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/compute/models/hosts.go:3891 +0xbd fp=0xc001115430 sp=0xc0011153a0 pc=0x185acbd
2021-03-08 09:56:51 +08:00
Zexi Li
5699ac0595 Merge pull request #10324 from tb365/automated-cherry-pick-of-#10322-upstream-release-3.4
Automated cherry pick of #10322: copyright update brand_cn&brand_en fix
2021-03-05 10:15:27 +08:00
tangbin
2e5b1288f0 copyright update brand_cn&brand_en fix 2021-03-05 10:00:31 +08:00
Zexi Li
b4fbdc8fa4 Merge pull request #10306 from tb365/automated-cherry-pick-of-#10305-upstream-release-3.4
Automated cherry pick of #10305: infos copyright add brand_en&brand_cn
2021-03-04 15:25:43 +08:00
tangbin
baccc6af2e infos copyright add brand_en&brand_cn 2021-03-04 11:20:01 +08:00
Zexi Li
e939acb221 Merge pull request #10274 from ioito/automated-cherry-pick-of-#10270-upstream-release-3.4
Automated cherry pick of #10270: fix(cloudevent): optimized cloudevent sql
2021-02-25 11:36:09 +08:00
Qu Xuan
7453b5a4aa fix(cloudevent): optimized cloudevent sql 2021-02-25 11:35:06 +08:00
Zexi Li
5ddda054d4 Merge pull request #10269 from ioito/automated-cherry-pick-of-#10265-upstream-release-3.4
Automated cherry pick of #10265: fix(region): add azure new region
2021-02-25 11:23:18 +08:00
Qu Xuan
7815cb0a0c fix(region): add azure new region 2021-02-25 10:24:47 +08:00
Zexi Li
a533bdcde8 Merge pull request #10238 from ioito/automated-cherry-pick-of-#10234-upstream-release-3.4
Automated cherry pick of #10234: fix(region): avoid not sync dns zone
2021-02-22 19:50:15 +08:00
Qu Xuan
105157dd22 fix(region): avoid not sync dns zone 2021-02-22 16:16:03 +08:00
yunion-ci-robot
c825ebdcc2 Merge pull request #10188 from swordqiu/automated-cherry-pick-of-#10158-upstream-release-3.4
Automated cherry pick of #10158: fix(apigateway): add enable_quota_check and return-domain-list
2021-02-08 05:48:59 +08:00
Qiu Jian
833a8058dd fix(apigateway): add enable_quota_check and return-domain-list attributes to fe params 2021-02-07 17:01:14 +08:00
Zexi Li
510ba895c3 Merge pull request #10168 from ioito/hotfix/qx-secgroup-clone-status
fix(region): secgroup clone set status
2021-02-05 14:38:29 +08:00
Qu Xuan
e5e9d54655 fix(region): secgroup clone set status 2021-02-05 14:27:13 +08:00
Zexi Li
53bfda4849 Merge pull request #10108 from ioito/automated-cherry-pick-of-#10104-upstream-release-3.4
Automated cherry pick of #10104: fix(region): delete virtual nics with network
2021-02-02 21:04:31 +08:00
Zexi Li
d99774a3f1 Merge pull request #10121 from wanyaoqi/automated-cherry-pick-of-#10117-upstream-release-3.4
Automated cherry pick of #10117: fix(region): add option auto reconcile backup servers
2021-02-02 20:11:48 +08:00
wanyaoqi
709daa66d3 fix(region): add option auto reconcile backup servers 2021-02-02 18:40:48 +08:00
Qu Xuan
2cbb4f9784 fix(region): delete virtual nics with network 2021-02-02 10:56:28 +08:00
Zexi Li
5696d10300 Merge pull request #10077 from wanyaoqi/automated-cherry-pick-of-#10073-upstream-release-3.4
Automated cherry pick of #10073: fix(host-deployer): remove escape character on windows passwd
2021-01-30 10:40:37 +08:00
wanyaoqi
97167be073 fix(host-deployer): remove escape character on windows passwd 2021-01-29 11:59:00 +08:00
Zexi Li
3a80ccd82f Merge pull request #10052 from ioito/automated-cherry-pick-of-#10048-upstream-release-3.4
Automated cherry pick of #10048: fix(region): secgroup priority fix
2021-01-28 15:12:27 +08:00
Qu Xuan
0722788a5a fix(region): secgroup priority fix 2021-01-28 14:22:35 +08:00
Zexi Li
3673a98fef Merge pull request #10024 from ioito/automated-cherry-pick-of-#10018-upstream-release-3.4
Automated cherry pick of #10018: fix(region): optimized secgroup rule sync
2021-01-26 14:53:43 +08:00
Qu Xuan
08d969baf4 fix(region): optimized secgroup rule sync 2021-01-26 14:12:48 +08:00
Zexi Li
d58a1533ad Merge pull request #10007 from wanyaoqi/automated-cherry-pick-of-#10003-upstream-release-3.4
Automated cherry pick of #10003: fix(host): fix wait time after execute mount fuse fs
2021-01-25 21:06:05 +08:00
Zexi Li
2fe7ba8f20 Merge pull request #10017 from swordqiu/automated-cherry-pick-of-#10013-upstream-release-3.4
Automated cherry pick of #10013: fix(keystone): user create without password can login with any password
2021-01-25 21:03:40 +08:00
Qiu Jian
ec9631f992 fix(keystone): user create without password can login with any password 2021-01-23 23:52:33 +08:00
wanyaoqi
44a135bba4 fix(host): fix wait time after mount fuse fs 2021-01-22 19:22:01 +08:00
yunion-ci-robot
c4031158e3 Merge pull request #9970 from tb365/bugfix/tb-bugfix-012001
Bugfix/tb bugfix 012001
2021-01-22 17:11:05 +08:00
Zexi Li
a4f775922e Merge pull request #9978 from yousong/automated-cherry-pick-of-#9974-upstream-release-3.4
Automated cherry pick of #9974: fix(region): cloudaccount: allow only one sync func in flight
2021-01-22 02:47:37 +08:00
Zexi Li
1442973d95 Merge pull request #9988 from ioito/automated-cherry-pick-of-#9973-upstream-release-3.4
Automated cherry pick of #9973: fix(region): avoid clean all rules when sync secgroups
2021-01-22 00:39:22 +08:00
Qu Xuan
60dad15824 fix(region): avoid clean all rules when sync secgroups 2021-01-21 21:34:28 +08:00
Yousong Zhou
571d2d297e fix(region): cloudaccount: allow only one sync func in flight
Ref https://github.com/yunionio/onecloud/pull/6859
2021-01-21 16:31:45 +08:00
tangbin
f05a913cbb loadbalancer add lb purge validate 2021-01-20 21:52:49 +08:00
tangbin
7b47c9bb8c fix(region): aws elb backendgroup sync bugfix 2021-01-20 21:48:25 +08:00
Zexi Li
6f8400a7e5 Merge pull request #9929 from rainzm/automated-cherry-pick-of-#9925-upstream-release-3.4
Automated cherry pick of #9925: Notify Optimization
2021-01-18 11:47:17 +08:00
rainzm
ecb169d9f9 fix(notify): add a time limit for resending notifications 2021-01-18 11:17:47 +08:00
Jian Qiu
ce630362fb fix(cloudcommon): missing set_meta opslog (#9918)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2021-01-17 11:34:02 +08:00
Zexi Li
61d8885b60 Merge pull request #9876 from swordqiu/automated-cherry-pick-of-#9872-upstream-release-3.4
Automated cherry pick of #9872: fix(region): AWS buckets in us-east-1 have null location
2021-01-14 09:36:46 +08:00
Qiu Jian
0b7a4f08e1 fix(region): AWS buckets in us-east-1 have null location 2021-01-14 09:30:45 +08:00
Zexi Li
caa530bd60 Merge pull request #9789 from yousong/automated-cherry-pick-of-#9785-upstream-release-3.4
Automated cherry pick of #9785: guest_deploy_task: log other deploy details with i18n
2021-01-07 21:16:57 +08:00
Yousong Zhou
559d30afa8 guest_deploy_task: log other deploy details with i18n
Fixes 9f350392 ("add service tag for actionlog")
2021-01-07 11:47:12 +08:00
Zexi Li
b8c10b8e7c Merge pull request #9766 from wanyaoqi/automated-cherry-pick-of-#9762-upstream-release-3.4
Automated cherry pick of #9762: feat(region): stop guest before freeze
2021-01-05 18:33:42 +08:00
wanyaoqi
b3285aebce feat(region): stop guest before freeze 2021-01-05 15:49:25 +08:00
Zexi Li
ad01c895cf Merge pull request #9739 from wanyaoqi/automated-cherry-pick-of-#9731-upstream-release-3.4
Automated cherry pick of #9731: fix(region): server start check host memory is enough
2020-12-30 21:40:07 +08:00
Zexi Li
b2aa6dd321 Merge pull request #9748 from rainzm/automated-cherry-pick-of-#9744-upstream-release-3.4
Automated cherry pick of #9744: fix(esxiagent): nicIndex should be incremented
2020-12-30 21:36:07 +08:00
rainzm
a4dcc91d0d fix(esxiagent): nicIndex should be incremented 2020-12-30 19:04:00 +08:00
wanyaoqi
18a751548c fix(region): server start check host memory is enough 2020-12-30 15:59:07 +08:00
Zexi Li
b53b09ebb5 Merge pull request #9718 from wanyaoqi/automated-cherry-pick-of-#9711-upstream-release-3.4
Automated cherry pick of #9711: fix(region,host,host-deployer): sync status chekc block jobs
2020-12-29 20:43:49 +08:00
Zexi Li
c6941536b7 Merge pull request #9714 from rainzm/automated-cherry-pick-of-#9693-upstream-release-3.4
Automated cherry pick of #9693: Solve the permission problem of notify to create receiver
2020-12-29 20:41:56 +08:00
wanyaoqi
edba3c3dfc fix(region,host): sync status check block jobs 2020-12-29 15:39:34 +08:00
wanyaoqi
a66c1aa1ba fix(host-deployer): add log line on blkid failed 2020-12-29 15:38:59 +08:00
wanyaoqi
c5dd4389d3 fix(climc): host add netif add params bridge/interface 2020-12-29 15:38:59 +08:00
rainzm
0e4ea782e1 feat(db): progressive inspection when determining the required scope 2020-12-29 15:14:28 +08:00
rainzm
9b993f1a99 fix(notify): inject domain info in ReceiverManager.FetchOwnerId 2020-12-29 15:14:28 +08:00
Zexi Li
8a62c46a92 Merge pull request #9704 from swordqiu/automated-cherry-pick-of-#9701-upstream-release-3.4
Automated cherry pick of #9701: fix(region): omit vpc quota check if vpc created by owner
2020-12-29 09:36:04 +08:00
Qiu Jian
d3ad4967a9 fix(region): omit vpc quota check if vpc created by owner
Vpc quota check is omitted if vpc is create by owner user
2020-12-29 01:21:47 +08:00
Zexi Li
37897cadc7 Merge pull request #9543 from ioito/automated-cherry-pick-of-#9540-upstream-release-3.4
Automated cherry pick of #9540: fix(region): openstack network is regional
2020-12-28 10:20:41 +08:00
Zexi Li
9a8111de6c Merge pull request #9647 from swordqiu/automated-cherry-pick-of-#9644-upstream-release-3.4
Automated cherry pick of #9644: feature(climc): policy save data into file
2020-12-26 12:09:35 +08:00
Qiu Jian
9cdd7dd2da feature(climc): policy save data into file
Allow saveing policy data into file
2020-12-25 17:13:41 +08:00
Zexi Li
8549df1a00 Merge pull request #9632 from ioito/automated-cherry-pick-of-#9629-upstream-release-3.4
Automated cherry pick of #9629: fix(region): optimized disk allocate sched failed log
2020-12-24 17:48:17 +08:00
Qu Xuan
cd9b632d08 fix(region): optimized disk allocate sched failed log 2020-12-24 17:02:14 +08:00
Zexi Li
ac8ba1e86d Merge pull request #9602 from yousong/automated-cherry-pick-of-#9599-upstream-release-3.4
Automated cherry pick of #9599: Bugfix/yousong climc ssh
2020-12-23 22:13:12 +08:00
Yousong Zhou
2add6fc1f5 fix(mcclient): options: webconsole: fix passing ssh port 2020-12-23 13:32:25 +08:00
Yousong Zhou
45eda7c703 refactor(climc): webconsole: use helper methods of response struct 2020-12-23 13:32:25 +08:00
Yousong Zhou
85008a7b0c refactor(webconsole): api: add helper methods for response struct 2020-12-23 13:32:25 +08:00
Yousong Zhou
2f9cfae375 refactor(webconsole): use structured response 2020-12-23 13:32:25 +08:00
Zexi Li
410782cffc Merge pull request #9576 from ioito/automated-cherry-pick-of-#9573-upstream-release-3.4
Automated cherry pick of #9573: fix(region): add huawei gpssd desc
2020-12-23 09:37:26 +08:00
Zexi Li
9342ccf9c3 Merge pull request #9580 from zhaoxiangchun/automated-cherry-pick-of-#9579-upstream-release-3.4
Automated cherry pick of #9579: fix(monitor): other servier create alert add used_by param as a agreement
2020-12-23 09:35:08 +08:00
Zexi Li
29c96f2d2b Merge pull request #9592 from swordqiu/automated-cherry-pick-of-#9589-upstream-release-3.4
Automated cherry pick of #9589: fix(cloudevent,devtool): missing metadata table
2020-12-23 09:08:00 +08:00
Qiu Jian
df7d68e404 fix(cloudevent,devtool): missing metadata table 2020-12-23 03:13:02 +08:00
Qu Xuan
869744d1bb fix(region): openstack network is regional 2020-12-22 16:27:28 +08:00
--global
b01a477cb2 fix(monitor): other servier create alert add used_by param as a agreement
1.解决notify,meter中创建的对应的策略也展示在统一报警策略页面。通过used_by
  进行区分
2020-12-22 16:17:09 +08:00
Qu Xuan
1ec3d6ddf0 fix(region): add huawei gpssd desc 2020-12-22 11:34:13 +08:00
Zexi Li
984006ea31 Merge pull request #9569 from wanyaoqi/automated-cherry-pick-of-#9498-upstream-release-3.4
Automated cherry pick of #9498: server migrate misc fix
2020-12-22 10:06:19 +08:00
yunion-ci-robot
1bc2c75e06 Merge pull request #9567 from zexi/automated-cherry-pick-of-#9564-upstream-release-3.4
Automated cherry pick of #9564: Hotfix/baremetal pxe net alloc
2020-12-21 23:47:46 +08:00
wanyaoqi
cf8b548392 fix(host): add print migrate progress info 2020-12-21 21:08:04 +08:00
wanyaoqi
a898d76094 fix(region): do not change disk status on migrating 2020-12-21 21:08:04 +08:00
Zexi Li
30ee4056e1 Merge pull request #9547 from yousong/automated-cherry-pick-of-#9544-upstream-release-3.4
Automated cherry pick of #9544: fix(region): lbbackend: better error reporting for finding influxdb info
2020-12-21 21:08:02 +08:00
Zexi Li
7d64b9fffc Merge pull request #9558 from ioito/automated-cherry-pick-of-#9555-upstream-release-3.4
Automated cherry pick of #9555: fix(region): fix openstack instance os type
2020-12-21 21:04:14 +08:00
Zexi Li
3da4dd1953 fix(region,baremetal): choose candidate network not according by types 2020-12-21 20:50:03 +08:00
Zexi Li
014170e74a fix(region,baremetal): pxe net reuse converted server access ip 2020-12-21 20:50:02 +08:00
Qu Xuan
db60e37c4d fix(region): fix openstack instance os type 2020-12-21 19:50:58 +08:00
Yousong Zhou
4ac56f7fc3 fix(region): lbbackend: better error reporting for finding influxdb info 2020-12-21 16:52:50 +08:00
Zexi Li
9494c0939a Merge pull request #9372 from ioito/automated-cherry-pick-of-#9360-upstream-release-3.4
Automated cherry pick of #9360: fix(region): sync servers
2020-12-21 10:41:11 +08:00
Zexi Li
1e1941cd7b Merge pull request #9532 from swordqiu/automated-cherry-pick-of-#9529-upstream-release-3.4
Automated cherry pick of #9529: fix(taskman): use admin token if task userCred token expired
2020-12-20 02:06:22 +08:00
Qiu Jian
70d2e5c84d fix(taskman): use admin token if task userCred token expired
Use admin credential token if task cached userCred token expired
2020-12-20 01:22:37 +08:00
yunion-ci-robot
4e864a7a86 Merge pull request #9522 from zexi/automated-cherry-pick-of-#9521-upstream-release-3.4
Automated cherry pick of #9521: Storage actual size filter
2020-12-20 00:02:09 +08:00
Zexi Li
5bce2bd959 fix(scheduler): storage predicate add actualCapacity filter 2020-12-19 22:05:05 +08:00
Zexi Li
8089afa122 Merge pull request #9525 from zexi/fix/remove-sched-k8s-extender
fix(scheduler): remove unused k8s extender
2020-12-19 22:03:31 +08:00
Zexi Li
da66f26503 fix(scheduler): remove unused k8s extender 2020-12-19 21:44:57 +08:00
Zexi Li
8450fe9ea0 Merge pull request #9497 from wanyaoqi/automated-cherry-pick-of-#9494-upstream-release-3.4
Automated cherry pick of #9494: fix(region): guest to create input keep billing info
2020-12-19 20:06:31 +08:00
Zexi Li
b0163b6a70 Merge pull request #9508 from ioito/automated-cherry-pick-of-#9159-upstream-release-3.4
Automated cherry pick of #9159: feat(region): add instance storage capability
2020-12-19 20:04:41 +08:00
Zexi Li
b19762e1a9 Merge pull request #9519 from swordqiu/automated-cherry-pick-of-#9515-upstream-release-3.4
Automated cherry pick of #9515: fix(host): telegraf listen on local ipv4 address explicitly
2020-12-19 18:11:58 +08:00
Qiu Jian
c3fd4937d3 fix(host): telegraf listen on local ipv4 address explicitly
Ensure telegraf listen on local IPv4 address explicityly and host send
metrics to telegraf local IPv4 address explicityly.
2020-12-19 15:38:15 +08:00
Zexi Li
77e19e79a0 Merge pull request #9505 from swordqiu/automated-cherry-pick-of-#9502-upstream-release-3.4
Automated cherry pick of #9502: fix(keystone): always upload&refresh service config whenever service …
2020-12-19 11:39:35 +08:00
Qu Xuan
c069179adc fix(region): sync servers 2020-12-19 10:27:55 +08:00
Zexi Li
fdf51560a3 Merge pull request #9505 from swordqiu/automated-cherry-pick-of-#9502-upstream-release-3.4
Automated cherry pick of #9502: fix(keystone): always upload&refresh service config whenever service …
2020-12-19 09:32:59 +08:00
Qiu Jian
9561c0c8d4 fix(keystone): always upload&refresh service config whenever service restart
Always upload&refresh service config whenever service restart
2020-12-19 00:54:54 +08:00
yunion-ci-robot
b0d7d2f912 Merge pull request #9493 from zexi/automated-cherry-pick-of-#9490-upstream-release-3.4
Automated cherry pick of #9490: Hotfix/baremetal pd makegood
2020-12-18 20:47:01 +08:00
wanyaoqi
35c0e52de9 fix(region): guest to create input keep billing info 2020-12-18 16:41:50 +08:00
Zexi Li
ec5995da4b fix(baremetal): clear jbod disks do PDMakeGood 2020-12-18 15:51:02 +08:00
Zexi Li
21567833fd Merge pull request #9480 from yousong/automated-cherry-pick-of-#9458-upstream-release-3.4
Automated cherry pick of #9458: Bugfix/yousong eip ipaddr
2020-12-18 12:51:42 +08:00
Zexi Li
159fba33b6 Merge pull request #9475 from yousong/automated-cherry-pick-of-#9472-upstream-release-3.4
Automated cherry pick of #9472: Bugfix/yousong host mtu
2020-12-18 00:19:44 +08:00
Yousong Zhou
5b0247a35f fix(region): eip_allocate_task: set eip status allocate_fail on task failure 2020-12-17 22:03:29 +08:00
Yousong Zhou
62c39c62cd fix(region,climc): eips: rename arg name for requested eip addr 2020-12-17 22:03:29 +08:00
Yousong Zhou
995b24c319 fix(region): guestnetworks: use net calculated mtu 2020-12-17 21:52:04 +08:00
Yousong Zhou
82e1234ed4 feat(region): networks: add getMtu method 2020-12-17 21:52:04 +08:00
Yousong Zhou
208a49e3d4 feat(apis): add const VPC_OVN_ENCAP_COST 2020-12-17 21:52:04 +08:00
Yousong Zhou
c8388cab1a feat(host): startvm: set vpc nic mtu
Windows DHCP client does not respect DHCP MTU option
2020-12-17 21:52:04 +08:00
Yousong Zhou
45b538bd2a feat(host): startvm: add nic_mtu shell func 2020-12-17 21:52:04 +08:00
Yousong Zhou
f2e3766bee refactor(host): startvm: for compat
QEMU 2.12 outputs device help on stderr in the following style

```
virtio-net-pci.speed=int32
```

QEMU 5.2.0 outputs it to stdout and in the following format

```
  speed=<int32>          -  (default: -1)
```
2020-12-17 21:52:04 +08:00
Yousong Zhou
2154e7c18b refactor(host): startvm: nic_speed: use raw string 2020-12-17 21:52:03 +08:00
Yousong Zhou
27dc7b6296 refactor(host): startvm: add QEMU_CMD_KVM_ARG 2020-12-17 21:52:03 +08:00
Zexi Li
ae64d437f2 Merge pull request #9462 from swordqiu/hotfix/qj-3.4-quota-check-default-on
fix(cloudcommon): quota checkout turnd on by default at release/3.4
2020-12-17 09:31:49 +08:00
Qiu Jian
8d842b0d2f fix(cloudcommon): quota checkout turnd on by default at release/3.4 2020-12-17 08:51:49 +08:00
Zexi Li
34d0478af1 Merge pull request #9457 from zexi/automated-cherry-pick-of-#9454-upstream-release-3.4
Automated cherry pick of #9454: fix(scheduler): fetch input network when specified
2020-12-16 18:24:58 +08:00
Zexi Li
b1bec7337f fix(scheduler): fetch input network when specified 2020-12-16 17:51:40 +08:00
Zexi Li
de77edc357 Merge pull request #9423 from zexi/automated-cherry-pick-of-#9418-upstream-release-3.4
Automated cherry pick of #9418: fix(region): baremetal post update related server
2020-12-16 10:41:03 +08:00
yunion-ci-robot
2ce7f7b9fe Merge pull request #9438 from wanyaoqi/automated-cherry-pick-of-#9435-upstream-release-3.4
Automated cherry pick of #9435: fix(host): fix set windows password with escape charater
2020-12-15 20:52:14 +08:00
wanyaoqi
e6206944dd fix(host): fix set windows password with escape charater 2020-12-15 16:58:11 +08:00
Zexi Li
02bac8b9ae Merge pull request #9434 from zexi/automated-cherry-pick-of-#9431-upstream-release-3.4
Automated cherry pick of #9431: Fix/climc server create desc
2020-12-15 11:54:35 +08:00
Zexi Li
78c10c78cc Merge pull request #9429 from yousong/automated-cherry-pick-of-#9426-upstream-release-3.4
Automated cherry pick of #9426: fix(vpcagent): ovn: stable dns A record value
2020-12-15 11:45:28 +08:00
Zexi Li
433807432a fix(climc): server-create --desc not work 2020-12-15 11:37:07 +08:00
Yousong Zhou
0f973234b8 fix(vpcagent): ovn: stable dns A record value 2020-12-15 11:10:36 +08:00
Zexi Li
58810cde95 Merge pull request #9424 from wanyaoqi/automated-cherry-pick-of-#9417-upstream-release-3.4
Automated cherry pick of #9417: fix(region,host): fix hot remove nic
2020-12-15 00:08:14 +08:00
Zexi Li
36a9314427 fix(region): baremetal post update related server 2020-12-14 19:16:00 +08:00
wanyaoqi
2864b15ecc fix(region,host): fix hot remove nic
- region: check is hot remove nic enable
- host: del qemu device after del netdev
2020-12-14 19:04:04 +08:00
wanyaoqi
0ee2cbcf60 fix(host): fix check hugepage enabled 2020-12-14 19:02:21 +08:00
Zexi Li
44252983e9 Merge pull request #9414 from zexi/automated-cherry-pick-of-#9411-upstream-release-3.4
Automated cherry pick of #9411: fix(scheduler): sku filter check zone if only prefer region specified
2020-12-14 17:56:55 +08:00
Zexi Li
532ada4bf9 fix(scheduler): sku filter check zone if only prefer region specified 2020-12-14 17:27:08 +08:00
Zexi Li
df4a02ac49 Merge pull request #9408 from zexi/automated-cherry-pick-of-#9405-upstream-release-3.4
Automated cherry pick of #9405: Hotfix/webconsole trim url
2020-12-14 17:23:36 +08:00
Zexi Li
6d5941eaad Merge pull request #9397 from zexi/automated-cherry-pick-of-#9394-upstream-release-3.4
Automated cherry pick of #9394: fix(scheduler): get candidates error more info
2020-12-14 15:52:35 +08:00
yunion-ci-robot
f77c4d078a Merge pull request #9398 from wanyaoqi/bugfix/wyq/fix-unmarshal-perform-params
fix(climc): fix marshal perform params
2020-12-14 15:50:05 +08:00
Zexi Li
5364ba5641 fix(webconsole): trim api_server url if end with slashes 2020-12-14 15:48:30 +08:00
Zexi Li
f4d8225a10 Merge pull request #9402 from rainzm/automated-cherry-pick-of-#9399-upstream-release-3.4
Automated cherry pick of #9399: fix(notify): avoid deadlock
2020-12-14 15:45:41 +08:00
rainzm
9122c7e10d fix(notify): avoid deadlock 2020-12-14 15:06:53 +08:00
wanyaoqi
3e3d356ffc fix(climc): fix marshal perform params 2020-12-14 14:55:02 +08:00
Zexi Li
1c86c0d73a fix(scheduler): get candidates error more info 2020-12-14 14:39:52 +08:00
Zexi Li
aa937e6966 Merge pull request #9387 from tb365/automated-cherry-pick-of-#9386-upstream-release-3.4
Automated cherry pick of #9386: feat(region): support sync skus by cloudregion
2020-12-13 13:51:51 +08:00
Zexi Li
706980e233 Merge pull request #9393 from swordqiu/automated-cherry-pick-of-#9390-upstream-release-3.4
Automated cherry pick of #9390: fix(region): network reserved ip count not consider expiration of reserved ips
2020-12-13 12:09:31 +08:00
Qiu Jian
47fdfc78c9 fix(region): network reserved ip count not consider expiration of reserved ips
network reserved ip count not consider expiration of reserved ips
2020-12-12 19:48:51 +08:00
TangBin
96d199724e feat(region): support sync skus by cloudregion 2020-12-12 19:08:29 +08:00
Zexi Li
50a36e3906 Merge pull request #9376 from tb365/automated-cherry-pick-of-#9359-upstream-release-3.4
Automated cherry pick of #9359: Bugfix/tb bugfix cmb 1210
2020-12-12 18:28:53 +08:00
TangBin
3817b9e6ad fix(region): goimports check fix 2020-12-12 17:54:42 +08:00
TangBin
e4c07c0304 feat(region): support sync skus by cloudregion 2020-12-12 17:45:59 +08:00
TangBin
2ff318a5b8 fix(region): server login info& keypair import input parameter trimspace 2020-12-12 17:28:16 +08:00
Zexi Li
e8605a1758 Merge pull request #9369 from swordqiu/automated-cherry-pick-of-#9366-upstream-release-3.4
Automated cherry pick of #9366: fix(keystone): ignore service config update without changes
2020-12-12 00:14:21 +08:00
Qiu Jian
ee391ed98a fix(keystone): ignore service config update without changes
ignore service config updates that no changes happen. prevent service
config change infomrer messages from flushing the log.
2020-12-11 22:22:42 +08:00
yunion-ci-robot
d2702b67f9 Merge pull request #9338 from zexi/automated-cherry-pick-of-#9335-upstream-release-3.4
Automated cherry pick of #9335: Hotfix/baremetal convert host
2020-12-11 13:32:15 +08:00
Zexi Li
deae194d43 Merge pull request #9355 from zexi/automated-cherry-pick-of-#9352-upstream-release-3.4
Automated cherry pick of #9352: Bugfix/scheduler SKU net
2020-12-11 09:18:31 +08:00
Zexi Li
aad036a822 fix(scheduler): sku by region and fill onecloud vpc networks 2020-12-10 21:14:37 +08:00
Zexi Li
16f59a2f2c Merge pull request #9334 from ioito/automated-cherry-pick-of-#9331-upstream-release-3.4
Automated cherry pick of #9331: fix(region): openstack hosts sync
2020-12-10 20:40:19 +08:00
Zexi Li
4aec6e7e36 Merge pull request #9350 from swordqiu/automated-cherry-pick-of-#9347-upstream-release-3.4
Automated cherry pick of #9347: fix(cloudcommon): perform public should check the sharing scope of
2020-12-10 20:38:12 +08:00
Qiu Jian
c553099588 fix(cloudcommon): perform public should check the sharing scope of resource
perform public should check the sharing scope of resource
2020-12-10 19:16:16 +08:00
Qu Xuan
5863e4a73d fix(region): openstack hosts sync 2020-12-10 18:23:54 +08:00
Zexi Li
bc3aa5432f Merge pull request #9327 from rainzm/automated-cherry-pick-of-#9325-upstream-release-3.4
Automated cherry pick of #9325: refactor(notify): add StartSubcontactPullTask for receiver
2020-12-10 17:22:21 +08:00
Zexi Li
bd666ee815 Merge pull request #9301 from ioito/automated-cherry-pick-of-#9298-upstream-release-3.4
Automated cherry pick of #9298: fix(region): support openstack subnet allocation pools
2020-12-10 17:18:08 +08:00
Zexi Li
2ad30a0872 Merge pull request #9323 from swordqiu/automated-cherry-pick-of-#9320-upstream-release-3.4
Automated cherry pick of #9320: fix(cloudcommon): disable quota check by default
2020-12-10 17:08:50 +08:00
Zexi Li
c5655ed2ba fix(baremetal): convert to host failed
- convert schedule should include converting status
- auto register name should lowercase
- finish convert set host name by guest
2020-12-10 16:59:41 +08:00
rainzm
3d99fe914d fix(notify): repull subcontact after changing config 2020-12-10 10:31:12 +08:00
rainzm
d357f03757 fix(notify): check for changes before updating config 2020-12-10 10:31:12 +08:00
rainzm
28e5b39fff refactor(notify): add StartSubcontactPullTask for receiver 2020-12-10 10:31:12 +08:00
Qiu Jian
2d248612e0 fix(cloudcommon): disable quota check by default
1. add enable_quota_check common option
2. disable quota check by default
3. specify scope of quota limit in OutOfQuota error message
2020-12-10 01:29:08 +08:00
Zexi Li
0ebde53d20 Merge pull request #9262 from wanyaoqi/automated-cherry-pick-of-#9259-upstream-release-3.4
Automated cherry pick of #9259: fix(region): attach network on register baremetal server
2020-12-09 20:40:56 +08:00
Zexi Li
8ac922480e Merge pull request #9311 from yousong/automated-cherry-pick-of-#9308-upstream-release-3.4
Automated cherry pick of #9308: Bugfix/yousong eip chargetype
2020-12-09 20:35:14 +08:00
Zexi Li
212bdc0907 Merge pull request #9318 from wanyaoqi/automated-cherry-pick-of-#9315-upstream-release-3.4
Automated cherry pick of #9315: fix(host): check lease living on restart etcd session
2020-12-09 20:33:23 +08:00
wanyaoqi
31436641cc fix(host): check lease living on restart etcd session 2020-12-09 16:57:19 +08:00
Yousong Zhou
5e3861b28b refactor(apis): compute: remove EIP_CHARGE_TYPE_DEFAULT
The default is now cloud provider specific
2020-12-09 12:26:58 +08:00
Yousong Zhou
475842e818 fix(region): sanitize eip charge type on all callsites 2020-12-09 12:26:58 +08:00
Yousong Zhou
f3fee11711 feat(region): regiondriver: add methods on eip charge type 2020-12-09 12:18:25 +08:00
Qu Xuan
d1d62de884 fix(region): support openstack subnet allocation pools 2020-12-09 10:33:04 +08:00
Zexi Li
20f2ed2b1f Merge pull request #9267 from ioito/automated-cherry-pick-of-#9266-upstream-release-3.4
Automated cherry pick of #9266: [WIP]fix(region): openstack available zones
2020-12-08 21:37:42 +08:00
Zexi Li
529da18451 Merge pull request #9280 from wanyaoqi/automated-cherry-pick-of-#9277-upstream-release-3.4
Automated cherry pick of #9277: fix(region): validate isolated devices on migrate
2020-12-08 21:36:12 +08:00
Zexi Li
ee5351b536 Merge pull request #9289 from zhasm/automated-cherry-pick-of-#9288-upstream-release-3.4
Automated cherry pick of #9288: fix(git,make): 更新获取 git branch 的规则
2020-12-08 18:11:22 +08:00
Zhang Dongliang
f82e51af65 fix(git,make): 更新获取 git branch 的规则 2020-12-08 18:00:34 +08:00
yunion-ci-robot
91680e5fca Merge pull request #9275 from wanyaoqi/automated-cherry-pick-of-#9272-upstream-release-3.4
Automated cherry pick of #9272: fix(host-deployer): cancel rename centos vgname
2020-12-08 17:07:40 +08:00
wanyaoqi
c74b89332d fix(region): validate isolated devices on migrate 2020-12-08 16:52:07 +08:00
Zexi Li
b8e6b5db7b Merge pull request #9271 from zhasm/automated-cherry-pick-of-#9268-upstream-release-3.4
Automated cherry pick of #9268: fix(git,make): git branch 获取方式优化
2020-12-08 16:35:45 +08:00
wanyaoqi
8471421b87 fix(host-deployer): cancel rename centos vgname 2020-12-08 16:30:48 +08:00
Qu Xuan
ab6d57afea fix(region): openstack available zones 2020-12-08 16:18:53 +08:00
Zhang Dongliang
5920af6aee fix(git,make): git branch 获取方式优化 2020-12-08 15:52:35 +08:00
Zexi Li
df6d774d69 Merge pull request #9256 from zhasm/automated-cherry-pick-of-#9230-upstream-release-3.4
Automated cherry pick of #9230: fix(git,make): 修正 gitbranch 变量的获取方式,解决自动升级版本 tag 不统一的问题
2020-12-08 12:50:51 +08:00
wanyaoqi
5d69ae9a02 fix(region): attach network on register baremetal server 2020-12-08 12:08:17 +08:00
Zhang Dongliang
c3be526988 fix(git,make): 修正 gitbranch 变量的获取方式,允许外部传入,解决自动升级版本 tag 不统一的问题 2020-12-08 11:50:47 +08:00
Zexi Li
9d1267b0f7 Merge pull request #9188 from rainzm/automated-cherry-pick-of-#9183-upstream-release-3.4
Automated cherry pick of #9183: fix(region): inspect invalid guest template
2020-12-04 10:21:23 +08:00
rainzm
e762b2e2e0 fix(region): inspect invalid guest template
The glance service hangs and other external reasons may cause the guest template to be judged as invalid.
Therefore, health inspection should be performed on time for invalid guest templates.
2020-12-03 20:45:20 +08:00
Zexi Li
cfefa015fd Merge pull request #9177 from zexi/automated-cherry-pick-of-#9176-upstream-release-3.4
Automated cherry pick of #9176: fix(scheduler): select resource unordered
2020-12-03 19:55:25 +08:00
Zexi Li
986fa9881f fix(scheduler): select resource unordered 2020-12-03 18:42:50 +08:00
Zexi Li
ffe1c9050b Merge pull request #9175 from yousong/automated-cherry-pick-of-#8483-upstream-release-3.4
Automated cherry pick of #8483: fix: climc vpc-create missing cloudregion_id
2020-12-03 18:39:20 +08:00
Qiu Jian
07bcf6a7a7 fix: climc vpc-create missing cloudregion_id 2020-12-03 18:18:46 +08:00
Zexi Li
0e01df9200 Merge pull request #9166 from wanyaoqi/automated-cherry-pick-of-#9163-upstream-release-3.4
Automated cherry pick of #9163: bugfix(region): fix list by srever type normal
2020-12-03 14:43:27 +08:00
Zexi Li
9e5667c50a Merge pull request #9168 from zhaoxiangchun/automated-cherry-pick-of-#9138-upstream-release-3.4
Automated cherry pick of #9138: fix(monitor): modify influxdbSuggestDriver query err
2020-12-03 14:42:26 +08:00
zhaoxiangchun
fd7fe62930 fix(monitor): modify influxdbSuggestDriver query err
1.修复influxdb相关的建议规则查询数据失败的问题
2020-12-03 14:16:21 +08:00
wanyaoqi
eba5bd84df bugfix(region): fix list by srever type normal
server list by normal shouldn't contains gpu and backup servers

cherrypick: release/3.4
2020-12-03 12:54:28 +08:00
Zexi Li
9080fdbde3 Merge pull request #9157 from wanyaoqi/automated-cherry-pick-of-#9154-upstream-release-3.4
Automated cherry pick of #9154: feat(region): add list filter server type
2020-12-03 09:34:12 +08:00
Zexi Li
ec76d129f6 Merge pull request #9153 from ioito/automated-cherry-pick-of-#9150-upstream-release-3.4
Automated cherry pick of #9150: fix(region): avoid qcloud sync local disk error
2020-12-02 21:05:23 +08:00
wanyaoqi
ee9e59df88 feat(region): add list filter server type
list server by specific server type: normal, gpu, backup

cherrypick: release/3.4
2020-12-02 20:31:44 +08:00
Qu Xuan
c2765f5fda fix(region): avoid qcloud sync local disk error 2020-12-02 20:27:54 +08:00
Zexi Li
8cd9d39155 Merge pull request #9143 from swordqiu/automated-cherry-pick-of-#9140-upstream-release-3.4
Automated cherry pick of #9140: fix(keystone): not allow to disable sql driver
2020-12-02 17:08:49 +08:00
Qiu Jian
e77ca84876 fix(keystone): not allow to disable sql driver
not allow to disable default SQL identity_provider driver
2020-12-02 16:42:35 +08:00
Zexi Li
76ca993e8a Merge pull request #9107 from rainzm/automated-cherry-pick-of-#9104-upstream-release-3.4
Automated cherry pick of #9104: fix(notify): return the result of the second attempt to execute the rpc call
2020-12-01 21:03:29 +08:00
Zexi Li
aa96758354 Merge pull request #9112 from yousong/automated-cherry-pick-of-#9109-upstream-release-3.4
Automated cherry pick of #9109: fix(host): make sure it won't match vpc guests by accident
2020-12-01 20:21:11 +08:00
Zexi Li
8a35ef6bcc Merge pull request #9119 from rainzm/automated-cherry-pick-of-#9116-upstream-release-3.4
Automated cherry pick of #9116: fix(region): delete guest without 'purge' in GuestDetachScalingGroupTask
2020-12-01 19:32:16 +08:00
rainzm
e2ab5190c6 fix(notify): return the result of the second attempt to execute the rpc call 2020-12-01 18:25:37 +08:00
rainzm
af006498f8 fix(region): delete guest without 'purge' in GuestDetachScalingGroupTask 2020-12-01 16:03:36 +08:00
Yousong Zhou
b54ebf45f3 fix(host): make sure it won't match vpc guests by accident 2020-12-01 15:33:31 +08:00
Zexi Li
639e1f045c Merge pull request #9099 from yousong/automated-cherry-pick-of-#9096-upstream-release-3.4
Automated cherry pick of #9096: Bugfix/yousong informer
2020-12-01 09:34:11 +08:00
Yousong Zhou
1c68b97c86 fix(taskman): SSubTask: set model manager 2020-11-30 23:13:04 +08:00
Yousong Zhou
ec47e47734 fix(region): secgrouprule: set model manager 2020-11-30 23:13:04 +08:00
Zexi Li
76fd4945bd Merge pull request #9082 from yousong/automated-cherry-pick-of-#9079-upstream-release-3.4
Automated cherry pick of #9079: feat(region): options: allow setting default vpc external access mode
2020-11-30 21:49:15 +08:00
Zexi Li
60ca1f7266 Merge pull request #9090 from rainzm/automated-cherry-pick-of-#9086-upstream-release-3.4
Automated cherry pick of #9086: fix(region): sort excludedNets correctly
2020-11-30 21:47:44 +08:00
rainzm
220fb5bca5 fix(region): sort excludedNets correctly
之前,excludedNets 内部表示起始 IP 的字段是 string 类型,直接使用 <
比较是错误的。
现在,把 excludedNets 表示起始 IP 的字段改为了
netutils.IPV4Addr,这样就可以正确地进行比较排序了。
2020-11-30 19:06:12 +08:00
Yousong Zhou
0ea12ffcc6 feat(region): options: allow setting default vpc external access mode 2020-11-30 18:30:31 +08:00
Yousong Zhou
f80c6a214a fix(region): pass up error from InitializeData 2020-11-30 18:30:31 +08:00
Zexi Li
29343a6828 Merge pull request #9060 from ioito/automated-cherry-pick-of-#8995-upstream-release-3.4
Automated cherry pick of #8995: fix(cloudid): avoid new public account sync system policy delay 1 day
2020-11-30 14:13:01 +08:00
Qu Xuan
b9d08c74a3 fix(cloudid): avoid new public account sync system policy delay 1 day 2020-11-27 20:18:26 +08:00
Zexi Li
4b06ee94d0 Merge pull request #9031 from ioito/automated-cherry-pick-of-#9021-upstream-release-3.4
Automated cherry pick of #9021: fix(region): auto sync cloudaccount resources
2020-11-27 20:14:05 +08:00
yunion-ci-robot
bf625de12d Merge pull request #9039 from yousong/automated-cherry-pick-of-#9036-upstream-release-3.4
Automated cherry pick of #9036: feat(region): search server by substr of ip or mac
2020-11-27 18:46:36 +08:00
Zexi Li
60dbb28022 Merge pull request #9053 from wanyaoqi/automated-cherry-pick-of-#9049-upstream-release-3.4
Automated cherry pick of #9049: fix(region,scheduler): fix netwrok predicate
2020-11-27 18:44:08 +08:00
wanyaoqi
43407d3d77 fix(region,scheduler): fix netwrok predicate
1. Guest config to schedule input should include network exit propertites.
2. Guest migrate and create backup server should not check network count,
because of migrate and create backup server will not allocate new network to guest.

cherrypick: release/3.5
2020-11-27 18:41:17 +08:00
Yousong Zhou
9e5018b147 feat(region): search server by substr of ip or mac 2020-11-27 15:16:47 +08:00
Qu Xuan
43f5c84955 fix(region): auto sync cloudaccount resources 2020-11-27 09:51:48 +08:00
Zexi Li
91dd66b5a8 Merge pull request #9008 from yousong/automated-cherry-pick-of-#9005-upstream-release-3.4
Automated cherry pick of #9005: Feature/yousong ovn encap ip
2020-11-26 21:29:31 +08:00
Yousong Zhou
1615426f29 feat(host): add option OvnEncapIpDetectionMethod can-reach:xx 2020-11-26 17:12:18 +08:00
Yousong Zhou
3df0be2fd4 feat(netutils2): add MyIPTo 2020-11-26 17:12:18 +08:00
Zexi Li
7d9a3c04b1 Merge pull request #8986 from swordqiu/automated-cherry-pick-of-#8968-upstream-release-3.4
Automated cherry pick of #8968: fix(region,esxiagent): allow host behind a nat
2020-11-26 12:11:25 +08:00
Zexi Li
1a2204d146 Merge pull request #8923 from zhaoxiangchun/automated-cherry-pick-of-#8920-upstream-release-3.4
Automated cherry pick of #8920: fix(monitor): modify notify alertInfo and alertOk detach resource
2020-11-26 11:45:32 +08:00
yunion-ci-robot
ed6c42ae37 Merge pull request #8994 from zexi/automated-cherry-pick-of-#8991-upstream-release-3.4
Automated cherry pick of #8991: fix(scheduler): clean expire cache before schedule
2020-11-26 11:43:31 +08:00
Zexi Li
372c9a393f fix(region): wire get vpc releated hosts is empty 2020-11-26 11:03:52 +08:00
Zexi Li
37f648bfb8 fix(region): network clean schedule cache after real deleted 2020-11-26 11:03:52 +08:00
Zexi Li
1818d4853a fix(scheduler): clean expire cache before schedule 2020-11-26 11:03:52 +08:00
zhaoxiangchun
ff5396b909 fix(monitor): modify notify alertInfo and alertOk detach resource
1.修复报警信息中>等被转义的问题
2.针对:host_raid.adapter和smart_device.exit_status
  只能出现alerting和nodata
两种报警状态。在queryCondition的查询逻辑下,nodata情况也进行detach操作
3.修复报警记录中报警策略翻译异常的问题
2020-11-26 09:46:34 +08:00
Zexi Li
b2854aff23 Merge pull request #8956 from tb365/automated-cherry-pick-of-#8955-upstream-release-3.4
Automated cherry pick of #8955: fix(region): allow reset huawei system disk
2020-11-25 22:01:28 +08:00
Zexi Li
da30ae5efd Merge pull request #8964 from ioito/automated-cherry-pick-of-#8961-upstream-release-3.4
Automated cherry pick of #8961: fix(region): valid qcloud hssd for system disk
2020-11-25 21:59:40 +08:00
Zexi Li
17face8f52 Merge pull request #8981 from zhaoxiangchun/automated-cherry-pick-of-#8977-upstream-release-3.4
Automated cherry pick of #8977: fix(monitor): modify monitor serviceType in StartService()
2020-11-25 21:57:11 +08:00
Zexi Li
9a8277ff20 Merge pull request #8990 from rainzm/automated-cherry-pick-of-#8987-upstream-release-3.4
Automated cherry pick of #8987: fix(region): allow delete storagecachedimage with 'cache_failed' status
2020-11-25 21:55:55 +08:00
rainzm
61eaea8099 fix(region): allow delete storagecachedimage with 'cache_failed' status
Having status 'cache_failed' means this storagecachedimage does not actually exist.
2020-11-25 20:48:02 +08:00
Qiu Jian
6f0d6cbeac fix(region,esxiagent): allow host behind a nat
check host by ip may fail if host is behind a nat. ignore this case.
2020-11-25 20:34:42 +08:00
zhaoxiangchun
09ed698ae8 fix(monitor): modify monitor serviceType in StartService()
1.修改monitor服务在service代码中注册的serviceType:
   alerter ===> monitor
2020-11-25 20:31:19 +08:00
TangBin
7bf1bef04a fix(region): update translations 2020-11-25 18:17:40 +08:00
TangBin
024a17de83 fix(region): allow reset huawei system disk 2020-11-25 18:11:26 +08:00
Qu Xuan
0f5a8b6407 fix(region): valid qcloud hssd for system disk 2020-11-25 11:53:04 +08:00
Zexi Li
cd4ce681b0 Merge pull request #8954 from ioito/automated-cherry-pick-of-#8895-upstream-release-3.4
Automated cherry pick of #8895: fix(region): 避免OneCloud密码校验通过,公有云厂商密码校验不通过
2020-11-25 10:06:19 +08:00
Qu Xuan
fc16c37eab fix(region): 避免OneCloud密码校验通过,公有云厂商密码校验不通过 2020-11-25 09:56:37 +08:00
Zexi Li
3dfd086a27 Merge pull request #8950 from yousong/automated-cherry-pick-of-#8947-upstream-release-3.4
Automated cherry pick of #8947: fix(region): change_ipaddr: retain eip_id on detach and attach
2020-11-25 09:28:23 +08:00
yunion-ci-robot
8e2cd5112d Merge pull request #8945 from yousong/automated-cherry-pick-of-#8942-upstream-release-3.4
Automated cherry pick of #8942: feat(cloudcommon): db: jointbase: add list:"user" for RowId
2020-11-25 09:17:18 +08:00
Yousong Zhou
a5d82922bd fix(region): change_ipaddr: retain eip_id on detach and attach 2020-11-24 21:59:33 +08:00
Yousong Zhou
9d19bf34b0 fix(vpcagent): models: guestnetworks: accomodate change_ipaddr
change_ipaddr does detach, then attach of network.  It's not solely an
update of ipaddr, but a combination of deletion then creation.
2020-11-24 21:56:05 +08:00
Yousong Zhou
e4bf0fa8dc feat(cloudcommon): db: jointbase: add list:"user" for RowId 2020-11-24 21:56:05 +08:00
Zexi Li
6bd82d216d Merge pull request #8932 from tb365/bugfix/tb-elasticcache-empty-error-fix
fix(region): elastic cache task fail message fix
2020-11-24 21:31:09 +08:00
Zexi Li
60138f6401 Merge pull request #8927 from zhaoxiangchun/automated-cherry-pick-of-#8926-upstream-release-3.4
Automated cherry pick of #8926: fix(monitor): modify suggestrule  process influxdb data
2020-11-24 21:29:36 +08:00
yunion-ci-robot
a43f747bdc Merge pull request #8936 from ioito/automated-cherry-pick-of-#8933-upstream-release-3.4
Automated cherry pick of #8933: fix(region): avoid public ip bandwidth is zero
2020-11-24 20:25:27 +08:00
Qu Xuan
2560198943 fix(region): avoid public ip bandwidth is zero 2020-11-24 18:11:38 +08:00
zhaoxiangchun
6e0d4cb35c fix(monitor): modify suggestrule process influxdb data
1. 调整与监控相关的时间范围的判断逻辑:不再要求时间范围内必须都有数据
2020-11-24 17:48:05 +08:00
TangBin
71535f670e fix(region): elastic cache task fail message fix
#6399
2020-11-24 17:07:30 +08:00
Zexi Li
5e47566b42 Merge pull request #8900 from wanyaoqi/automated-cherry-pick-of-#8889-upstream-release-3.4
Automated cherry pick of #8889: fix(host): wait put host offline success
2020-11-23 13:04:31 +08:00
wanyaoqi
c325d8355c fix(host): wait put host offline success
Unregister host wait for host offline success,
in case region is in upgrading.

cherrypick: release/3.4
2020-11-22 15:30:56 +08:00
Zexi Li
206dc2a62d Merge pull request #8894 from yousong/automated-cherry-pick-of-#8892-upstream-release-3.4
Automated cherry pick of #8892: fix(locales): fix translation text
2020-11-22 11:00:07 +08:00
yunion-ci-robot
55a7de9ba6 Merge pull request #8867 from swordqiu/automated-cherry-pick-of-#8865-upstream-release-3.4
Automated cherry pick of #8865: fix: allow disk attach to multiple guests
2020-11-21 19:25:00 +08:00
Yousong Zhou
3b2938380a fix(region): elasticcache_instances: fix error fmt 2020-11-21 17:36:36 +08:00
Yousong Zhou
3774549979 fix(locales): fix translation text 2020-11-21 17:35:45 +08:00
Zexi Li
9c2cc664f6 Merge pull request #8883 from ioito/hotfix/qx-rds-network-params
fix(region): compatible rds network params
2020-11-20 12:03:19 +08:00
Qu Xuan
42582043ee fix(region): compatible rds network params 2020-11-20 11:44:10 +08:00
Zexi Li
690aef8f4e Merge pull request #8875 from ioito/automated-cherry-pick-of-#8873-upstream-release-3.4
Automated cherry pick of #8873: optimized: server delete log and wait time
2020-11-20 10:04:32 +08:00
Zexi Li
eb7173085e Merge pull request #8880 from ioito/automated-cherry-pick-of-#8876-upstream-release-3.4
Automated cherry pick of #8876: feat: rds recovery new instance from backup supported
2020-11-19 20:53:14 +08:00
Qu Xuan
b6917c5604 feat: rds recovery new instance from backup supported 2020-11-19 20:39:56 +08:00
Qu Xuan
47349e71b9 optimized: server delete log and wait time 2020-11-19 16:27:18 +08:00
Qiu Jian
3d2b24a351 fix: allow disk attach to multiple guests 2020-11-19 13:27:30 +08:00
Zexi Li
b9565f288a Merge pull request #8862 from swordqiu/automated-cherry-pick-of-#8860-upstream-release-3.4
Automated cherry pick of #8860: fix: add host.memoty.total and host.cpu.total usage stats
2020-11-19 11:03:21 +08:00
Qiu Jian
6b0ae74acb fix: add host.memoty.total and host.cpu.total usage stats 2020-11-19 01:26:37 +08:00
Zexi Li
438a0cb0b7 Merge pull request #8846 from zhaoxiangchun/automated-cherry-pick-of-#8844-upstream-release-3.4
Automated cherry pick of #8844: detach AlertResource on alertDisable
2020-11-18 21:16:36 +08:00
Zexi Li
3fb97c99b6 Merge pull request #8852 from swordqiu/automated-cherry-pick-of-#8850-upstream-release-3.4
Automated cherry pick of #8850: fix: add host-joint resources into domain level resources
2020-11-18 21:15:07 +08:00
yunion-ci-robot
ad8459053f Merge pull request #8855 from zhasm/automated-cherry-pick-of-#8849-upstream-release-3.4
Automated cherry pick of #8849: docker 交叉编译规则更新
2020-11-18 16:36:13 +08:00
Zhang Dongliang
491a9ece55 docker 交叉编译规则更新 2020-11-18 16:14:31 +08:00
Qiu Jian
ba2a188f0d fix: add host-joint resources into domain level resources 2020-11-18 15:26:39 +08:00
zhaoxiangchun
ea793d9902 detach AlertResource on alertDisable
1. 报警规则禁用时,detach 关联的报警资源

影响范围:报警规则的禁用;logger日志服务i18n的日志展示
2020-11-18 12:21:25 +08:00
Zexi Li
4b4964e58e Merge pull request #8840 from rainzm/automated-cherry-pick-of-#8827-upstream-release-3.4
Automated cherry pick of #8827: fix(notify): be compatible with keystone's UsersV3.GetById
2020-11-17 17:52:11 +08:00
rainzm
4a06b38da8 fix: add err handler for notifyRobot 2020-11-17 17:13:15 +08:00
rainzm
96400124ba feat(notify): enable watching user in keystone 2020-11-17 17:13:15 +08:00
rainzm
aee0299d71 fix(notify): be compatible with keystone's UsersV3.GetById
Fill UsersV3.GetById with user's name, it will return user's info.
2020-11-17 17:13:15 +08:00
Zexi Li
cbea17b4c4 Merge pull request #8835 from ioito/automated-cherry-pick-of-#8823-upstream-release-3.4
Automated cherry pick of #8823: optimized: aliyun create rds backup
2020-11-17 14:52:30 +08:00
Zexi Li
4acb237f70 Merge pull request #8833 from zhaoxiangchun/automated-cherry-pick-of-#8816-upstream-release-3.4
Automated cherry pick of #8816: modify  alertResource ws info
2020-11-17 14:51:29 +08:00
Qu Xuan
3a8e998718 optimized: aliyun create rds backup 2020-11-17 14:30:42 +08:00
zhaoxiangchun
bef9af4c3b modify alertResource ws info
ignore_alert:ture 前端不再进行弹窗提示
2020-11-17 14:23:28 +08:00
Zexi Li
3e17ee7519 Merge pull request #8805 from wanyaoqi/automated-cherry-pick-of-#8803-upstream-release-3.4
Automated cherry pick of #8803: host: restart etcd session on keepalive failed
2020-11-17 14:20:24 +08:00
yunion-ci-robot
d3aba7285a Merge pull request #8819 from ioito/automated-cherry-pick-of-#8817-upstream-release-3.4
Automated cherry pick of #8817: fix: add error cause
2020-11-16 21:42:06 +08:00
Qu Xuan
43f4f5f946 fix: add error cause 2020-11-16 14:57:37 +08:00
Zexi Li
4d3c7f3059 Merge pull request #8785 from tb365/automated-cherry-pick-of-#8783-upstream-release-3.4
Automated cherry pick of #8783: aliyun finance cloud region add suffix
2020-11-15 08:00:55 +08:00
Zexi Li
fd26fc1947 Merge pull request #8808 from zhaoxiangchun/automated-cherry-pick-of-#8806-upstream-release-3.4
Automated cherry pick of #8806: commonalert bugfix:
2020-11-15 07:55:32 +08:00
Zexi Li
b74f61fe1d Merge pull request #8811 from swordqiu/automated-cherry-pick-of-#8809-upstream-release-3.4
Automated cherry pick of #8809: fix: baremetal usage should exclude converted hypervisor
2020-11-15 07:52:46 +08:00
Qiu Jian
dc19e7b035 fix: baremetal usage should exclude converted hypervisor 2020-11-15 01:42:32 +08:00
zhaoxiangchun
37272588fa commonalert bugfix:
1.修改消息模版内容:对matches信息进行聚合只返回对应的name信息。解决body消息超过限制
2.报警资源:每次以策略匹配的最新matches为标准。进行updateOrCreate 和
  delete操作。

影响范围:消息模版、报警资源数量
2020-11-14 18:44:14 +08:00
wanyaoqi
029530ac34 host: restart etcd session on keepalive failed 2020-11-14 15:27:10 +08:00
yunion-ci-robot
c047d69a53 Merge pull request #8802 from swordqiu/automated-cherry-pick-of-#8800-upstream-release-3.4
Automated cherry pick of #8800: fix: host memory usage status not correct
2020-11-14 11:22:04 +08:00
yunion-ci-robot
6f76c5d670 Merge pull request #8798 from yousong/automated-cherry-pick-of-#8796-upstream-release-3.4
Automated cherry pick of #8796: vendor: update yunion.io/x/jsonutils
2020-11-14 00:11:06 +08:00
Qiu Jian
71ddac232d fix: host memory usage status not correct 2020-11-13 23:59:51 +08:00
Yousong Zhou
ca9859f126 vendor: update yunion.io/x/jsonutils
See yunionio/onecloud#8357
2020-11-13 18:46:27 +08:00
Zexi Li
7db6ad9a01 Merge pull request #8788 from swordqiu/automated-cherry-pick-of-#8786-upstream-release-3.4
Automated cherry pick of #8786: fix: keystone init empty catalogy cause panic
2020-11-13 15:24:09 +08:00
Qiu Jian
b545066e05 fix: keystone init empty catalogy cause panic 2020-11-13 14:56:24 +08:00
TangBin
befef016dc aliyun finance cloud zone add suffix 2020-11-13 14:44:30 +08:00
TangBin
c32ad0ac5b aliyun finance cloud region add suffix 2020-11-13 14:44:29 +08:00
Zexi Li
ecc75aa231 Merge pull request #8773 from swordqiu/automated-cherry-pick-of-#8771-upstream-release-3.4
Automated cherry pick of #8771: feature: allow join project across domain
2020-11-13 10:39:50 +08:00
Zexi Li
202e0bf266 Merge pull request #8778 from zhaoxiangchun/automated-cherry-pick-of-#8776-upstream-release-3.4
Automated cherry pick of #8776: suggestalet bugfix
2020-11-13 10:39:14 +08:00
zhaoxiangchun
c4d4700d26 suggestalet bugfix
1.安全组规则的in规则为全开放的主机 筛选逻辑修改
2.修复无法正确过滤用户所属资源的bug
2020-11-12 21:32:15 +08:00
Qiu Jian
1fce2ec30c feature: allow join project across domain 2020-11-12 20:41:27 +08:00
Zexi Li
dfe7661c61 Merge pull request #8762 from ioito/automated-cherry-pick-of-#8760-upstream-release-3.4
Automated cherry pick of #8760: fix: avoid panic
2020-11-12 19:31:31 +08:00
Zexi Li
5a28b3c13e Merge pull request #8766 from ioito/automated-cherry-pick-of-#8764-upstream-release-3.4
Automated cherry pick of #8764: fix: support resize qcloud hssd disk
2020-11-12 18:51:40 +08:00
Qu Xuan
27c8861b64 fix: support resize qcloud hssd disk 2020-11-12 16:48:17 +08:00
Qu Xuan
e9459b4a7d fix: avoid panic 2020-11-12 16:20:16 +08:00
yunion-ci-robot
5861a18051 Merge pull request #8755 from rainzm/automated-cherry-pick-of-#8753-upstream-release-3.4
Automated cherry pick of #8753: fix(region): prevent infinite recursion
2020-11-12 11:54:03 +08:00
rainzm
0bbe2e7590 fix(region): prevent infinite recursion
When weekDays is [1,2,3,4,5,6,7] and timePoints is [0], It will recurse infinitely.
2020-11-12 11:39:58 +08:00
Zexi Li
b93d695fe9 Merge pull request #8751 from ioito/automated-cherry-pick-of-#8749-upstream-release-3.4
Automated cherry pick of #8749: fix: renew rds
2020-11-12 00:49:52 +08:00
Qu Xuan
39fe8b2133 fix: renew rds 2020-11-11 20:20:25 +08:00
Zexi Li
c357d61add Merge pull request #8725 from tb365/automated-cherry-pick-of-#8723-upstream-release-3.4
Automated cherry pick of #8723: batch user create bugifx
2020-11-11 11:57:08 +08:00
Zexi Li
749ca9dc63 Merge pull request #8745 from wanyaoqi/automated-cherry-pick-of-#8722-upstream-release-3.4
Automated cherry pick of #8722: add success note on guest start and stop
2020-11-11 11:55:48 +08:00
Zexi Li
5aa0bbb091 Merge pull request #8721 from tb365/automated-cherry-pick-of-#8719-upstream-release-3.4
Automated cherry pick of #8719: huawei create disk bugfix
2020-11-11 11:54:17 +08:00
wanyaoqi
7d35397d50 host: specifie bash for start guest 2020-11-11 11:05:30 +08:00
wanyaoqi
30776fc707 usage: host show isolated dev reserved memory 2020-11-11 11:05:30 +08:00
wanyaoqi
ea70090f6b add success note on guest start and stop 2020-11-11 11:05:30 +08:00
TangBin
e9a4a6380e batch user create bugifx 2020-11-10 16:49:49 +08:00
TangBin
642b137332 huawei create disk bugfix 2020-11-10 16:18:05 +08:00
Zexi Li
ce60116ba3 Merge pull request #8717 from ioito/automated-cherry-pick-of-#8715-upstream-release-3.4
Automated cherry pick of #8715: fix: aws secgroup out rule is deny any
2020-11-10 12:54:34 +08:00
Qu Xuan
1ee8fd05b3 fix: aws secgroup out rule is deny any 2020-11-10 11:04:58 +08:00
Zexi Li
e1d1ef0dd8 Merge pull request #8695 from lvyangyang/automated-cherry-pick-of-#8694-upstream-release-3.4
Automated cherry pick of #8694: fix:修复dns record name校验的问题
2020-11-07 18:42:59 +08:00
lvyangyang
e108d17556 fix:修复dns record name校验的问题 2020-11-06 19:59:52 +08:00
yunion-ci-robot
fe6cb8a9cf Merge pull request #8691 from swordqiu/automated-cherry-pick-of-#8689-upstream-release-3.4
Automated cherry pick of #8689: fix: change owner should update quota usages
2020-11-06 15:11:19 +08:00
yunion-ci-robot
9a9f77c9d9 Merge pull request #8688 from rainzm/automated-cherry-pick-of-#8686-upstream-release-3.4
Automated cherry pick of #8686: feat(region): add option NoCheckOsTypeForCachedImage
2020-11-06 15:07:17 +08:00
yunion-ci-robot
35ac1f9fdd Merge pull request #8685 from ioito/automated-cherry-pick-of-#8683-upstream-release-3.4
Automated cherry pick of #8683: fix: aliyun eip api
2020-11-06 15:04:20 +08:00
Qiu Jian
6927652a65 fix: change owner should update quota usages 2020-11-06 14:48:29 +08:00
Zexi Li
c4afca7187 Merge pull request #8682 from ioito/automated-cherry-pick-of-#8680-upstream-release-3.4
Automated cherry pick of #8680: fix: 支持多内存过滤套餐
2020-11-06 13:50:07 +08:00
Zexi Li
a49d0b280c Merge pull request #8679 from swordqiu/automated-cherry-pick-of-#8677-upstream-release-3.4
Automated cherry pick of #8677: fix: missing column error when order by extra fields
2020-11-06 13:49:42 +08:00
Zexi Li
f797f062f8 Merge pull request #8674 from zexi/automated-cherry-pick-of-#8672-upstream-release-3.4
Automated cherry pick of #8672: scheduler: ignore non running guests only exclude ready status
2020-11-06 13:48:23 +08:00
rainzm
6f60f1a48b fix(esxi): don't specify spec.Identity when osName is empty 2020-11-06 12:58:51 +08:00
rainzm
c3b8e7bbd4 fix(esxi): add device after cloning vm 2020-11-06 12:57:19 +08:00
rainzm
edc651a308 refactor(region): faster GetIImageById 2020-11-06 12:01:41 +08:00
rainzm
76b1796c7e refactor(region): faster sync CapacityUsed for Storage
1. replace cronjob SyncCapacityUsedForStorage with
SyncCapacityUsedForEsxiStorage
2. do not sync capacityUsed for storage when deleting and creating vm
for now because of performance issues。
2020-11-06 12:01:41 +08:00
rainzm
b5201a352f feat(region): add option NoCheckOsTypeForCachedImage 2020-11-06 12:01:41 +08:00
Qu Xuan
fc4460fa39 fix: aliyun eip api 2020-11-06 11:10:32 +08:00
Qu Xuan
e975fc6713 fix: 支持多内存过滤套餐 2020-11-06 10:32:20 +08:00
Qiu Jian
c8ddd7653f fix: missing column error when order by extra fields 2020-11-05 23:52:32 +08:00
Zexi Li
827be9167e scheduler: ignore non running guests only exclude ready status 2020-11-05 18:23:51 +08:00
Zexi Li
f55022a26d Merge pull request #8666 from swordqiu/automated-cherry-pick-of-#8664-upstream-release-3.4
Automated cherry pick of #8664: update vendor for jsonutils
2020-11-05 13:10:35 +08:00
Qiu Jian
aae3da8c2b update vendor for jsonutils 2020-11-05 11:34:28 +08:00
yunion-ci-robot
e6828a1665 Merge pull request #8656 from lvyangyang/automated-cherry-pick-of-#8655-upstream-release-3.4
Automated cherry pick of #8655: fix:域名正则校验dnsrecord name,同步中文域名取punycode
2020-11-04 18:42:10 +08:00
lvyangyang
6bfff8b70d fix:域名正则校验dnsrecord name,同步中文域名取punycode 2020-11-04 17:38:27 +08:00
Zexi Li
a3753fc311 Merge pull request #8634 from tb365/automated-cherry-pick-of-#8633-upstream-release-3.4
Automated cherry pick of #8633: aws create bugfix
2020-11-04 11:19:57 +08:00
Zexi Li
2b7ba4df63 Merge pull request #8642 from rainzm/automated-cherry-pick-of-#8640-upstream-release-3.4
Automated cherry pick of #8640: fix(notify): customize the title of the verification email based on the copyright
2020-11-04 10:57:16 +08:00
Zexi Li
4fde5eab04 Merge pull request #8639 from ioito/automated-cherry-pick-of-#8636-upstream-release-3.4
Automated cherry pick of #8636: fix: add qcloud hssd
2020-11-03 20:41:32 +08:00
rainzm
58c5514a01 fix(notify): customize the title of the verification email based on the copyright 2020-11-03 20:26:52 +08:00
Qu Xuan
0c19c21efa fix: add qcloud hssd 2020-11-03 20:22:07 +08:00
TangBin
41dd48e8fa lbcert cache delete bugfix 2020-11-03 16:40:37 +08:00
TangBin
3ceb0e2dc1 aws create bugfix 2020-11-03 16:40:37 +08:00
Zexi Li
ab479aea26 Merge pull request #8623 from wanyaoqi/automated-cherry-pick-of-#8619-upstream-release-3.4
Automated cherry pick of #8619: fix stream disk on add disk from snapshot
2020-11-03 10:40:01 +08:00
wanyaoqi
82f5b9ccb0 fix stream disk on add disk from snapshot 2020-11-02 19:32:37 +08:00
Zexi Li
4d7b6ef36d Merge pull request #8615 from ioito/automated-cherry-pick-of-#8613-upstream-release-3.4
Automated cherry pick of #8613: optimized: rds zone sync
2020-11-02 19:12:44 +08:00
Qu Xuan
83d0a3ce0c optimized: rds zone sync 2020-11-02 16:52:08 +08:00
yunion-ci-robot
10b4ebfd01 Merge pull request #8606 from rainzm/automated-cherry-pick-of-#8603-upstream-release-3.4
Automated cherry pick of #8603: fix(region): compute NextSyncTime for snapshotpolicydisk
2020-11-02 01:43:45 +08:00
yunion-ci-robot
bc5f255bc7 Merge pull request #8610 from swordqiu/automated-cherry-pick-of-#8608-upstream-release-3.4
Automated cherry pick of #8608: fix: save service config changes may send invalid action log
2020-11-01 11:48:48 +08:00
Qiu Jian
c8138c291b fix: save service config changes may send invalid action log 2020-10-31 19:06:22 +08:00
Rain Zheng
f290aa5d58 fix(region): compute NextSyncTime for snapshotpolicydisk
1. 如果计算出来的 NextSyncTime 和 base 相等,可以将 base 加1一个小时递归处理。
2. 对于 retentionday 有效的快照策略,比如某一个 snaphsotpolicy
是每周一生效,并且打的快照自动保留 3 天,那么,就应该在每周一(打快照)
和每周四(释放快照)进行快照的同步。
2020-10-31 15:50:51 +08:00
yunion-ci-robot
a6f97fc759 Merge pull request #8595 from rainzm/automated-cherry-pick-of-#8593-upstream-release-3.4
Automated cherry pick of #8593: fix(region): prevent dirty data when syncing snapshot
2020-10-30 19:38:45 +08:00
yunion-ci-robot
dfeee78717 Merge pull request #8592 from ioito/automated-cherry-pick-of-#8590-upstream-release-3.4
Automated cherry pick of #8590: fix: secgroup cache tenant_id
2020-10-30 19:34:56 +08:00
rainzm
7460ea1461 fix(region): clear dirty data of snapshotpolicydisks when start up 2020-10-30 15:24:56 +08:00
rainzm
250ad41c7b fix(region): detach all snapshotpolicy when realdeleting disk 2020-10-30 15:24:56 +08:00
rainzm
a53a44cb2e fix(region): prevent dirty data when syncing snapshot 2020-10-30 15:24:56 +08:00
Qu Xuan
4cbe931635 fix: secgroup cache tenant_id 2020-10-30 15:04:25 +08:00
yunion-ci-robot
45fc6d0ff1 Merge pull request #8578 from rainzm/automated-cherry-pick-of-#8576-upstream-release-3.4
Automated cherry pick of #8576: fix(region): sync automatically snapshot for external disk
2020-10-30 09:11:44 +08:00
yunion-ci-robot
a1b72712ec Merge pull request #8561 from zexi/automated-cherry-pick-of-#8558-upstream-release-3.4
Automated cherry pick of #8558: informer: ignore outside context cancel when worker run
2020-10-30 00:37:44 +08:00
yunion-ci-robot
8e474c5961 Merge pull request #8579 from tb365/automated-cherry-pick-of-#8573-upstream-release-3.4
Automated cherry pick of #8573: qcloud elb cert duplicate fix
2020-10-29 23:28:43 +08:00
TangBin
8f2f78b4ed qcloud elb cert duplicate fix 2020-10-29 22:37:09 +08:00
rainzm
a3f01f1330 fix(region): sync automatically snapshot for external disk 2020-10-29 22:32:21 +08:00
Zexi Li
a0f495db93 informer: ignore outside context cancel when worker run 2020-10-29 20:54:00 +08:00
yunion-ci-robot
605f3fea26 Merge pull request #8566 from rainzm/automated-cherry-pick-of-#8564-upstream-release-3.4
Automated cherry pick of #8564: update vendor
2020-10-29 20:08:43 +08:00
rainzm
52a72952c9 update vendor 2020-10-29 17:25:58 +08:00
Yousong Zhou
4eb1292a2d Merge pull request #8550 from swordqiu/automated-cherry-pick-of-#8548-upstream-release-3.4
Automated cherry pick of #8548: fix: fail to delete public_ip eip
2020-10-29 10:18:33 +08:00
Qiu Jian
b1e91c1c27 fix: fail to delete public_ip eip 2020-10-28 23:46:20 +08:00
yunion-ci-robot
a1760d7b86 Merge pull request #8537 from rainzm/automated-cherry-pick-of-#8535-upstream-release-3.4
Automated cherry pick of #8535: refactor(region): faster list for cachedimage
2020-10-28 17:58:42 +08:00
rainzm
c456586860 refactor(region): faster list for cachedimage
Pro version of #8440 with checking the necessity of id filtering
2020-10-28 15:36:03 +08:00
yunion-ci-robot
71e759a032 Merge pull request #8527 from rainzm/automated-cherry-pick-of-#8525-upstream-release-3.4
Automated cherry pick of #8525: fix(esxi): no callback in uploadHandler
2020-10-28 00:59:42 +08:00
yunion-ci-robot
96ce64d5f0 Merge pull request #8514 from ioito/automated-cherry-pick-of-#8512-upstream-release-3.4
Automated cherry pick of #8512: fix: avoid sync project panic
2020-10-28 00:48:42 +08:00
rainzm
d31802c87b fix(esxi): filter vmdk item in lease.info 2020-10-27 21:32:21 +08:00
rainzm
d3964bf0d1 fix(esxi): use correct device index
1. Sort devices via their Key.
2. There is no relationship between vdisk index and vnics length.
2020-10-27 21:32:21 +08:00
rainzm
57dad6281a fix(esxi): no callback in uploadHandler 2020-10-27 21:32:21 +08:00
Zexi Li
b74130903e Merge pull request #8519 from ioito/automated-cherry-pick-of-#8517-upstream-release-3.4
Automated cherry pick of #8517: fix: set secgroup status
2020-10-27 17:28:39 +08:00
Qu Xuan
44046f2861 fix: set secgroup status 2020-10-27 16:20:06 +08:00
Qu Xuan
95f7600b67 fix: avoid sync project panic 2020-10-27 16:13:48 +08:00
yunion-ci-robot
749b819a62 Merge pull request #8501 from yousong/automated-cherry-pick-of-#8499-upstream-release-3.4
Automated cherry pick of #8499: lockman: test: add prefix setting
2020-10-26 21:24:40 +08:00
Yousong Zhou
f7f7c7be81 lockman: test: add prefix setting 2020-10-26 20:36:32 +08:00
yunion-ci-robot
6a221dbc1e Merge pull request #8498 from zhaoxiangchun/automated-cherry-pick-of-#8496-upstream-release-3.4
Automated cherry pick of #8496: commalertUpdateInput increat param:
2020-10-26 19:55:47 +08:00
zhaoxiangchun
002a2af272 commalertUpdateInput increat param:
1.处理operator对alertType == system的报警策略的update请求
2020-10-26 18:21:11 +08:00
yunion-ci-robot
1757d3d6a9 Merge pull request #8494 from rainzm/automated-cherry-pick-of-#8493-upstream-release-3.4
Automated cherry pick of #8493: fix(region): roll back the optimization of cachedimage list
2020-10-26 18:17:39 +08:00
rainzm
be5a6a93cc fix(region): roll back the optimization of cachedimage list 2020-10-26 17:37:59 +08:00
yunion-ci-robot
bbbe78dbef Merge pull request #8489 from ioito/automated-cherry-pick-of-#8487-upstream-release-3.4
Automated cherry pick of #8487: fix: avoid delete public ip when sync eip list
2020-10-26 17:02:42 +08:00
Qu Xuan
a851e01330 fix: avoid delete public ip when sync eip list 2020-10-26 16:18:46 +08:00
yunion-ci-robot
29d06d52dd Merge pull request #8466 from wanyaoqi/automated-cherry-pick-of-#8464-upstream-release-3.4
Automated cherry pick of #8464: check disk is in reset before delete snapshot
2020-10-25 10:54:39 +08:00
yunion-ci-robot
1a6d4d1035 Merge pull request #8486 from swordqiu/automated-cherry-pick-of-#8484-upstream-release-3.4
Automated cherry pick of #8484: fix: server usage status not correct
2020-10-25 10:52:41 +08:00
Qiu Jian
90d649aef9 fix: server usage status not correct 2020-10-25 08:38:48 +08:00
Zexi Li
23b99a6232 Merge pull request #8472 from wanyaoqi/automated-cherry-pick-of-#8470-upstream-release-3.4
Automated cherry pick of #8470: fix on stream disk complete snapshots refcount not update
2020-10-24 13:09:42 +08:00
Zexi Li
16c38fe6be Merge pull request #8476 from zexi/automated-cherry-pick-of-#8474-upstream-release-3.4
Automated cherry pick of #8474: monitor: set default influxdb datasource by endpoint type
2020-10-24 13:07:07 +08:00
Zexi Li
b43f8b3fac monitor: set default influxdb datasource by endpoint type 2020-10-23 20:10:08 +08:00
wanyaoqi
8e5b74a3f6 fix on stream disk complete snapshots refcount not update 2020-10-23 19:11:32 +08:00
yunion-ci-robot
b0cd3bf999 Merge pull request #8414 from zhaoxiangchun/automated-cherry-pick-of-#8412-upstream-release-3.4
Automated cherry pick of #8412: bugfix:
2020-10-23 18:35:17 +08:00
yunion-ci-robot
4a15284684 Merge pull request #8463 from rainzm/automated-cherry-pick-of-#8461-upstream-release-3.4
Automated cherry pick of #8461: fix(glance): allow public and private operations of guestimage
2020-10-23 18:29:15 +08:00
wanyaoqi
d78068d43a check disk is in reset before delete snapshot 2020-10-23 18:26:22 +08:00
yunion-ci-robot
80dce5eafb Merge pull request #8452 from wanyaoqi/automated-cherry-pick-of-#8450-upstream-release-3.4
Automated cherry pick of #8450: host increase cpu mem max size
2020-10-23 18:18:20 +08:00
yunion-ci-robot
950696ddb9 Merge pull request #8458 from rainzm/automated-cherry-pick-of-#8456-upstream-release-3.4
Automated cherry pick of #8456: fix(esxi): resize root disk after cloning vm
2020-10-23 18:17:20 +08:00
zhaoxiangchun
e7674116e1 bugfix:
1.资源报警增加websocket 消息通知:admin用户
2.统一influxdb中查询到的tag展示
2020-10-23 17:58:20 +08:00
rainzm
3fae388db5 fix(glance): allow public and private operations of guestimage
The public and private operations of the guest image depends on these operations of the subimage.
2020-10-23 17:57:48 +08:00
rainzm
8f3b8c7ff1 fix(esxi): resize root disk after cloning vm
The root disk size set when the machine is cloned does not take effect,
so set the root disk size after the machine is cloned.
2020-10-23 17:03:52 +08:00
wanyaoqi
a4b1d3952d host increase cpu mem max size 2020-10-23 15:15:55 +08:00
yunion-ci-robot
a5ef16243d Merge pull request #8442 from rainzm/automated-cherry-pick-of-#8440-upstream-release-3.4
Automated cherry pick of #8440: refactor(region): faster list for cachedimage
2020-10-22 21:25:14 +08:00
rainzm
b0823a09bb refactor(region): faster list for cachedimage
修改之前:
诸如provider, zone, host_schedtag_id, valid
等过滤条件,是通过过滤出符合条件的 storagecachedimage 然后使用 cachedimage_id 来过滤 cachedimge,
问题是,每一个过滤条件都会独立的去执行上面的过程,这样同样的查询可能要经过很多次,并且如果遇到
弱的过滤条件,比如 valid ,过滤出来的 storagecachedimage
非常之多,然后在使用 cachedimage_id 去过滤 cachedimage,会非常慢。

修改之后:
过滤条件的相似的逻辑合并起来,只需要向 subQuery 中添加 filter,使用 subQuery 一次把 storagecachedimage
过滤出来,然后使用 cachedimage_id 过滤 cachedimage。
2020-10-22 20:18:40 +08:00
yunion-ci-robot
492920ac7c Merge pull request #8428 from ioito/automated-cherry-pick-of-#8426-upstream-release-3.4
Automated cherry pick of #8426: fix: 避免冲掉设置的到期释放时间
2020-10-22 20:13:22 +08:00
yunion-ci-robot
f96ac33175 Merge pull request #8433 from lvyangyang/automated-cherry-pick-of-#8416-upstream-release-3.4
Automated cherry pick of #8416: fix:get all project dns resource
2020-10-22 20:10:19 +08:00
yunion-ci-robot
1bc16d6f2e Merge pull request #8439 from rainzm/automated-cherry-pick-of-#8437-upstream-release-3.4
Automated cherry pick of #8437: fix(region): add suffix 'display' for time_points and repeat_weekdays
2020-10-22 20:07:17 +08:00
rainzm
0ba8cb7fbd fix: don't update NextSyncTime when snapshots that should be added has not 2020-10-22 19:42:26 +08:00
rainzm
93bb4022f2 fix(region): init NextSyncTimeiwhen create snapshotpolicydisks 2020-10-22 19:42:26 +08:00
rainzm
bbfb9db90a fix(region): add suffix 'display' for time_points and repeat_weekdays
TimePoints and RepeatWeekdays in SnapshotPolicyDetails is duplicated
with thess in SnapshotPolicy, which result in the fault of reponse for
request GET.
2020-10-22 19:42:26 +08:00
lvyangyang
66c81ee548 fix:get all project dns resource 2020-10-22 17:06:00 +08:00
Qu Xuan
8f3cb9cdbb fix: 避免冲掉设置的到期释放时间 2020-10-22 15:41:19 +08:00
yunion-ci-robot
1ac71d0016 Merge pull request #8409 from wanyaoqi/automated-cherry-pick-of-#8407-upstream-release-3.4
Automated cherry pick of #8407: fix informer backend
2020-10-22 15:04:16 +08:00
yunion-ci-robot
e8238a2cf5 Merge pull request #8425 from ioito/automated-cherry-pick-of-#8423-upstream-release-3.4
Automated cherry pick of #8423: fix: add aliyun new region
2020-10-22 14:31:17 +08:00
Qu Xuan
22349276d9 fix: add aliyun new region 2020-10-22 11:53:08 +08:00
wanyaoqi
d6a9b5dac2 fix informer backend 2020-10-21 10:54:14 +08:00
yunion-ci-robot
0e3aa96f77 Merge pull request #8406 from rainzm/automated-cherry-pick-of-#8404-upstream-release-3.4
Automated cherry pick of #8404: fix(notify): add AllOkContactTypes in where permanently enabled and verified ContactType
2020-10-21 10:51:16 +08:00
rainzm
5306add70a feat(notify): add IntelliNotify
IntelliNotify will try to create receiver nonexistent if createReceiver is set to true
2020-10-20 20:38:17 +08:00
rainzm
f367f1abef fix(notify): add AllOkContactTypes in where permanently enabled and verified ContactType 2020-10-20 20:38:17 +08:00
Zexi Li
93dc36134d Merge pull request #8402 from wanyaoqi/automated-cherry-pick-of-#8400-upstream-release-3.4
Automated cherry pick of #8400: fix fetch customize columns
2020-10-20 18:52:56 +08:00
wanyaoqi
f706d59ac5 fix fetch customize columns 2020-10-20 18:43:52 +08:00
758 changed files with 23480 additions and 39087 deletions

View File

@@ -1,7 +0,0 @@
_output/alpine-build/_cache
pkg
vendor
cmd
locales
docs
scripts

View File

@@ -1,6 +0,0 @@
公有云子账号创建成功
主账号:{{ .account }}<br>
名称:{{ .name }}<br>
密码:{{ .password }}<br>
登录地址: {{ .iam_login_url }}<br>
资源ID: {{ .id }}<br>

View File

@@ -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>

View File

@@ -1 +0,0 @@
公有云子账号 {{ .name }} 创建成功

View File

@@ -1 +0,0 @@
The clouduser {{ .name }} created successfully

View File

@@ -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{})
}

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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{})
}

View File

@@ -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
})
}

View File

@@ -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{})
}

View File

@@ -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
})
}

View File

@@ -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{})
}

View File

@@ -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{})
}

View File

@@ -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{})
}

View File

@@ -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

View File

@@ -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
})

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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")
}

View File

@@ -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
}

View File

@@ -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
})
}

View File

@@ -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"`

View File

@@ -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
})
}

View File

@@ -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{})
}

View File

@@ -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)

View File

@@ -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
})
}

View File

@@ -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
}

View File

@@ -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 {

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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
})
}

View File

@@ -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)

View File

@@ -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
})
}

View File

@@ -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 {

View File

@@ -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))
}

View File

@@ -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
View File

@@ -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
View File

@@ -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=

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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 (

View File

@@ -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,

View File

@@ -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, "")
}

View File

@@ -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() {

View File

@@ -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())
}

View File

@@ -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"`
}

View File

@@ -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 = ""
)

View File

@@ -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 {
}

View File

@@ -82,10 +82,6 @@ type ClouduserCreateInput struct {
// swagger:ignore
ExternalId string `json:"external_id"`
// 是否发送邮件通知(仅设置email不为空生效)
// default: false
Notify bool `json:"notify"`
}
type ClouduserListInput struct {

View File

@@ -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"`
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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"`
// 是否跟随主机删除而自动释放

View File

@@ -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
}

View File

@@ -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"`
}

View File

@@ -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"`
}

View File

@@ -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
}

View File

@@ -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"`
}

View File

@@ -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
}

View File

@@ -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"}
)

View File

@@ -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
}

View File

@@ -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"`
}

View File

@@ -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"`

View File

@@ -16,5 +16,4 @@ package compute
const (
DBINSTANCE_SKU_AVAILABLE = "available"
DBINSTANCE_SKU_SOLDOUT = "soldout"
)

View File

@@ -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 {

View File

@@ -30,7 +30,6 @@ type DnsZoneCacheCreateInput struct {
type DnsZoneCacheDetails struct {
apis.StatusStandaloneResourceDetails
SDnsZoneCache
Account string
Brand string

View File

@@ -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"`
}

View File

@@ -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 (

View File

@@ -20,10 +20,6 @@ type ElasticcacheSkuDetails struct {
apis.StatusStandaloneResourceDetails
CloudregionResourceInfo
ZoneResourceInfoBase
SlaveZoneResourceInfoBase
SElasticcacheSku
// 云环境
CloudEnv string `json:"cloud_env"`
}

View File

@@ -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 {

View File

@@ -53,10 +53,8 @@ type ServerListInput struct {
Hypervisor []string `json:"hypervisor"`
// 列出绑定了弹性IPEIP的主机
WithEip *bool `json:"with_eip"`
// 列出未绑定弹性IPEIP)的主机
// 列出未绑定弹性IPEIO)的主机
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"`
}

View File

@@ -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

View File

@@ -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"`
}

View File

@@ -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 {

View File

@@ -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"`
}

View File

@@ -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"`
}

View File

@@ -23,9 +23,6 @@ import (
type ScheduledTaskDetails struct {
apis.VirtualResourceDetails
SScheduledTask
// 描述
TimerDesc string `json:"timer_desc"`
// 定时方式触发
Timer TimerDetails `json:"timer"`
// 周期方式触发

View File

@@ -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"`
}

View File

@@ -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"`

View File

@@ -64,7 +64,7 @@ var SKU_FAMILIES = []string{
}
type ServerSkuListInput struct {
apis.EnabledStatusStandaloneResourceListInput
apis.StatusStandaloneResourceListInput
apis.DomainizedResourceListInput
ManagedResourceListInput

View File

@@ -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

View File

@@ -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"

View File

@@ -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"`

View File

@@ -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

View File

@@ -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
}

View File

@@ -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,
}
)

View File

@@ -106,8 +106,6 @@ var (
"time_zone",
"domainized_namespace",
"api_server",
"global_http_proxy",
"global_https_proxy",
},
}

View File

@@ -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"`
}

View File

@@ -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 {

View File

@@ -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"`

View File

@@ -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
}

View File

@@ -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

View File

@@ -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