Compare commits

..

165 Commits

Author SHA1 Message Date
yunion-ci-robot
423777c775 Merge pull request #4796 from tb365/automated-cherry-pick-of-#4795-upstream-release-3.0
Automated cherry pick of #4795: add filter skus by domain id
2020-01-10 20:25:58 +08:00
yunion-ci-robot
52f2a1f3b4 Merge pull request #4722 from tb365/automated-cherry-pick-of-#4712-upstream-release-3.0
Automated cherry pick of #4712: cloud account support manually sync skus
2020-01-10 20:06:59 +08:00
yunion-ci-robot
dd0ced571d Merge pull request #4806 from tb365/automated-cherry-pick-of-#4801-upstream-release-3.0
Automated cherry pick of #4801: kvm elb listener update bugfix
2020-01-10 19:50:58 +08:00
yunion-ci-robot
dbd959d040 Merge pull request #4767 from tb365/automated-cherry-pick-of-#4766-upstream-release-3.0
Automated cherry pick of #4766: _getModule fix
2020-01-10 19:22:59 +08:00
TangBin
9be50f0007 kvm elb listener update bugfix 2020-01-10 18:52:00 +08:00
TangBin
840b6e9a16 spelling mistakes fix 2020-01-10 17:17:25 +08:00
TangBin
ec83f583c2 user register ingore blank row 2020-01-10 17:17:25 +08:00
TangBin
2983659c53 add filter skus by domain id 2020-01-10 17:17:25 +08:00
Zexi Li
af20c84a50 Merge pull request #4794 from rainzm/automated-cherry-pick-of-#4779-upstream-release-3.0
Automated cherry pick of #4779: fix(esxi-agent): Avoid redundant agent & Adjust workspace path
2020-01-10 11:51:57 +08:00
Rain
5cee576fc4 fix(esxi-agent): Avoid redundant agent & Adjust workspace path
1. There is only one esxi agent needed in OneCloud.
2. Workspace path shoule be EsxiAgentPath not the parent directory of this.
3. The VM name is too long for vcenter when importing VM so that shrink
it.
2020-01-10 11:01:37 +08:00
yunion-ci-robot
ba89e19f3e Merge pull request #4778 from rainzm/automated-cherry-pick-of-#4754-upstream-release-3.0
Automated cherry pick of #4754: fix(region): Sync HostStorage in syncOnPremiseCloudProviderInfo
2020-01-10 10:36:58 +08:00
yunion-ci-robot
73faf76bbb Merge pull request #4762 from wanyaoqi/automated-cherry-pick-of-#4761-upstream-release-3.0
Automated cherry pick of #4761: image-properties-add-disable-delete
2020-01-10 10:28:58 +08:00
yunion-ci-robot
17bd125542 Merge pull request #4769 from wanyaoqi/automated-cherry-pick-of-#4768-upstream-release-3.0
Automated cherry pick of #4768: fix guest start no task complete
2020-01-10 10:22:58 +08:00
yunion-ci-robot
3b14136705 Merge pull request #4783 from swordqiu/automated-cherry-pick-of-#4780-upstream-release-3.0
Automated cherry pick of #4780: fix: initialize service config on keystone when service boot
2020-01-10 10:19:58 +08:00
yunion-ci-robot
a968e3544c Merge pull request #4785 from yousong/automated-cherry-pick-of-#4784-upstream-release-3.0
Automated cherry pick of #4784: dnsrecords: add helper methods
2020-01-10 10:15:57 +08:00
Yousong Zhou
9d20a58a85 dns: chain load records for cname 2020-01-09 23:23:34 +08:00
Yousong Zhou
a719ad6d82 dns: prepare for responding with A record of cname value 2020-01-09 23:23:34 +08:00
Yousong Zhou
2f9e3f7da0 dnsrecords: add helper methods 2020-01-09 23:23:34 +08:00
Qiu Jian
5f8758e5c4 fix: initialize service config on keystone when service boot 2020-01-09 22:15:27 +08:00
Rain
ae2369befd fix(region): Sync HostStorage in syncOnPremiseCloudProviderInfo
情景:绕过OneCloud,删除 storage 上的所有 vm 并且删除 storage 然后新建 storage。

问题:因为存在 vm 在使用此 storage ,所以在同步的时候,对应的 storage
会删除失败,并且阻止了 storagecache 的同步。这样在创建机器的时候,如果
使用旧的 storage 就会导致创建失败(因为此 Host 已经不再使用对应的
remote storage); 如果使用新的 storage 就会因为找不到对应的 storage cache 而失败。

修改:如果因为以上原因删除失败的 storage 的 storage_type 为 local
那么就把这个 storage 置为 offline,并且不再阻止 storage cache 的同步。
2020-01-09 21:04:32 +08:00
wanyaoqi
a4a7d004c8 fix guest start no task complete 2020-01-09 17:13:03 +08:00
TangBin
9a7d223311 _getModule fix 2020-01-09 16:42:16 +08:00
wanyaoqi
d9910a0364 image-properties-add-disable-delete 2020-01-09 15:42:02 +08:00
TangBin
6ad8ff188d cloud account support manually sync skus 2020-01-09 11:17:04 +08:00
yunion-ci-robot
641cd05a9a Merge pull request #4756 from rainzm/automated-cherry-pick-of-#4755-upstream-release-3.0
Automated cherry pick of #4755: fix(esxi-agent): Adjust the VM Path in Datastore
2020-01-09 10:28:57 +08:00
Zexi Li
570a6bbab7 Merge pull request #4760 from swordqiu/automated-cherry-pick-of-#4757-upstream-release-3.0
Automated cherry pick of #4757: fix: brand of compute quota key should be fixed
2020-01-09 09:58:54 +08:00
yunion-ci-robot
01a466b989 Merge pull request #4710 from wanyaoqi/automated-cherry-pick-of-#4709-upstream-release-3.0
Automated cherry pick of #4709: host misc fix
2020-01-09 00:05:58 +08:00
yunion-ci-robot
4fd7e6fcf0 Merge pull request #4725 from yousong/automated-cherry-pick-of-#4724-upstream-release-3.0
Automated cherry pick of #4724: wires: lift name length, charset constraint
2020-01-08 23:44:59 +08:00
Qiu Jian
8a2841f672 fix: brand of compute quota key should be fixed 2020-01-08 23:36:12 +08:00
yunion-ci-robot
0adccb5c8b Merge pull request #4751 from ioito/automated-cherry-pick-of-#4750-upstream-release-3.0
Automated cherry pick of #4750: fix: cloudevent 成功条件补充
2020-01-08 23:33:59 +08:00
Rain
a712df096a fix(esxi-agent): Adjust the VM Path in Datastore 2020-01-08 21:09:44 +08:00
Qu Xuan
ed75a7262b fix: cloudevent 成功条件补充 2020-01-08 20:44:13 +08:00
Zexi Li
adea5e3441 Merge pull request #4738 from swordqiu/automated-cherry-pick-of-#4735-upstream-release-3.0
Automated cherry pick of #4735: fix: misc quota bugs 1. snapshot pending usage not cleaned after created 2. server-attach-network error 3. loadbalancer fail to set cloudregion_id
2020-01-08 19:17:40 +08:00
Yousong Zhou
64f29934f0 wires: lift name length, charset constraint 2020-01-08 19:15:17 +08:00
yunion-ci-robot
6cc5c4d942 Merge pull request #4729 from ioito/automated-cherry-pick-of-#4728-upstream-release-3.0
Automated cherry pick of #4728: fix: eip duplicate name
2020-01-08 19:05:57 +08:00
Qiu Jian
e817fb0920 fix: misc quota bugs 1. snapshot pending usage not cleaned after created 2. server-attach-network error 3. loadbalancer fail to set cloudregion_id 2020-01-08 18:53:36 +08:00
Qu Xuan
2c412db6c8 fix: eip duplicate name 2020-01-08 18:11:15 +08:00
yunion-ci-robot
d08761095c Merge pull request #4699 from rainzm/automated-cherry-pick-of-#4695-upstream-release-3.0
Automated cherry pick of #4695: fix(glance): Cancel pending usage of image quota correctly
2020-01-08 16:11:58 +08:00
yunion-ci-robot
03cf19f1db Merge pull request #4705 from tb365/automated-cherry-pick-of-#4701-upstream-release-3.0
Automated cherry pick of #4701: azure skus sync fix
2020-01-08 15:53:59 +08:00
Zexi Li
3c77aa38ff Merge pull request #4715 from wanyaoqi/automated-cherry-pick-of-#4714-upstream-release-3.0
Automated cherry pick of #4714: set subimage some field nullable
2020-01-08 15:42:48 +08:00
wanyaoqi
d3a2ebeacb set subimage some field nullable 2020-01-08 15:36:44 +08:00
yunion-ci-robot
d868952b0d Merge pull request #4706 from ioito/automated-cherry-pick-of-#4655-upstream-release-3.0
Automated cherry pick of #4655: optimized: 优化公有云日志查询
2020-01-08 14:56:57 +08:00
wanyaoqi
9ac505c907 host misc fix 2020-01-08 14:22:18 +08:00
yunion-ci-robot
05ee08e411 Merge pull request #4684 from yousong/automated-cherry-pick-of-#4683-upstream-release-3.0
Automated cherry pick of #4683: hostman: distro name OpenWrt instead of OpenWRT
2020-01-08 12:57:59 +08:00
Qu Xuan
ef39ed3d0c optimized: 优化公有云日志查询 2020-01-08 11:46:38 +08:00
yunion-ci-robot
85ac87b7c9 Merge pull request #4651 from ioito/automated-cherry-pick-of-#4650-upstream-release-3.0
Automated cherry pick of #4650: fix: 避免创建rds account, database后未设置exteranl_id
2020-01-08 11:42:56 +08:00
yunion-ci-robot
3b3480b29b Merge pull request #4637 from ioito/automated-cherry-pick-of-#4636-upstream-release-3.0
Automated cherry pick of #4636: fix: 加强密码校验
2020-01-08 11:38:58 +08:00
TangBin
6628f15ab0 huawei redis sync fix 2020-01-08 11:34:42 +08:00
TangBin
9f55497161 ctyun default gateway fix 2020-01-08 11:34:42 +08:00
TangBin
9e96e4f7e4 huawei network default gateway fix 2020-01-08 11:34:42 +08:00
TangBin
12c87f630a network create GuestIpPrefix fix 2020-01-08 11:34:42 +08:00
TangBin
5d2fb3bf56 azure skus sync fix 2020-01-08 11:34:42 +08:00
Rain
af5b218377 fix(glance): Cancel pending usage of image quota correctly
ImageNumber always be zero because the 'image_number' in data was
removed so that canceling pending usage not work.
2020-01-08 11:33:32 +08:00
yunion-ci-robot
802197f161 Merge pull request #4642 from tb365/automated-cherry-pick-of-#4634-upstream-release-3.0
Automated cherry pick of #4634: huawei image delete bugfix
2020-01-08 11:26:59 +08:00
yunion-ci-robot
45f3ee7989 Merge pull request #4690 from ioito/automated-cherry-pick-of-#4685-upstream-release-3.0
Automated cherry pick of #4685: fix: next marker format
2020-01-08 10:09:57 +08:00
Zexi Li
d9a43ae92a Merge pull request #4682 from swordqiu/automated-cherry-pick-of-#4676-upstream-release-3.0
Automated cherry pick of #4676: fix: guest network default share scope should be system if non-default-domain-projects is off
2020-01-07 19:30:44 +08:00
Zexi Li
8ae4e5bcec Merge pull request #4675 from swordqiu/automated-cherry-pick-of-#4666-upstream-release-3.0
Automated cherry pick of #4666: fix: guess brand on guest create
2020-01-07 19:28:49 +08:00
yunion-ci-robot
67dd167835 Merge pull request #4665 from ioito/automated-cherry-pick-of-#4656-upstream-release-3.0
Automated cherry pick of #4656: fix: 避免拥有带宽包的腾讯云创建机器失败
2020-01-07 18:08:59 +08:00
Qu Xuan
2d1d8db96a fix: next marker format 2020-01-07 18:02:23 +08:00
Yousong Zhou
9e42b83406 hostman: openwrt: deploy public key for root 2020-01-07 18:00:34 +08:00
Yousong Zhou
1a16fbd9cf hostman: split DeployAuthorizedKeys() 2020-01-07 18:00:34 +08:00
Yousong Zhou
77d19d2ec3 hostman: openwrt: support deploy networking scripts 2020-01-07 18:00:34 +08:00
Yousong Zhou
5391943537 hostman: openwrt: deploy hostname with board config 2020-01-07 18:00:34 +08:00
Yousong Zhou
5c1044a1f6 hostman: distro name OpenWrt instead of OpenWRT 2020-01-07 18:00:34 +08:00
yunion-ci-robot
6e87e25b38 Merge pull request #4659 from ioito/automated-cherry-pick-of-#4658-upstream-release-3.0
Automated cherry pick of #4658: fix: 避免同步安全组失败后,没有任何日志记录
2020-01-07 17:09:57 +08:00
Qiu Jian
95565e4b6d fix: guest network default share scope should be system if non-default-domain-projects is off 2020-01-07 16:58:36 +08:00
Qiu Jian
6c0bdeac49 fix: guess brand on guest create 2020-01-07 15:13:40 +08:00
Qu Xuan
5100ced74c fix: 避免拥有带宽包的腾讯云创建机器失败 2020-01-07 14:59:11 +08:00
Qu Xuan
f022f4138e fix: 避免同步安全组失败后,没有任何日志记录 2020-01-07 11:48:43 +08:00
yunion-ci-robot
6ecf644277 Merge pull request #4639 from rainzm/automated-cherry-pick-of-#4635-upstream-release-3.0
Automated cherry pick of #4635: fix: Workmanager delayTaskWithoutReqctx
2020-01-07 09:33:56 +08:00
Rain
ee34fbdafe fix: Workmanager delayTaskWithoutReqctx
The context of delayTaskWithoutReqctx should have 'taskid' value.
2020-01-06 15:21:04 +08:00
yunion-ci-robot
61ff4ddbc8 Merge pull request #4649 from swordqiu/automated-cherry-pick-of-#4645-upstream-release-3.0
Automated cherry pick of #4645: fix: comment out TestDialTimeout
2020-01-06 15:12:59 +08:00
Qu Xuan
ec7bc017dd fix: 避免创建rds account, database后未设置exteranl_id 2020-01-06 13:38:09 +08:00
Qiu Jian
a96d17efcc fix: comment out TestDialTimeout 2020-01-06 13:12:04 +08:00
TangBin
ac1d08d619 huawei image delete bugfix 2020-01-06 11:52:49 +08:00
Qu Xuan
d032dccd91 fix: 加强密码校验 2020-01-06 11:45:03 +08:00
yunion-ci-robot
987495c463 Merge pull request #4633 from wanyaoqi/automated-cherry-pick-of-#4632-upstream-release-3.0
Automated cherry pick of #4632: host image support container deploy:
2020-01-05 19:10:39 +08:00
wanyaoqi
dc2fd237f0 host image support container deploy: 2020-01-05 18:52:11 +08:00
Zexi Li
03cca94b0c Merge pull request #4630 from swordqiu/automated-cherry-pick-of-#4627-upstream-release-3.0
Automated cherry pick of #4627: fix: increase default sync worker count from 2 to 5
2020-01-05 12:22:58 +08:00
Qiu Jian
3365161fa5 fix: increase default sync worker count from 2 to 5 2020-01-05 12:21:27 +08:00
Zexi Li
e810d4567e Merge pull request #4625 from swordqiu/automated-cherry-pick-of-#4601-upstream-release-3.0
Automated cherry pick of #4601: fix: remove bw/ebw quota limit
2020-01-04 23:59:38 +08:00
Qiu Jian
954341e4ab remove bw/ebw quota from scheduler 2020-01-04 23:35:42 +08:00
Qiu Jian
becfe078d5 fix: remove bw/ebw quota limit 2020-01-04 23:35:42 +08:00
Zexi Li
8915b934b1 Merge pull request #4622 from zexi/automated-cherry-pick-of-#4621-upstream-release-3.0
Automated cherry pick of #4621: fix: fmt error
2020-01-04 23:21:01 +08:00
Zexi Li
b67da6996f Merge pull request #4620 from swordqiu/automated-cherry-pick-of-#4616-upstream-release-3.0
Automated cherry pick of #4616: fix: huawei uncache image fail
2020-01-04 23:20:19 +08:00
Zexi Li
ce40f6378f Merge pull request #4610 from ioito/automated-cherry-pick-of-#4609-upstream-release-3.0
Automated cherry pick of #4609: fix: 避免仅删除value时,行为演变为删除标签
2020-01-04 23:17:56 +08:00
Zexi Li
2c2b1544c6 fix: fmt error 2020-01-04 23:12:39 +08:00
Qiu Jian
44114e8d94 fix: huawei uncache image fail 2020-01-04 23:03:53 +08:00
Zexi Li
b9405e72e7 Merge pull request #4608 from rainzm/automated-cherry-pick-of-#4602-upstream-release-3.0
Automated cherry pick of #4602: fix(notify): Fix the error of filter about contacts
2020-01-04 22:29:57 +08:00
Rain
3a5b32fc60 fix(notify): Fix the error of filter about contacts 2020-01-04 22:26:43 +08:00
Qu Xuan
9bbba1a3cc fix: 避免仅删除value时,行为演变为删除标签 2020-01-04 22:16:07 +08:00
Zexi Li
25277900d4 Merge pull request #4600 from rainzm/automated-cherry-pick-of-#4597-upstream-release-3.0
Automated cherry pick of #4597: fix(region): Add reset_password in guest template's ConfigInfo
2020-01-04 22:03:25 +08:00
Rain
4cdf779700 fix(region): Cancel the check about project when creating service catlog 2020-01-04 21:40:16 +08:00
Rain
dc09cb88c4 fix(region): Add reset_password in guest template's ConfigInfo 2020-01-04 21:40:16 +08:00
Zexi Li
155ef44d8f Merge pull request #4595 from rainzm/automated-cherry-pick-of-#4592-upstream-release-3.0
Automated cherry pick of #4592: fix(region): Fix that 'Can_delete' disappears due to parameter structuring
2020-01-04 21:10:02 +08:00
Zexi Li
e08b7ff91d Merge pull request #4591 from rainzm/automated-cherry-pick-of-#4588-upstream-release-3.0
Automated cherry pick of #4588: fix(region): Set normal's snapshotpolicy's status as ready
2020-01-04 21:09:41 +08:00
yunion-ci-robot
fa544dbdc7 Merge pull request #4596 from rainzm/automated-cherry-pick-of-#4419-upstream-release-3.0
Automated cherry pick of #4419: feature(esxi-agent): Esxi Agent Golang
2020-01-04 21:08:41 +08:00
Rain
67f0dc3f8b feature(esxi-agent): Esxi Agent Golang
1. 修改了host-deployer 使其支持 vmware vddk 的 deploy guest fs 操作。
2. esxi agent python ==> Go

fix(esxi-agent): Fix some bugs and irregular contents

fix(esxi-agent): Partial parameter structure

fix(esxi-agent): Add ovf template and remove some binary file

fix(esxi-agent): Format Code

fix(esxi-agent): fix based on reviewers' comments

fix(esxi-agent): fix host-deployer because of occasional unknown panic

fix: DelayTask should have a new Context

fix(esxi-agent): call hostutils.DelayTask

change '_interface' package to 'iagent' package

fix(esxi-agent): Fix some irregular code
2020-01-04 21:04:29 +08:00
Rain
d333e30d52 fix(region): Fix that 'Can_delete' disappears due to parameter structuring 2020-01-04 21:03:56 +08:00
Rain
94068ce53e feature(region): Add bind/unbind-snapshotpolicy api for disk 2020-01-04 21:00:33 +08:00
Rain
7a0b6fd2ee fix(region): Set normal's snapshotpolicy's status as ready 2020-01-04 21:00:33 +08:00
屈轩
c0115d5a9c fix: 子网删除忽略弹性网卡 (#4575) 2020-01-04 20:52:54 +08:00
Jian Qiu
50ea8fc5a8 Automated cherry pick of #4527: fix: httpclient timeout value cleanup, use notimeout client for oss (#4531)
* fix: httpclient timeout value cleanup, use notimeout client for oss

* Adaptive timeout client

* more test cases

* remove resolve timeout test case

* use adptive timeout only if timeout = 0
2020-01-04 20:52:25 +08:00
yunion-ci-robot
fec4cb1804 Merge pull request #4570 from bistuzx/automated-cherry-pick-of-#4557-upstream-release-3.0
Automated cherry pick of #4557: add cloud account create&update options
2020-01-04 20:28:43 +08:00
yunion-ci-robot
49b3bf2dce Merge pull request #4582 from ioito/automated-cherry-pick-of-#4581-upstream-release-3.0
Automated cherry pick of #4581: fix: 修复zstack安全组创建失败问题
2020-01-04 20:12:39 +08:00
yunion-ci-robot
b89a445451 Merge pull request #4559 from ioito/automated-cherry-pick-of-#4558-upstream-release-3.0
Automated cherry pick of #4558: fix: openstack eip dissociate optimized
2020-01-04 20:02:36 +08:00
Qu Xuan
d3a0e345d9 fix: 修复zstack安全组创建失败问题 2020-01-04 20:01:21 +08:00
Zexi Li
0542deef75 Merge pull request #4568 from swordqiu/automated-cherry-pick-of-#4564-upstream-release-3.0
Automated cherry pick of #4564: fix: minio fail to set object metadata
2020-01-04 19:52:52 +08:00
Zexi Li
0db77fc304 Merge pull request #4552 from swordqiu/automated-cherry-pick-of-#4549-upstream-release-3.0
Automated cherry pick of #4549: fix: domain quota-list include domain's own quota
2020-01-04 19:46:26 +08:00
Zexi Li
c6a8eae499 Merge pull request #4580 from zexi/automated-cherry-pick-of-#4579-upstream-release-3.0
Automated cherry pick of #4579: dockerfile: component use base image
2020-01-04 19:28:01 +08:00
Zexi Li
62f0a84a83 dockerfile: component use base image 2020-01-04 19:28:35 +08:00
张旭
aa6e9a8107 add cloud account create&update options 2020-01-04 19:19:06 +08:00
yunion-ci-robot
8528410bf8 Merge pull request #4554 from tb365/automated-cherry-pick-of-#4553-upstream-release-3.0
Automated cherry pick of #4553: elastic account add random password
2020-01-04 19:05:36 +08:00
Qu Xuan
d2f33742a0 fix: openstack eip dissociate optimized 2020-01-04 18:43:30 +08:00
Qiu Jian
b4b1494e1c fix: minio fail to set object metadata 2020-01-04 18:37:42 +08:00
TangBin
bb8c9d1b47 get eip bugfix 2020-01-04 18:23:22 +08:00
TangBin
ab1d2c0c24 get eip bugfix 2020-01-04 18:23:22 +08:00
TangBin
ef1b8f5245 host batch register bugfix 2020-01-04 18:23:22 +08:00
TangBin
8d1f755b4e elastic cache account add login info api 2020-01-04 18:23:22 +08:00
TangBin
ad32d9063a elastic account add random password 2020-01-04 18:23:22 +08:00
yunion-ci-robot
7ca467e35b Merge pull request #4538 from wanyaoqi/automated-cherry-pick-of-#4535-upstream-release-3.0
Automated cherry pick of #4535: fix disk filter by guest
2020-01-04 18:20:36 +08:00
Qiu Jian
8270238116 fix: domain quota-list include domain's own quota 2020-01-04 17:18:50 +08:00
Zexi Li
ac4f897510 Merge pull request #4544 from swordqiu/automated-cherry-pick-of-#4539-upstream-release-3.0
Automated cherry pick of #4539: fix: add cloudprovider capabilities
2020-01-04 17:03:35 +08:00
wanyaoqi
0eef43bb0a add recover on guest suddenly shotdown 2020-01-04 16:51:59 +08:00
Qiu Jian
5096ee9de3 minor fixes 2020-01-04 16:21:41 +08:00
Qiu Jian
34e0d8dd27 minor fixes 2020-01-04 16:21:41 +08:00
Qiu Jian
975154b98a minor fixes 2020-01-04 16:21:41 +08:00
Qiu Jian
1b23d6c755 add cloudevent capabilities 2020-01-04 16:21:41 +08:00
Qiu Jian
cdbc49a1a8 fix: add cloudprovider capabilities 2020-01-04 16:21:41 +08:00
wanyaoqi
86df323603 fix disk filter by guest 2020-01-04 15:19:16 +08:00
Zexi Li
422dcf8020 Merge pull request #4534 from zexi/automated-cherry-pick-of-#4533-upstream-release-3.0
Automated cherry pick of #4533: devtool: use public influxdb endpoint
2020-01-04 14:50:40 +08:00
Zexi Li
a47bdf3566 devtool: use public influxdb endpoint 2020-01-04 14:37:00 +08:00
yunion-ci-robot
275832f438 Merge pull request #4512 from tb365/automated-cherry-pick-of-#4509-upstream-release-3.0
Automated cherry pick of #4509: account create bugfix
2020-01-04 12:55:36 +08:00
TangBin
dbbe173e51 InitPendingUsagesInContext fix 2020-01-04 12:42:09 +08:00
TangBin
f0276d1a01 account&provider health status check 2020-01-04 12:42:09 +08:00
TangBin
0cfb8dbd5a elastic skus add region_ext_id & zone_ext_id 2020-01-04 12:42:09 +08:00
TangBin
ad0ddf6dd9 disk delete condition validator 2020-01-04 12:42:09 +08:00
TangBin
3b1c4dc2e5 huawei oss client read http ProxyFromEnvironment 2020-01-04 12:42:09 +08:00
TangBin
4d907584e2 network operations add action log 2020-01-04 12:42:09 +08:00
TangBin
2b9a995b13 account create bugfix 2020-01-04 12:42:09 +08:00
Zexi Li
6dc2ccee60 Merge pull request #4521 from zexi/automated-cherry-pick-of-#4520-upstream-release-3.0
Automated cherry pick of #4520: baremetal: fix megaraid check jbod always disabled
2020-01-03 21:51:22 +08:00
yunion-ci-robot
2bd77ec202 Merge pull request #4514 from ioito/automated-cherry-pick-of-#4513-upstream-release-3.0
Automated cherry pick of #4513: fix: 腾讯云不支持描述字段参数
2020-01-03 21:28:39 +08:00
Zexi Li
30fab89baa baremetal: fix megaraid check jbod always disabled 2020-01-03 21:21:33 +08:00
Qu Xuan
8d47608e4e fix: 腾讯云不支持描述字段参数 2020-01-03 20:41:28 +08:00
Zexi Li
eeeb81bf3f Merge pull request #4502 from swordqiu/automated-cherry-pick-of-#4498-upstream-release-3.0
Automated cherry pick of #4498: fix: allow delete cloudaccount with auto-sync enabled
2020-01-03 19:06:20 +08:00
yunion-ci-robot
78d68a023b Merge pull request #4505 from rainzm/automated-cherry-pick-of-#4497-upstream-release-3.0
Automated cherry pick of #4497: fix(huawei): Add 'X-Project-ID' header for huawei nat reuqest
2020-01-03 19:03:36 +08:00
yunion-ci-robot
6534a7c6a5 Merge pull request #4493 from ioito/automated-cherry-pick-of-#4492-upstream-release-3.0
Automated cherry pick of #4492: fix: 修复provider为空的套餐
2020-01-03 18:38:36 +08:00
Rain
9d60403817 fix(huawei): Add 'X-Project-ID' header for huawei nat reuqest 2020-01-03 17:23:52 +08:00
Qiu Jian
6ba7cbbb37 fix: allow delete cloudaccount with auto-sync enabled 2020-01-03 17:17:24 +08:00
Zexi Li
047bf47534 Merge pull request #4491 from swordqiu/automated-cherry-pick-of-#4488-upstream-release-3.0
Automated cherry pick of #4488: scheduler schedule according to quota limit
2020-01-03 17:13:42 +08:00
Qiu Jian
243590995f fix: OutOfQuota error code 500 2020-01-03 16:02:44 +08:00
Qiu Jian
53a9c010cb automatically save pendingUsage in context 2020-01-03 16:02:44 +08:00
Qiu Jian
9a6d9df76d remove obsolete codes 2020-01-03 16:02:44 +08:00
Qiu Jian
8870fe2d1f bug fixes 2020-01-03 16:02:43 +08:00
Qiu Jian
d2d8a7eeaa move lb from zonequota to regionquota 2020-01-03 16:02:43 +08:00
Qiu Jian
56be0bb3c5 scheduler schedule according to quota limit 2020-01-03 16:02:43 +08:00
Qu Xuan
d9956a9445 fix: 修复provider为空的套餐 2020-01-03 15:54:18 +08:00
Zexi Li
0702803b52 Merge pull request #4487 from rainzm/automated-cherry-pick-of-#4483-upstream-release-3.0
Automated cherry pick of #4483: fix(notify): Always update websocket config
2020-01-03 11:22:47 +08:00
Zexi Li
f12c77ca4c Merge pull request #4479 from swordqiu/automated-cherry-pick-of-#4478-upstream-release-3.0
Automated cherry pick of #4478: fix: bucket list object may skip first matched object
2020-01-03 11:01:21 +08:00
Rain
e0e72f4dc2 fix(notify): Always update websocket config 2020-01-02 19:15:23 +08:00
Qiu Jian
1cd4472073 fix: sort objects and directories 2020-01-02 17:47:07 +08:00
Qiu Jian
71c877428e fix: bucket list object may skip first matched object 2020-01-02 17:47:07 +08:00
rainzm
20a2dc5bf3 fix(region): Add support for suspend when syncing status of guest (#4477) 2020-01-02 16:34:22 +08:00
Zexi Li
e00f4a1f7d Merge pull request #4473 from zexi/automated-cherry-pick-of-#4411-upstream-release-3.0
Automated cherry pick of #4411: host misc fix
2020-01-02 12:32:16 +08:00
wanyaoqi
72c489140d host misc fix
- host check not require ntpd
- create host record use generate name
2020-01-02 12:32:32 +08:00
1147 changed files with 8060 additions and 112876 deletions

38
.circleci/Dockerfile Normal file
View File

@@ -0,0 +1,38 @@
FROM centos:7
MAINTAINER Yousong Zhou <zhouyousong@yunion.cn>
RUN true \
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum install -y git wget \
&& yum groupinstall -y "Development Tools" \
&& : ceph for cmd/host \
&& rpm --import 'https://download.ceph.com/keys/release.asc' \
&& yum install -y https://download.ceph.com/rpm-luminous/el7/noarch/ceph-release-1-1.el7.noarch.rpm \
&& yum install -y libcephfs-devel librbd-devel librados-devel \
&& yum clean all
WORKDIR /opt
RUN true \
&& wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz \
&& tar xzf go1.13.3.linux-amd64.tar.gz \
&& rm -vf go1.13.3.linux-amd64.tar.gz \
&& true
ENV GOROOT="/opt/go"
ENV PATH="/opt/go/bin:${PATH}"
RUN useradd -c "OneCloud Builder" --create-home --home-dir /home/build --shell /bin/bash build
ENV HOME /home/build
WORKDIR /home/build
USER build
ENV GOPATH="/home/build/go"
ENV PATH="${GOPATH}/bin:${PATH}"
RUN true \
&& mkdir -p "$GOPATH" \
&& d="$GOPATH/src/golang.org/x/tools" \
&& mkdir -p "$d" \
&& git clone --branch yun --depth 8 https://github.com/yousong/tools "$d" \
&& cd "$d" \
&& go install ./cmd/goimports \
&& true

View File

@@ -5,10 +5,10 @@ version: 2
jobs:
check:
docker:
- image: yunionio/centos-build:1.0-1
- image: yunionio/onecloud-ci:v1.0.3
environment:
ONECLOUD_CI_BUILD: "1"
working_directory: /root/go/onecloud
working_directory: /home/build/go/src/yunion.io/x/onecloud
steps:
- checkout
- run:
@@ -18,7 +18,7 @@ jobs:
requires:
- check
docker:
- image: yunionio/centos-build:1.0-1
- image: yunionio/onecloud-ci:v1.0.2
environment:
ONECLOUD_CI_BUILD: "1"
@@ -26,14 +26,14 @@ jobs:
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /root/go/onecloud
working_directory: /home/build/go/src/yunion.io/x/onecloud
parallelism: 4
steps:
- checkout
- restore_cache:
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
- run:
command: |
targets="$(circleci tests glob "cmd/*" | grep -v cmd/host-image | circleci tests split)"
@@ -43,7 +43,7 @@ jobs:
- save_cache:
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
- store_artifacts:
path: _output/
@@ -51,16 +51,16 @@ jobs:
requires:
- check
docker:
- image: yunionio/centos-build:1.0-1
- image: yunionio/onecloud-ci:v1.0.2
environment:
GO111MODULE: "on"
working_directory: /root/go/onecloud
working_directory: /home/build/go/src/yunion.io/x/onecloud
steps:
- checkout
- restore_cache:
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
- run:
name: unit_test
command: |
@@ -68,7 +68,7 @@ jobs:
- save_cache:
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
workflows:
version: 2

View File

@@ -29,17 +29,16 @@ jobs:
- name: Build
run: |
sudo apt-get update
sudo apt-get install librados-dev librbd-dev # baremetal-agent needs this
sudo apt-get install librados-dev librbd-dev
make cmd/apigateway cmd/climc cmd/keystone
make cmd/logger cmd/region cmd/scheduler cmd/webconsole
make cmd/yunionconf cmd/glance cmd/torrent cmd/s3gateway
make cmd/ansibleserver cmd/cloudnet cmd/notify
make cmd/host && ./scripts/bundle_libraries.sh _output/bin/bundles/host _output/bin/host && ./scripts/host_find_libraries.sh _output/bin/bundles/host
make cmd/host-deployer && ./scripts/bundle_libraries.sh _output/bin/bundles/host-deployer _output/bin/host-deployer
make cmd/baremetal-agent && ./scripts/bundle_libraries.sh _output/bin/bundles/baremetal-agent _output/bin/baremetal-agent
make cmd/cloudevent cmd/devtool
make cmd/*cli
make cmd/esxi-agent
make docker-alpine-build F='-j4 cmd/host cmd/vpcagent'
- name: Image baremetal-agent
uses: elgohr/Publish-Docker-Github-Action@master
@@ -51,26 +50,6 @@ jobs:
snapshot: true
dockerfile: build/docker/Dockerfile.baremetal-agent
- name: Image esxi-agent
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/esxi-agent
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.esxi-agent
- name: Image vpcagent
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/vpcagent
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.vpcagent
- name: Image climc
uses: elgohr/Publish-Docker-Github-Action@master
with:
@@ -201,7 +180,7 @@ jobs:
snapshot: true
dockerfile: build/docker/Dockerfile.host-deployer
- name: Image cloudevent
- name: Image cloudevent
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/cloudevent

View File

@@ -83,9 +83,6 @@ test:
vet:
go vet ./...
cmd/esxi-agent: prepare_dir
CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
cmd/%: prepare_dir
$(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
@@ -192,75 +189,43 @@ mod:
go mod vendor -v
DOCKER_BUILD_IMAGE_VERSION?=1.0-1
DOCKER_BUILD_IMAGE_VERSION?=latest
define dockerCentOSBuildCmd
set -o xtrace
define dockerBuildCmd
set -o errexit
set -o pipefail
cd /root/onecloud
cd /home/build/onecloud
export GOFLAGS=-mod=vendor
make $(1)
chown -R $(shell id -u):$(shell id -g) _output
endef
docker-centos-build: export dockerCentOSBuildCmd:=$(call dockerCentOSBuildCmd,$(F))
docker-centos-build:
docker-build: export dockerBuildCmd:=$(call dockerBuildCmd,$(F))
docker-build:
echo "$$dockerBuildCmd"
docker rm --force onecloud-ci-build &>/dev/null || true
docker run \
--name onecloud-ci-build \
--rm \
--volume $(CURDIR):/root/onecloud \
registry.cn-beijing.aliyuncs.com/yunionio/centos-build:$(DOCKER_BUILD_IMAGE_VERSION) \
/bin/bash -c "$$dockerCentOSBuildCmd"
--volume $(CURDIR):/home/build/onecloud \
yunionio/onecloud-ci:$(DOCKER_BUILD_IMAGE_VERSION) \
/bin/bash -c "$$dockerBuildCmd"
chown -R $$(id -u):$$(id -g) _output
ls -lh _output/bin
# NOTE we need a way to stop and remove the container started by docker-build.
# No --tty, --stop-signal won't work
docker-centos-build-stop:
docker-centos stop --time 0 onecloud-ci-build || true
docker-build-stop:
docker stop --time 0 onecloud-ci-build || true
.PHONY: docker-centos-build
.PHONY: docker-centos-build-stop
define dockerAlpineBuildCmd
set -o xtrace
set -o errexit
set -o pipefail
cd /root/go/src/yunion.io/x/onecloud
export GOFLAGS=-mod=vendor
make $(1)
chown -R $(shell id -u):$(shell id -g) _output
endef
docker-alpine-build: export dockerAlpineBuildCmd:=$(call dockerAlpineBuildCmd,$(F))
docker-alpine-build:
docker rm --force onecloud-docker-alpine-build &>/dev/null || true
docker run --rm \
--name onecloud-docker-alpine-build \
-v $(CURDIR):/root/go/src/yunion.io/x/onecloud \
-v $(CURDIR)/_output/alpine-build:/root/go/src/yunion.io/x/onecloud/_output \
registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-1 \
/bin/sh -c "$$dockerAlpineBuildCmd"
ls -lh _output/alpine-build/bin
docker-alpine-build-stop:
docker stop --time 0 onecloud-docker-alpine-build || true
.PHONY: docker-alpine-build
.PHONY: docker-alpine-build-stop
.PHONY: docker-build
.PHONY: docker-build-stop
define helpText
Build with docker
make docker-centos-build F='-j4'
make docker-centos-build F='-j4 cmd/region cmd/climc'
make docker-centos-build-stop
make docker-alpine-build F='-j4'
make docker-alpine-build F='-j4 cmd/host cmd/host-deployer'
make docker-alpine-build-stop
make docker-build F='-j4'
make docker-build F='-j4 cmd/region cmd/climc'
make docker-build-stop
Tidy up go modules and vendor directory

View File

@@ -1,42 +0,0 @@
#!/bin/bash
set -e
pushd $(dirname $BASH_SOURCE) > /dev/null
CUR_DIR=$(pwd -P)
popd > /dev/null
ACCOUNT=$1
if [ -z "$ACCOUNT" ]; then
echo "Usage: $0 <cloud-acount-id-or-name>"
exit 1
fi
ACCOUNT_ID=$(climc cloud-account-show $ACCOUNT | grep -w " id " | awk '{print $4}')
ACCOUNT_NAME=$(climc cloud-account-show $ACCOUNT | grep -w " name " | awk '{print $4}')
if [ -z "$ACCOUNT_ID" ]; then
echo "Cloud account $ACCOUNT not found"
exit 1
fi
echo "Ready to clean cloud account $ACCOUNT_NAME($ACCOUNT_ID)..."
echo "1. Disable cloud account $ACCOUNT_NAME($ACCOUNT_ID) ..."
climc cloud-account-disable $ACCOUNT_ID
echo "2. Clean all providers ..."
for provider_id in $(climc cloud-provider-list --account $ACCOUNT_ID --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
echo "### to clean cloud provider $provider_id ..."
$CUR_DIR/clean_provider.sh $provider_id
done
echo "3. Delete cloud account ..."
climc cloud-account-delete $ACCOUNT_ID

View File

@@ -1,27 +0,0 @@
#/bin/bash
set -e
EIP=$1
if [ -z "$EIP" ]; then
echo "Usage: $0 <eip_id_or_name>"
exit 1
fi
EIP_NAME=$(climc eip-show $EIP | grep -w " name " | awk '{print $4}')
EIP_ID=$(climc eip-show $EIP | grep -w " id " | awk '{print $4}')
if [ -z "$EIP_ID" ]; then
echo "Cannot find eip $EIP_ID"
exit 1
fi
echo "To clean eip $EIP_NAME($EIP_ID)..."
clean_eip() {
local EID=$1
climc eip-purge $EID
}
clean_eip $EIP_ID

View File

@@ -1,80 +0,0 @@
#!/bin/bash
set -e
HOST=$1
if [ -z "$HOST" ]; then
echo "Usage: $0 <host_id_or_name>"
exit 1
fi
error_exit() {
echo "Error: $1"
exit 1
}
HOSTID=$(climc host-show $HOST | grep -w " id " | awk '{print $4}')
HOSTNAME=$(climc host-show $HOST | grep -w " name " | awk '{print $4}')
if [ -z "$HOSTNAME" ]; then
error_exit "Cannot find host $HOST"
fi
if [ -z "$HOSTID" ]; then
error_exit "Cannot find host $HOST"
fi
echo "Ready to purge host $HOSTNAME($HOSTID)..."
echo "1. Disable $HOSTNAME($HOSTID)"
if ! climc host-disable $HOSTID > /dev/null; then
error_exit "Fail to disable $HOST"
fi
echo "2. Clean servers on $HOSTNAME($HOSTID)"
for i in $(climc server-list --host $HOSTID --admin --limit 2048 --system | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc server-update --delete enable $i > /dev/null
climc server-purge $i > /dev/null
done
for i in $(climc server-list --host $HOSTID --admin --limit 2048 --pending-delete --system | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc server-purge $i > /dev/null
done
echo "3. Clean disks on $HOSTNAME($HOSTID)"
for storageid in $(climc host-storage-list --host $HOSTID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $4}')
do
STORAGENAME=$(climc storage-show $storageid | grep -w " name " | awk '{print $4}')
STORAGE_TYPE=$(climc storage-show $storageid | grep -w " storage_type " | awk '{print $4}')
if [ "$STORAGE_TYPE" == "local" ]; then
for diskid in $(climc disk-list --admin --system --details --search $storageid --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc disk-purge $diskid > /dev/null
done
for diskid in $(climc disk-list --admin --system --details --search $storageid --pending-delete --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc disk-purge $diskid > /dev/null
done
fi
done
echo "4. Remove host $HOSTNAME($HOSTID)"
BAREMETAL=$(climc host-show $HOSTID | grep -w " is_baremetal " | awk '{print $4}')
HOSTTYPE=$(climc host-show $HOSTID | grep -w " host_type " | awk '{print $4}')
if [ "$BAREMETAL" == "true" ] && [ "$HOSTTYPE" != "baremetal" ]; then
climc host-update --host-type baremetal $HOSTID > /dev/null
fi
climc host-delete $HOSTID > /dev/null
echo "DONE."

View File

@@ -1,27 +0,0 @@
#!/bin/bash
set -e
LB=$1
if [ -z "$LB" ]; then
echo "Usage: $0 <loadbalancer_id_or_name>"
exit 1
fi
LB_ID=$(climc lb-show $LB | grep -w " id " | awk '{print $4}')
LB_NAME=$(climc lb-show $LB | grep -w " name " | awk '{print $4}')
if [ -z "$LB_ID" ]; then
echo "Loadbalancer $LB not found"
exit 1
fi
echo "Ready to remove loadbalancer $LB_NAME($LB_ID) ..."
clean_loadbalancer() {
local LID=$1
climc lb-purge $LID
}
clean_loadbalancer $LB_ID

View File

@@ -1,27 +0,0 @@
#!/bin/bash
set -e
LB_ACL=$1
if [ -z "$LB_ACL" ]; then
echo "Usage: $0 <loadbalancer_id_or_name>"
exit 1
fi
LB_ACL_ID=$(climc lbacl-show $LB_ACL | grep -w " id " | awk '{print $4}')
LB_ACL_NAME=$(climc lbacl-show $LB_ACL | grep -w " name " | awk '{print $4}')
if [ -z "$LB_ACL_ID" ]; then
echo "Loadbalancer ACL $LB_ACL_ID not found"
exit 1
fi
echo "Ready to remove loadbalancer acl $LB_ACL_NAME($LB_ACL_ID) ..."
clean_loadbalancer_acl() {
local LID=$1
climc lbacl-purge $LID
}
clean_loadbalancer_acl $LB_ACL_ID

View File

@@ -1,27 +0,0 @@
#!/bin/bash
set -e
LB_CERT=$1
if [ -z "$LB_CERT" ]; then
echo "Usage: $0 <loadbalancer_id_or_name>"
exit 1
fi
LB_CERT_ID=$(climc lbcert-show $LB_CERT | grep -w " id " | awk '{print $4}')
LB_CERT_NAME=$(climc lbcert-show $LB_CERT | grep -w " name " | awk '{print $4}')
if [ -z "$LB_CERT_ID" ]; then
echo "Loadbalancer certificate $LB_CERT_ID not found"
exit 1
fi
echo "Ready to remove loadbalancer certificate $LB_CERT_NAME($LB_CERT_ID) ..."
clean_loadbalancer_cert() {
local LID=$1
climc lbcert-purge $LID
}
clean_loadbalancer_cert $LB_CERT_ID

View File

@@ -1,96 +0,0 @@
#!/bin/bash
set -e
pushd $(dirname $BASH_SOURCE) > /dev/null
CUR_DIR=$(pwd -P)
popd > /dev/null
PROVIDER=$1
if [ -z "$PROVIDER" ]; then
echo "Usage: $0 <cloud-provider-id-or-name>"
exit 1
fi
PROVIDER_ID=$(climc cloud-provider-show $PROVIDER | grep -w " id " | awk '{print $4}')
PROVIDER_NAME=$(climc cloud-provider-show $PROVIDER | grep -w " name " | awk '{print $4}')
if [ -z "$PROVIDER_ID" ]; then
echo "Cloud provider $PROVIDER not found"
exit 1
fi
echo "Ready to clean cloud provider $PROVIDER_NAME($PROVIDER_ID)..."
echo "1. Disable cloud provider $PROVIDER_NAME($PROVIDER_ID) ..."
climc cloud-provider-disable $PROVIDER_ID
echo "2. Clean all hosts ..."
for hostid in $(climc host-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_host.sh $hostid
done
echo "3. Clean all loadbalancer ..."
for lbid in $(climc lb-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_loadbalancer.sh $lbid
done
echo "4. Clean all loadbalancer acl ..."
for lbaclid in $(climc lbacl-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_loadbalancer_acl.sh $lbaclid
done
echo "5. Clean all loadbalancer certificate ..."
for lbcertid in $(climc lbcert-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_loadbalancer_certificate.sh $lbcertid
done
echo "6. Clean all vpc ..."
for vpcid in $(climc vpc-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_vpc.sh $vpcid
done
echo "7. Clean all eips ..."
for eipid in $(climc eip-list --admin --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_eip.sh $eipid
done
echo "8. Clean all snapshots ..."
for snapid in $(climc snapshot-list --admin --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
echo "to clean snapshot $snapid ..."
$CUR_DIR/clean_snapshot.sh $snapid
done
echo "9. Clean all storagecache ..."
for cacheid in $(climc storage-cache-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_storagecache.sh $cacheid
done
echo "10. Clean all storages ..."
for storeid in $(climc storage-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
$CUR_DIR/clean_storage.sh $storeid
done
echo "Delete cloud provider ..."
climc cloud-provider-delete $PROVIDER_ID

View File

@@ -1,27 +0,0 @@
#/bin/bash
set -e
SNAPSHOT=$1
if [ -z "$SNAPSHOT" ]; then
echo "Usage: $0 <snapshot_id_or_name>"
exit 1
fi
SNAPSHOT_NAME=$(climc snapshot-show $SNAPSHOT | grep -w " name " | awk '{print $4}')
SNAPSHOT_ID=$(climc snapshot-show $SNAPSHOT | grep -w " id " | awk '{print $4}')
if [ -z "$SNAPSHOT_ID" ]; then
echo "Cannot find snapshot $SNAPSHOT_ID"
exit 1
fi
echo "To clean snapshot $SNAPSHOT_NAME($SNAPSHOT_ID)..."
clean_snapshot() {
local SNAP_ID=$1
climc snapshot-purge $SNAP_ID > /dev/null
}
clean_snapshot $SNAPSHOT_ID

View File

@@ -1,34 +0,0 @@
#!/bin/bash
set -e
STORAGE=$1
if [ -z "$STORAGE" ]; then
echo "Usage: $0 <storage_id_or_name>"
exit 1
fi
STORAGE_ID=$(climc storage-show $STORAGE | grep -w " id " | awk '{print $4}')
STORAGE_NAME=$(climc storage-show $STORAGE | grep -w " name " | awk '{print $4}')
if [ -z "$STORAGE_ID" ]; then
echo "Storage $STORAGE not found"
exit 1
fi
echo "Clean disks on storage $STORAGE_NAME($STORAGE_ID) ..."
for disk_id in $(climc disk-list --admin --storage $STORAGE_ID --show-emulated --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc disk-purge $disk_id > /dev/null
done
for disk_id in $(climc disk-list --admin --storage $STORAGE_ID --show-emulated --pending-delete --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc disk-purge $disk_id > /dev/null
done
# CACHE_ID=$(climc storage-show $STORAGE_ID | grep -w " storagecache_id " | awk '{print $4}')
climc storage-delete $STORAGE_ID > /dev/null

View File

@@ -1,28 +0,0 @@
#!/bin/bash
set -e
CACHE=$1
if [ -z "$CACHE" ]; then
echo "Usage: $0 <storage_cache_id_or_name>"
exit 1
fi
CACHE_ID=$(climc storage-cache-show $CACHE | grep -w " id " | awk '{print $4}')
CACHE_NAME=$(climc storage-cache-show $CACHE | grep -w " name " | awk '{print $4}')
if [ -z "$CACHE_ID" ]; then
echo "Storage cache $CACHE not found"
exit 1
fi
echo "Ready to remove storagecache $CACHE_NAME($CACHE_ID) ..."
for imgid in $(climc storage-cached-image-list --storagecache $CACHE_ID --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $4}')
do
climc storagecache-uncache-image $CACHE_ID $imgid --force # > /dev/null
done
climc storage-cache-delete $CACHE_ID > /dev/null

View File

@@ -1,55 +0,0 @@
#/bin/bash
set -e
VPC=$1
if [ -z "$VPC" ]; then
echo "Usage: $0 <vpc_id_or_name>"
exit 1
fi
VPC_NAME=$(climc vpc-show $VPC | grep -w " name " | awk '{print $4}')
VPC_ID=$(climc vpc-show $VPC | grep -w " id " | awk '{print $4}')
if [ -z "$VPC_ID" ]; then
echo "Cannot find vpc $VPC"
exit 1
fi
echo "To clean vpc $VPC_NAME($VPC_ID)..."
clean_network() {
climc network-purge $1 > /dev/null
}
clean_wire() {
local WIRE_ID=$1
for net_id in $(climc network-list --admin --wire $WIRE_ID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
clean_network $net_id
done
climc wire-delete $wire_id > /dev/null
}
clean_vpc() {
local VPC_ID=$1
climc vpc-purge $VPC_ID > /dev/null
}
echo "1. Clean wires ..."
for wire_id in $(climc wire-list --vpc $VPC_ID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
clean_wire $wire_id
done
echo "2. Clean route tables ..."
for routetable_id in $(climc routetable-list --vpc $VPC_ID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc routetable-purge $routetable_id >/dev/null
done
echo "3. clean vpc ..."
clean_vpc $VPC_ID

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:v0.0.1
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:latest
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"

View File

@@ -32,8 +32,3 @@ COPY ./opt/cloud/yunion/baremetal/pxelinux.0 /opt/cloud/yunion/baremetal
ADD ./mkisofs /bin/mkisofs
ADD ./.mkisofs.bin /bin/.mkisofs.bin
ADD ./bundles/mkisofs /bin/bundles/mkisofs
# use GNU timeout command replace busybox timeout command
RUN rm /usr/bin/timeout
ADD ./timeout /bin/timeout
ADD ./.timeout.bin /bin/.timeout.bin
ADD ./bundles/timeout /bin/bundles/timeout

View File

@@ -1,5 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/climc-base:v20200308
ADD ./build/climc/root/opt /opt
FROM registry.cn-beijing.aliyuncs.com/yunionio/climc-base:latest
ADD ./_output/bin/climc ./_output/bin/*cli /opt/yunion/bin/

View File

@@ -6,7 +6,7 @@ ENV TZ Asia/Shanghai
RUN mkdir -p /opt/yunion/bin
RUN apk add --no-cache bash bash-completion tzdata ca-certificates vim && \
RUN apk add --no-cache bash bash-completion tzdata ca-certificates && \
rm -rf /var/cache/apk/*
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

View File

@@ -1,9 +1,11 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.1.0
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
ENV TZ Asia/Shanghai
RUN apk add librados librbd
RUN mkdir -p /opt/yunion/bin
ADD ./_output/alpine-build/bin/host /opt/yunion/bin/host
ADD ./_output/bin/host /opt/yunion/bin/host
ADD ./_output/bin/.host.bin /opt/yunion/bin/.host.bin
ADD ./_output/bin/bundles/host /opt/yunion/bin/bundles/host

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:v0.0.2
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"

View File

@@ -1,4 +0,0 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
ADD ./_output/bin/monitor /opt/yunion/bin/monitor

View File

@@ -1,6 +0,0 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/openvswitch:2.9.6-1
MAINTAINER "Yousong Zhou <zhouyousong@yunion.cn>"
RUN mkdir -p /opt/yunion/bin
ADD ./_output/alpine-build/bin/vpcagent /opt/yunion/bin/vpcagent

View File

@@ -1,19 +0,0 @@
[Unit]
Description=Yunion Host Image Server
Documentation=https://docs.yunion.cn
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/yunion/bin/host-image --conf /etc/yunion/host.conf
WorkingDirectory=/opt/yunion/bin
KillMode=process
Restart=always
RestartSec=30
LimitNOFILE=500000
LimitNPROC=500000
[Install]
WantedBy=multi-user.target

View File

@@ -1,2 +0,0 @@
DESCRIPTION="Yunion Host Image Server"
SERVICE="yes"

View File

@@ -35,7 +35,6 @@ import (
_ "yunion.io/x/onecloud/cmd/climc/shell/cloudnet"
_ "yunion.io/x/onecloud/cmd/climc/shell/etcd"
_ "yunion.io/x/onecloud/cmd/climc/shell/k8s"
_ "yunion.io/x/onecloud/cmd/climc/shell/monitor"
"yunion.io/x/onecloud/pkg/mcclient"
)

View File

@@ -30,7 +30,6 @@ func init() {
type CloudaccountListOptions struct {
options.BaseListOptions
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
}
R(&CloudaccountListOptions{}, "cloud-account-list", "List cloud accounts", func(s *mcclient.ClientSession, args *CloudaccountListOptions) error {
var params *jsonutils.JSONDict
@@ -40,9 +39,6 @@ func init() {
if err != nil {
return err
}
if len(args.Capability) > 0 {
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
}
}
result, err := modules.Cloudaccounts.List(s, params)
if err != nil {
@@ -99,9 +95,6 @@ func init() {
if len(args.OptionsBillingBucketAccount) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
}
if len(args.OptionsBillingFilePrefix) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
}
if options.Size() > 0 {
params.(*jsonutils.JSONDict).Add(options, "options")
}
@@ -167,8 +160,8 @@ func init() {
if len(args.OptionsBillingBucketAccount) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
}
if len(args.OptionsBillingFilePrefix) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
if len(args.OptionsBillingFileAccount) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingFileAccount), "billing_file_account")
}
if options.Size() > 0 {
params.Add(options, "options")
@@ -311,9 +304,6 @@ func init() {
if len(args.OptionsBillingBucketAccount) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
}
if len(args.OptionsBillingFilePrefix) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
}
if options.Size() > 0 {
params.Add(options, "options")
}
@@ -324,9 +314,6 @@ func init() {
if args.RemoveOptionsBillingBucketAccount {
removeOptions = append(removeOptions, "billing_bucket_account")
}
if args.RemoveOptionsBillingFilePrefix {
removeOptions = append(removeOptions, "billing_file_prefix")
}
if len(removeOptions) > 0 {
params.Add(jsonutils.NewStringArray(removeOptions), "remove_options")
}
@@ -391,8 +378,8 @@ func init() {
if len(args.OptionsBillingBucketAccount) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
}
if len(args.OptionsBillingFilePrefix) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
if len(args.OptionsBillingFileAccount) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingFileAccount), "billing_file_account")
}
if options.Size() > 0 {
params.Add(options, "options")
@@ -404,8 +391,8 @@ func init() {
if args.RemoveOptionsBillingBucketAccount {
removeOptions = append(removeOptions, "billing_bucket_account")
}
if args.RemoveOptionsBillingFilePrefix {
removeOptions = append(removeOptions, "billing_file_prefix")
if args.RemoveOptionsBillingFileAccount {
removeOptions = append(removeOptions, "billing_file_account")
}
if len(removeOptions) > 0 {
params.Add(jsonutils.NewStringArray(removeOptions), "remove_options")
@@ -674,23 +661,6 @@ func init() {
return nil
})
R(&options.SGoogleCloudAccountUpdateCredentialOptions{}, "cloud-account-update-credential-google", "Update credential of a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateCredentialOptions) error {
data, err := ioutil.ReadFile(args.GoogleJsonFile)
if err != nil {
return err
}
params, err := jsonutils.Parse(data)
if err != nil {
return err
}
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "update-credential", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SS3CloudAccountUpdateCredentialOptions{}, "cloud-account-update-credential-s3", "Update credential of a generic S3 cloud account", func(s *mcclient.ClientSession, args *options.SS3CloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "update-credential", params)

View File

@@ -24,9 +24,6 @@ func init() {
type CloudeventListOptions struct {
options.BaseListOptions
Since string `help:"since time"`
Until string `hlep:"until time"`
}
R(&CloudeventListOptions{}, "cloud-event-list", "List cloud events", func(s *mcclient.ClientSession, opts *CloudeventListOptions) error {
params, err := options.ListStructToParams(opts)

View File

@@ -31,9 +31,8 @@ func init() {
Usable bool `help:"Vpc & Network usable"`
HasObjectStorage bool `help:"filter cloudproviders that has object storage"`
NoObjectStorage bool `help:"filter cloudproviders that has no object storage"`
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
HasObjectStorage bool `help:"filter cloudproviders that has object storage"`
NoObjectStorage bool `help:"filter cloudproviders that has no object storage"`
}
R(&CloudproviderListOptions{}, "cloud-provider-list", "List cloud providers", func(s *mcclient.ClientSession, args *CloudproviderListOptions) error {
var params *jsonutils.JSONDict
@@ -53,10 +52,6 @@ func init() {
} else if args.NoObjectStorage {
params.Add(jsonutils.JSONFalse, "has_object_storage")
}
if len(args.Capability) > 0 {
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
}
}
result, err := modules.Cloudproviders.List(s, params)
if err != nil {

View File

@@ -49,7 +49,7 @@ func init() {
type CloudregionCityListOptions struct {
Manager string `help:"List objects belonging to the cloud provider"`
Account string `help:"List objects belonging to the cloud account"`
Provider string `help:"List objects from the provider" choices:"VMware|Aliyun|Qcloud|Azure|Aws|Huawei|Openstack|Ucloud|ZStack|Google|Ctyun"`
Provider string `help:"List objects from the provider" choices:"VMware|Aliyun|Qcloud|Azure|Aws|Huawei|Openstack|Ucloud|ZStack"`
City string `help:"List regions in the specified city"`
PublicCloud *bool `help:"List objects belonging to public cloud" json:"public_cloud"`

View File

@@ -29,11 +29,11 @@ func init() {
* 操作用户的通信地址(如果用户的通信地址不存在则进行添加;如果已存在则进行修改;如果设置空则进行删除。)
*/
type ContactsUpdateOptions struct {
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
CONTACTTYPE string `help:"The contact type email|mobile" choices:"email|mobile|dingtalk"`
CONTACT string `help:"The contacts details mobile number or email address or dingtalk's userid, if set it the empty str means delete"`
Status string `help:"Enabled or disabled contact status" choices:"enable|disable"`
Pull string `help:"pull some subcontacts(e.g., dingtalk, feishu, etc) related to mobile"`
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
CONTACTTYPE string `help:"The contact type email|mobile" choices:"email|mobile|dingtalk"`
CONTACT string `help:"The contacts details mobile number or email address or dingtalk's userid, if set it the empty str means delete"`
Status string `help:"Enabled or disabled contact status" choices:"enable|disable"`
UpdateDingtalk bool `help:"if update dingtalk"`
}
R(&ContactsUpdateOptions{}, "contact-update", "Create, delete or update contact for user", func(s *mcclient.ClientSession, args *ContactsUpdateOptions) error {
arr := jsonutils.NewArray()
@@ -52,8 +52,12 @@ func init() {
params := jsonutils.NewDict()
params.Add(arr, "contacts")
if args.UpdateDingtalk {
params.Add(jsonutils.JSONTrue, "update_dingtalk")
}
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", args.Pull, params)
if err != nil {
return err
}
@@ -62,21 +66,6 @@ func init() {
return nil
})
type ContactsPullOptions struct {
UID string `help:"The user you wanna pull contact"`
CONTACTTYPE string `help:"The contact type"`
}
R(&ContactsPullOptions{}, "contact-pull", "Pull contact", func(s *mcclient.ClientSession, args *ContactsPullOptions) error {
params := jsonutils.NewDict()
params.Set("contacts", jsonutils.NewArray())
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", args.CONTACTTYPE, params)
if err != nil {
return err
}
printObject(contact)
return nil
})
type ContactsDeleteOptions struct {
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
CONTACTTYPE string `help:"The contact type email|mobile|dingtalk" choices:"email|mobile|dingtalk"`
@@ -89,7 +78,7 @@ func init() {
arr.Add(tmpObj)
params := jsonutils.NewDict()
params.Add(arr, "contacts")
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", "", params)
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
if err != nil {
return err
}
@@ -180,7 +169,7 @@ func init() {
tmpDict := jsonutils.NewDict()
tmpDict.Add(jsonutils.NewString(args.CONTACT_TYPE), "contact_type")
tmpDict.Add(jsonutils.NewString(args.CONTACT), "contact")
_, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "verify", "", tmpDict)
_, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "verify", tmpDict)
if err != nil {
return err
}

View File

@@ -79,7 +79,7 @@ func init() {
if err != nil {
return err
}
users, err := modules.Groups.GetUsers(s, grpId, nil)
users, err := modules.Groups.GetUsers(s, grpId)
if err != nil {
return err
}

View File

@@ -18,13 +18,11 @@ import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/ssh"
)
func init() {
@@ -40,7 +38,7 @@ func init() {
Occupied bool `help:"show occupid host" json:"-"`
Enabled bool `help:"Show enabled host only" json:"-"`
Disabled bool `help:"Show disabled host only" json:"-"`
HostType string `help:"Host type filter" choices:"baremetal|hypervisor|esxi|kubelet|hyperv|aliyun|azure|qcloud|aws|huawei|ucloud|google|ctyun"`
HostType string `help:"Host type filter" choices:"baremetal|hypervisor|esxi|kubelet|hyperv|aliyun|azure|qcloud|aws|huawei|ucloud"`
AnyMac string `help:"Mac matches one of the host's interface"`
IsBaremetal *bool `help:"filter host list by is_baremetal=true|false"`
@@ -57,8 +55,6 @@ func init() {
CdromBoot *bool `help:"filter hosts list by cdrom_boot=true|false"`
Sn string `help:"find host by sn"`
options.BaseListOptions
}
R(&HostListOptions{}, "host-list", "List hosts", func(s *mcclient.ClientSession, opts *HostListOptions) error {
@@ -80,9 +76,6 @@ func init() {
if len(opts.Uuid) > 0 {
params.Add(jsonutils.NewString(opts.Uuid), "uuid")
}
if len(opts.Sn) > 0 {
params.Add(jsonutils.NewString(opts.Sn), "sn")
}
result, err := modules.Hosts.List(s, params)
if err != nil {
return err
@@ -666,44 +659,4 @@ func init() {
printObject(result)
return nil
})
type HostSSHLoginOptions struct {
ID string `help:"ID or name of host"`
Port int `help:"SSH service port" default:"22"`
}
R(&HostSSHLoginOptions{}, "host-ssh", "SSH login of a host", func(s *mcclient.ClientSession, args *HostSSHLoginOptions) error {
srvid, e := modules.Hosts.GetId(s, args.ID, nil)
if e != nil {
return e
}
i, e := modules.Hosts.GetLoginInfo(s, srvid, nil)
if e != nil {
return e
}
host, err := i.GetString("ip")
if err != nil {
return err
}
user, err := i.GetString("username")
if err != nil {
return err
}
passwd, err := i.GetString("password")
if err != nil {
return err
}
port := 22
if args.Port != 22 {
port = args.Port
}
sshCli, err := ssh.NewClient(host, port, user, passwd, "")
if err != nil {
return err
}
log.Infof("ssh %s:%d", host, port)
if err := sshCli.RunTerminal(); err != nil {
return err
}
return nil
})
}

View File

@@ -50,7 +50,7 @@ type ImageOptionalOptions struct {
OsLang string `help:"OS Language" choices:"zh_CN|en_US"`
Preference int64 `help:"Disk preferences"`
Notes string `help:"Notes about the image"`
Hypervisor []string `help:"Prefer hypervisor type" choices:"kvm|esxi|baremetal|container|openstack|ctyun"`
Hypervisor []string `help:"Prefer hypervisor type" choices:"kvm|esxi|baremetal|container|openstack"`
DiskDriver string `help:"Perfer disk driver" choices:"virtio|scsi|pvscsi|ide|sata"`
NetDriver string `help:"Preferred network driver" choices:"virtio|e1000|vmxnet3"`
}

View File

@@ -51,10 +51,9 @@ func init() {
})
type KeypairCreate struct {
NAME string `help:"Name of keypair to be created"`
Scheme string `help:"Scheme of keypair, default is RSA" choices:"RSA" default:"RSA"`
PublicKey string `help:"Publickey of keypair"`
Desc string `help:"Short description of keypair"`
NAME string `help:"Name of keypair to be created"`
Scheme string `help:"Scheme of keypair, default is RSA" choices:"RSA|DSA" default:"RSA"`
Desc string `help:"Short description of keypair"`
}
R(&KeypairCreate{}, "keypair-create", "Create a new keypair", func(s *mcclient.ClientSession, args *KeypairCreate) error {
@@ -64,10 +63,6 @@ func init() {
params.Add(jsonutils.NewString(args.Scheme), "scheme")
}
if len(args.PublicKey) > 0 {
params.Add(jsonutils.NewString(args.PublicKey), "public_key")
}
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}

View File

@@ -1,69 +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 monitor
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
aN := cmdN("alert")
R(&options.AlertListOptions{}, aN("list"), "List all alerts",
func(s *mcclient.ClientSession, args *options.AlertListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Alerts.List(s, params)
if err != nil {
return err
}
printList(ret, monitor.Alerts.GetColumns(s))
return nil
})
R(&options.AlertShowOptions{}, aN("show"), "Show details of a alert rule",
func(s *mcclient.ClientSession, args *options.AlertShowOptions) error {
ret, err := monitor.Alerts.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.AlertUpdateOptions{}, aN("update"), "Update a alert rule",
func(s *mcclient.ClientSession, args *options.AlertUpdateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Alerts.Update(s, args.ID, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.AlertDeleteOptions{}, aN("delete"), "Delete alerts",
func(s *mcclient.ClientSession, args *options.AlertDeleteOptions) error {
ret := monitor.Alerts.BatchDelete(s, args.ID, nil)
printBatchResults(ret, monitor.Alerts.GetColumns(s))
return nil
})
}

View File

@@ -1,27 +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 monitor
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/util/printutils"
)
var (
R = shell.R
printList = printutils.PrintJSONList
printObject = printutils.PrintJSONObject
printBatchResults = printutils.PrintJSONBatchResults
)

View File

@@ -1,56 +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 monitor
import (
"fmt"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func cmdN(suffix string) func(action string) string {
return func(action string) string {
return fmt.Sprintf("monitor-%s-%s", suffix, action)
}
}
func init() {
dsN := cmdN("datasource")
R(&options.DataSourceListOptions{}, dsN("list"), "List all monitor data source",
func(s *mcclient.ClientSession, args *options.DataSourceListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.DataSources.List(s, params)
if err != nil {
return err
}
printList(ret, monitor.DataSources.GetColumns(s))
return nil
})
R(&options.DataSourceDeleteOptions{}, dsN("delete"), "Delete monitor data source",
func(s *mcclient.ClientSession, args *options.DataSourceDeleteOptions) error {
ret, err := monitor.DataSources.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -1,99 +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 monitor
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
nN := cmdN("notification")
R(&options.NotificationListOptions{}, nN("list"), "List all alert notification",
func(s *mcclient.ClientSession, args *options.NotificationListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.List(s, params)
if err != nil {
return err
}
printList(ret, monitor.Notifications.GetColumns(s))
return nil
})
R(&options.NotificationDingDingCreateOptions{}, nN("create-dingding"),
"Create dingding alert notification",
func(s *mcclient.ClientSession, args *options.NotificationDingDingCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.Create(s, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationFeishuCreateOptions{}, nN("create-feishu"),
"Create feishu alert notification",
func(s *mcclient.ClientSession, args *options.NotificationFeishuCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.Create(s, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationShowOptions{}, nN("show"), "Show alert notification",
func(s *mcclient.ClientSession, args *options.NotificationShowOptions) error {
ret, err := monitor.Notifications.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationUpdateOptions{}, nN("update"), "Update alert notification",
func(s *mcclient.ClientSession, args *options.NotificationUpdateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.Update(s, args.ID, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationDeleteOptions{}, nN("delete"), "Show delete notification",
func(s *mcclient.ClientSession, args *options.NotificationDeleteOptions) error {
ret := monitor.Notifications.BatchDelete(s, args.ID, nil)
printBatchResults(ret, monitor.Notifications.GetColumns(s))
return nil
})
}

View File

@@ -59,18 +59,18 @@ func init() {
* 修改指定的报警规则
*/
type NodealertUpdateOptions struct {
ID string `help:"ID of the alert rule" required:"true" positional:"true"`
Type string `help:"Alert rule type" choices:"guest|host"`
Metric string `help:"Metric name, include measurement and field, such as vm_cpu.usage_active"`
NodeName string `help:"Name of the guest or host"`
NodeID string `help:"ID of the guest or host"`
Period string `help:"Specify the query time period for the data"`
Window string `help:"Specify the query interval for the data"`
Threshold *float64 `help:"Threshold value of the metric"`
Comparator string `help:"Comparison operator for join expressions" choices:">|<|>=|<=|=|!="`
Recipients string `help:"Comma separated recipient ID"`
Level string `help:"Alert level" choices:"normal|important|fatal"`
Channel string `help:"Ways to send an alarm" choices:"email|mobile"`
ID string `help:"ID of the alert rule" required:"true" positional:"true"`
Type string `help:"Alert rule type" choices:"guest|host"`
Metric string `help:"Metric name, include measurement and field, such as vm_cpu.usage_active"`
NodeName string `help:"Name of the guest or host"`
NodeID string `help:"ID of the guest or host"`
Period string `help:"Specify the query time period for the data"`
Window string `help:"Specify the query interval for the data"`
Threshold float64 `help:"Threshold value of the metric"`
Comparator string `help:"Comparison operator for join expressions" choices:">|<|>=|<=|=|!="`
Recipients string `help:"Comma separated recipient ID"`
Level string `help:"Alert level" choices:"normal|important|fatal"`
Channel string `help:"Ways to send an alarm" choices:"email|mobile"`
}
R(&NodealertUpdateOptions{}, "nodealert-update", "Update the node alert rule", func(s *mcclient.ClientSession, args *NodealertUpdateOptions) error {
params, err := options.StructToParams(args)
@@ -92,11 +92,14 @@ func init() {
* 删除指定ID的报警规则
*/
type NodealertDeleteOptions struct {
ID []string `help:"ID of node alert" required:"true" positional:"true"`
ID string `help:"ID of node alert" required:"true" positional:"true"`
}
R(&NodealertDeleteOptions{}, "nodealert-delete", "Delete a node alert", func(s *mcclient.ClientSession, args *NodealertDeleteOptions) error {
ret := modules.NodeAlert.BatchDelete(s, args.ID, nil)
printBatchResults(ret, modules.NodeAlert.GetColumns(s))
alarm, err := modules.NodeAlert.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(alarm)
return nil
})

View File

@@ -29,7 +29,7 @@ func init() {
*/
type NotificationCreateOptions struct {
CONTACTTYPE string `help:"User's contacts type"`
CONTACTTYPE string `help:"User's contacts type" choices:"email|mobile|dingtalk|webconsole"`
TOPIC string `help:"Title or topic of the notification"`
PRIORITY string `help:"Priority of the notification" choices:"normal|important|fatal"`
MSG string `help:"The content of the notification"`

View File

@@ -34,24 +34,7 @@ func init() {
}
body := jsonutils.NewDict()
body.Add(tmp, args.CONTACTTYPE)
ret, err := modules.Configs.Create(s, body)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&ConfigCreate2Options{}, "notify-config-validate", "config validate", func(s *mcclient.ClientSession,
args *ConfigCreate2Options) error {
tmp := jsonutils.NewDict()
for i := 0; i+1 < len(args.CONFIGS); i += 2 {
tmp.Add(jsonutils.NewString(args.CONFIGS[i+1]), args.CONFIGS[i])
}
ret, err := modules.Configs.PerformAction(s, args.CONTACTTYPE, "validate", tmp)
if err != nil {
return err
}
printObject(ret)
modules.Configs.Create(s, body)
return nil
})

View File

@@ -28,7 +28,6 @@ func init() {
NOTES string `help:"Why reserve this IP"`
IPS []string `help:"IPs to reserve"`
Duration string `help:"reservation duration, e.g. 1I, 1H, 2M"`
Status string `help:"ip status"`
}
R(&NetworkReserveIPOptions{}, "network-reserve-ip", "Reserve an IP address from pool", func(s *mcclient.ClientSession, args *NetworkReserveIPOptions) error {
params := jsonutils.NewDict()
@@ -37,9 +36,6 @@ func init() {
if len(args.Duration) > 0 {
params.Add(jsonutils.NewString(args.Duration), "duration")
}
if len(args.Status) > 0 {
params.Add(jsonutils.NewString(args.Status), "status")
}
net, err := modules.Networks.PerformAction(s, args.NETWORK, "reserve-ip", params)
if err != nil {
return err

View File

@@ -21,7 +21,6 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/util/regutils"
"yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/cloudcommon/cmdline"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
@@ -151,19 +150,12 @@ func init() {
})
type ServerAttachNetworkOptions struct {
SERVER string `help:"ID or Name of server"`
NETDESC []string `help:"Network description"`
SERVER string `help:"ID or Name of server"`
NETDESC string `help:"Network description"`
}
R(&ServerAttachNetworkOptions{}, "server-attach-network", "Attach a server to a virtual network", func(s *mcclient.ClientSession, args *ServerAttachNetworkOptions) error {
input := compute.AttachNetworkInput{[]*compute.NetworkConfig{}}
for i := 0; i < len(args.NETDESC); i++ {
conf, err := cmdline.ParseNetworkConfig(args.NETDESC[i], -1)
if err != nil {
return err
}
input.Nets = append(input.Nets, conf)
}
params := jsonutils.Marshal(input)
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.NETDESC), "net_desc")
srv, err := modules.Servers.PerformAction(s, args.SERVER, "attachnetwork", params)
if err != nil {
return err

View File

@@ -34,7 +34,6 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/ssh"
)
func init() {
@@ -1219,77 +1218,4 @@ func init() {
}
return nil
})
R(&options.ServerSSHLoginOptions{}, "server-ssh", "Use SSH login a server", func(s *mcclient.ClientSession, opts *options.ServerSSHLoginOptions) error {
srv, err := modules.Servers.Get(s, opts.ID, nil)
if err != nil {
return err
}
srvid, err := srv.GetString("id")
if err != nil {
return err
}
address := make([]string, 0)
nics, err := srv.GetArray("nics")
if err != nil {
return err
}
for _, nic := range nics {
if addr, err := nic.GetString("ip_addr"); err == nil {
address = append(address, addr)
}
}
if len(address) == 0 {
return fmt.Errorf("Not found ip address from server %s", opts.ID)
}
params := jsonutils.NewDict()
if len(opts.Key) > 0 {
privateKey, e := ioutil.ReadFile(opts.Key)
if e != nil {
return e
}
params.Add(jsonutils.NewString(string(privateKey)), "private_key")
}
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
if e != nil {
return e
}
passwd, err := i.GetString("password")
if err != nil {
return err
}
if opts.Password != "" {
passwd = opts.Password
}
user, err := i.GetString("username")
if err != nil {
return err
}
if opts.User != "" {
user = opts.User
}
host := address[0]
if opts.Host != "" {
host = opts.Host
}
port := 22
if opts.Port != 22 {
port = opts.Port
}
sshCli, err := ssh.NewClient(host, port, user, passwd, "")
if err != nil {
return err
}
log.Infof("ssh %s:%d", host, port)
if err := sshCli.RunTerminal(); err != nil {
return err
}
return nil
})
}

View File

@@ -22,9 +22,9 @@ import (
)
type GeneralUsageOptions struct {
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun"`
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|Google|Ctyun"`
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|DStack|Google|Ctyun"`
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack"`
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack"`
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|DStack"`
Project string `help:"show usage of specified project"`
ProjectDomain string `help:"show usage of specified domain"`

View File

@@ -15,7 +15,6 @@
package shell
import (
"encoding/base64"
"fmt"
"net/url"
@@ -46,9 +45,6 @@ func init() {
if err != nil {
return err
}
if decodeStr, err := base64.StdEncoding.DecodeString(connParams); err == nil {
connParams = string(decodeStr)
}
var query url.Values
connUrl, err := url.ParseRequestURI(connParams)
if err == nil {
@@ -68,9 +64,7 @@ func init() {
return nil
}
newQuery := url.Values(make(map[string][]string))
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connParams)))
u.RawQuery = newQuery.Encode()
u.RawQuery = connParams
fmt.Println(u.String())
return nil
}

View File

@@ -1,23 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"yunion.io/x/onecloud/pkg/monitor/service"
)
func main() {
service.StartService()
}

View File

@@ -1,71 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"context"
"os"
"os/signal"
"sync"
"syscall"
"yunion.io/x/log"
app_common "yunion.io/x/onecloud/pkg/cloudcommon/app"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/vpcagent/options"
_ "yunion.io/x/onecloud/pkg/vpcagent/ovn"
"yunion.io/x/onecloud/pkg/vpcagent/worker"
)
func main() {
defer atexit.Handle()
opts := &options.Options{}
commonOpts := &opts.CommonOptions
{
common_options.ParseOptions(opts, os.Args, "vpcagent.conf", "vpcagent")
app_common.InitAuth(commonOpts, func() {
log.Infof("auth finished ok")
})
}
if err := opts.ValidateThenInit(); err != nil {
log.Fatalf("opts validate: %s", err)
}
w := worker.NewWorker(opts)
if w == nil {
log.Fatalf("new worker failed")
}
{
wg := &sync.WaitGroup{}
ctx, cancelFunc := context.WithCancel(context.Background())
ctx = context.WithValue(ctx, "wg", wg)
wg.Add(1)
go w.Start(ctx)
go func() {
sigChan := make(chan os.Signal)
signal.Notify(sigChan, syscall.SIGINT)
signal.Notify(sigChan, syscall.SIGTERM)
sig := <-sigChan
log.Infof("signal received: %s", sig)
cancelFunc()
}()
wg.Wait()
}
}

18
go.mod
View File

@@ -3,7 +3,6 @@ module yunion.io/x/onecloud
go 1.12
require (
cloud.google.com/go v0.38.0
github.com/360EntSecGroup-Skylar/excelize v1.4.0
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible
github.com/Azure/go-autorest v10.15.5+incompatible
@@ -23,7 +22,6 @@ require (
github.com/aokoli/goutils v1.0.1
github.com/aws/aws-sdk-go v1.21.4
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
github.com/benbjohnson/clock v1.0.0
github.com/bitly/go-simplejson v0.5.0
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/c-bata/go-prompt v0.2.1
@@ -102,7 +100,6 @@ require (
github.com/shirou/gopsutil v2.18.10+incompatible
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9
github.com/smartystreets/goconvey v1.6.4
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.4.0
@@ -112,21 +109,16 @@ require (
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3 // indirect
github.com/vishvananda/netlink v1.0.0
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible
github.com/vmware/govmomi v0.19.0
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738
go.uber.org/atomic v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
golang.org/x/net v0.0.0-20191007182048-72f939374954
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20191008105621-543471e840be
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987
google.golang.org/api v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
google.golang.org/grpc v1.23.1
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
@@ -140,12 +132,12 @@ require (
k8s.io/client-go v9.0.0+incompatible
k8s.io/klog v0.1.0 // indirect
k8s.io/kubernetes v1.12.3
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
yunion.io/x/jsonutils v0.0.0-20200113074440-9297fd00ba07
yunion.io/x/executor v0.0.0-20191202093616-92e2e6119257
yunion.io/x/jsonutils v0.0.0-20191220095028-7fef3b75f64d
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070
yunion.io/x/pkg v0.0.0-20191221094533-5097f12f41ac
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20200221103553-6a98f7f8ab92
yunion.io/x/sqlchemy v0.0.0-20191226074733-6eb73845bfb7
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
)

57
go.sum
View File

@@ -3,8 +3,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
github.com/360EntSecGroup-Skylar/excelize v1.4.0 h1:43rak9uafmwSJpXfFO1heKQph8tP3nlfWJWFQQtW1R0=
github.com/360EntSecGroup-Skylar/excelize v1.4.0/go.mod h1:R8KYLmGns0vDPe6/HyphW0mzW+MFexlGDafU0ykVEnU=
github.com/Azure/azure-sdk-for-go v5.0.0-beta.0.20161118192335-3b1282355199+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
@@ -80,8 +78,6 @@ github.com/aws/aws-sdk-go v1.21.4 h1:1xB+x6Dzev8ETmeHEiSfUVbIzmC/0EyFfXMkJpzKPCE
github.com/aws/aws-sdk-go v1.21.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
github.com/benbjohnson/clock v1.0.0 h1:78Jk/r6m4wCi6sndMpty7A//t4dw/RW5fV4ZgDVfX1w=
github.com/benbjohnson/clock v1.0.0/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
@@ -221,16 +217,12 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY=
github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4 h1:hU4mGcQI4DaAYW+IbTun+2qEZVFxK0ySjQLTbS0VQKc=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb h1:n22Aukg/TjoypWc37dbKIpCsz0VMFPD36HQk1WKvg3A=
@@ -264,10 +256,7 @@ github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead h1:Y9WOGZY2nw5ksbEf5AIpk+vK52Tdg/VN/rHFRfEeeGQ=
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
@@ -452,8 +441,6 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbm
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd h1:p5kvxG4NHogJX1brTLtvUSGdW0/aBvIyqDSW7tmnsmQ=
github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd/go.mod h1:XUKj4gbqj2QvJk/OdLWzyZ3FYli0f+MdpngyryX0gcw=
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
@@ -494,10 +481,6 @@ github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c/go.mod h1:M/I710pXKQ
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3 h1:KfqgRfYvGRyKOQUx8GphSC8D6vVoBndzco3rESP8I4k=
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/vishvananda/netlink v1.0.0 h1:bqNY2lgheFIu1meHUFSH3d7vG93AFyqg3oGbJCOJgSM=
github.com/vishvananda/netlink v1.0.0/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmware/govmomi v0.19.0 h1:CR6tEByWCPOnRoRyhLzuHaU+6o2ybF3qufNRWS/MGrY=
@@ -516,10 +499,7 @@ go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738 h1:lWF4f9Nypl1ZqSb4gLeh/DGvBYVaUYHuiB93teOmwgc=
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.20.1 h1:pMEjRZ1M4ebWGikflH7nQpV6+Zr88KBMA2XJD3sbijw=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
@@ -544,7 +524,6 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -558,7 +537,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190419010253-1f3472d942ba/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
@@ -570,8 +548,6 @@ golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -596,7 +572,6 @@ golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606122018-79a91cf218c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190830023255-19e00faab6ad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -620,36 +595,23 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.zx2c4.com/wireguard v0.0.20190908 h1:SUoXDdwSMtomLdvke+zz83/u9tNvl4hHmcTIWp38tow=
golang.zx2c4.com/wireguard v0.0.20190908/go.mod h1:LhfXh5z6bLC2lW2ve6BzYZFwnnsXK3OQjySR0Yh2dO8=
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987 h1:26OAgqBTufVr8WKonCEhhjO1oKsYhHv0iM5Dg92G1TM=
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987/go.mod h1:7hq1rEDsx7/FWl8IEEnfH2Xhs6M2MNnjUfN0PeI8Rm0=
google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo=
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
@@ -683,7 +645,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76 h1:cGc6jt7tNK7a2WfgNKjxjoU/UXXr9Q7JTqvCupZ+6+Y=
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
@@ -697,12 +658,12 @@ k8s.io/kubernetes v1.12.3 h1:5GPfYyyBylqcZUqL+ApYpYTm2IYjH56JUewYC0GbetU=
k8s.io/kubernetes v1.12.3/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
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/executor v0.0.0-20191202093616-92e2e6119257 h1:LZ6eC1uoLDAp7NQlaCy+DKnF31Mgd3LDKlIithziEmY=
yunion.io/x/executor v0.0.0-20191202093616-92e2e6119257/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051 h1:vtZw2iwGrsARNSwRTREGjmr2BWPdxbmXVkb3kI1qu28=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/jsonutils v0.0.0-20200113074440-9297fd00ba07 h1:i6Im3w4UoyCIKOEtr0Y3aAPGrL9FYAzeFXoj3daXXt0=
yunion.io/x/jsonutils v0.0.0-20200113074440-9297fd00ba07/go.mod h1:NpWHLv3D1iMpsp1Kv6o1ASPZmuSKutE3RIMhxKSOeAM=
yunion.io/x/jsonutils v0.0.0-20191220095028-7fef3b75f64d h1:58hs2hyO2DgeVQ5i2fAKjg/ooPH0q4+ALEnqtxjn7DA=
yunion.io/x/jsonutils v0.0.0-20191220095028-7fef3b75f64d/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b h1:Z9z+7iegu0HXuL+S8taVWRd1P4b9JJOgPXIeoqYrj7c=
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=
@@ -710,13 +671,11 @@ yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf h1:OsKC+2ghZHwp+Ztm/MwKlLKKRiE7QcPG8eTp0GmsHbg=
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-20200103043034-27c6f82160fa h1:+7zYi8MhaOW/53/7FOERnhQqAU4UhgaOVIS+AMzTKNU=
yunion.io/x/pkg v0.0.0-20200103043034-27c6f82160fa/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070 h1:rKnYgtvMHKmzPEUTkyNjyKOG7wzjpUvI7fcZwLNGQXw=
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20191221094533-5097f12f41ac h1:upUF6LBhCKx9c/OUzSUwfv50oCtU4LLmO+UtnKEQsg8=
yunion.io/x/pkg v0.0.0-20191221094533-5097f12f41ac/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-20200221103553-6a98f7f8ab92 h1:Iz70/alKMAW3KeePhmExuhWsYw1MGTcMr5ewAL5lj1I=
yunion.io/x/sqlchemy v0.0.0-20200221103553-6a98f7f8ab92/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/sqlchemy v0.0.0-20191226074733-6eb73845bfb7 h1:nK047S9fIjIBkB9Yyo2e6itUA7TpmFsd7/a6mGKjNU0=
yunion.io/x/sqlchemy v0.0.0-20191226074733-6eb73845bfb7/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3 h1:bfC8EhXYvyGYldRWlzxiCM39Zfj3s3+zham9mW2h2LE=
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=

View File

@@ -187,7 +187,7 @@ func (f *ResourceHandlers) listHandler(ctx context.Context, w http.ResponseWrite
}
}
func (f *ResourceHandlers) doList(session *mcclient.ClientSession, module modulebase.IBaseManager, query jsonutils.JSONObject, w http.ResponseWriter, r *http.Request) {
func (f *ResourceHandlers) doList(session *mcclient.ClientSession, module modulebase.BaseManagerInterface, query jsonutils.JSONObject, w http.ResponseWriter, r *http.Request) {
var exportKeys []string
var exportTexts []string
exportFormat, _ := query.GetString("export")

View File

@@ -117,24 +117,21 @@ func rpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
v, ok := retobj.Interface().(jsonutils.JSONObject)
if ok {
appsrv.SendJSON(w, v)
return
}
v2, ok := retobj.Interface().([]modulebase.SubmitResult)
if ok {
w.WriteHeader(207)
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(v2))
return
} else {
httperrors.BadGatewayError(w, "recv invalid data")
}
httperrors.BadGatewayError(w, "recv invalid data")
} else {
v, ok := reterr.Interface().(*httputils.JSONClientError)
if ok {
httperrors.JsonClientError(w, v)
return
} else {
httperrors.BadGatewayError(w, fmt.Sprintf("%s", reterr.Interface()))
}
httperrors.BadGatewayError(w, fmt.Sprintf("%s", reterr.Interface()))
}
}

View File

@@ -15,19 +15,15 @@
package cloudevent
import (
"time"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/apis/compute"
)
type CloudeventListInput struct {
apis.VirtualResourceListInput
apis.BaseListInput
compute.ManagedResourceListInput
apis.SharableVirtualResourceListInput
// 操作日志起始时间
Since time.Time `json:"since"`
// 操作日志截止时间
Until time.Time `json:"until"`
Cloudprovider string `json:"cloudprovider"`
Providers []string `json:"providers"`
}

View File

@@ -16,16 +16,8 @@ package cloudprovider
// SGeographicInfo is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SGeographicInfo.
type SGeographicInfo struct {
// 纬度
// example: 26.647003
Latitude float32 `json:"latitude"`
// 经度
// example: 106.630211
Longitude float32 `json:"longitude"`
// 城市
// example: Guiyang
City string `json:"city"`
// 国家代码
// example: CN
CountryCode string `json:"country_code"`
Latitude float32 `json:"latitude"`
Longitude float32 `json:"longitude"`
City string `json:"city"`
CountryCode string `json:"country_code"`
}

View File

@@ -31,36 +31,14 @@ type SchedtagConfig struct {
type NetworkConfig struct {
apis.Meta
// 网卡序号, 从0开始
// required: true
Index int `json:"index"`
// 子网名称或ID
// required: true
Network string `json:"network"`
// swagger:ignore
Wire string `json:"wire"`
// 内网地址
Exit bool `json:"exit"`
Private bool `json:"private"`
// 网卡MAC地址
// requried: false
Mac string `json:"mac"`
// 子网内的IPv4地址, 若不指定会安装子网的地址分配策略分配一个IP地址
// required: false
Address string `json:"address"`
// 子网内的IPv6地址
// required: false
// swagger:ignore
Index int `json:"index"`
Network string `json:"network"`
Wire string `json:"wire"`
Exit bool `json:"exit"`
Private bool `json:"private"`
Mac string `json:"mac"`
Address string `json:"address"`
Address6 string `json:"address6"`
// 驱动方式
// 若指定镜像的网络驱动方式,此参数会被覆盖
Driver string `json:"driver"`
BwLimit int `json:"bw_limit"`
Vip bool `json:"vip"`
@@ -75,132 +53,33 @@ type NetworkConfig struct {
StandbyPortCount int `json:"standby_port_count"`
StandbyAddrCount int `json:"standby_addr_count"`
// swagger:ignore
Project string `json:"project_id"`
// swagger:ignore
Project string `json:"project_id"`
Domain string `json:"domain_id"`
Ifname string `json:"ifname"`
Schedtags []*SchedtagConfig `json:"schedtags"`
}
type AttachNetworkInput struct {
// 添加的网卡的配置
// required: true
Nets []*NetworkConfig `json:"nets"`
}
type DiskConfig struct {
apis.Meta
// 挂载到虚拟机的磁盘顺序, -1代表不挂载任何虚拟机
// default: -1
Index int `json:"index"`
Index int `json:"index"` // -1 means not attach to any guests
ImageId string `json:"image_id"`
SnapshotId string `json:"snapshot_id"`
DiskType string `json:"disk_type"`
Schedtags []*SchedtagConfig `json:"schedtags"`
// 镜像ID,通过镜像创建磁盘,创建虚拟机时第一块磁盘需要指定此参数
// required: false
ImageId string `json:"image_id"`
// 快照ID,通过快照创建磁盘,此参数必须加上 'snapshot-' 前缀
// example: snapshot-3140cecb-ccc4-4865-abae-3a5ba8c69d9b
// requried: false
SnapshotId string `json:"snapshot_id"`
// 磁盘类型
// enum: sys, data, swap
DiskType string `json:"disk_type"`
Schedtags []*SchedtagConfig `json:"schedtags"`
// 磁盘大小,单位Mb
// 若创建裸金属服务器是, -1代表自动向后扩展存储
// requried:true
SizeMb int `json:"size"`
// 文件系统,仅kvm支持自动格式化磁盘,私有云和公有云此参数不会生效
// enum: swap, ext2, ext3, ext4, xfs, ntfs, fat, hfsplus
// requried: false
Fs string `json:"fs"`
// 磁盘存储格式
// enum: qcow2, raw, docker, iso, vmdk, vmdkflatver1, vmdkflatver2, vmdkflat, vmdksparse, vmdksparsever1, vmdksparsever2, vmdksepsparse vhd
// requried: false
Format string `json:"format"`
// 磁盘驱动方式
// enum: virtio, ide, scsi, sata, pvscsi
// requried: false
Driver string `json:"driver"`
// 磁盘缓存模式
// enum: writeback, none, writethrough
// requried: false
Cache string `json:"cache"`
// 挂载点,必须以 '/' 开头,例如 /opt 仅KVM此参数有效
// requried: false
Mountpoint string `json:"mountpoint"`
//后端存储类型,若指定了存储ID,此参数会根据存储设置,若不指定,则作为调度的一个参考
//
//
//
//| 平台 | 存储类型 | 中文 | 数据盘 | 系统盘 | 可否扩容 | 可否单独创建 | 扩容步长 | 说明 |
//| ---- | ---- | ---- | ----- | ----- | ------- | ----------- | ------- | ----- |
//| Esxi |local |本地盘 |1-500GB |30~500GB | 是 | 否 | 1G | |
//| Esxi |nas |NAS盘 |30-3072GB |30~500GB | 是 | 否 | 1G | |
//| Esxi |vsan |VSAN盘 |30-3072GB |30~500GB | 是 | 否 | 1G | |
//| KVM |local |本地盘盘 |1-500GB |30~500GB | 是 | 否 | 1G | |
//| KVM |rbd |云硬盘 |1-3072GB |30~500GB | 是 | 是 | 1G | |
//| Azure |standard_lrs |标准 HDD |1-4095GB |30~4095GB | 是 | 是 | 1G | |
//| Azure |standardssd_lrs |标准 SSD |1-4095GB |30~4095GB | 是 | 是 | 1G | |
//| Azure |premium_lrs |高级SSD |1-4095GB |30~4095GB | 是 | 是 | 1G | |
//| AWS |gp2 |通用型SSD |1-16384GB |20~16384GB | 是 | 是 | 1G | |
//| AWS |io1 |预配置 IOPS SSD|4-16384GB |20-16384GB | 是 | 是 | 1G | |
//| AWS |st1 |吞吐优化HDD |500-16384GB |不支持 | 是 | 是 | 1G | |
//| AWS |sc1 |Cold HDD |500-16384GB |不支持 | 是 | 是 | 1G | |
//| AWS |standard |磁介质 |1-1024GB |20-1024GB | 是 | 是 | 1G | |
//| 腾讯云 |cloud_ssd |SSD云硬盘 |10-16000GB |50~500GB | 是 | 是 | 10G | |
//| 腾讯云 |cloud_basic |普通云硬盘 |10-16000GB |50~500GB | 是 | 是 | 10G | |
//| 腾讯云 |cloud_preium |高性能云硬盘 |10-16000GB |50~1024GB | 是 | 是 | 10G | |
//| 腾讯云 |local_basic |普通本地盘 |10-1600GB |不支持 | 否 | 否 | | |
//| 腾讯云 |local_ssd |SSD本地盘 |10-7000GB |部分区域套餐支持 | 否 | 否 | | |
//| 腾讯云 |local_pro |HDD本地盘 |跟随套餐 |部分区域套餐支持 | 否 | 否 | | |
//| 华为云或天翼云 |SSD |超高IO云硬盘 |10-32768GB |40~1024GB | 是 | 是 | 1G | |
//| 华为云或天翼云 |SAS |高IO云硬盘 |10-32768GB |40~1024GB | 是 | 是 | 1G | |
//| 华为云或天翼云 |SATA |普通IO云硬盘 |10-32768GB |40~1024GB | 是 | 是 | 1G | |
//| OpenStack |nova |nova |不支持 |30-500GB | 否 | 否 | | |
//| OpenStack |自定义 |... |无限制 |无限制 | 是 | 是 | 1G | |
//| Ucloud |CLOUD_NORMAL |普通云盘 |20-8000GB |不支持 | 是 | 是 | 1G | |
//| Ucloud |CLOUD_SSD |SSD云盘 |20-4000GB |20-500GB | 是 | 是 | 1G | |
//| Ucloud |LOCAL_NORMAL |普通本地盘 | | | 是 | 是 | 1G | |
//| Ucloud |LOCAL_SSD |SSD本地盘 | | | 是 | 是 | 1G | |
//| Ucloud |EXCLUSIVE_LOCAL_DISK |独享本地盘 | | | 是 | 是 | 1G | |
//| ZStack |localstorage |本地盘 | | | 是 | 是 | 1G | |
//| ZStack |ceph |云硬盘 | | | 是 | 是 | 1G | |
//| Google |local-ssd |本地SSD暂存盘 |375GB |不支持 | 否 | 否 | | 跟随实例创建一次最多添加8个 |
//| Google |pd-standard |标准永久性磁盘 |10-65536GB |10-65536GB | 是 | 是 | 1G | |
//| Google |pd-ssd |SSD永久性磁盘 |10-65536GB |10-65536GB | 是 | 是 | 1G | |
Backend string `json:"backend"`
//介质类型
//rotate: 机械盘
//ssd: 固态硬盘
//hybird: 混合盘
//emum: [rotate, ssd, hybrid]
//default: hybird
Medium string `json:"medium"`
//swagger:ignore
SizeMb int `json:"size"`
Fs string `json:"fs"`
Format string `json:"format"`
Driver string `json:"driver"`
Cache string `json:"cache"`
Mountpoint string `json:"mountpoint"`
Backend string `json:"backend"` // stroageType
Medium string `json:"medium"`
ImageProperties map[string]string `json:"image_properties"`
//存储ID, 指定存储后,磁盘会在此存储上创建
//存储列表可以参数 storage 列表API
//required: false
Storage string `json:"storage_id"`
//swagger:ignore
DiskId string `json:"disk_id"`
DiskId string `json:"disk_id"`
}
type IsolatedDeviceConfig struct {
@@ -231,92 +110,26 @@ type BaremetalDiskConfig struct {
}
type ServerConfigs struct {
// 调度使用指定的云账号
PreferManager string `json:"prefer_manager_id"`
// 调度到指定区域,优先级低于prefer_zone_id
PreferRegion string `json:"prefer_region_id"`
// 调度到指定可用区,优先级低于prefer_host_id
PreferZone string `json:"prefer_zone_id"`
// 调度使用指定二层网络, 优先级低于prefer_host_id
PreferWire string `json:"prefer_wire_id"`
// 调度使用指定宿主机
PreferHost string `json:"prefer_host_id"`
// 主机高可用时,将备机调度到指定宿主机, 此参数仅对KVM生效
// prefer options
PreferRegion string `json:"prefer_region_id"`
PreferZone string `json:"prefer_zone_id"`
PreferWire string `json:"prefer_wire_id"`
PreferHost string `json:"prefer_host_id"`
PreferBackupHost string `json:"prefer_backup_host"`
// 虚拟化技术或平台
//
//
//
// |hypervisor | 技术或平台 |
// |------- | ---------- |
// |kvm | 本地私有云 |
// |esxi | VMWare |
// |baremetal | 裸金属 |
// |aliyun | 阿里云 |
// |aws | 亚马逊 |
// |qcloud | 腾讯云 |
// |azure | 微软云 |
// |huawei | 华为云 |
// |openstack | OpenStack |
// |ucloud | Ucloud |
// |zstack | ZStack |
// |google | 谷歌云 |
// |ctyun | 天翼云 |
// default: kvm
Hypervisor string `json:"hypervisor"`
// 包年包月资源池
// swagger:ignore
// emum: shared, prepaid, dedicated
// ResourceType "shared|prepaid|dedicated"`
ResourceType string `json:"resource_type"`
// 套餐名称, 此参数优先级高于vcpu_count和vmem_size
// 套餐可以通过 serverskus 列表获取
// esxi, openstack, zstack等私有云都统一使用provider为OneCloud的套餐
// 公有云使用各自的套餐
InstanceType string `json:"instance_type"`
Backup bool `json:"backup"`
Count int `json:"count"`
// swagger:ignore
// Deprecated
// alias for InstanceType
Sku string `json:"sku" deprecated-by:"instance_type"`
Disks []*DiskConfig `json:"disks"`
Networks []*NetworkConfig `json:"nets"`
Schedtags []*SchedtagConfig `json:"schedtags"`
IsolatedDevices []*IsolatedDeviceConfig `json:"isolated_devices"`
BaremetalDiskConfigs []*BaremetalDiskConfig `json:"baremetal_disk_configs"`
// 虚拟机高可用(创建备机)
// default: false
// requried: false
Backup bool `json:"backup"`
// 创建虚拟机数量
// default: 1
Count int `json:"count"`
// 磁盘列表,第一块磁盘为系统盘,需要指定image_id
// 若指定主机快照,此参数可以为空
// required: true
Disks []*DiskConfig `json:"disks"`
// 指定主机网络
// required: false
Networks []*NetworkConfig `json:"nets"`
// 调度标签
// required: false
Schedtags []*SchedtagConfig `json:"schedtags"`
// 透传设备列表
// required: false
IsolatedDevices []*IsolatedDeviceConfig `json:"isolated_devices"`
// 裸金属磁盘配置列表
BaremetalDiskConfigs []*BaremetalDiskConfig `json:"baremetal_disk_configs"`
// 主机组列表, 参数可以是主机组名称或ID,建议使用ID
InstanceGroupIds []string `json:"groups"`
// DEPRECATE
@@ -346,149 +159,51 @@ type ServerCreateInput struct {
*ServerConfigs
// 虚拟机内存大小,单位Mb,若未指定instance_type,此参数为必传项
VmemSize int `json:"vmem_size"`
VmemSize int `json:"vmem_size"`
VcpuCount int `json:"vcpu_count"`
UserData string `json:"user_data"`
Metadata map[string]string `json:"__meta__"`
// 虚拟机Cpu大小,若未指定instance_type,此参数为必传项
// default: 1
VcpuCount int `json:"vcpu_count"`
// 用户自定义启动脚本
// required: false
UserData string `json:"user_data"`
// swagger:ignore
Keypair string `json:"keypair" deprecated-by:"keypair_id"`
// 秘钥对Id
// required: false
KeypairId string `json:"keypair_id"`
Password string `json:"password"`
Cdrom string `json:"cdrom"`
Vga string `json:"vga"`
Vdi string `json:"vdi"`
Bios string `json:"bios"`
// Description string `json:"description"`
BootOrder string `json:"boot_order"`
EnableCloudInit bool `json:"enable_cloud_init"`
ResetPassword *bool `json:"reset_password"`
// DisableDelete *bool `json:"disable_delete"`
ShutdownBehavior string `json:"shutdown_behavior"`
AutoStart bool `json:"auto_start"`
DeployConfigs []*DeployConfig `json:"deploy_configs"`
// IsSystem bool `json:"is_system"`
Duration string `json:"duration"`
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
SecgroupId string `json:"secgrp_id"`
EipBw int `json:"eip_bw,omitzero"`
EipChargeType string `json:"eip_charge_type,omitempty"`
Eip string `json:"eip,omitempty"`
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
Secgroups []string `json:"secgroups"`
// 密码
// 要求: 密码长度 >= 20, 至少包含一个数字一个小写字母一个大小字母及特殊字符~`!@#$%^&*()-_=+[]{}|:';\",./<>?中的一个
// requried: false
Password string `json:"password"`
// 使用ISO光盘启动, 仅KVM平台支持
// required: false
Cdrom string `json:"cdrom"`
// enum: cirros, vmware, qxl, std
// default: std
Vga string `json:"vga"`
// 远程连接协议
// enum: vnc, spice
// default: vnc
Vdi string `json:"vdi"`
// BIOS类型, 若镜像是Windows并且支持UEFI,则自动会设置为UEFI
// emulate: BIOS, UEFI
Bios string `json:"bios"`
// 启动顺序
// c: cdrome
// d: disk
// n: network
// example: cnd
// default: cdn
BootOrder string `json:"boot_order"`
// 启用cloud-init,需要镜像装有cloud-init服务
// default: false
EnableCloudInit bool `json:"enable_cloud_init"`
// 随机密码, 若指定password参数,此参数不生效
// 若值为false并且password为空,则表示保留镜像密码
ResetPassword *bool `json:"reset_password"`
// 关机后执行的操作
// terminate: 关机后自动删除
// emum: stop, terminate
// default: stop
ShutdownBehavior string `json:"shutdown_behavior"`
// 创建后自动启动
// 部分云创建后会自动启动例如: 腾讯云, AWS, OpenStack, ZStack, Ucloud, Huawei, Azure, 天翼云
// default: false
AutoStart bool `json:"auto_start"`
DeployConfigs []*DeployConfig `json:"deploy_configs"`
// 包年包月时长
//
//
// |平台 |是否支持 |
// |---- |------- |
// |KVM |否 |
// |ESxi |否 |
// |OpenStack |否 |
// |ZStack |否 |
// |Google |否 |
// |Azure |否 |
// |AWS |否 |
// |腾讯云 |是 |
// |Aliyun |是 |
// |Ucloud |是 |
// |Huawei |是 |
// |天翼云 |是 |
Duration string `json:"duration"`
// swagger:ignore
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
// 弹性公网IP带宽
// 指定此参数后会创建新的弹性公网IP并绑定到新建的虚拟机
// 私有云不支持此参数
EipBw int `json:"eip_bw,omitzero"`
// 弹性公网IP计费类型
EipChargeType string `json:"eip_charge_type,omitempty"`
// 弹性公网IP名称或ID
// 绑定已有弹性公网IP, 此参数会限制虚拟机再谈下公网IP所在的区域创建
// required: false
Eip string `json:"eip,omitempty"`
// 使用主机快照创建虚拟机, 主机快照不会重置密码及秘钥信息
// 使用主机快照创建的虚拟机将沿用之前的密码秘钥及安全组信息
// required: false
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
// 安全组Id, 此参数会和secgroups参数合并
SecgroupId string `json:"secgrp_id"`
// 安全组Id列表
Secgroups []string `json:"secgroups"`
// swagger:ignore
OsType string `json:"os_type"`
// Fill by server
OsProfile jsonutils.JSONObject `json:"__os_profile__"`
BillingType string `json:"billing_type"`
BillingCycle string `json:"billing_cycle"`
// swagger:ignore
OsProfile jsonutils.JSONObject `json:"__os_profile__"`
// swagger:ignore
BillingType string `json:"billing_type"`
// swagger:ignore
BillingCycle string `json:"billing_cycle"`
// swagger:ignore
// Deprecated
// 此参数等同于 hypervisor=baremetal
// DEPRECATE or not used fields
Baremetal bool `json:"baremetal"`
// Used to store BaremetalConvertHypervisorTaskId
ParentTaskId string `json:"__parent_task_id,omitempty"`
// 指定系统盘默认存储类型, 如果指定宿主机
// swagger:ignore
// default stroage type if host is given
DefaultStorageType string `json:"default_storage_type,omitempty"`
// 指定用于新建主机的主机镜像ID
GuestImageID string `json:"guest_image_id"`
}
func (input *ServerCreateInput) AfterUnmarshal() {
if input.Baremetal {
input.Hypervisor = HYPERVISOR_BAREMETAL
}
// Guest Image ID
GuestImageID string
}
type ServerCloneInput struct {

View File

@@ -49,13 +49,9 @@ type BucketCreateInput struct {
StorageClass string `json:"storage_class"`
}
type BucketDetails struct {
apis.VirtualResourceDetails
type BucketDetail struct {
apis.Meta
SBucket
CloudproviderInfo
AccessUrls []cloudprovider.SBucketAccessUrl `json:"access_urls"`
}
type BucketObjectsActionInput struct {
@@ -93,9 +89,3 @@ func (input *BucketMetadataInput) Validate() error {
}
return nil
}
type BucketListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
}

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 compute
import "yunion.io/x/onecloud/pkg/apis"
type CachedImageUncacheImageInput struct {
// 存储缓存名Id
// required: true
StoragecacheId string `json:"storagecache_id"`
// 是否强制清除缓存
// default: false
IsForce bool `json:"is_force"`
}
type CachedimageDetails struct {
apis.StandaloneResourceDetails
SCachedimage
// 镜像状态, 和info里面的status一致
// example: active
Status string `json:"status"`
// 操作系统类型
// example: FreeBSD
OsType string `json:"os_type"`
// 操作系统发行版
// example: FreeBSD
OsDistribution string `json:"os_distribution"`
// 操作系统版本
// example: 11
OsVersion string `json:"os_version"`
// 虚拟化类型
Hypervisor string `json:"hypervisor"`
// 此镜像被使用次数
// example: 0
CachedCount int `json:"cached_count"`
}

View File

@@ -1,24 +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 CachedLoadbalancerAclDetails struct {
apis.SharableVirtualResourceDetails
SCachedLoadbalancerAcl
CloudproviderInfo
}

View File

@@ -1,24 +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 CachedLoadbalancerCertificateDetails struct {
apis.VirtualResourceDetails
SCachedLoadbalancerCertificate
CloudproviderInfo
}

View File

@@ -26,58 +26,17 @@ import (
type CloudaccountCreateInput struct {
apis.EnabledStatusStandaloneResourceCreateInput
// 指定云平台
// Qcloud: 腾讯云
// Ctyun: 天翼云
// enum: VMware, Aliyun, Qcloud, Azure, Aws, Huawei, OpenStack, Ucloud, ZStack, Google, Ctyun
Provider string `json:"provider"`
// swagger:ignore
AccountId string
// 指定云平台品牌, 此参数默认和provider相同
// requried: false
//
//
//
// | provider | 支持的参数 |
// | -------- | ---------- |
// | VMware | VMware |
// | Aliyun | Aliyun |
// | Qcloud | Qcloud |
// | Azure | Azure |
// | Aws | Aws |
// | Huawei | Huawei |
// | OpenStack | OpenStack |
// | Ucloud | Ucloud |
// | ZStack | ZStack, DStack |
// | Google | Google |
// | Ctyun | Ctyun |
Brand string `json:"brand"`
// swagger:ignore
IsPublicCloud bool
// swagger:ignore
IsOnPremise bool
// 指定云账号所属的项目
Tenant string `json:"tenant"`
// swagger:ignore
TenantId string
// 启用自动同步
// default: false
EnableAutoSync bool `json:"enable_auto_sync"`
// 自动同步间隔时间
SyncIntervalSeconds int `json:"sync_interval_seconds"`
// 自动根据云上项目或订阅创建本地项目
// default: false
AutoCreateProject bool `json:"auto_create_project"`
// 额外信息,例如账单的access key
Options *jsonutils.JSONObject `json:"options"`
Provider string
AccountId string
Brand string
IsPublicCloud bool
IsOnPremise bool
Tenant string
TenantId string
EnableAutoSync bool
SyncIntervalSeconds int
AutoCreateProject bool
Options *jsonutils.JSONObject
cloudprovider.SCloudaccount
cloudprovider.SCloudaccountCredential
@@ -98,83 +57,3 @@ func (i CloudaccountShareModeInput) Validate() error {
}
return nil
}
type CloudaccountListInput struct {
apis.EnabledStatusStandaloneResourceListInput
ManagedResourceListInput
CapabilityListInput
}
type ProviderProject struct {
// 子订阅项目名称
// example: system
Tenant string `json:"tenant"`
// 子订阅项目Id
// 9a48383a-467a-4542-8b50-4e15b0a8715f
TenantId string `json:"tenant_id"`
}
type CloudaccountDetail struct {
apis.StandaloneResourceDetails
SCloudaccount
// 子订阅项目信息
Projects []ProviderProject `json:"projects"`
// 同步时间间隔
// example: 3600
SyncIntervalSeconds int `json:"sync_interval_seconds"`
// 同步状态
SyncStatus2 string `json:"sync_stauts2"`
// 云账号环境类型
// public: 公有云
// private: 私有云
// onpremise: 本地IDC
// example: public
CloudEnv string `json:"cloud_env"`
// 云账号项目名称
// example: system
Tenant string `json:"tenant"`
// 弹性公网Ip数量
// example: 2
EipCount int `json:"eip_count,allowempty"`
// 虚拟私有网络数量
// example: 4
VpcCount int `json:"vpc_count,allowempty"`
// 云盘数量
// example: 12
DiskCount int `json:"disk_count,allowempty"`
// 宿主机数量(不计算虚拟机宿主机数量)
// example: 0
HostCount int `json:"host_count,allowempty"`
// 云主机数量
// example: 4
GuestCount int `json:"guest_count,allowempty"`
// 块存储数量
// example: 12
StorageCount int `json:"storage_count,allowempty"`
// 子订阅数量
// example: 1
ProviderCount int `json:"provider_count,allowempty"`
// 路由表数量
// example: 0
RoutetableCount int `json:"routetable_count,allowempty"`
// 存储缓存数量
// example: 10
StoragecacheCount int `json:"storagecache_count,allowempty"`
}

View File

@@ -14,271 +14,85 @@
package compute
import (
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/cloudprovider"
)
type CloudproviderInfo struct {
// 云平台
// example: Google
Provider string `json:"provider,omitempty"`
// 云平台品牌
// example: Google
Brand string `json:"brand,omitempty"`
// 云账号名称
// example: google-account
Account string `json:"account,omitempty"`
// 云账号Id
// example: 4d3c8979-9dd0-439b-8d78-36fe1ab1666c
AccountId string `json:"account_id,omitempty"`
// 子订阅名称
// example: google-account
Manager string `json:"manager,omitempty"`
// 子订阅Id
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
ManagerId string `json:"manager_id,omitempty"`
// 子订阅所在项目名称
// example: system
ManagerProject string `json:"manager_project,omitempty"`
// 子订阅所在项目Id
// example: 4d3c8979-9dd0-439b-8d78-36fe1ab1666c
ManagerProjectId string `json:"manager_project_id,omitempty"`
// 子订阅所在域名称
// example: Default
ManagerDomain string `json:"manager_domain,omitempty"`
// 子订阅所在域Id
// example: default
ManagerDomainId string `json:"manager_domain_id,omitempty"`
// 区域名称
// example: 腾讯云 华南地区(广州)
Region string `json:"region,omitempty"`
// 区域Id
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
RegionId string `json:"region_id,omitempty"`
// 区域Id
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
CloudregionId string `json:"cloudregion_id,omitempty"`
// 区域外部Id
// Qcloud/ap-guangzhou
RegionExternalId string `json:"region_external_id,omitempty"`
// 区域外部Id(不携带平台信息)
// example: ap-guangzhou
RegionExtId string `json:"region_ext_id,omitempty"`
// 可用区名称
// example: 腾讯云 广州四区
Zone string `json:"zone,omitempty"`
// 可用区Id
// example: 336ac6d2-b80d-43bb-86d5-1ebf474da8d4
ZoneId string `json:"zone_id,omitempty"`
// 可用区外部Id
// example: ap-guangzhou-4
ZoneExtId string `json:"zone_ext_id,omitempty"`
// 云环境
// example: public
CloudEnv string `json:"cloud_env,omitempty"`
}
type CloudproviderDetails struct {
apis.StandaloneResourceDetails
SCloudprovider
// 云账号名称
// example: google-account
Cloudaccount string `json:"cloudaccount"`
// 子订阅同步状态
SyncStatus2 string `json:"sync_status2"`
// 支持服务列表
Capabilities []string `json:"capabilities"`
// 云主机数量
// example: 1
GuestCount int `json:"guest_count"`
// 宿主机数量
// example: 2
HostCount int `json:"host_count"`
// 虚拟私有网络数量
// example: 4
VpcCount int `json:"vpc_count"`
// 块存储梳理
// example: 4
StorageCount int `json:"storage_count"`
// 存储缓存数量
// example: 1
StorageCacheCount int `json:"storagecache_count"`
// 弹性公网IP数量
// example: 12
EipCount int `json:"eip_count"`
// 快照数量
// example: 0
SnapshotCount int `json:"snapshot_count"`
// 负载均衡器数量
// example: 2
LoadbalancerCount int `json:"loadbalancer_count"`
// 项目数量
ProjectCount int `json:"project_count"`
// 同步区域数量
SyncRegionCount int `json:"sync_region_count"`
// 子订阅品牌信息
Brand string `json:"brand"`
Provider string `json:"provider,omitempty"`
Brand string `json:"brand,omitempty"`
Account string `json:"account,omitempty"`
AccountId string `json:"account_id,omitempty"`
Manager string `json:"manager,omitempty"`
ManagerId string `json:"manager_id,omitempty"`
ManagerProject string `json:"manager_project,omitempty"`
ManagerProjectId string `json:"manager_project_id,omitempty"`
ManagerDomain string `json:"manager_domain,omitempty"`
ManagerDomainId string `json:"manager_domain_id,omitempty"`
Region string `json:"region,omitempty"`
RegionId string `json:"region_id,omitempty"`
CloudregionId string `json:"cloudregion_id,omitempty"`
RegionExternalId string `json:"region_external_id,omitempty"`
RegionExtId string `json:"region_ext_id,omitempty"`
Zone string `json:"zone,omitempty"`
ZoneId string `json:"zone_id,omitempty"`
ZoneExtId string `json:"zone_ext_id,omitempty"`
CloudEnv string `json:"cloud_env,omitempty"`
}
type ManagedResourceListInput struct {
// 列出关联指定云订阅(ID或Name)的资源
Cloudprovider string `json:"cloudprovider"`
type CloudaccountListInput struct {
// List objects belonging to the cloud provider
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
Manager string `json:"manager" deprecated-by:"cloudprovider"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
ManagerId string `json:"manager_id" deprecated-by:"cloudprovider"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
CloudproviderId string `json:"cloudprovider_id" deprecated-by:"cloudprovider"`
Cloudprovider string `json:"cloudprovider"`
// 列出关联指定云账号(ID或Name)的资源
// List objects belonging to the cloud provider
// deprecate:true
// description: this param will be deprecate at 3.0
Manager string `json:"manager"`
// deprecate:true
// description: this param will be deprecate at 3.0
ManagerId string `json:"manager_id"`
// deprecate:true
// description: this param will be deprecate at 3.0
CloudproviderId string `json:"cloudprovider_id"`
// List objects belonging to the cloud account
Cloudaccount string `json:"cloudaccount"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
CloudaccountId string `json:"cloudaccount_id" deprecated-by:"cloudaccount"`
// swagger:ignore
// Deprecated
CloudaccountId string `json:"cloudaccount_id"`
// deprecate:true
// description: this param will be deprecate at 3.0
Account string `json:"account" deprecated-by:"cloudaccount"`
// swagger:ignore
// Deprecated
Account string `json:"account"`
// deprecate:true
// description: this param will be deprecate at 3.0
AccountId string `json:"account_id" deprecated-by:"cloudaccount"`
AccountId string `json:"account_id"`
// 列出指定云平台的资源,支持的云平台如下
//
// | Provider | 开始支持版本 | 平台 |
// |-----------|------------|-------------------------------------|
// | OneCloud | 0.0 | OneCloud内置私有云包括KVM和裸金属管理 |
// | VMware | 1.2 | VMware vCenter |
// | OpenStack | 2.6 | OpenStack M版本以上私有云 |
// | ZStack | 2.10 | ZStack私有云 |
// | Aliyun | 2.0 | 阿里云 |
// | Aws | 2.3 | Amazon AWS |
// | Azure | 2.2 | Microsoft Azure |
// | Google | 2.13 | Google Cloud Platform |
// | Qcloud | 2.3 | 腾讯云 |
// | Huawei | 2.5 | 华为公有云 |
// | Ucloud | 2.7 | UCLOUD |
// | Ctyun | 2.13 | 天翼云 |
// | S3 | 2.11 | 通用s3对象存储 |
// | Ceph | 2.11 | Ceph对象存储 |
// | Xsky | 2.11 | XSKY启明星辰Ceph对象存储 |
//
// enum: OneCloud,VMware,Aliyun,Qcloud,Azure,Aws,Huawei,OpenStack,Ucloud,ZStack,Google,Ctyun,S3,Ceph,Xsky"
Providers []string `json:"providers"`
// swagger:ignore
// Deprecated
Provider []string `json:"provider" deprecated-by:"providers"`
// List objects from the providers, choices:"OneCloud|VMware|Aliyun|Qcloud|Azure|Aws|Huawei|OpenStack|Ucloud|ZStack|Google"
Providers []string `json:"provider"`
// 列出指定云平台品牌的资源一般来说brand和provider相同除了以上支持的provider之外还支持以下band
//
// | Brand | Provider | 说明 |
// |----------|----------|------------|
// | DStack | ZStack | 滴滴云私有云 |
//
Brands []string `json:"brands"`
// swagger:ignore
// Deprecated
Brand []string `json:"brand" deprecated-by:"brands"`
// List objects belonging to brands
Brands []string `json:"brand"`
}
// 列出指定云环境的资源,支持云环境如下:
//
// | CloudEnv | 说明 |
// |-----------|--------|
// | public | 公有云 |
// | private | 私有云 |
// | onpremise | 本地IDC |
//
// enum: public,private,onpremise
type CloudTypeListInput struct {
// enum: public_cloud,private_cloud,on_premise
CloudEnv string `json:"cloud_env"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
PublicCloud bool `json:"public_cloud"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
IsPublic bool `json:"is_public"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
PrivateCloud bool `json:"private_cloud"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
IsPrivate bool `json:"is_private"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
IsOnPremise bool `json:"is_on_premise"`
// 过滤资源是否为非OneCloud内置私有云管理的资源
// List objects managed by external providers
// default: false
IsManaged bool `json:"is_managed"`
}
func (input *ManagedResourceListInput) AfterUnmarshal() {
if len(input.CloudEnv) > 0 {
return
}
if input.PublicCloud || input.IsPublic {
input.CloudEnv = CLOUD_ENV_PUBLIC_CLOUD
} else if input.PrivateCloud || input.IsPrivate {
input.CloudEnv = CLOUD_ENV_PRIVATE_CLOUD
} else if input.IsOnPremise {
input.CloudEnv = CLOUD_ENV_ON_PREMISE
}
}
type CapabilityListInput struct {
// 根据该云平台的功能对云账号或云订阅进行过滤
Capability []string `json:"capability"`
// swagger:ignore
// Deprecated
// filter by HasObjectStorage
HasObjectStorage *bool `json:"has_object_storage"`
}
type CloudproviderListInput struct {
apis.EnabledStatusStandaloneResourceListInput
ManagedResourceListInput
UsableResourceListInput
CapabilityListInput
}
func (input *CapabilityListInput) AfterUnmarshal() {
if input.HasObjectStorage != nil && *input.HasObjectStorage && !utils.IsInStringArray(cloudprovider.CLOUD_CAPABILITY_OBJECTSTORE, input.Capability) {
input.Capability = append(input.Capability, cloudprovider.CLOUD_CAPABILITY_OBJECTSTORE)
}
}

View File

@@ -1,41 +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 CloudproviderregionDetails struct {
apis.JoinModelBaseDetails
Cloudprovider string
Cloudregion string
// 云账号Id
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
CloudaccountId string `json:"cloudaccount_id"`
// 云账号名称
// example: googl-account
Cloudaccount string `json:"cloudaccount"`
// 云账号所在域Id
// example: 0df40413-eb69-49c7-895e-618ddeb80f55
CloudaccountDomainId string `json:"cloudaccount_domain_id"`
// 是否开启自动同步
// example: false
EnableAutoSync bool `json:"enable_auto_sync"`
// 自动同步周期
// example: 300
SyncIntervalSeconds int `json:"sync_interval_seconds"`
}

View File

@@ -1,56 +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 CloudregionDetails struct {
apis.StandaloneResourceDetails
SCloudregion
// 虚拟私有网络数量
// example: 2
VpcCount int `json:"vpc_count,allowempty"`
// 可用区数量
// example: 3
ZoneCount int `json:"zone_count,allowempty"`
// 云主机梳理
// example: 2
GuestCount int `json:"guest_count,allowempty"`
// IP子网数量
// example: 12
NetworkCount int `json:"network_count,allowempty"`
// 距离前天0点新增云主机数量
// example: 0
GuestIncrementCount int `json:"guest_increment_count,allowempty"`
}
type CloudregionInfo struct {
// 区域的名称
// example: Default
Region string `json:"region"`
// 区域的Id
// example: default
RegionId string `json:"region_id"`
// 纳管云区域的组合Id(平台+Id)
// example: ZStack/59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
RegionExternalId string `json:"region_external_id"`
// 纳管云区域的Id
// example: 59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
RegionExtId string `json:"region_ext_id"`
}

View File

@@ -36,7 +36,6 @@ const (
CITY_TAIPEI = "Taipei" //台北市
CITY_KAOHSIUNG = "Kaohsiung" //高雄市
CITY_CHENG_DU = "Chengdu" //成都
CITY_HE_YUAN = "HeYuan" //河源
CITY_CHONG_QING = "Chongqing" //重庆
CITY_LAN_ZHOU = "Lanzhou" //兰州
CITY_TAI_YUAN = "Taiyuan" //太原
@@ -77,11 +76,6 @@ const (
//瑞士
CITY_ZURICH = "Zurich" //苏黎世
CITY_GENEVA = "Geneva" //日内瓦
// 挪威
CITY_STAVANGER = "Stavanger" //斯塔万格
CITY_OSLO = "Oslo" // 奥斯陆
// 马来西亚
CITY_KUALA_LUMPUR = "Kuala Lumpur" //吉隆坡
@@ -110,7 +104,6 @@ const (
CITY_IOWA = "Iowa" //爱荷华
CITY_US_GOV_WEST = "us-gov-west" //???
CITY_SOUTH_CAROLINA = "South Carolina" //南卡罗来纳州
CITY_SALT_LAKE_CITY = "Salt Lake City" //盐湖城
// 英国
CITY_LONDON = "London" //伦敦
@@ -121,8 +114,7 @@ const (
CITY_DUBAI = "Dubai" //迪拜
// 德国
CITY_FRANKFURT = "Frankfurt" // 法兰克福
CITY_DELMENHORST = "Delmenhorst" // 代尔门霍斯特
CITY_FRANKFURT = "Frankfurt" //法兰克福
// 韩国
CITY_SEOUL = "Seoul" //首尔
@@ -193,5 +185,4 @@ const (
COUNTRY_CODE_NG = "NG" //尼日利亚
COUNTRY_CODE_VN = "VN" //越南
COUNTRY_CODE_CH = "CH" //瑞士
COUNTRY_CODE_NO = "NO" //挪威
)

View File

@@ -16,131 +16,38 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type DBInstanceCreateInput struct {
apis.VirtualResourceCreateInput
DeletePreventableCreateInput
type SDBInstanceCreateInput struct {
apis.Meta
// Ip子网名称或Id,建议使用Id
// required: true
Network string `json:"network"`
// swagger:ignore
NetworkId string
// Ip子网内的地址,不填则按照ip子网的地址分配策略分配一个ip
// required: false
Address string `json:"address"`
// rds实例名称或Id,建议使用Id
// 创建只读实例时此参数必传
MasterInstance string `json:"master_instance"`
// swagger:ignore
MasterInstanceId string
// 安全组名称或Id
// default: default
Secgroup string `json:"secgroup"`
// swagger:ignore
SecgroupId string
// 主可用区名称或Id, 此参数从指定的套餐所在的可用区获取
Zone1 string `json:"zone1"`
// 次可用区名称或Id, 此参数从指定的套餐所在的可用区获取
Zone2 string `json:"zone2"`
// 三节点可用区名称或Id,, 此参数从指定的套餐所在的可用区获取
Zone3 string `json:"zone3"`
// swagger:ignore
ZoneId string
// 区域名称或Id建议使用Id
// swagger:ignore
Cloudregion string `json:"cloudregion"`
// swagger:ignore
CloudregionId string
// swagger:ignore
VpcId string
// swagger:ignore
ManagerId string
// swagger:ignore
Name string
Description string
DisableDelete *bool
NetworkId string
Address string
MasterInstanceId string
SecgroupId string
Zone1 string
Zone2 string
Zone3 string
ZoneId string
CloudregionId string
Cloudregion string
VpcId string
ManagerId string
NetworkExternalId string
BillingType string
BillingCycle string
InstanceType string
Engine string
EngineVersion string
Category string
StorageType string
DiskSizeGB int
Password string
// 包年包月时间周期
Duration string `json:"duration"`
// swagger:ignore
BillingType string
// swagger:ignore
BillingCycle string
// 套餐名称, 若此参数不填, 则必须有vmem_size_mb及vcpu_count参数
// 套餐列表可以通过 dbinstancesku 获取
InstanceType string `json:"instance_type"`
// rds引擎
// enum: MySQL, SQLServer, PostgreSQL, MariaDB, Oracle, PPAS
// required: true
Engine string `json:"engine"`
// rds引擎版本
// 根据各个引擎版本各不相同
// required: true
EngineVersion string `json:"engine_version"`
// rds类型
//
//
//
// | 平台 | 支持类型 |
// | ----- | ------ |
// | 华为云 |ha, single, replica|
// | 阿里云 |basic, high_availability, always_on, finance|
// 翻译:
// basic: 基础版
// high_availability: 高可用
// always_on: 集群版
// finance: 金融版, 三节点
// ha: 高可用
// single: 单机
// replica: 只读
// required: true
Category string `json:"category"`
// rds存储类型
//
//
//
// | 平台 | 支持类型 |
// | 华为云 |SSD, SAS, SATA|
// | 阿里云 |local_ssd, cloud_essd, cloud_ssd|
// required: true
StorageType string `json:"storage_type"`
// rds存储大小
// 可参考rds套餐的大小范围和步长情况
// required: true
DiskSizeGB int `json:"disk_size_gb"`
// rds初始化密码
// 阿里云不需要此参数
// 华为云会默认创建一个用户,若不传此参数, 则为随机密码
Password string `json:"password"`
// rds实例cpu大小
// 若指定实例套餐,此参数将根据套餐设置
VcpuCount int `json:"vcpu_count"`
// rds实例内存大小
// 若指定实例套餐,此参数将根据套餐设置
VmemSizeMb int `json:"vmem_size_mb"`
// swagger:ignore
Provider string
VcpuCount int
VmemSizeMb int
Provider string
}
type SDBInstanceChangeConfigInput struct {
@@ -159,79 +66,5 @@ type SDBInstanceRecoveryConfigInput struct {
DBInstancebackup string
DBInstancebackupId string `json:"dbinstancebackup_id"`
Databases map[string]string `json:"databases,allowempty"`
}
type DBInstanceListInput struct {
apis.VirtualResourceListInput
ZonalFilterListInput
ManagedResourceListInput
VpcFilterListInput
}
type DBInstanceBackupListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
RegionalFilterListInput
DbinstanceFilterListInput
}
type DBInstancePrivilegeListInput struct {
apis.ResourceBaseListInput
// filter by dbinstanceaccount
Dbinstanceaccount string `json:"dbinstanceaccount"`
// filter by dbinstancedatabase
Dbinstancedatabase string `json:"dbinstancedatabase"`
}
type DBInstanceParameterListInput struct {
apis.StandaloneResourceListInput
DbinstanceFilterListInput
}
type DBInstanceDatabaseListInput struct {
apis.StatusStandaloneResourceListInput
DbinstanceFilterListInput
}
type DBInstanceAccountListInput struct {
apis.StatusStandaloneResourceListInput
DbinstanceFilterListInput
}
type DbinstanceFilterListInput struct {
// filter by dbinstance
Dbinstance string `json:"dbinstance"`
// swagger:ignore
// Deprecated
// filter by dbinstance_id
DbinstanceId string `json:"dbinstance_id" deprecated-by:"dbinstance"`
}
type DBInstanceDetails struct {
apis.VirtualResourceDetails
SDBInstance
CloudproviderInfo
// 虚拟私有网络名称
// example: test-vpc
Vpc string `json:"vpc"`
// 安全组名称
// example: Default
Secgroup string `json:"secgroup"`
// iops
// example: 0
Iops int `json:"iops"`
// IP子网名称
// example: test-network
Network string `json:"network"`
// 标签信息
Metadata map[string]string `json:"metadata"`
Databases map[string]string `json:"allowempty"`
}

View File

@@ -17,72 +17,21 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type SDBInstanceAccountPrivilege struct {
// 数据库名称或Id
// required: true
Database string `json:"database"`
// swagger:ignore
Database string
DBInstancedatabaseId string
// 权限类型
//
//
//
// | 平台 |Rds引擎 | 支持类型 |
// | ---- |------- | -------- |
// | Aliyun |MySQL, MariaBD | rw, r, ddl, dml |
// | Aliyun |SQLServer | rw, r, owner |
// | Huawei |MySQL, MariaDB | rw, r |
// 同一平台不同的rds类型支持的权限不尽相同
// required: true
Privilege string `json:"privilege"`
Privilege string
}
type DBInstanceAccountCreateInput struct {
apis.StatusStandaloneResourceCreateInput
type SDBInstanceAccountCreateInput struct {
apis.Meta
// rds实例名称或Id,建议使用Id
//
//
//
// | 平台 |支持Rds引擎 |
// | ---- |------- |
// | Aliyun |MySQL, MariaBD, SQLServer |
// | 华为云 |MySQL, MariaBD |
// required: true
// 阿里云SQL Server 2017集群版不支持创建账号
// 实例状态必须是运行中
DBInstance string `json:"dbinstance"`
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
// 账号密码,若不指定,则会随机生成
// required: false
Password string `json:"password"`
// 账号权限
// required: false
Privileges []SDBInstanceAccountPrivilege `json:"privileges"`
Name string
Description string
Password string
Privileges []SDBInstanceAccountPrivilege
}
type SDBInstanceSetPrivilegesInput struct {
Privileges []SDBInstanceAccountPrivilege `json:"privileges"`
}
type DBInstancePrivilege struct {
// 数据库名称
Database string
// 账号名称
Account string
// 数据库Id
DBInstancedatabaseId string
// 权限
Privileges string
}
type DBInstanceAccountDetails struct {
apis.StandaloneResourceDetails
SDBInstanceAccount
// 账号权限列表
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges,allowempty"`
Privileges []SDBInstanceAccountPrivilege
}

View File

@@ -16,39 +16,17 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type DBInstanceBackupCreateInput struct {
apis.VirtualResourceCreateInput
type SDBInstanceBackupCreateInput struct {
apis.Meta
// Rds实例名称或Id, 建议使用Id
// required: true
DBInstance string `json:"dbinstance"`
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
// 需要备份的Rds数据库列表
// required: false
Databases []string `json:"databases"`
// swagger:ignore
DBNames string
// swagger:ignore
Engine string
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
Name string
Description string
DBNames string
Databases []string
Engine string
EngineVersion string
// swagger:ignore
CloudregionId string
// swagger:ignore
BackupMode string
// swagger:ignore
ManagerId string
}
type DBInstanceBackupDetails struct {
apis.VirtualResourceDetails
SDBInstanceBackup
// RDS实例名称
DBInstance string `json:"dbinstance"`
CloudproviderInfo
BackupMode string
ManagerId string
}

View File

@@ -17,54 +17,18 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type SDBInstanceDatabasePrivilege struct {
// 数据库账号名称或Id
// required: true
Account string `json:"account"`
// swagger:ignore
Account string
DBInstanceaccountId string
// 权限
// | 平台 |Rds引擎 | 支持类型 |
// | ---- |------- | -------- |
// | Aliyun |MySQL, MariaBD | rw, r, ddl, dml |
// | Aliyun |SQLServer | rw, r, owner |
// | Huawei |MySQL, MariaDB | rw, r |
// 同一平台不同的rds类型支持的权限不尽相同
// required: true
Privilege string `json:"privilege"`
Privilege string
}
type DBInstanceDatabaseCreateInput struct {
apis.StatusStandaloneResourceCreateInput
type SDBInstanceDatabaseCreateInput struct {
apis.Meta
// rds实例名称或Id,建议使用Id
//
//
//
// | 平台 |支持Rds引擎 |
// | ---- |------- |
// | Aliyun |MySQL, MariaBD, SQLServer |
// | 华为云 |MySQL, MariaBD |
// required: true
// 阿里云SQL Server 2017集群版不支持创建数据库
// 阿里云只读实例不支持创建数据库
// 实例状态必须是运行中
DBInstance string `json:"dbinstance"`
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
// 数据库字符集
// required: true
CharacterSet string `json:"character_set"`
// 赋予账号权限
// required: false
Accounts []SDBInstanceDatabasePrivilege `json:"accounts"`
}
type DBInstancedatabaseDetails struct {
apis.StandaloneResourceDetails
SDBInstanceDatabase
// 数据库权限
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges"`
DBInstanceId string `json:"dbinstance_id"`
CharacterSet string
Name string
Description string
Accounts []SDBInstanceDatabasePrivilege
DBInstanceaccountId string
}

View File

@@ -15,8 +15,6 @@
package compute
import (
"time"
"yunion.io/x/onecloud/pkg/apis"
)
@@ -25,25 +23,15 @@ type DiskCreateInput struct {
*DiskConfig
// 此参数仅适用于未指定storage时进行调度到指定区域创建磁盘
// required: false
// prefer options
PreferRegion string `json:"prefer_region_id"`
PreferZone string `json:"prefer_zone_id"`
PreferWire string `json:"prefer_wire_id"`
PreferHost string `json:"prefer_host_id"`
// 此参数仅适用于未指定storage时进行调度到指定可用区区创建磁盘
// required: false
PreferZone string `json:"prefer_zone_id"`
// swagger:ignore
PreferWire string `json:"prefer_wire_id"`
// 此参数仅适用于未指定storage时进行调度到指定可用区区创建磁盘
// required: false
PreferHost string `json:"prefer_host_id"`
// 此参数仅适用于未指定storage时进行调度到指定平台创建磁盘
// default: kvm
// enum: kvm, openstack, esxi, aliyun, aws, qcloud, azure, huawei, openstack, ucloud, zstack google, ctyun
Hypervisor string `json:"hypervisor"`
// Project string `json:"project"`
// Domain string `json:"domain_id"`
}
// ToServerCreateInput used by disk schedule
@@ -82,99 +70,3 @@ func (req *ServerCreateInput) ToDiskCreateInput() *DiskCreateInput {
input.Domain = req.Domain
return &input
}
type SnapshotPolicyFilterListInput struct {
// filter disk by snapshotpolicy
Snapshotpolicy string `json:"snapshotpolicy"`
// swagger:ignore
// Deprecated
// filter disk by snapshotpolicy_id
SnapshotpolicyId string `json:"snapshotpolicy_id" deprecated-by:"snapshotpolicy"`
}
type DiskListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
BillingFilterListInput
StorageFilterListInput
StorageShareFilterListInput
SnapshotPolicyFilterListInput
ServerFilterListInput
// filter disk by whether it is being used
Unused *bool `json:"unused"`
// swagger:ignore
// Deprecated
// filter by disk type
Type string `json:"type" deprecated-by:"disk_type"`
// 过滤指定disk_type的磁盘列表可能的值为sys, data, swap. volume
//
// | disk_type值 | 说明 |
// |-------------|----------|
// | sys | 虚拟机系统盘 |
// | data | 虚拟机数据盘 |
// | swap | 虚拟机内存交换盘 |
// | volume | 容器volumn盘 |
//
DiskType string `json:"disk_type"`
}
type DiskFilterListInput struct {
// 以指定虚拟磁盘ID或Name过滤列表结果
Disk string `json:"disk"`
// swagger:ignore
// Deprecated
// filter by disk_id
DiskId string `json:"disk_id" deprecated-by:"disk"`
}
type SimpleGuest struct {
Name string `json:"name"`
Id string `json:"id"`
Status string `json:"status"`
}
type SimpleSnapshotPolicy struct {
RepeatWeekdays []int `json:"repeat_weekdays"`
TimePoints []int `json:"time_points"`
}
type DiskDetails struct {
apis.VirtualResourceDetails
SDisk
CloudproviderInfo
// 云平台
Provider string `json:"provider"`
// 存储名称
Storage string `json:"storage"`
// 存储类型
StorageType string `json:"storage_type"`
// 介质类型
MediumType string `json:"medium_type"`
// 所挂载的虚拟机
Guests []SimpleGuest `json:"guests"`
// 所挂载的虚拟机
Guest string `json:"guest"`
// 所挂载虚拟机的数量
GuestCount int `json:"guest_count"`
// 所挂载虚拟机状态
GuestStatus string `json:"guest_status"`
// 自动清理时间
AutoDeleteAt time.Time `json:"auto_delete_at"`
// 自动快照策略状态
SnapshotpolicyStatus string `json:"snapshotpolicy_status,allowempty"`
// 自动快照策略
Snapshotpolicies []SimpleSnapshotPolicy `json:"snapshotpolicies"`
// 手动快照数量
ManualSnapshotCount int `json:"manual_snapshot_count"`
// 最多可创建手动快照数量
MaxManualSnapshotCount int `json:"max_manual_snapshot_count"`
}

View File

@@ -1,25 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import "yunion.io/x/onecloud/pkg/apis"
type DynamicschedtagDetails struct {
apis.StandaloneResourceDetails
SDynamicschedtag
Schedtag string `json:"schedtag"`
ResourceType string `json:"resource_type"`
}

View File

@@ -14,10 +14,6 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
const (
ELASTIC_CACHE_STATUS_RUNNING = "running" //(正常)
ELASTIC_CACHE_STATUS_RESTARTING = "restarting" //(重启中)
@@ -106,28 +102,3 @@ const (
ELASTIC_CACHE_ARCH_TYPE_CLUSTER = "cluster" // 集群
ELASTIC_CACHE_ARCH_TYPE_RWSPLIT = "rwsplit" // 读写分离
)
type ElasticcacheListInput struct {
apis.VirtualResourceListInput
ZonalFilterListInput
VpcFilterListInput
ManagedResourceListInput
}
type ElasticcacheAccountListInput struct {
apis.StatusStandaloneResourceListInput
}
type ElasticcacheAclListInput struct {
apis.StandaloneResourceListInput
}
type ElasticcacheBackupListInput struct {
apis.StatusStandaloneResourceListInput
}
type ElasticcacheParameterListInput struct {
apis.StandaloneResourceListInput
}

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 compute
import "yunion.io/x/onecloud/pkg/apis"
type ElasticcacheBackupDetails struct {
apis.StandaloneResourceDetails
SElasticcacheBackup
CloudproviderInfo
// 引擎
Engine string `json:"engine"`
// 引擎版本
EngineVersion string `json:"engine_version"`
}

View File

@@ -1,22 +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 ElasticcacheSkuDetails struct {
apis.StandaloneResourceDetails
SElasticcacheSku
}

View File

@@ -1,79 +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 SElasticipCreateInput struct {
apis.VirtualResourceCreateInput
// 区域名称或Id, 建议使用Id
// 在指定区域内创建弹性公网ip
Cloudregion string `json:"cloudregion"`
// swagger:ignore
Region string
// swagger:ignore
RegionId string
// swagger:ignore
CloudregionId string
// 子订阅Id, 建议使用Id
// 使用指定子订阅创建弹性公网ip
// 弹性公网ip和虚拟机在同一区域同一子订阅底下才可以进行绑定操作
Cloudprovider string `json:"cloudprovider"`
// swagger:ignore
Manager string
// swagger:ignore
ManagerId string
// 计费类型: 流量或带宽
//
//
//
// | 平台 | 支持类型 |
// | --- | -------- |
// |Aliyun | traffic, bandwidth |
// |腾讯云 | traffic |
// |Azure | traffic |
// |Google | traffic, bandwidth |
// |Ucloud | traffic |
// |Aws | traffic |
// |华为云 | traffic, bandwidth |
// |天翼云 | traffic, bandwidth |
// |KVM | 不支持创建 |
// |VMware | 不支持创建 |
// |ZStack | traffic |
// |OpenStack | traffic |
// default: traffic
// enum: traffic, bandwidth
ChargeType string `json:"charge_type"`
// 子网名称或Id
// 私有云创建此参数必传,例如Openstack, ZStack
Network string `json:"network"`
// swagger:ignore
NetworkId string
}
type ElasticipDetails struct {
apis.VirtualResourceDetails
SElasticip
CloudproviderInfo
// 绑定资源名称
AssociateName string `json:"associate_name"`
}

View File

@@ -14,10 +14,6 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
const (
EIP_MODE_INSTANCE_PUBLICIP = "public_ip"
EIP_MODE_STANDALONE_EIP = "elastic_ip"
@@ -52,16 +48,3 @@ const (
var (
EIP_ASSOCIATE_VALID_TYPES = []string{EIP_ASSOCIATE_TYPE_SERVER, EIP_ASSOCIATE_TYPE_NAT_GATEWAY}
)
type ElasticipListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
RegionalFilterListInput
UsableResourceListInput
// filter usable eip for given associate type
UsableEipForAssociateType string `json:"usable_eip_for_associate_type"`
// filter usable eip for given associate id
UsableEipForAssociateId string `json:"usable_eip_for_associate_id"`
}

View File

@@ -1,26 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import "yunion.io/x/onecloud/pkg/apis"
type ExternalProjectDetails struct {
apis.StandaloneResourceDetails
SExternalProject
CloudproviderInfo
Tenant string `json:"tenant"`
}

View File

@@ -1,100 +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 RegionalFilterListInput struct {
// 过滤位于指定城市区域的资源
City string `json:"city"`
// 过滤处于指定区域内的资源
Cloudregion string `json:"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
CloudregionId string `json:"cloudregion_id" deprecated-by:"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
Region string `json:"region" deprecated-by:"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
RegionId string `json:"region_id" deprecated-by:"cloudregion"`
}
type ZonalFilterListInput struct {
RegionalFilterListInput
// 过滤处于指定可用区内的资源
Zone string `json:"zone"`
// swagger:ignore
// Deprecated
// filter by zone_id
ZoneId string `json:"zone_id" deprecated-by:"zone"`
// 过滤处于多个指定可用区内的资源
Zones []string `json:"zones"`
}
func (input ZonalFilterListInput) ZoneList() []string {
zoneStr := input.Zone
if len(zoneStr) > 0 {
input.Zones = append(input.Zones, zoneStr)
}
return input.Zones
}
type HostFilterListInput struct {
ZonalFilterListInput
// 过滤关联指定宿主机ID或Name的列表结果
Host string `json:"host"`
// swagger:ignore
// Deprecated
// filter by host_id
HostId string `json:"host_id" deprecated-by:"host"`
}
type CloudregionListInput struct {
apis.EnabledStatusStandaloneResourceListInput
apis.DomainizedResourceListInput
ManagedResourceListInput
UsableResourceListInput
UsableVpcResourceListInput
// 过滤位于指定城市的区域
City string `json:"city"`
// 过滤提供特定服务的区域
Service string `json:"service"`
}
type ZoneListInput struct {
apis.StatusStandaloneResourceListInput
apis.DomainizedResourceListInput
ManagedResourceListInput
RegionalFilterListInput
UsableResourceListInput
UsableVpcResourceListInput
// 过滤提供特定服务的可用区
Service string `json:"service"`
}

View File

@@ -21,8 +21,3 @@ import (
type GlobalVpcCreateInput struct {
apis.EnabledStatusStandaloneResourceCreateInput
}
type GlobalVpcDetails struct {
apis.StandaloneResourceDetails
SGlobalVpc
}

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 compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
type GroupguestDetails struct {
apis.JoinModelBaseDetails
Instancegroup string
Server string
Guest string
SGroupguest
}

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 compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
type GroupnetworkDetails struct {
apis.JoinModelBaseDetails
SGroupnetwork
// 主机组名称
Instancegroup string
// IP子网名称
Network string
}

View File

@@ -150,7 +150,7 @@ const (
HYPERVISOR_DEFAULT = HYPERVISOR_KVM
)
var VM_RUNNING_STATUS = []string{VM_START_START, VM_STARTING, VM_RUNNING, VM_BLOCK_STREAM, VM_BLOCK_STREAM_FAIL}
var VM_RUNNING_STATUS = []string{VM_START_START, VM_STARTING, VM_RUNNING, VM_BLOCK_STREAM}
var VM_CREATING_STATUS = []string{VM_CREATE_NETWORK, VM_CREATE_DISK, VM_START_DEPLOY, VM_DEPLOYING}
var HYPERVISORS = []string{
@@ -229,10 +229,9 @@ var HOSTTYPE_HYPERVISOR = map[string]string{
}
const (
VM_AWS_DEFAULT_LOGIN_USER = "ec2user"
VM_AWS_DEFAULT_WINDOWS_LOGIN_USER = "Administrator"
VM_AZURE_DEFAULT_LOGIN_USER = "toor"
VM_ZSTACK_DEFAULT_LOGIN_USER = "root"
VM_AWS_DEFAULT_LOGIN_USER = "ec2user"
VM_AZURE_DEFAULT_LOGIN_USER = "toor"
VM_ZSTACK_DEFAULT_LOGIN_USER = "root"
VM_METADATA_APP_TAGS = "app_tags"
VM_METADATA_CREATE_PARAMS = "create_params"

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 compute
import "yunion.io/x/onecloud/pkg/apis"
type GuestDiskDetails struct {
apis.JoinModelBaseDetails
SGuestdisk
// 云主机名称
Guest string
// 云主机名称
Server string
// 磁盘名称
Disk string
// 存储类型
// example: local
StorageType string `json:"storage_type"`
// 磁盘大小, 单位Mb
// example: 10240
DiskSize int `json:"disk_size"`
// 磁盘状态
// example: ready
Status string `json:"status"`
// 磁盘类型
// example: data
DiskType string `json:"disk_type"`
// 介质类型
// example: ssd
MediumType string `json:"medium_type"`
}

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 compute
import "yunion.io/x/onecloud/pkg/apis"
type GuestnetworkDetails struct {
apis.JoinModelBaseDetails
SGuestnetwork
// 云主机名称
Guest string
// 云主机名称
Server string
// IP子网名称
Network string
}

View File

@@ -15,79 +15,56 @@
package compute
import (
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
type ServerFilterListInput struct {
// 以关联主机ID或Name过滤列表
Server string `json:"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
ServerId string `json:"server_id" deprecated-by:"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
Guest string `json:"guest" deprecated-by:"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
GuestId string `json:"guest_id" deprecated-by:"server"`
}
type ServerListInput struct {
apis.VirtualResourceListInput
apis.BaseListInput
ManagedResourceListInput
HostFilterListInput
NetworkFilterListInput
BillingFilterListInput
GroupFilterListInput
SecgroupFilterListInput
DiskFilterListInput
// 只列出裸金属主机
// 过滤可用区底下的资源
Zone string `json:"zone"`
// 过滤连接此二层网络的资源
Wire string `json:"wire"`
// 过滤关联此网络的资源
Network string `json:"network"`
// Disk ID or Name
Disk string `json:"disk"`
// Host ID or Name
Host string `json:"host"`
// Show baremetal servers
Baremetal *bool `json:"baremetal"`
// 只列出GPU主机
// Show gpu servers
Gpu *bool `json:"gpu"`
// 列出管理安全组为指定安全组的主机
// Secgroup ID or Name
Secgroup string `json:"secgroup"`
// AdminSecgroup ID or Name
AdminSecgroup string `json:"admin_security"`
// 列出Hypervisor为指定值的主机
// enum: kvm,esxi,baremetal,aliyun,azure,aws,huawei,ucloud,zstack,openstack,google,ctyun"`
Hypervisor []string `json:"hypervisor"`
// 列出绑定了弹性IPEIP的主机
// Show server of hypervisor choices:"kvm|esxi|container|baremetal|aliyun|azure|aws|huawei|ucloud|zstack|openstack"`
Hypervisor string `json:"hypervisor"`
// Show servers in cloudregion
Region string `json:"region"`
// Show Servers with EIP
WithEip *bool `json:"with_eip"`
// 列出未绑定弹性IPEIO的主机
// Show Servers without EIP
WithoutEip *bool `json:"without_eip"`
// 列出操作系统为指定值的主机
// enum: linux,windows,vmware
// OS Type choices:"linux|windows|vmware"`
OsType string `json:"os_type"`
// 对列表结果按照磁盘进行排序
// enum: asc,desc
// Order by disk size choices:"asc|desc"
OrderByDisk string `json:"order_by_disk"`
// 对主机列表结果按照宿主机名称进行排序
// enum: asc,desc
// Order by host name choices:"asc|desc"
OrderByHost string `json:"order_by_host"`
// 列出可以挂载指定EIP的主机
// Vpc id or name
Vpc string `json:"vpc"`
// Eip id or name
UsableServerForEip string `json:"usable_server_for_eip"`
// 按主机资源类型进行排序
// enum: shared,prepaid,dedicated
// Show Servers without user metadata
WithoutUserMeta *bool `json:"without_user_meta"`
// Instance Group ID or Name
Group string `json:"group"`
// Resource type choices:"shared|prepaid|dedicated"
ResourceType string `json:"resource_type"`
// 返回开启主备机功能的主机
GetBackupGuestsOnHost *bool `json:"get_backup_guests_on_host"`
// 根据宿主机 SN 过滤
HostSn string `json:"host_sn"`
}
func (input *ServerListInput) AfterUnmarshal() {
if input.Baremetal != nil && *input.Baremetal {
input.Hypervisor = append(input.Hypervisor, HYPERVISOR_BAREMETAL)
}
// Billing type choices:"postpaid|prepaid"
BillingType string `json:"billing_type"`
}
type ServerRebuildRootInput struct {
@@ -129,51 +106,3 @@ func (i ServerRebuildRootInput) GetKeypairName() string {
type ServerResumeInput struct {
apis.Meta
}
type ServerDetails struct {
apis.VirtualResourceDetails
SGuest
CloudproviderInfo
// details
// 网络概要
Networks string `json:"networks"`
// 磁盘概要
Disks string `json:"disks"`
// 磁盘详情
DisksInfo *jsonutils.JSONArray `json:"disks_info"`
// 虚拟机Ip列表
VirtualIps string `json:"virtual_ips"`
// 安全组规则
SecurityRules string `json:"security_rules"`
// 操作系统名称
OsName string `json:"os_name"`
// 操作系统类型
OsType string `json:"os_type"`
// 系统管理员可见的安全组规则
AdminSecurityRules string `json:"admin_security_rules"`
// list
AttachTime time.Time `attach_time`
// common
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
// 备机所在宿主机名称
BackupHostName string `json:"backup_host_name"`
// 北京所在宿主机状态
BackupHostStatus string `json:"backup_host_status"`
// 宿主机名称
Host string `json:"host"`
// 宿主机SN
HostSN string `json:"host_sn"`
CanRecycle bool `json:"can_recycle"`
// 自动释放时间
AutoDeleteAt time.Time `json:"auto_delete_at"`
// 标签
Metadata map[string]string `json:"metadata"`
// 磁盘数量
DiskCount int `json:"disk_count"`
// 是否支持ISO启动
CdromSupport bool `json:"cdrom_support"`
}

View File

@@ -36,6 +36,7 @@ type GuesttemplateCreateInput struct {
}
type GuesttemplateDetails struct {
apis.Meta
apis.SharableVirtualResourceDetails
SGuestTemplate

View File

@@ -15,8 +15,6 @@
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
@@ -45,82 +43,3 @@ type DiskSpec struct {
EndIndex int `json:"end_index"`
Count int `json:"count"`
}
type HostListInput struct {
apis.EnabledStatusStandaloneResourceListInput
apis.DomainizedResourceListInput
ManagedResourceListInput
ZonalFilterListInput
WireFilterListInput
SchedtagFilterListInput
StorageFilterListInput
UsableResourceListInput
// filter by ResourceType
ResourceType string `json:"resource_type"`
// filter by mac of any network interface
AnyMac string `json:"any_mac"`
// filter storages not attached to this host
StorageNotAttached *bool `json:"storage_not_attached"`
// filter by Hypervisor
Hypervisor string `json:"hypervisor"`
// filter host that is empty
IsEmpty *bool `json:"is_empty"`
// filter host that is baremetal
Baremetal *bool `json:"baremetal"`
}
type HostDetails struct {
apis.StandaloneResourceDetails
SHost
CloudproviderInfo
Schedtags []SchedtagShortDescDetails `json:"schedtags"`
ServerId string `json:"server_id"`
Server string `json:"server"`
ServerIps string `json:"server_ips"`
// 网卡数量
NicCount int `json:"nic_count"`
// 网卡详情
NicInfo []jsonutils.JSONObject `json:"nic_info"`
// CPU超分比
CpuCommit int `json:"cpu_commit"`
// 内存超分比
MemCommit int `json:"mem_commit"`
// 云主机数量
// example: 10
Guests int `json:"guests"`
// 非系统云主机数量
// example: 0
NonsystemGuests int `json:"nonsystem_guests"`
// 运行中云主机数量
// example: 2
RunningGuests int `json:"running_geusts"`
// CPU超分率
CpuCommitRate float64 `json:"cpu_commit_rate"`
// 内存超分率
MemCommitRate float64 `json:"mem_commit_rate"`
// 存储大小
Storage int64 `json:"storage"`
// 已使用存储大小
StorageUsed int64 `json:"storage_used"`
// 浪费存储大小(异常磁盘存储大小)
StorageWaste int64 `json:"storage_waste"`
// 虚拟存储大小
StorageVirtual int64 `json:"storage_virtual"`
// 可用存储大小
StorageFree int64 `json:"storage_free"`
// 存储超分率
StorageCommitRate float64 `json:"storage_commit_rate"`
Spec *jsonutils.JSONDict `json:"spec"`
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
CanPrepare bool `json:"can_prepare"`
PrepareFailReason string `json:"prepare_fail_reason"`
// 标签
Metadata map[string]string `json:"metadata"`
}

View File

@@ -110,7 +110,6 @@ var HOST_TYPES = []string{
HOST_TYPE_UCLOUD,
HOST_TYPE_ZSTACK,
HOST_TYPE_CTYUN,
HOST_TYPE_GOOGLE,
}
var NIC_TYPES = []string{NIC_TYPE_IPMI, NIC_TYPE_ADMIN}

View File

@@ -1,22 +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
type HostJointsDetails struct {
// 宿主机名称
Host string `json:"host"`
// 裸金属服务器名称
Baremetal string `json:"baremetal"`
}

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 compute
import "yunion.io/x/onecloud/pkg/apis"
type HostnetworkDetails struct {
apis.JoinModelBaseDetails
HostJointsDetails
SHostwire
// IP子网名称
Network string `json:"network"`
NicType string `json:"nic_type"`
}

View File

@@ -1,25 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import "yunion.io/x/onecloud/pkg/apis"
type HostschedtagDetails struct {
apis.JoinModelBaseDetails
HostJointsDetails
SHostschedtag
Schedtag string `json:"string"`
}

View File

@@ -1,57 +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/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
type HoststorageDetails struct {
apis.JoinModelBaseDetails
HostJointsDetails
SHoststorage
// 存储名称
Storage string `json:"storage"`
// 存储大小
Capacity int64 `json:"capacity"`
// 存储配置信息
StorageConf jsonutils.JSONObject `json:"storage_conf"`
// 已使用存储大小
UsedCapacity int64 `json:"used_capacity"`
// 浪费存储大小(异常磁盘总大小)
WasteCapacity int64 `json:"waste_capacity"`
// 可用存储大小
FreeCapacity int64 `json:"free_capacity"`
// 存储类型
// example: local
StorageType string `json:"storage_type"`
// 介质类型
// example: ssd
MediumType string `json:"medium_type"`
// 是否启用
Enabled bool `json:"enabled"`
// 超售比
Cmtbound float32 `json:"cmtbound"`
// 镜像缓存路径
ImagecachePath string `json:"imagecache_path"`
// 存储缓存Id
StoragecacheId string `json:"storagecached_id"`
GuestDiskCount int `json:"guest_disk_count,allowempty"`
}

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 compute
import "yunion.io/x/onecloud/pkg/apis"
type HostwireDetails struct {
apis.JoinModelBaseDetails
HostJointsDetails
SHostwire
// 二层网络名称
Wire string `json:"wire"`
// 带宽大小
Bandwidth int `json:"bandwidth"`
}

View File

@@ -14,10 +14,6 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
type RegionalResourceCreateInput struct {
Cloudregion string `json:"cloudregion"`
CloudregionId string `json:"cloudregion_id"`
@@ -29,83 +25,5 @@ type ManagedResourceCreateInput struct {
}
type DeletePreventableCreateInput struct {
//删除保护,创建的资源默认不允许删除
//default: true
DisableDelete *bool `json:"disable_delete"`
}
type KeypairListInput struct {
apis.StandaloneResourceListInput
apis.UserResourceListInput
// list in admin mode
Admin *bool `json:"admin"`
}
type CachedimageListInput struct {
apis.StandaloneResourceListInput
ManagedResourceListInput
ZonalFilterListInput
}
type ExternalProjectListInput struct {
apis.StandaloneResourceListInput
ManagedResourceListInput
}
type RouteTableListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
RegionalFilterListInput
VpcFilterListInput
}
type SnapshotPolicyCacheListInput struct {
apis.ResourceBaseListInput
// filter by snapshotpolicy Id or Name
Snapshotpolicy string `json:"snapshotpolicy"`
}
type BillingFilterListInput struct {
// filter by billing_type
BillingType string `json:"billing_type"`
}
type NetworkInterfaceListInput struct {
apis.StatusStandaloneResourceListInput
ManagedResourceListInput
}
type BaremetalagentListInput struct {
apis.StandaloneResourceListInput
}
type DnsRecordListInput struct {
apis.AdminSharableVirtualResourceListInput
}
type DynamicschedtagListInput struct {
apis.StandaloneResourceListInput
}
type GuestTemplateListInput struct {
apis.SharableVirtualResourceListInput
}
type SchedpolicyListInput struct {
apis.StandaloneResourceListInput
}
type ServiceCatalogListInput struct {
apis.SharableVirtualResourceListInput
}
type SnapshotPolicyListInput struct {
apis.VirtualResourceListInput
}

View File

@@ -17,29 +17,20 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type InstanceGroupListInput struct {
apis.VirtualResourceListInput
ZonalFilterListInput
ServerFilterListInput
apis.BaseListInput
// service_type过滤列表结果
// Filter by service type
ServiceType string `json:"service_type"`
// parent_id过滤列表结果
// Filter by parent id
ParentId string `json:"parent_id"`
// Filter by zone id
ZoneId string `json:"zone_id"`
// Filter by guest id or name
Server string `json:"server"`
}
type InstanceGroupDetail struct {
apis.VirtualResourceDetails
apis.Meta
SGroup
// 云主机数量
GuestCount int `json:"guest_count"`
}
type GroupFilterListInput struct {
// 以指定实例组ID或Name过滤列表结果
Group string `json:"group"`
// swagger:ignore
// deprecated: true
// Filter by instance group Id
GroupId string `json:"group_id" deprecated-by:"group"`
GuestCount int64 `json:"guest_count"`
}

View File

@@ -1,49 +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 SimpleSnapshot struct {
// 快照Id
Id string `json:"id"`
// 快照名称
Name string `json:"name"`
// 存储Id
StorageId string `json:"storage_id"`
// 磁盘类型
DiskType string `json:"disk_type"`
// 区域Id
CloudregionId string `json:"cloudregion_id"`
// 快照大小
Size int `json:"size"`
}
type InstnaceSnapshotDetails struct {
apis.VirtualResourceDetails
SInstanceSnapshot
// 云主机状态
GuestStatus string `json:"guest_status"`
// 云主机名称
Guest string `json:"guest"`
// 存储类型
StorageType string `json:"storage_type"`
// 快照列表
Snapshots []SimpleSnapshot `json:"snapshots"`
Properties map[string]string `json:"properties"`
}

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 compute
import "yunion.io/x/onecloud/pkg/apis"
type IsolateDeviceDetails struct {
apis.StandaloneResourceDetails
SIsolatedDevice
// 宿主机名称
Host string `json:"host"`
// 云主机名称
Guest string `json:"guest"`
// 云主机状态
GuestStatus string `json:"guest_status"`
}

View File

@@ -14,10 +14,6 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
const (
DIRECT_PCI_TYPE = "PCI"
GPU_HPC_TYPE = "GPU-HPC" // # for compute
@@ -42,17 +38,3 @@ var VENDOR_ID_MAP = map[string]string{
"NVIDIA": NVIDIA_VENDOR_ID,
"AMD": AMD_VENDOR_ID,
}
type IsolatedDeviceListInput struct {
apis.StandaloneResourceListInput
apis.DomainizedResourceListInput
HostFilterListInput
// 只列出GPU直通设备
Gpu *bool `json:"gpu"`
// 只列出USB直通设备
Usb *bool `json:"usb"`
// 只列出未使用的直通设备
Unused *bool `json:"unused"`
}

View File

@@ -1,57 +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"
var KEYPAIR_SCHEMAS = []string{
KEYPAIRE_SCHEME_RSA,
}
type KeypairCreateInput struct {
apis.StandaloneResourceCreateInput
// 公钥内容,若为空则自动生成公钥
PublicKey string `json:"public_key"`
// swagger:ignore
PrivateKey string
// swagger:ignore
Fingerprint string
// swagger:ignore
OwnerId string
// 秘钥类型
// enum: RSA
// default: RSA
Scheme string `json:"scheme"`
}
type KeypairDetails struct {
apis.StandaloneResourceDetails
SKeypair
// 私钥长度
PrivateKeyLen int `json:"private_key_len"`
// 关联云主机次数
LinkedGuestCount int `json:"linked_guest_count"`
// 用户Id
OwnerId string `json:"owner_id"`
// 用户名称
OwnerName string `json:"owner_name"`
}

View File

@@ -1,20 +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 (
KEYPAIRE_SCHEME_RSA = "RSA"
KEYPAIRE_SCHEME_DSA = "DSA"
)

Some files were not shown because too many files have changed in this diff Show More