Compare commits

...

647 Commits

Author SHA1 Message Date
Zexi Li
70be65707a Merge pull request #6626 from ioito/automated-cherry-pick-of-#6619-upstream-release-2.12
Automated cherry pick of #6619: fix: 避免azure卸载磁盘失败
2020-05-27 17:52:28 +08:00
Qu Xuan
e67ded4478 fix: 避免azure卸载磁盘失败 2020-05-27 15:58:23 +08:00
Zexi Li
ef28c00820 Merge pull request #6563 from ioito/automated-cherry-pick-of-#6558-upstream-release-2.12
Automated cherry pick of #6558: fix: 避免openstack以镜像做系统盘创建失败
2020-05-22 22:45:57 +08:00
Qu Xuan
ea846d06b9 fix: 避免openstack以镜像做系统盘创建失败 2020-05-22 20:19:30 +08:00
Zexi Li
cbd7d4f652 Merge pull request #6343 from swordqiu/automated-cherry-pick-of-#6338-upstream-release-2.12
Automated cherry pick of #6338: fix: avoid using background context
2020-05-14 18:19:13 +08:00
Qiu Jian
90d90eac2d fix: avoid using background context 2020-05-14 17:07:05 +08:00
Zexi Li
95d196b465 Merge pull request #6313 from ioito/automated-cherry-pick-of-#6306-upstream-release-2.12
Automated cherry pick of #6306: fix: openstack 安全组规则同步
2020-05-13 12:42:11 +08:00
Qu Xuan
f6c16dd0b3 fix: openstack 安全组规则同步 2020-05-12 17:58:34 +08:00
Zexi Li
c7faaa18b8 Merge pull request #6100 from ioito/automated-cherry-pick-of-#6095-upstream-release-2.12
Automated cherry pick of #6095: fix: 普通用户可获取rds账号密码
2020-04-29 13:08:31 +08:00
yunion-ci-robot
20eedc000d Merge pull request #6108 from ioito/automated-cherry-pick-of-#6103-upstream-release-2.12
Automated cherry pick of #6103: fix: 修复openstack存储同步问题
2020-04-28 23:36:36 +08:00
Qu Xuan
95ff50e23b fix: 修复openstack存储同步问题 2020-04-28 14:49:11 +08:00
Qu Xuan
4f22331673 fix: 普通用户可获取rds账号密码 2020-04-28 10:45:47 +08:00
Zexi Li
03ca3febfe Merge pull request #6067 from rainzm/automated-cherry-pick-of-#6062-upstream-release-2.12
Automated cherry pick of #6062: fix/notify: Add deadline for rpc client
2020-04-27 12:48:20 +08:00
Rain
4aa53ae8fe fix/notify: Add deadline for rpc client 2020-04-27 10:45:54 +08:00
Zexi Li
a4cabafcfb Merge pull request #6033 from ioito/automated-cherry-pick-of-#6028-upstream-release-2.12
Automated cherry pick of #6028: fix: json unmarshal
2020-04-26 18:19:13 +08:00
Qu Xuan
25d4f102df fix: json unmarshal 2020-04-26 15:54:10 +08:00
Zexi Li
a5ce661648 Merge pull request #5926 from ioito/automated-cherry-pick-of-#5919-upstream-release-2.12
Automated cherry pick of #5919: fix: 非私有云同步region name
2020-04-23 00:04:43 +08:00
Zexi Li
9816ed5878 Merge pull request #5936 from ioito/automated-cherry-pick-of-#5931-upstream-release-2.12
Automated cherry pick of #5931: fix: 转换非标准存储类型到lrs
2020-04-22 23:57:51 +08:00
Qu Xuan
bcae0c1d81 fix: 转换非标准存储类型到lrs 2020-04-22 18:55:12 +08:00
Qu Xuan
0579fc4bb9 fix: 非私有云同步region name 2020-04-22 18:01:17 +08:00
Zexi Li
d2868a7af2 Merge pull request #5889 from ioito/automated-cherry-pick-of-#5884-upstream-release-2.12
Automated cherry pick of #5884: fix: 仅当变更domainId时才需要更新projectId
2020-04-22 10:32:50 +08:00
Qu Xuan
0055a08350 fix: 仅当变更domainId时才需要更新projectId 2020-04-21 21:15:45 +08:00
Zexi Li
10e902a837 Merge pull request #5829 from ioito/automated-cherry-pick-of-#5825-upstream-release-2.12
Automated cherry pick of #5825: fix: 尽量避免secgroup重名问题
2020-04-17 00:03:23 +08:00
Zexi Li
b704a0b067 Merge pull request #5809 from ioito/automated-cherry-pick-of-#5805-upstream-release-2.12
Automated cherry pick of #5805: fix: 优化rds sku list查询速度
2020-04-16 18:01:22 +08:00
Qu Xuan
29fd7507f1 fix: 尽量避免secgroup重名问题 2020-04-16 16:42:34 +08:00
Qu Xuan
7bbbccee47 fix: 优化rds sku list查询速度 2020-04-15 18:03:06 +08:00
yunion-ci-robot
b02f01c969 Merge pull request #5778 from ioito/automated-cherry-pick-of-#5774-upstream-release-2.12
Automated cherry pick of #5774: fix: azure重装系统删除不必要的参数
2020-04-12 00:33:44 +08:00
Qu Xuan
9aa90a3b06 fix: azure重装系统删除不必要的参数 2020-04-11 15:13:45 +08:00
Zexi Li
52f33b0420 Merge pull request #5690 from ioito/automated-cherry-pick-of-#5686-upstream-release-2.12
Automated cherry pick of #5686: fix: 修复重装系统时未能更换指定image问题
2020-04-03 19:43:41 +08:00
Zexi Li
023b8c6de0 Merge pull request #5675 from ioito/automated-cherry-pick-of-#5671-upstream-release-2.12
Automated cherry pick of #5671: fix: 华为云rds使用自身的存储类型
2020-04-03 19:41:58 +08:00
Qu Xuan
b3a603bcc8 fix: 修复重装系统时未能更换指定image问题 2020-04-03 11:36:52 +08:00
Qu Xuan
36e0ce4f87 fix: 华为云rds使用自身的存储类型 2020-04-02 17:30:56 +08:00
yunion-ci-robot
799bb49451 Merge pull request #5610 from swordqiu/automated-cherry-pick-of-#5608-upstream-release-2.12
Automated cherry pick of #5608: fix: allow list loadbalancer cluster by default
2020-03-28 09:47:41 +08:00
Qiu Jian
93f79bec1b fix: allow list loadbalancer cluster by default 2020-03-28 09:04:21 +08:00
Zexi Li
fe6b0e38e6 Merge pull request #5598 from ioito/automated-cherry-pick-of-#5596-upstream-release-2.12
Automated cherry pick of #5596: fix: 避免onecloud lb未返回provider及brand信息
2020-03-26 10:41:55 +08:00
Qu Xuan
eae3b06b96 fix: 避免onecloud lb未返回provider及brand信息 2020-03-25 18:28:37 +08:00
Zexi Li
d91086def8 Merge pull request #5559 from rainzm/automated-cherry-pick-of-#5555-upstream-release-2.12
Automated cherry pick of #5555: feat(notify): Compatibility and repair
2020-03-19 10:06:47 +08:00
yunion-ci-robot
2b94a9062d Merge pull request #5494 from ioito/automated-cherry-pick-of-#5490-upstream-release-2.12
Automated cherry pick of #5490: fix: class action 统一使用keywords包裹
2020-03-19 08:47:20 +08:00
Rain
e42dc01341 feat(notify): Compatibility and repair 2020-03-18 21:22:47 +08:00
Zexi Li
399844eef2 Merge pull request #5549 from swordqiu/automated-cherry-pick-of-#5545-upstream-release-2.12
Automated cherry pick of #5545: fix: policy fetcher not retry after initial failure
2020-03-18 10:52:58 +08:00
Qu Xuan
e440019097 fix: class action 统一使用keywords包裹 2020-03-17 18:45:15 +08:00
Qiu Jian
f3f13e18cb fix: policy fetcher not retry after initial failure 2020-03-17 18:31:58 +08:00
yunion-ci-robot
91ed14d40e Merge pull request #5533 from ioito/automated-cherry-pick-of-#5529-upstream-release-2.12
Automated cherry pick of #5529: fix: 避免重装系统失败后imageId依然发生改变
2020-03-17 08:20:15 +08:00
yunion-ci-robot
33ac4a6edf Merge pull request #5527 from ioito/automated-cherry-pick-of-#5452-upstream-release-2.12
Automated cherry pick of #5452: fix: 优化rds sku同步逻辑
2020-03-16 15:19:13 +08:00
Zexi Li
ab6260d8bc Merge pull request #5510 from swordqiu/automated-cherry-pick-of-#5506-upstream-release-2.12
Automated cherry pick of #5506: fix: recode cloudprovider usable filter
2020-03-16 13:00:08 +08:00
Zexi Li
bf2589d4fd Merge pull request #5523 from ioito/automated-cherry-pick-of-#5519-upstream-release-2.12
Automated cherry pick of #5519: fix: 避免未传递prority参数导致校验未通过
2020-03-16 12:56:25 +08:00
Qu Xuan
42138c82a9 fix: 避免重装系统失败后imageId依然发生改变 2020-03-16 11:31:08 +08:00
Qu Xuan
ce72c82bea fix: 优化rds sku同步逻辑 2020-03-16 10:43:04 +08:00
Qu Xuan
543f83c1c1 fix: 避免未传递prority参数导致校验未通过 2020-03-15 13:14:47 +08:00
yunion-ci-robot
d5d6ed39c6 Merge pull request #5512 from zexi/automated-cherry-pick-of-#5511-upstream-release-2.12
Automated cherry pick of #5511: scheduler: fix disk allocated not balanced
2020-03-14 17:51:05 +08:00
Zexi Li
7716881286 scheduler: fix disk allocated not balanced 2020-03-14 16:44:55 +08:00
Qiu Jian
cdcf3b6ebf fix: recode cloudprovider usable filter 2020-03-14 09:13:44 +08:00
yunion-ci-robot
017f8adf36 Merge pull request #5489 from wanyaoqi/automated-cherry-pick-of-#5484-upstream-release-2.12
Automated cherry pick of #5484: download handler set no timeout
2020-03-13 13:32:50 +08:00
wanyaoqi
70e859ad67 download handler set no timeout 2020-03-13 12:03:29 +08:00
Zexi Li
dca8d06739 Merge pull request #5468 from rainzm/feat/vendor_2.12
feat: Update Vendor for release/2.12
2020-03-12 12:07:38 +08:00
Rain
c5335acf5c feat: Update Vendor for release/2.12 2020-03-12 11:59:49 +08:00
Zexi Li
31abdc46a2 Merge pull request #5451 from zexi/automated-cherry-pick-of-#5447-upstream-release-2.12
Automated cherry pick of #5447: region: host update storage set enabled
2020-03-11 15:58:36 +08:00
Zexi Li
d779fc0528 region: host update storage set enabled 2020-03-11 15:59:51 +08:00
Zexi Li
16880022d6 Merge pull request #5423 from swordqiu/automated-cherry-pick-of-#5419-upstream-release-2.12
Automated cherry pick of #5419: fix: fail to find esxi admin vnic, use vnic with default IPv4 route
2020-03-10 14:45:50 +08:00
yunion-ci-robot
ae97d9fa90 Merge pull request #5425 from rainzm/automated-cherry-pick-of-#5424-upstream-release-2.12
Automated cherry pick of #5424: fix(esxi): Add two account with same account name
2020-03-10 11:03:59 +08:00
Rain
0b3d80e359 fix(esxi): Add two account with same account name 2020-03-09 17:56:23 +08:00
Qiu Jian
3a8aae5a55 fix: fail to find esxi admin vnic, use vnic with default IPv4 route 2020-03-09 16:07:41 +08:00
Zexi Li
950aae9895 Merge pull request #5418 from zexi/automated-cherry-pick-of-#5414-upstream-release-2.12
Automated cherry pick of #5414: opslog: notes use text column
2020-03-09 12:36:52 +08:00
Zexi Li
8d002a8e78 opslog: notes use text column 2020-03-09 12:32:10 +08:00
Zexi Li
94b5c8f6df Merge pull request #5407 from swordqiu/automated-cherry-pick-of-#5403-upstream-release-2.12
Automated cherry pick of #5403: fix: cloudprovider performEnable should also enable its cloudaccount
2020-03-09 12:30:45 +08:00
Qiu Jian
946d3232c7 fix: cloudprovider performEnable should also enable its cloudaccount 2020-03-08 18:31:55 +08:00
Zexi Li
e95c7165c4 Merge pull request #5396 from swordqiu/automated-cherry-pick-of-#5392-upstream-release-2.12
Automated cherry pick of #5392: fix: scoped resource should override FetchOwnerId
2020-03-07 15:51:30 +08:00
Qiu Jian
58d5bc0f89 fix: scoped resource should override FetchOwnerId 2020-03-07 15:47:46 +08:00
yunion-ci-robot
25e8ce027a Merge pull request #5386 from rainzm/automated-cherry-pick-of-#5378-upstream-release-2.12
Automated cherry pick of #5378: fix: Add 'scope=system' and 'system' for Caches when querying from Keystone.
2020-03-06 19:16:50 +08:00
Zexi Li
841c59e8c3 Merge pull request #5376 from swordqiu/automated-cherry-pick-of-#5372-upstream-release-2.12
Automated cherry pick of #5372: fix: no scope shcedtag should be visible to all
2020-03-06 18:32:43 +08:00
Rain
6869846840 fix: Add 'scope=system' and 'system' for Caches when querying from Keystone.
1. Query 'scope=system' and 'system=true' is neccessary when fetching all users
   or groups from Keystone.
   Without these, users and groups in other domains (non-caller domains),
   as well as system-level users, cannot be detected.
2. Query 'scope=system' is neccessary when fetching all project from Keystone.
2020-03-06 17:18:24 +08:00
Qiu Jian
ee196529f6 fix: no scope shcedtag should be visible to all 2020-03-06 15:24:51 +08:00
Zexi Li
249db7d9d5 Merge pull request #5370 from rainzm/automated-cherry-pick-of-#5366-upstream-release-2.12
Automated cherry pick of #5366: fix/notify: Fix the resend mechanism
2020-03-06 12:46:19 +08:00
Rain
8508032c60 fix/notify: Fix the resend mechanism 2020-03-06 11:13:49 +08:00
yunion-ci-robot
55fb6930f7 Merge pull request #5354 from rainzm/automated-cherry-pick-of-#5353-upstream-release-2.12
Automated cherry pick of #5353: feature(notify): Add query and return value for contact UPDATE interface
2020-03-05 19:05:50 +08:00
Rain
f4b7e4c93f fix the conflict 2020-03-05 17:17:26 +08:00
Rain
fe2add1563 feature(notify): Add query and return value for contact UPDATE interface
1. Add same return value with contact GET interface when updating
2. Add pull params for query to pull subcontact by mobile number.
   For example, pull user_id from dingtalk throught user's mobile
   number.
3. Add corresponding feature based on above for climc.
4. UserCache will try FetchByName if there is no id matched user when
   fetching users from KeyStone.
2020-03-05 17:11:41 +08:00
yunion-ci-robot
fe2eeaf97c Merge pull request #5319 from ioito/automated-cherry-pick-of-#5315-upstream-release-2.12
Automated cherry pick of #5315: fix: 避免旧套餐下架zone信息未知,导致同步rds异常
2020-03-03 02:19:46 +08:00
Qu Xuan
d156d2a648 fix: 避免旧套餐下架zone信息未知,导致同步rds异常 2020-03-02 17:10:23 +08:00
yunion-ci-robot
5283c09784 Merge pull request #5311 from ioito/automated-cherry-pick-of-#5307-upstream-release-2.12
Automated cherry pick of #5307: 修复aliyun没有权限获取余额问题
2020-02-28 21:59:25 +08:00
yunion-ci-robot
b38a17bbc1 Merge pull request #5298 from tb365/bugfix/tb-bugfix-022801
vpc list add param vpc_usable
2020-02-28 21:15:21 +08:00
yunion-ci-robot
f951a08008 Merge pull request #5285 from wanyaoqi/automated-cherry-pick-of-#5255-upstream-release-2.12
Automated cherry pick of #5255: fix nic get pci address
2020-02-28 21:06:20 +08:00
Qu Xuan
a9043c3423 修复aliyun没有权限获取余额问题 2020-02-28 19:56:37 +08:00
TangBin
971ed7aee5 vpc list add param vpc_usable 2020-02-28 14:35:50 +08:00
yunion-ci-robot
e8d6024b65 Merge pull request #5294 from ioito/automated-cherry-pick-of-#5290-upstream-release-2.12
Automated cherry pick of #5290: 添加azure region city信息
2020-02-28 13:15:20 +08:00
Qu Xuan
2702fd9419 添加azure region city信息 2020-02-28 11:38:09 +08:00
wanyaoqi
f876e3ec66 fix nic get pci address 2020-02-27 23:06:20 +08:00
yunion-ci-robot
13972ead36 Merge pull request #5235 from ioito/automated-cherry-pick-of-#5231-upstream-release-2.12
Automated cherry pick of #5231: fix: 添加磁盘回滚snapshot日志
2020-02-26 15:56:13 +08:00
yunion-ci-robot
64bf28f065 Merge pull request #5246 from ioito/automated-cherry-pick-of-#5242-upstream-release-2.12
Automated cherry pick of #5242: fix: 避免根磁盘小于镜像大小导致创建失败
2020-02-26 10:15:11 +08:00
yunion-ci-robot
6afb54f2ff Merge pull request #5251 from ioito/automated-cherry-pick-of-#5247-upstream-release-2.12
Automated cherry pick of #5247: fix: 返回azure api 错误信息
2020-02-25 21:05:12 +08:00
Qu Xuan
fd556c8cb3 fix: 返回azure api 错误信息 2020-02-25 19:32:09 +08:00
Qu Xuan
26657d8213 fix: 避免根磁盘小于镜像大小导致创建失败 2020-02-25 15:41:28 +08:00
Qu Xuan
a2ab3e2e37 fix: 添加磁盘回滚snapshot日志 2020-02-24 16:11:19 +08:00
yunion-ci-robot
f7b7c2ca79 Merge pull request #5230 from rainzm/automated-cherry-pick-of-#5186-upstream-release-2.12
Automated cherry pick of #5186: feature(notify): Validate config
2020-02-24 15:23:08 +08:00
Rain
7e4b8c2f54 feature(notify): Validate config 2020-02-24 14:13:00 +08:00
Zexi Li
ae5199417b Merge pull request #5209 from swordqiu/automated-cherry-pick-of-#5208-upstream-release-2.12
Automated cherry pick of #5208: fix: reset paging limit to 2048 from 20
2020-02-21 16:46:18 +08:00
Zexi Li
84d9282f61 Merge pull request #5221 from rainzm/automated-cherry-pick-of-#5217-upstream-release-2.12
Automated cherry pick of #5217: fix: Storage filter not work for Esxi
2020-02-21 16:44:56 +08:00
yunion-ci-robot
c8642a5055 Merge pull request #5204 from tb365/automated-cherry-pick-of-#5199-upstream-release-2.12
Automated cherry pick of #5199: cloud region city list add default limit 2048
2020-02-21 16:06:40 +08:00
Rain
0001287411 fix: Storage filter not work for Esxi
1. SESXiGuestDriver.DoScheduleStorageFilter should return true.
2. ESXi's SHost.GetStorageSizeMB should return the capacity of all the
storage belonging to it.
2020-02-21 15:14:55 +08:00
yunion-ci-robot
8bbbe29d74 Merge pull request #5203 from ioito/automated-cherry-pick-of-#5198-upstream-release-2.12
Automated cherry pick of #5198: fix: 修复azure坐标问题,添加新的azure region城市信息
2020-02-20 20:58:29 +08:00
yunion-ci-robot
33efca986e Merge pull request #5195 from ioito/automated-cherry-pick-of-#5191-upstream-release-2.12
Automated cherry pick of #5191: fix: add aliyun new region info
2020-02-20 16:14:30 +08:00
TangBin
9463d2647a huawei cloud create bugfix 2020-02-20 15:34:06 +08:00
TangBin
4c9a53e119 huawei cloud create bugfix 2020-02-20 15:33:08 +08:00
TangBin
055edec299 cloud region city list add default limit 2048 2020-02-20 15:33:08 +08:00
Qiu Jian
9e8a0ec8c4 fix: reset paging limit to 2048 from 20 2020-02-20 15:19:41 +08:00
Qu Xuan
96ba08a0be fix: 修复azure坐标问题,添加新的azure region城市信息 2020-02-20 14:59:09 +08:00
Qu Xuan
c0d220b0be fix: add aliyun new region info 2020-02-20 11:08:26 +08:00
yunion-ci-robot
1c6e52e23b Merge pull request #5182 from tb365/automated-cherry-pick-of-#5181-upstream-release-2.12
Automated cherry pick of #5181: aws listener sync fix
2020-02-19 19:19:27 +08:00
tangbin
6482f61358 huawei http listener sync fix 2020-02-19 18:46:27 +08:00
tangbin
2cb5c91d3f aws rebuild root fix 2020-02-19 18:46:27 +08:00
tangbin
efce8fcce2 aws listener sync fix 2020-02-19 18:46:27 +08:00
yunion-ci-robot
4c9789a3cf Merge pull request #5147 from tb365/automated-cherry-pick-of-#5145-upstream-release-2.12
Automated cherry pick of #5145: qcloud elb sync
2020-02-19 16:07:29 +08:00
Yousong Zhou
39d6ec3f99 Merge pull request #5174 from swordqiu/automated-cherry-pick-of-#5173-upstream-release-2.12
Automated cherry pick of #5173: fix: sync cloud provider should change its cloud account's sync_status
2020-02-19 16:02:36 +08:00
yunion-ci-robot
d6ea55819a Merge pull request #5163 from tb365/automated-cherry-pick-of-#5162-upstream-release-2.12
Automated cherry pick of #5162: huawei elb backend vpc validate fix
2020-02-19 13:48:28 +08:00
yunion-ci-robot
ea2cbcb9dd Merge pull request #5171 from ioito/automated-cherry-pick-of-#5167-upstream-release-2.12
Automated cherry pick of #5167: fix: 避免将虚拟机ip同步到弹性网卡
2020-02-19 12:34:28 +08:00
Qiu Jian
6630b2b616 fix: sync cloud provider should change its cloud account's sync_status 2020-02-19 11:54:29 +08:00
Zexi Li
fc81a230d8 Merge pull request #5152 from swordqiu/automated-cherry-pick-of-#5151-upstream-release-2.12
Automated cherry pick of #5151: fix: 1. adjust default response header timer to 30 seconds 2. set default paging limit to 20
2020-02-19 02:29:49 +08:00
Qu Xuan
c187b8815d fix: 避免将虚拟机ip同步到弹性网卡 2020-02-18 15:40:13 +08:00
yunion-ci-robot
ac8deb50c9 Merge pull request #5142 from ioito/automated-cherry-pick-of-#5138-upstream-release-2.12
Automated cherry pick of #5138: fix: 避免未过滤掉同一个network底下的guest
2020-02-18 14:41:40 +08:00
tangbin
3910867270 huawei elb backend vpc validate fix 2020-02-18 14:18:32 +08:00
Qiu Jian
f3e172f9cf fix: 1. adjust default response header timer to 30 seconds 2. set default paging limit to 20 2020-02-18 08:53:59 +08:00
TangBin
9ec6f25468 qcloud elb sync 2020-02-17 22:29:29 +08:00
Qu Xuan
9de5c4b12e fix: 避免未过滤掉同一个network底下的guest 2020-02-17 20:53:42 +08:00
yunion-ci-robot
e2e456f71c Merge pull request #5107 from rainzm/automated-cherry-pick-of-#5106-upstream-release-2.12
Automated cherry pick of #5106: fix(notify): Set some default template
2020-02-14 12:24:04 +08:00
Rain
41ec0eef0c fix(notify): Set some default template 2020-02-13 16:51:33 +08:00
yunion-ci-robot
5d52afc364 Merge pull request #5093 from bistuzx/automated-cherry-pick-of-#5092-upstream-release-2.12
Automated cherry pick of #5092: update account bucket options
2020-02-13 03:49:04 +08:00
张旭
ea34a7eaf8 update account bucket options 2020-02-12 18:27:00 +08:00
yunion-ci-robot
bd81f14238 Merge pull request #5076 from ioito/automated-cherry-pick-of-#5072-upstream-release-2.12
Automated cherry pick of #5072: fix: 忽略无权限的资源标签
2020-02-11 17:20:58 +08:00
Qu Xuan
425ee89d02 fix: 忽略无权限的资源标签 2020-02-10 16:41:40 +08:00
yunion-ci-robot
93146a9906 Merge pull request #5068 from swordqiu/automated-cherry-pick-of-#5065-upstream-release-2.12
Automated cherry pick of #5065: fix: allow empty domain for windows deployment
2020-02-10 10:34:56 +08:00
Qiu Jian
a8ade5bcec fix: allow empty domain for windows deployment 2020-02-10 09:23:30 +08:00
yunion-ci-robot
4dfc5ea305 Merge pull request #5058 from swordqiu/automated-cherry-pick-of-#5054-upstream-release-2.12
Automated cherry pick of #5054: fix: createdAt should not be synced when update
2020-02-09 22:09:57 +08:00
Qiu Jian
ba1c114ef8 fix: createdAt should not be synced when update 2020-02-08 21:30:36 +08:00
yunion-ci-robot
1ba74bed22 Merge pull request #5034 from tb365/automated-cherry-pick-of-#5032-upstream-release-2.12
Automated cherry pick of #5032: aws create with eip fix
2020-02-07 04:50:52 +08:00
tangbin
4e9c24192f aws create with eip fix 2020-02-06 17:57:06 +08:00
yunion-ci-robot
32066e5273 Merge pull request #5025 from ioito/automated-cherry-pick-of-#5021-upstream-release-2.12
Automated cherry pick of #5021: fix: 避免因大小写导致linux未注入默认用户
2020-02-06 13:48:52 +08:00
Qu Xuan
aab846429a fix: 避免因大小写导致linux未注入默认用户 2020-02-06 12:06:17 +08:00
yunion-ci-robot
f44a20ca9b Merge pull request #5017 from swordqiu/automated-cherry-pick-of-#5014-upstream-release-2.12
Automated cherry pick of #5014: fix: support empty dns domain
2020-02-06 09:47:48 +08:00
Qiu Jian
3cddd57f3f fix: support empty dns domain 2020-02-06 03:27:04 +08:00
yunion-ci-robot
cf4f9b5dc2 Merge pull request #5002 from ioito/automated-cherry-pick-of-#4999-upstream-release-2.12
Automated cherry pick of #4999: fix: 避免私有云调整配置匹配不到sku
2020-02-03 16:16:44 +08:00
Qu Xuan
4e34329c79 fix: 避免私有云调整配置匹配不到sku 2020-02-03 12:42:30 +08:00
Zexi Li
220b061ebb Merge pull request #4984 from swordqiu/automated-cherry-pick-of-#4983-upstream-release-2.12
Automated cherry pick of #4983: fix: try allocate host access ip from reserved pool
2020-01-19 10:37:28 +08:00
Qiu Jian
4eecb6ec9b fix: try allocate host access ip from reserved pool 2020-01-19 00:25:52 +08:00
Zexi Li
2a47a4497e Merge pull request #4969 from swordqiu/automated-cherry-pick-of-#4968-upstream-release-2.12
Automated cherry pick of #4968: fix: network-reserve-ip ignores expired reserved ips
2020-01-18 16:04:26 +08:00
Qiu Jian
a28b075517 fix: resolve backport compilation error 2020-01-18 14:38:17 +08:00
Qiu Jian
f50b15c4ef fix: network-reserve-ip ignores expired reserved ips 2020-01-18 14:26:44 +08:00
yunion-ci-robot
155d7c0d21 Merge pull request #4949 from ioito/automated-cherry-pick-of-#4946-upstream-release-2.12
Automated cherry pick of #4946: fix: 腾讯云主机带宽跟随eip带宽变化而变化
2020-01-17 19:44:10 +08:00
Qu Xuan
b7f15ba70a fix: 腾讯云主机带宽跟随eip带宽变化而变化 2020-01-17 13:37:47 +08:00
yunion-ci-robot
2c73e172ce Merge pull request #4882 from tb365/automated-cherry-pick-of-#4880-upstream-release-2.12
Automated cherry pick of #4880: huawei remove backend group bugfix
2020-01-17 11:01:10 +08:00
yunion-ci-robot
302556814a Merge pull request #4908 from ioito/automated-cherry-pick-of-#4904-upstream-release-2.12
Automated cherry pick of #4904: fix: 避免创建azure时指定高级ssd失效
2020-01-16 09:49:07 +08:00
Qu Xuan
08c24e78c3 fix: 避免创建azure时指定高级ssd失效 2020-01-15 18:03:01 +08:00
Zexi Li
3b812a74ce Merge pull request #4896 from rainzm/automated-cherry-pick-of-#4895-upstream-release-2.12
Automated cherry pick of #4895: fix(notify): Update template
2020-01-14 18:23:41 +08:00
Rain
ddfbaefe15 fix(notify): Update template 2020-01-14 18:11:51 +08:00
TangBin
e69130e2d3 aliyun backendgroup bugfix 2020-01-14 15:52:28 +08:00
TangBin
60fa2466d0 aws backendgroup delete bugfix 2020-01-14 15:52:28 +08:00
TangBin
33a1c9ad9f aws sync routetable 2020-01-14 15:52:28 +08:00
TangBin
0b4bf4ad75 huawei remove backend group bugfix 2020-01-14 15:52:28 +08:00
yunion-ci-robot
40633d71b2 Merge pull request #4867 from ioito/automated-cherry-pick-of-#4862-upstream-release-2.12
Automated cherry pick of #4862: fix: 仅kvm需要去判断是否需要关机调整配置,公有云私有云默认不需要
2020-01-14 03:00:03 +08:00
yunion-ci-robot
ed4880dedd Merge pull request #4841 from ioito/automated-cherry-pick-of-#4837-upstream-release-2.12
Automated cherry pick of #4837: fix: 添加磁盘创建失败日志
2020-01-14 02:56:03 +08:00
yunion-ci-robot
a7b33d0763 Merge pull request #4853 from ioito/automated-cherry-pick-of-#4849-upstream-release-2.12
Automated cherry pick of #4849: fix: aliyun rule fix
2020-01-14 02:22:02 +08:00
Zexi Li
06ef8007de Merge pull request #4846 from ioito/automated-cherry-pick-of-#4842-upstream-release-2.12
Automated cherry pick of #4842: fix: 添加安全组操作日志
2020-01-13 20:50:31 +08:00
Qu Xuan
dd4f1f5e2b fix: 仅kvm需要去判断是否需要关机调整配置,公有云私有云默认不需要 2020-01-13 19:17:35 +08:00
Qu Xuan
5ef620eda6 fix: aliyun rule fix 2020-01-13 17:45:32 +08:00
Qu Xuan
8af74bde26 fix: 添加安全组操作日志 2020-01-13 15:28:20 +08:00
Qu Xuan
10970b5293 fix: 添加磁盘创建失败日志 2020-01-13 14:56:09 +08:00
yunion-ci-robot
0dc76d6fce Merge pull request #4803 from tb365/automated-cherry-pick-of-#4801-upstream-release-2.12
Automated cherry pick of #4801: kvm elb listener update bugfix
2020-01-10 19:53:01 +08:00
TangBin
713274cb76 kvm elb listener update bugfix 2020-01-10 18:49:36 +08:00
yunion-ci-robot
3c442a2ceb Merge pull request #4772 from wanyaoqi/automated-cherry-pick-of-#4768-upstream-release-2.12
Automated cherry pick of #4768: fix guest start no task complete
2020-01-10 10:24:59 +08:00
yunion-ci-robot
59f44aa283 Merge pull request #4788 from yousong/automated-cherry-pick-of-#4784-upstream-release-2.12
Automated cherry pick of #4784: dnsrecords: add helper methods
2020-01-10 10:16:59 +08:00
Yousong Zhou
2bc6f73bf3 dns: chain load records for cname 2020-01-09 23:24:26 +08:00
Yousong Zhou
c47aa60243 dns: prepare for responding with A record of cname value 2020-01-09 23:24:26 +08:00
Yousong Zhou
d7e1879274 dnsrecords: add helper methods 2020-01-09 23:24:25 +08:00
wanyaoqi
b10450232b fix guest start no task complete 2020-01-09 17:14:39 +08:00
yunion-ci-robot
fd30e1f7d6 Merge pull request #4747 from yousong/automated-cherry-pick-of-#4724-upstream-release-2.12
Automated cherry pick of #4724: wires: lift name length, charset constraint
2020-01-08 23:43:00 +08:00
Yousong Zhou
2c4b5d83ba wires: lift name length, charset constraint 2020-01-08 19:15:56 +08:00
yunion-ci-robot
b822543513 Merge pull request #4732 from ioito/automated-cherry-pick-of-#4728-upstream-release-2.12
Automated cherry pick of #4728: fix: eip duplicate name
2020-01-08 19:03:59 +08:00
Qu Xuan
c5ad5c4fd5 fix: eip duplicate name 2020-01-08 18:12:37 +08:00
yunion-ci-robot
24c3b516ba Merge pull request #4696 from rainzm/automated-cherry-pick-of-#4695-upstream-release-2.12
Automated cherry pick of #4695: fix(glance): Cancel pending usage of image quota correctly
2020-01-08 16:13:57 +08:00
yunion-ci-robot
ea0f474128 Merge pull request #4702 from tb365/automated-cherry-pick-of-#4701-upstream-release-2.12
Automated cherry pick of #4701: azure skus sync fix
2020-01-08 15:58:57 +08:00
Zexi Li
6f70d31f6e Merge pull request #4718 from wanyaoqi/automated-cherry-pick-of-#4714-upstream-release-2.12
Automated cherry pick of #4714: set subimage some field nullable
2020-01-08 15:43:03 +08:00
wanyaoqi
5e67253bcc set subimage some field nullable 2020-01-08 15:38:21 +08:00
yunion-ci-robot
650888c10f Merge pull request #4688 from yousong/automated-cherry-pick-of-#4683-upstream-release-2.12
Automated cherry pick of #4683: hostman: distro name OpenWrt instead of OpenWRT
2020-01-08 12:55:57 +08:00
yunion-ci-robot
24c645025f Merge pull request #4654 from ioito/automated-cherry-pick-of-#4650-upstream-release-2.12
Automated cherry pick of #4650: fix: 避免创建rds account, database后未设置exteranl_id
2020-01-08 11:40:59 +08:00
yunion-ci-robot
5faa172bda Merge pull request #4641 from ioito/automated-cherry-pick-of-#4636-upstream-release-2.12
Automated cherry pick of #4636: fix: 加强密码校验
2020-01-08 11:36:58 +08:00
TangBin
481599ec59 huawei redis sync fix 2020-01-08 11:31:51 +08:00
TangBin
f73152496f huawei network default gateway fix 2020-01-08 11:31:39 +08:00
TangBin
51ccda9d6e network create GuestIpPrefix fix 2020-01-08 11:31:39 +08:00
Rain
72bc05401f 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:27:48 +08:00
yunion-ci-robot
574b3fe93d Merge pull request #4693 from ioito/automated-cherry-pick-of-#4685-upstream-release-2.12
Automated cherry pick of #4685: fix: next marker format
2020-01-08 10:07:58 +08:00
Zexi Li
e1fc0dac25 Merge pull request #4679 from swordqiu/automated-cherry-pick-of-#4676-upstream-release-2.12
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:24 +08:00
yunion-ci-robot
d1b60cb99f Merge pull request #4670 from ioito/automated-cherry-pick-of-#4656-upstream-release-2.12
Automated cherry pick of #4656: fix: 避免拥有带宽包的腾讯云创建机器失败
2020-01-07 18:05:57 +08:00
Qu Xuan
7939127ce1 fix: next marker format 2020-01-07 18:05:18 +08:00
Yousong Zhou
674c1a278c hostman: openwrt: deploy public key for root 2020-01-07 18:01:57 +08:00
Yousong Zhou
cffa941453 hostman: split DeployAuthorizedKeys() 2020-01-07 18:01:57 +08:00
Yousong Zhou
4e7ca3eddb hostman: openwrt: support deploy networking scripts 2020-01-07 18:01:57 +08:00
Yousong Zhou
6e2a684330 hostman: openwrt: deploy hostname with board config 2020-01-07 18:01:57 +08:00
Yousong Zhou
d19a14ec78 hostman: distro name OpenWrt instead of OpenWRT 2020-01-07 18:01:57 +08:00
yunion-ci-robot
cb2f1aa4b1 Merge pull request #4662 from ioito/automated-cherry-pick-of-#4658-upstream-release-2.12
Automated cherry pick of #4658: fix: 避免同步安全组失败后,没有任何日志记录
2020-01-07 17:07:56 +08:00
Qiu Jian
ce8c31c84a fix: guest network default share scope should be system if non-default-domain-projects is off 2020-01-07 16:53:02 +08:00
Qu Xuan
4f5f4a60e2 fix: 避免拥有带宽包的腾讯云创建机器失败 2020-01-07 15:05:49 +08:00
Qu Xuan
7e040d7aff fix: 避免同步安全组失败后,没有任何日志记录 2020-01-07 11:50:19 +08:00
yunion-ci-robot
91af65ca94 Merge pull request #4646 from swordqiu/automated-cherry-pick-of-#4645-upstream-release-2.12
Automated cherry pick of #4645: fix: comment out TestDialTimeout
2020-01-06 15:12:59 +08:00
Qu Xuan
0eadd02531 fix: 避免创建rds account, database后未设置exteranl_id 2020-01-06 13:39:56 +08:00
Qiu Jian
eb9b413e43 fix: comment out TestDialTimeout 2020-01-06 13:09:48 +08:00
Qu Xuan
4bb58627e3 fix: 加强密码校验 2020-01-06 11:52:21 +08:00
Zexi Li
c15e23d96d Merge pull request #4626 from swordqiu/automated-cherry-pick-of-#4557-upstream-release-2.12
Automated cherry pick of #4557: add cloud account create&update options
2020-01-05 11:09:59 +08:00
Qiu Jian
cf4241894e fix: fail to compile climc 2020-01-05 09:39:18 +08:00
张旭
0c367976e0 add cloud account create&update options 2020-01-05 09:34:50 +08:00
Zexi Li
6cb171533d Merge pull request #4613 from ioito/automated-cherry-pick-of-#4609-upstream-release-2.12
Automated cherry pick of #4609: fix: 避免仅删除value时,行为演变为删除标签
2020-01-04 23:18:13 +08:00
Zexi Li
b1984e6634 Merge pull request #4605 from rainzm/automated-cherry-pick-of-#4602-upstream-release-2.12
Automated cherry pick of #4602: fix(notify): Fix the error of filter about contacts
2020-01-04 22:29:38 +08:00
Rain
aff70fedc1 fix(notify): Fix the error of filter about contacts 2020-01-04 22:23:54 +08:00
Qu Xuan
7f37e300ef fix: 避免仅删除value时,行为演变为删除标签 2020-01-04 22:17:32 +08:00
Zexi Li
be2491a89b Merge pull request #4573 from bistuzx/automated-cherry-pick-of-#4557-upstream-release-2.12
Automated cherry pick of #4557: add cloud account create&update options
2020-01-04 21:10:42 +08:00
Jian Qiu
6960dbbf54 Automated cherry pick of #4527: fix: httpclient timeout value cleanup, use notimeout client for oss (#4528)
* 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

* add GetFreePort methods
2020-01-04 20:51:36 +08:00
yunion-ci-robot
a1963e5837 Merge pull request #4578 from ioito/automated-cherry-pick-of-#4574-upstream-release-2.12
Automated cherry pick of #4574: fix: 子网删除忽略弹性网卡
2020-01-04 20:31:40 +08:00
张旭
f5a40c3e02 add cloud account create&update options 2020-01-04 20:25:42 +08:00
yunion-ci-robot
bccf1dc67f Merge pull request #4585 from ioito/automated-cherry-pick-of-#4581-upstream-release-2.12
Automated cherry pick of #4581: fix: 修复zstack安全组创建失败问题
2020-01-04 20:13:37 +08:00
Qu Xuan
fd05116707 fix: 修复zstack安全组创建失败问题 2020-01-04 20:02:32 +08:00
yunion-ci-robot
30e451afa7 Merge pull request #4562 from ioito/automated-cherry-pick-of-#4558-upstream-release-2.12
Automated cherry pick of #4558: fix: openstack eip dissociate optimized
2020-01-04 19:59:36 +08:00
Zexi Li
c808bfc47d Merge pull request #4565 from swordqiu/automated-cherry-pick-of-#4564-upstream-release-2.12
Automated cherry pick of #4564: fix: minio fail to set object metadata
2020-01-04 19:52:25 +08:00
Qu Xuan
ebd9c788aa fix: 子网删除忽略弹性网卡 2020-01-04 19:25:10 +08:00
Qu Xuan
6b0d54f9c2 fix: openstack eip dissociate optimized 2020-01-04 18:44:35 +08:00
Qiu Jian
164de8a9cd fix: minio fail to set object metadata 2020-01-04 18:36:43 +08:00
Zexi Li
74865802ba Merge pull request #4524 from zexi/automated-cherry-pick-of-#4520-upstream-release-2.12
Automated cherry pick of #4520: baremetal: fix megaraid check jbod always disabled
2020-01-03 21:52:14 +08:00
yunion-ci-robot
0b2eb093af Merge pull request #4517 from ioito/automated-cherry-pick-of-#4513-upstream-release-2.12
Automated cherry pick of #4513: fix: 腾讯云不支持描述字段参数
2020-01-03 21:31:41 +08:00
Zexi Li
02982f7850 baremetal: fix megaraid check jbod always disabled 2020-01-03 21:23:05 +08:00
Qu Xuan
1db48ed31f fix: 腾讯云不支持描述字段参数 2020-01-03 20:46:29 +08:00
Zexi Li
4422faf411 Merge pull request #4499 from swordqiu/automated-cherry-pick-of-#4498-upstream-release-2.12
Automated cherry pick of #4498: fix: allow delete cloudaccount with auto-sync enabled
2020-01-03 19:06:29 +08:00
yunion-ci-robot
a907289d0f Merge pull request #4503 from rainzm/automated-cherry-pick-of-#4497-upstream-release-2.12
Automated cherry pick of #4497: fix(huawei): Add 'X-Project-ID' header for huawei nat reuqest
2020-01-03 19:05:35 +08:00
yunion-ci-robot
3d40f4dd9d Merge pull request #4496 from ioito/automated-cherry-pick-of-#4492-upstream-release-2.12
Automated cherry pick of #4492: fix: 修复provider为空的套餐
2020-01-03 18:36:35 +08:00
Rain
194f8f9916 fix(huawei): Add 'X-Project-ID' header for huawei nat reuqest 2020-01-03 17:19:59 +08:00
Qiu Jian
f912464b49 fix: allow delete cloudaccount with auto-sync enabled 2020-01-03 17:13:35 +08:00
Qu Xuan
d8f148f791 fix: 修复provider为空的套餐 2020-01-03 15:55:39 +08:00
Zexi Li
58a4a5cc29 Merge pull request #4484 from rainzm/automated-cherry-pick-of-#4483-upstream-release-2.12
Automated cherry pick of #4483: fix(notify): Always update websocket config
2020-01-03 11:22:29 +08:00
Zexi Li
1acaac1241 Merge pull request #4482 from swordqiu/automated-cherry-pick-of-#4478-upstream-release-2.12
Automated cherry pick of #4478: fix: bucket list object may skip first matched object
2020-01-03 11:01:37 +08:00
Rain
58645ae956 fix(notify): Always update websocket config 2020-01-02 18:17:09 +08:00
Qiu Jian
d718738084 fix: sort objects and directories 2020-01-02 17:48:58 +08:00
Qiu Jian
9944c0d655 fix: bucket list object may skip first matched object 2020-01-02 17:48:58 +08:00
yunion-ci-robot
de741bd1e3 Merge pull request #4466 from yousong/automated-cherry-pick-of-#4464-upstream-release-2.12
Automated cherry pick of #4464: networks: 确保外部network也有ifname_hint
2020-01-01 15:31:34 +08:00
Yousong Zhou
19a1f90a54 networks: 确保外部network也有ifname_hint 2020-01-01 10:52:37 +08:00
yunion-ci-robot
123b7de76e Merge pull request #4461 from ioito/automated-cherry-pick-of-#4459-upstream-release-2.12
Automated cherry pick of #4459: fix: openstack image: vmdk -> qcow2
2020-01-01 09:30:33 +08:00
yunion-ci-robot
4c83dc9e21 Merge pull request #4458 from ioito/automated-cherry-pick-of-#4455-upstream-release-2.12
Automated cherry pick of #4455: fix: 避免nova external_id duplicate
2019-12-31 23:29:33 +08:00
Qu Xuan
c8878ca5a5 fix: openstack image: vmdk -> qcow2 2019-12-31 19:55:54 +08:00
Qu Xuan
ae8d10e18e fix: 避免nova external_id duplicate 2019-12-31 18:47:44 +08:00
yunion-ci-robot
710e27ea40 Merge pull request #4447 from wanyaoqi/automated-cherry-pick-of-#4445-upstream-release-2.12
Automated cherry pick of #4445: not return on recv packet failed
2019-12-31 17:29:32 +08:00
yunion-ci-robot
b8bd0afeeb Merge pull request #4437 from yousong/automated-cherry-pick-of-#4435-upstream-release-2.12
Automated cherry pick of #4435: networks: newIfnameHint: 可读性改善
2019-12-31 17:13:33 +08:00
wanyaoqi
49eb90b3d2 not return on recv packet failed 2019-12-31 17:04:27 +08:00
Yousong Zhou
4ddf168402 guestnetworks: 加强ifname内容判断 2019-12-31 14:24:39 +08:00
Yousong Zhou
cafdab7d61 networks: newIfnameHint: 可读性改善 2019-12-31 14:24:39 +08:00
yunion-ci-robot
71d38f4b88 Merge pull request #4425 from wanyaoqi/automated-cherry-pick-of-#4423-upstream-release-2.12
Automated cherry pick of #4423: region MakeCloudProviderInfo instance snapshots
2019-12-31 01:28:32 +08:00
yunion-ci-robot
ba6045f875 Merge pull request #4400 from ioito/automated-cherry-pick-of-#4398-upstream-release-2.12
Automated cherry pick of #4398: fix: 避免创建时localstorage为空导致校验失败
2019-12-31 01:21:33 +08:00
yunion-ci-robot
a96d820651 Merge pull request #4382 from ioito/automated-cherry-pick-of-#4380-upstream-release-2.12
Automated cherry pick of #4380: fix: 支持过滤有admin_secgrp的虚拟机
2019-12-31 01:03:32 +08:00
yunion-ci-robot
529a01df4f Merge pull request #4389 from ioito/automated-cherry-pick-of-#4387-upstream-release-2.12
Automated cherry pick of #4387: fix: 避免私有云找不到对应的套餐
2019-12-31 00:53:36 +08:00
yunion-ci-robot
39b8b501fe Merge pull request #4396 from ioito/automated-cherry-pick-of-#4394-upstream-release-2.12
Automated cherry pick of #4394: fix: 避免同步将eip同步到弹性网卡里面
2019-12-31 00:48:33 +08:00
Zexi Li
2fc2ff8721 Merge pull request #4407 from wanyaoqi/automated-cherry-pick-of-#4405-upstream-release-2.12
Automated cherry pick of #4405: fix panic on fstab no content
2019-12-31 00:43:14 +08:00
yunion-ci-robot
2d923f2dcf Merge pull request #4422 from tb365/automated-cherry-pick-of-#4420-upstream-release-2.12
Automated cherry pick of #4420: update rbac default policy
2019-12-31 00:22:32 +08:00
wanyaoqi
e662b4a750 region MakeCloudProviderInfo instance snapshots
- MakeCloudProviderInfo: fix panic on account is nil
- GetSnapshotsNotInInstanceSnapshot: add filter disk_id
2019-12-30 21:20:17 +08:00
TangBin
bf945704b6 update rbac default policy 2019-12-30 19:14:45 +08:00
yunion-ci-robot
20468aab12 Merge pull request #4414 from yousong/automated-cherry-pick-of-#4412-upstream-release-2.12
Automated cherry pick of #4412: networks: make ifname hint also valid qemu identifier
2019-12-30 18:54:33 +08:00
Yousong Zhou
e4fad874ac networks: make ifname hint also valid qemu identifier 2019-12-30 18:14:37 +08:00
Zexi Li
11facb6d01 Merge pull request #4403 from swordqiu/automated-cherry-pick-of-#4401-upstream-release-2.12
Automated cherry pick of #4401: fix: host-update ipmi and host-sync-config support
2019-12-30 17:59:03 +08:00
wanyaoqi
238ba18829 fix panic on fstab no content 2019-12-30 16:27:03 +08:00
Qiu Jian
081f6de5f7 fix: host-update ipmi and host-sync-config support 2019-12-30 16:14:22 +08:00
Qu Xuan
dd23fabbd4 fix: 避免创建时localstorage为空导致校验失败 2019-12-30 15:34:44 +08:00
Qu Xuan
065cd2a5a6 fix: 避免同步将eip同步到弹性网卡里面 2019-12-30 14:55:12 +08:00
Qu Xuan
8d953b6937 fix: 支持过滤有admin_secgrp的虚拟机 2019-12-30 10:51:56 +08:00
Qu Xuan
71ad4a7baf fix: 避免私有云找不到对应的套餐 2019-12-30 10:42:36 +08:00
yunion-ci-robot
6c0a2b94fb Merge pull request #4349 from ioito/automated-cherry-pick-of-#4347-upstream-release-2.12
Automated cherry pick of #4347: fix: 支持同步经典网络ip地址
2019-12-30 09:18:31 +08:00
yunion-ci-robot
e02b675ee1 Merge pull request #4365 from ioito/automated-cherry-pick-of-#4362-upstream-release-2.12
Automated cherry pick of #4362: fix: 更正腾讯云磁盘创建时间
2019-12-29 22:04:39 +08:00
yunion-ci-robot
ae0df7f083 Merge pull request #4385 from ioito/automated-cherry-pick-of-#4383-upstream-release-2.12
Automated cherry pick of #4383: fix: 修复接收参数异常问题
2019-12-28 14:18:33 +08:00
Qu Xuan
6c51584720 fix: 支持同步经典网络ip地址 2019-12-28 13:18:37 +08:00
Qu Xuan
7ee8d72fe3 fix: 更正腾讯云磁盘创建时间 2019-12-28 13:07:28 +08:00
yunion-ci-robot
4491605dad Merge pull request #4377 from ioito/automated-cherry-pick-of-#4375-upstream-release-2.12
Automated cherry pick of #4375: fix: 避免因太多锁导致删除安全组task失败
2019-12-28 09:53:35 +08:00
Qu Xuan
7555e13ed6 fix: 修复接收参数异常问题 2019-12-27 20:35:12 +08:00
Qu Xuan
8518ce8ab5 fix: 避免因太多锁导致删除安全组task失败 2019-12-27 16:24:01 +08:00
Zexi Li
3a48f06c6e Merge pull request #4370 from swordqiu/automated-cherry-pick-of-#4368-upstream-release-2.12
Automated cherry pick of #4368: fix: alter user email charset to utf8
2019-12-27 14:28:59 +08:00
Qiu Jian
7f4f49e05b fix: alter user email charset to utf8 2019-12-27 14:12:55 +08:00
yunion-ci-robot
fd2843b2aa Merge pull request #4356 from swordqiu/automated-cherry-pick-of-#4354-upstream-release-2.12
Automated cherry pick of #4354: fix: cloudaccount try get info of empty project
2019-12-27 11:28:31 +08:00
yunion-ci-robot
338a00de6d Merge pull request #4351 from ioito/automated-cherry-pick-of-#4336-upstream-release-2.12
Automated cherry pick of #4336: fix: 优化支持openstack重装系统
2019-12-27 01:14:30 +08:00
yunion-ci-robot
1e182fdf78 Merge pull request #4298 from wanyaoqi/automated-cherry-pick-of-#4296-upstream-release-2.12
Automated cherry pick of #4296: snapshot misc bugfix
2019-12-27 01:10:30 +08:00
yunion-ci-robot
a720cd7a4d Merge pull request #4335 from wanyaoqi/automated-cherry-pick-of-#4333-upstream-release-2.12
Automated cherry pick of #4333: eip add distinct account
2019-12-27 01:02:35 +08:00
Qiu Jian
c7f3b5014e fix: cloudaccount try get info of empty project 2019-12-26 22:43:12 +08:00
Qu Xuan
447c1149b3 fix: 优化支持openstack重装系统 2019-12-26 21:53:27 +08:00
Zexi Li
c6b9908536 Merge pull request #4328 from swordqiu/automated-cherry-pick-of-#4326-upstream-release-2.12
Automated cherry pick of #4326: fix: baremetal diskconfig empty adaptor index
2019-12-26 21:15:59 +08:00
Zexi Li
047492e6ea Merge pull request #4346 from swordqiu/automated-cherry-pick-of-#4344-upstream-release-2.12
Automated cherry pick of #4344: fix: reduce action log for keystone authentication event
2019-12-26 21:12:21 +08:00
Qiu Jian
74b9311d33 fix: reduce action log for keystone authentication event 2019-12-26 20:55:31 +08:00
yunion-ci-robot
555178c3eb Merge pull request #4324 from swordqiu/automated-cherry-pick-of-#4322-upstream-release-2.12
Automated cherry pick of #4322: fix: SyncEip时同步项目应该在同步主机信息之前
2019-12-26 15:53:34 +08:00
Zexi Li
48bd78fd68 Merge pull request #4321 from swordqiu/automated-cherry-pick-of-#4319-upstream-release-2.12
Automated cherry pick of #4319: fix: bucket list objects with marker and limit
2019-12-26 15:46:41 +08:00
wanyaoqi
a7269ed6e1 eip add distinct account 2019-12-26 14:46:50 +08:00
yunion-ci-robot
080dc22420 Merge pull request #4301 from yousong/automated-cherry-pick-of-#4299-upstream-release-2.12
Automated cherry pick of #4299: hostman: different error message for different error reason
2019-12-26 11:05:32 +08:00
yunion-ci-robot
44daad6372 Merge pull request #4315 from ioito/automated-cherry-pick-of-#4313-upstream-release-2.12
Automated cherry pick of #4313: fix: 避免在域管理后台rules不可见
2019-12-26 01:55:15 +08:00
yunion-ci-robot
08cb53823f Merge pull request #4309 from ioito/automated-cherry-pick-of-#4307-upstream-release-2.12
Automated cherry pick of #4307: fix: 同步openstack宿主机关闭服务后状态
2019-12-26 01:51:14 +08:00
Qiu Jian
481b8cf1a2 fix: baremetal diskconfig empty adaptor index 2019-12-26 01:13:16 +08:00
Qiu Jian
d46f1a6f4c fix: SyncEip时同步项目应该在同步主机信息之前 2019-12-26 01:02:09 +08:00
Qiu Jian
ace9f6e2d4 remove httperrors 2019-12-26 00:51:40 +08:00
Qiu Jian
4cc6f3e999 fix fmt issue 2019-12-26 00:50:40 +08:00
Qiu Jian
d6f9eed05a fix: minor fix 2019-12-26 00:50:40 +08:00
Qiu Jian
8827d2b15c fix: bucket list objects with marker and limit 2019-12-26 00:50:40 +08:00
Qu Xuan
9e4efab13c fix: 避免在域管理后台rules不可见 2019-12-25 17:15:01 +08:00
yunion-ci-robot
2835fed7dc Merge pull request #4306 from ioito/automated-cherry-pick-of-#4304-upstream-release-2.12
Automated cherry pick of #4304: fix: 支持忽略cloudaccount健康检查
2019-12-25 17:11:13 +08:00
Qu Xuan
39753f5a76 fix: 同步openstack宿主机关闭服务后状态 2019-12-25 16:27:51 +08:00
Qu Xuan
c7f577e08e fix: 支持忽略cloudaccount健康检查 2019-12-25 16:10:03 +08:00
yunion-ci-robot
22239cb5ab Merge pull request #4295 from ioito/automated-cherry-pick-of-#4293-upstream-release-2.12
Automated cherry pick of #4293: fix: 避免未接收到tenant参数
2019-12-25 16:03:15 +08:00
Yousong Zhou
bd80c3a399 hostman: fsdriver: fix hostname deployment for openwrt
We will need to add native uci support later
2019-12-25 16:02:23 +08:00
Yousong Zhou
7c5cd59d90 hostman: add default values for host config 2019-12-25 16:02:23 +08:00
Yousong Zhou
ac6a97fea6 networks: different indent level for asymmetric branches 2019-12-25 16:02:23 +08:00
Yousong Zhou
a81d7c749a hostman: different error message for different error reason 2019-12-25 16:02:23 +08:00
wanyaoqi
265e3f6732 snapshot misc bugfix 2019-12-25 15:53:27 +08:00
Qu Xuan
c17b058baa fix: 避免未接收到tenant参数 2019-12-25 14:41:15 +08:00
yunion-ci-robot
ea12386358 Merge pull request #4275 from rainzm/automated-cherry-pick-of-#4274-upstream-release-2.12
Automated cherry pick of #4274: fix(notify): Fix for user cache and list contacts
2019-12-23 21:11:15 +08:00
Rain
72a787da9a fix(notify): Fix for user cache and list contacts 2019-12-23 20:49:25 +08:00
yunion-ci-robot
f0b166a302 Merge pull request #4279 from tb365/automated-cherry-pick-of-#4277-upstream-release-2.12
Automated cherry pick of #4277: add services query permission
2019-12-23 18:35:12 +08:00
TangBin
68fadf1c18 add services query permission 2019-12-23 18:14:52 +08:00
yunion-ci-robot
a448a6f3b9 Merge pull request #4271 from swordqiu/automated-cherry-pick-of-#4270-upstream-release-2.12
Automated cherry pick of #4270: feature: support centos 8 deployment. centos 8 requiest NetworkManager
2019-12-23 10:43:14 +08:00
Qiu Jian
f6a3a487d8 feature: support centos 8 deployment. centos 8 requiest NetworkManager 2019-12-21 18:43:42 +08:00
yunion-ci-robot
372e52b638 Merge pull request #4230 from yousong/automated-cherry-pick-of-#4228-upstream-release-2.12
Automated cherry pick of #4228: mcclient: proxy setting aware by using httputils' transport
2019-12-20 21:28:06 +08:00
yunion-ci-robot
37460bddb9 Merge pull request #4243 from rainzm/automated-cherry-pick-of-#4232-upstream-release-2.12
Automated cherry pick of #4232: Fix(notify): Unified the api params and fix some bug.
2019-12-20 16:04:07 +08:00
Rain
c968eb3fe1 feat(notify): Add default email tempalte with topic IMAGE_ACTIVED 2019-12-20 11:41:59 +08:00
Rain
3e3a1381a7 Fix(notify): Unified the api params and fix some bug.
1. Config Verify 和 Contact 的 InitalizeData 写得过于直接了。
会导致正常的数据被覆盖。实际上,数据的Init只需要更换数据
库的时候更新,如何判断数据库要被更新了,就是判断新出现的
column 有没有非零值的,如果有,就说明数据库不是第一次更新。

2. 前端的请求经过yunionapi,最终会调用climc里面注册的ResourceManager,
所以这个地方一定要和后端的参数处理统一。之前因为添加 uname
的支持破坏了这个地方的统一,虽然climc可以调用成功但是前端接口调用会失败。

3. Resend 的bug,会导致任务的阻塞。

4. 为了兼容kapacitor对climc
notify的调用,分成了notify和notify-batch两个命令。
2019-12-20 11:41:59 +08:00
yunion-ci-robot
e4666ffb85 Merge pull request #4234 from tb365/automated-cherry-pick-of-#4184-upstream-release-2.12
Automated cherry pick of #4184: elastic skus query bugfix
2019-12-20 11:27:04 +08:00
yunion-ci-robot
bd0f6b9771 Merge pull request #4240 from zexi/automated-cherry-pick-of-#4238-upstream-release-2.12
Automated cherry pick of #4238: baremetal: fix register input params lost
2019-12-20 00:16:06 +08:00
Zexi Li
90bf94ad5e baremetal: fix register input params lost 2019-12-19 21:12:48 +08:00
TangBin
aedb61c647 add cache skus query params 2019-12-19 18:17:40 +08:00
TangBin
fd4434d7af add zone service filter 2019-12-19 18:17:40 +08:00
TangBin
7045af048c zone customize columns add region_external_id 2019-12-19 18:17:40 +08:00
TangBin
aa93908f6d get elasitc cache account password api 2019-12-19 18:17:40 +08:00
TangBin
ec63cb5d05 elastic skus query bugfix 2019-12-19 18:17:40 +08:00
Yousong Zhou
8999868e5f httputils: unset DisableCompression=true 2019-12-19 15:04:04 +08:00
Yousong Zhou
ae2a798926 mcclient: proxy setting aware by using httputils' transport 2019-12-19 15:04:04 +08:00
yunion-ci-robot
e4d2d67cd2 Merge pull request #4222 from rainzm/automated-cherry-pick-of-#4221-upstream-release-2.12
Automated cherry pick of #4221: fix(region): Fix the bug of snapshotpolicy's list with details
2019-12-19 11:10:05 +08:00
Rain
72e5e95a0a fix(region): Fix the bug of snapshotpolicy's list with details
snapshotpolicy的GetCustomizeColumns和GetExtraDetails本来写的就有问题,
不过在2.12版本没有展示出来,因为2.13版本参数结构化的原因,details获取
的时候extraDict和jsonDict的更新逻辑有所改变,使得query携带着list第一
个item的数据一直存在整个循环之中,最终数据都是一样的。
2019-12-19 10:50:37 +08:00
Zexi Li
211653ea5f Merge pull request #4218 from rainzm/automated-cherry-pick-of-#4217-upstream-release-2.12
Automated cherry pick of #4217: bugfix(notify): Fix the bug of notify config and verify
2019-12-18 20:49:40 +08:00
Rain
6895168a6c bugfix(notify): Fix the bug of notify config and verify
1. 优化了报错信息
2. 将验证信息的发送由异步改成了同步,这样前端可以方便的展示验证消息发送失败的原因
3. 主动初始化webconsole的配置信息,使得websocket能够马上正常工作
4. 修复了验证信息发送失败之后联系方式状态不正确的bug
5. 去掉有关email回调地址的api
6. 修复了 update config 首次不起作用的 bug
2019-12-18 19:01:52 +08:00
yunion-ci-robot
6b659bec11 Merge pull request #4214 from yousong/automated-cherry-pick-of-#4212-upstream-release-2.12
Automated cherry pick of #4212: guestnetworks: ignore empty preferIfname
2019-12-18 19:01:07 +08:00
Yousong Zhou
2771bd990e guestnetworks: ignore empty preferIfname
Fixes cc02ac74 ("guestnetworks: check ifname uniqueness across different
networks")
2019-12-18 09:17:25 +00:00
yunion-ci-robot
86002e3c33 Merge pull request #4209 from swordqiu/automated-cherry-pick-of-#4207-upstream-release-2.12
Automated cherry pick of #4207: fix: ESXi fakeDC ID should matches any datacenter
2019-12-17 22:38:04 +08:00
Qiu Jian
29597ae0b5 fix: ESXi fakeDC ID should matches any datacenter 2019-12-17 18:50:52 +08:00
yunion-ci-robot
f8813618a2 Merge pull request #4205 from rainzm/automated-cherry-pick-of-#4204-upstream-release-2.12
Automated cherry pick of #4204: fix(notify): Fix the bugs of user cache and some api's params
2019-12-17 17:27:10 +08:00
Rain
f4811f3509 fix(notify): Fix the bugs of user cache and some api's params 2019-12-17 17:20:27 +08:00
yunion-ci-robot
ef14598cea Merge pull request #4179 from ioito/automated-cherry-pick-of-#4177-upstream-release-2.12
Automated cherry pick of #4177: fix: 增强host-list --usable限制
2019-12-17 17:03:03 +08:00
yunion-ci-robot
b686f609f8 Merge pull request #4197 from ioito/automated-cherry-pick-of-#4194-upstream-release-2.12
Automated cherry pick of #4194: fix: 标签过滤和框架保持一致
2019-12-17 16:35:05 +08:00
yunion-ci-robot
504d0e3bdf Merge pull request #4195 from swordqiu/automated-cherry-pick-of-#4193-upstream-release-2.12
Automated cherry pick of #4193: fix: fetch hosts if no permission to access datacenter
2019-12-17 16:23:02 +08:00
Qu Xuan
bfadc7b6e7 fix: 标签过滤和框架保持一致 2019-12-17 15:57:29 +08:00
Qiu Jian
4ea2d318e0 fix: fetch hosts if no permission to access datacenter 2019-12-17 15:56:33 +08:00
Qu Xuan
db98eee265 fix: 增强host-list --usable限制 2019-12-17 14:49:12 +08:00
yunion-ci-robot
dd54ff6c6c Merge pull request #4190 from swordqiu/automated-cherry-pick-of-#4188-upstream-release-2.12
Automated cherry pick of #4188: fix: disabling cloud account should not turn off auto sync switch
2019-12-17 14:02:04 +08:00
yunion-ci-robot
518b05216f Merge pull request #4187 from swordqiu/automated-cherry-pick-of-#4128-upstream-release-2.12
Automated cherry pick of #4128: feaute: object storage support set/get http headers
2019-12-17 14:01:03 +08:00
yunion-ci-robot
e1fe28ab95 Merge pull request #4191 from wanyaoqi/bugfix/wyq/make-mod
release/2.12: make mod
2019-12-17 13:50:03 +08:00
wanyaoqi
6610e57293 make mod 2019-12-17 13:19:00 +08:00
Qiu Jian
5c77969718 fix: disabling cloud account should not turn off auto sync switch 2019-12-17 01:20:23 +08:00
yunion-ci-robot
bc607d8f68 Merge pull request #4169 from ioito/automated-cherry-pick-of-#4168-upstream-release-2.12
Automated cherry pick of #4168: fix: 避免创建安全组规则时未能接收到安全组参数
2019-12-16 23:54:01 +08:00
Qiu Jian
59bed062f8 fix: minor fixes 2019-12-16 23:46:03 +08:00
Qiu Jian
26826e3218 fix: bucket-object-upload not work 2019-12-16 23:13:21 +08:00
Qiu Jian
61e5f5eb74 misc imporvements 2019-12-16 23:09:36 +08:00
Qiu Jian
23096b9164 feaute: object storage support set/get http headers 2019-12-16 21:44:31 +08:00
yunion-ci-robot
7e39c89c4a Merge pull request #4173 from rainzm/automated-cherry-pick-of-#4103-upstream-release-2.12
Automated cherry pick of #4103: feat(notify): Available uname in api & Unified template management
2019-12-16 11:44:01 +08:00
yunion-ci-robot
9867fb7dba Merge pull request #4171 from ioito/automated-cherry-pick-of-#4170-upstream-release-2.12
Automated cherry pick of #4170: fix: 避免频繁同步rds sku信息
2019-12-16 11:26:00 +08:00
Rain
f5cf95fa8b feat(notify): Available uname in api & Unified template management
1. Uname is availbale now in api via adding "uname=true" in query.
So we can use uname in climc which is much more visual and use uid in
web client which avoid time-consuming remote calls that may occur.

2. Previously, the template for the message was managed by the
individual sending components. Now, these templats was managed uniformly
by Notify Service so that we can easily add and remove.

3. Now, failure to send a validation message will trigger a notification
to the user via websocket.
2019-12-16 11:05:45 +08:00
Qu Xuan
08cb039c98 fix: 避免频繁同步rds sku信息 2019-12-16 11:03:21 +08:00
Qu Xuan
0dbd655c17 fix: 避免创建安全组规则时未能接收到安全组参数 2019-12-16 10:22:53 +08:00
yunion-ci-robot
59ec24d13a Merge pull request #4154 from ioito/automated-cherry-pick-of-#4152-upstream-release-2.12
Automated cherry pick of #4152: fix: 私有云同步的sku归属于default region
2019-12-14 11:31:01 +08:00
yunion-ci-robot
d0edfcb351 Merge pull request #4144 from tb365/automated-cherry-pick-of-#4141-upstream-release-2.12
Automated cherry pick of #4141: huawei sync instance offset bugfix
2019-12-14 11:08:00 +08:00
yunion-ci-robot
6d5e1ccab3 Merge pull request #4161 from ioito/automated-cherry-pick-of-#4159-upstream-release-2.12
Automated cherry pick of #4159: fix: 增强host-list --usable限制
2019-12-14 10:53:00 +08:00
Qu Xuan
e12943ea8f fix: 增强host-list --usable限制 2019-12-13 20:29:55 +08:00
Qu Xuan
3d1bd111fb fix: 私有云同步的sku归属于default region 2019-12-13 17:39:33 +08:00
TangBin
fe688862f0 huawei sync instance offset bugfix 2019-12-13 15:46:12 +08:00
yunion-ci-robot
651ded2b8f Merge pull request #4136 from swordqiu/automated-cherry-pick-of-#4134-upstream-release-2.12
Automated cherry pick of #4134: fix: misc bugfix for esxi 20191213
2019-12-13 12:59:00 +08:00
yunion-ci-robot
b10f4d839d Merge pull request #4125 from yousong/automated-cherry-pick-of-#4123-upstream-release-2.12
Automated cherry pick of #4123: guestnetworks: check ifname uniqueness across different networks
2019-12-13 12:57:01 +08:00
Qiu Jian
872a217b5a fix: misc bugfix for esxi 20191213 2019-12-13 12:35:26 +08:00
yunion-ci-robot
2718f39c67 Merge pull request #4131 from ioito/automated-cherry-pick-of-#4129-upstream-release-2.12
Automated cherry pick of #4129: fix: 避免插入时出现duplicate primary key error
2019-12-13 11:38:59 +08:00
Qu Xuan
ab692d05fd fix: 避免插入时出现duplicate primary key error 2019-12-13 10:46:01 +08:00
Yousong Zhou
ca578b4848 guestnetworks: check ifname uniqueness across different networks
With PerformChangeIpAddr, it can happen that a guestnetwork from network
A can take a name that was originally allocated by network B
2019-12-12 15:47:13 +00:00
yunion-ci-robot
40b52e027c Merge pull request #4114 from bistuzx/automated-cherry-pick-of-#4113-upstream-release-2.12
Automated cherry pick of #4113: delete duplicate param brand
2019-12-12 15:35:59 +08:00
张旭
ac5584caae delete duplicate param brand 2019-12-12 15:26:47 +08:00
yunion-ci-robot
2bf1ef40b2 Merge pull request #4110 from bistuzx/automated-cherry-pick-of-#4109-upstream-release-2.12
Automated cherry pick of #4109: add associated_bills & modify meter version
2019-12-12 12:41:01 +08:00
张旭
6886e20ba3 add associated_bills & modify meter version 2019-12-12 11:59:58 +08:00
yunion-ci-robot
54ced32814 Merge pull request #4099 from ioito/automated-cherry-pick-of-#4097-upstream-release-2.12
Automated cherry pick of #4097: fix: 避免zstack参数含有中文,未编码导致请求失败
2019-12-12 11:02:38 +08:00
Qu Xuan
f295ac0066 fix: 避免zstack参数含有中文,未编码导致请求失败 2019-12-11 23:20:56 +08:00
yunion-ci-robot
33924e56cc Merge pull request #4106 from wanyaoqi/automated-cherry-pick-of-#4104-upstream-release-2.12
Automated cherry pick of #4104: fix image upload log event
2019-12-11 22:30:45 +08:00
wanyaoqi
7af90dc0a5 fix image upload log event 2019-12-11 20:41:01 +08:00
yunion-ci-robot
11cc8c7891 Merge pull request #4094 from yousong/automated-cherry-pick-of-#4092-upstream-release-2.12
Automated cherry pick of #4092: loadbalancerbackends: janitor: move to InitializeData
2019-12-11 20:14:43 +08:00
Yousong Zhou
c7c11a6d5a loadbalancerbackends: janitor: move to InitializeData
The janitor only makes sense when inside region service
2019-12-11 08:24:01 +00:00
yunion-ci-robot
c83aeefc09 Merge pull request #4074 from ioito/automated-cherry-pick-of-#4072-upstream-release-2.12
Automated cherry pick of #4072: fix: 导出用户标签不加user:前缀
2019-12-11 15:07:39 +08:00
Yousong Zhou
f40cbe41b6 Automated cherry pick of #4084: httputils: use http.ProxyFromEnvironment by default (#4086)
* vendor: update aliyun-oss-go-sdk to v2.0.4

To use ClientOption oss.HTTPClient

* aliyun: use a http client that respects env proxy settings

* httputils: use http.ProxyFromEnvironment by default
2019-12-10 21:15:47 +08:00
屈轩
345f008916 fix: 子订阅更改项目时也同步更新external project项目信息 (#4070) 2019-12-10 21:12:41 +08:00
Qu Xuan
7be54fefee fix: 导出用户标签不加user:前缀 2019-12-09 21:45:48 +08:00
yunion-ci-robot
0a4d5b63a0 Merge pull request #4059 from ioito/automated-cherry-pick-of-#4057-upstream-release-2.12
Automated cherry pick of #4057: fix: 避免在初始化model时设置rds skuhandler
2019-12-09 10:45:37 +08:00
屈轩
7ce699990a fix: 避免在初始化model时设置rds skuhandler 2019-12-08 12:43:18 +08:00
yunion-ci-robot
a51f74e2d8 Merge pull request #4043 from ioito/automated-cherry-pick-of-#4040-upstream-release-2.12
Automated cherry pick of #4040: fix: 返回region external_id
2019-12-07 17:42:36 +08:00
yunion-ci-robot
1fe3213b6e Merge pull request #4049 from wanyaoqi/automated-cherry-pick-of-#4047-upstream-release-2.12
Automated cherry pick of #4047: region misc bugfix
2019-12-07 17:16:37 +08:00
yunion-ci-robot
cd094ebb32 Merge pull request #4037 from ioito/automated-cherry-pick-of-#4035-upstream-release-2.12
Automated cherry pick of #4035: fix: 避免普通用户添加规则到系统安全组
2019-12-06 23:23:38 +08:00
Qu Xuan
f11f3298d7 fix: 返回region external_id 2019-12-06 20:36:22 +08:00
yunion-ci-robot
41c9dd1c5a Merge pull request #4034 from tb365/automated-cherry-pick-of-#4032-upstream-release-2.12
Automated cherry pick of #4032: image upload bugfix
2019-12-06 18:26:35 +08:00
wanyaoqi
df49302e12 region misc bugfix
- fix capabilities filter disabled account
- fix kvm guest start no logevent
- fix guest restart not set guest status immediately
2019-12-06 17:10:47 +08:00
yunion-ci-robot
1668e2eba0 Merge pull request #4029 from tb365/automated-cherry-pick-of-#4028-upstream-release-2.12
Automated cherry pick of #4028: huawei reset password bugfix
2019-12-06 15:50:34 +08:00
Qu Xuan
f175a3eb4e fix: 避免普通用户添加规则到系统安全组 2019-12-06 14:47:01 +08:00
TangBin
8a1ee68c05 image upload bugfix 2019-12-06 10:06:34 +08:00
yunion-ci-robot
210b8c7349 Merge pull request #4023 from wanyaoqi/automated-cherry-pick-of-#4021-upstream-release-2.12
Automated cherry pick of #4021: add socket used check of deploy server
2019-12-05 14:36:35 +08:00
TangBin
264ffc5cc8 add elastic cache skus capability api 2019-12-05 11:21:48 +08:00
TangBin
235dabdfae elastic cache task bugfix 2019-12-05 11:21:48 +08:00
TangBin
7e04910c9c huawei reset password bugfix 2019-12-05 11:21:48 +08:00
yunion-ci-robot
a40cf5e478 Merge pull request #4001 from tb365/automated-cherry-pick-of-#3999-upstream-release-2.12
Automated cherry pick of #3999: cloudregion cities filter
2019-12-04 16:12:35 +08:00
TangBin
81baf01309 yunionmeta offline data using gzip files disk billing type error fix 2019-12-04 14:50:00 +08:00
TangBin
95e7368f2e cloudregion cities filter 2019-12-04 14:50:00 +08:00
wanyaoqi
d1049ca209 add socket used check of deploy server 2019-12-04 11:41:47 +08:00
yunion-ci-robot
c10748991b Merge pull request #4018 from yousong/automated-cherry-pick-of-#4016-upstream-release-2.12
Automated cherry pick of #4016: hostman: hostinfo: turn off report_ignored_msrs
2019-12-04 11:04:34 +08:00
yunion-ci-robot
ee1dd15bf6 Merge pull request #4014 from swordqiu/automated-cherry-pick-of-#4013-upstream-release-2.12
Automated cherry pick of #4013: fix: network-addresses add created_at column
2019-12-04 10:46:33 +08:00
yunion-ci-robot
cf9f709f9a Merge pull request #3996 from ioito/automated-cherry-pick-of-#3994-upstream-release-2.12
Automated cherry pick of #3994: fix: 避免每次重启region同步rds sku, 避免新加公有云账号未能及时同步sku问题
2019-12-04 10:34:36 +08:00
Yousong Zhou
b1f1ed5048 hostman: hostinfo: turn off report_ignored_msrs
Quote mainline linux commit fab0aa3b ("KVM: x86: Allow suppressing
prints on RDMSR/WRMSR of unhandled MSRs")

> Some guests use these unhandled MSRs very frequently.
> This cause dmesg to be populated with lots of aggregated messages on
> usage of ignored MSRs. As ignore_msrs=true means that the user is
> well-aware his guest use ignored MSRs, allow to also disable the
> prints on their usage.
>
> An example of such guest is ESXi which tends to access a lot to MSR
> 0x34 (MSR_SMI_COUNT) very frequently.
>
> In addition, we have observed this to cause unnecessary delays to
> guest execution. Such an example is ESXi which experience networking
> delays in it's guests (L2 guests) because of these prints (even when
> prints are rate-limited). This can easily be reproduced by pinging
> from one L2 guest to another.  Once in a while, a peak in ping RTT
> will be observed. Removing these unhandled MSR prints solves the
> issue.
>
> Because these prints can help diagnose issues with guests,
> this commit only suppress them by a module parameter instead of
> removing them from code entirely.
2019-12-04 02:23:10 +00:00
yunion-ci-robot
a0d2d1961a Merge pull request #4011 from ioito/automated-cherry-pick-of-#4009-upstream-release-2.12
Automated cherry pick of #4009: fix: 未设置密码时,使用随机密码
2019-12-04 10:16:33 +08:00
yunion-ci-robot
bed7635ff1 Merge pull request #4006 from ioito/automated-cherry-pick-of-#4004-upstream-release-2.12
Automated cherry pick of #4004: fix: 忽略名称条件,只要cpu,mem一致就不再同步
2019-12-04 10:14:34 +08:00
Qiu Jian
40af1680ed fix: network-addresses add created_at column 2019-12-04 10:04:37 +08:00
Qu Xuan
8b067089e1 fix: 未设置密码时,使用随机密码 2019-12-03 19:19:16 +08:00
Qu Xuan
76db8ff957 fix: 忽略名称条件,只要cpu,mem一致就不再同步 2019-12-03 16:29:51 +08:00
yunion-ci-robot
834963ec18 Merge pull request #3984 from yousong/automated-cherry-pick-of-#3978-upstream-release-2.12
Automated cherry pick of #3978: cloudnet: fix validating "action"
2019-12-03 00:40:33 +08:00
Qu Xuan
21bc1ccd42 fix: 避免每次重启region同步rds sku, 避免新加公有云账号未能及时同步sku问题 2019-12-02 17:54:55 +08:00
yunion-ci-robot
6bf4b4f168 Merge pull request #3991 from ioito/automated-cherry-pick-of-#3989-upstream-release-2.12
Automated cherry pick of #3989: fix: avoid index out of range
2019-12-02 17:40:35 +08:00
Zexi Li
37d19a591f Merge pull request #3981 from rainzm/automated-cherry-pick-of-#3979-upstream-release-2.12
Automated cherry pick of #3979: feat(region): Add suspend feature for vmware guest
2019-12-02 10:35:19 +08:00
Qu Xuan
74c8d17700 fix: avoid index out of range 2019-12-02 10:24:32 +08:00
郑雨
c5dfc0dbe8 feat(region): Add suspend feature for vmware guest 2019-11-29 16:10:31 +08:00
Yousong Zhou
f33f1cb540 cloudnet: return non-nil data on validata create data pass 2019-11-29 08:03:07 +00:00
Yousong Zhou
52c8c32d3b climc: cloudnet: fix passing invalid port on creating rules 2019-11-29 08:03:07 +00:00
Yousong Zhou
7c9659225d cloudnet: fix validating "action" 2019-11-29 08:03:07 +00:00
yunion-ci-robot
75b71f6c30 Merge pull request #3971 from rainzm/automated-cherry-pick-of-#3932-upstream-release-2.12
Automated cherry pick of #3932: fix(notify): Check input parameters and return when error occury
2019-11-29 11:49:30 +08:00
郑雨
165a83adfb fix(notify): Check input parameters and return when error occury 2019-11-29 11:16:00 +08:00
yunion-ci-robot
cf50b302a9 Merge pull request #3965 from ioito/automated-cherry-pick-of-#3957-upstream-release-2.12
Automated cherry pick of #3957: fix: 修复rds普通后台下账号权限问题
2019-11-28 18:21:30 +08:00
Qu Xuan
8c238edba6 fix: 修复rds普通后台下账号权限问题 2019-11-28 17:38:14 +08:00
yunion-ci-robot
2a49903ec4 Merge pull request #3960 from wanyaoqi/automated-cherry-pick-of-#3958-upstream-release-2.12
Automated cherry pick of #3958: add lock on host detected offline
2019-11-28 14:15:31 +08:00
wanyaoqi
9cfa0baee4 add lock on host detected offline 2019-11-28 11:22:42 +08:00
yunion-ci-robot
9f5bae0848 Merge pull request #3956 from ioito/automated-cherry-pick-of-#3939-upstream-release-2.12
Automated cherry pick of #3939: fix: 避免解绑eip后可以立即syncstatus操作导致同步eip出现问题
2019-11-27 22:08:29 +08:00
屈轩
f929b7d04c Merge branch 'release/2.12' into automated-cherry-pick-of-#3939-upstream-release-2.12 2019-11-27 21:40:04 +08:00
Qu Xuan
57c21a2eb7 fix: 避免解绑eip后可以立即syncstatus操作导致同步eip出现问题 2019-11-27 21:30:40 +08:00
yunion-ci-robot
3312592a6e Merge pull request #3953 from ioito/automated-cherry-pick-of-#3943-upstream-release-2.12
Automated cherry pick of #3943: fix: remove rds accout,database tenant attr
2019-11-27 21:26:28 +08:00
yunion-ci-robot
115fbc9f6c Merge pull request #3935 from ioito/automated-cherry-pick-of-#3933-upstream-release-2.12
Automated cherry pick of #3933: fix: 抽离disable delete,避免删除账号失败
2019-11-27 21:05:28 +08:00
yunion-ci-robot
1bd2cc7c2a Merge pull request #3949 from wanyaoqi/automated-cherry-pick-of-#3922-upstream-release-2.12
Automated cherry pick of #3922: snapshot show storage type
2019-11-27 20:58:31 +08:00
yunion-ci-robot
d20b7cd8d1 Merge pull request #3942 from tb365/automated-cherry-pick-of-#3940-upstream-release-2.12
Automated cherry pick of #3940: 修复不支持redis的公有云账号会频繁读取oss数据的问题
2019-11-27 20:54:29 +08:00
Zexi Li
2c3e420c9e Merge pull request #3951 from swordqiu/automated-cherry-pick-of-#3950-upstream-release-2.12
Automated cherry pick of #3950: fix: 1. service-config not support key=value pair 2. sync_purge_removed_resources not working
2019-11-27 20:51:58 +08:00
Qu Xuan
fedbcb7e62 fix: remove rds accout,database tenant attr 2019-11-27 20:50:34 +08:00
yunion-ci-robot
2c56e3c0ea Merge pull request #3946 from wanyaoqi/automated-cherry-pick-of-#3944-upstream-release-2.12
Automated cherry pick of #3944: fix image set chksum
2019-11-27 20:48:33 +08:00
Qiu Jian
940626f02b fix: 1. service-config not support key=value pair 2. sync_purge_removed_resources not working 2019-11-27 20:43:53 +08:00
Qu Xuan
6279046908 fix: 抽离disable delete,避免删除账号失败 2019-11-27 20:32:21 +08:00
Zexi Li
ae4ac10a9d Merge pull request #3937 from swordqiu/automated-cherry-pick-of-#3936-upstream-release-2.12
Automated cherry pick of #3936: fix: cloud account may not be visible temporarily after create
2019-11-27 20:25:51 +08:00
TangBin
603deb46b2 elastic cache owner 2019-11-27 19:33:09 +08:00
TangBin
9b338f1ac1 validate prepaid resource delete condition 2019-11-27 19:33:09 +08:00
TangBin
7b95e9ffcb 修复不支持redis的公有云账号会频繁读取oss数据的问题 2019-11-27 19:33:09 +08:00
wanyaoqi
dd932abdea snapshot show storage type 2019-11-27 19:17:10 +08:00
wanyaoqi
4442ec9ef5 fix image set chksum 2019-11-27 18:27:45 +08:00
Qiu Jian
04118849ca fix: cloud account may not be visible temporarily after create 2019-11-27 16:23:26 +08:00
yunion-ci-robot
fb93c05e8c Merge pull request #3909 from ioito/automated-cherry-pick-of-#3907-upstream-release-2.12
Automated cherry pick of #3907: fix: rds创建账号所属项目跟随rds实例
2019-11-27 09:09:27 +08:00
yunion-ci-robot
4c7962d4f9 Merge pull request #3900 from tb365/automated-cherry-pick-of-#3897-upstream-release-2.12
Automated cherry pick of #3897: huawei disk detach bugfix
2019-11-27 09:06:28 +08:00
yunion-ci-robot
cc0ad1bf6c Merge pull request #3912 from ioito/automated-cherry-pick-of-#3910-upstream-release-2.12
Automated cherry pick of #3910: fix: 避免有,Azure更新安全组规则出错
2019-11-27 08:57:28 +08:00
yunion-ci-robot
9d6cf8c9bb Merge pull request #3904 from ioito/automated-cherry-pick-of-#3902-upstream-release-2.12
Automated cherry pick of #3902: fix: 普通后台也返回cloudregion_id信息
2019-11-27 08:54:28 +08:00
Qu Xuan
5e9ca17c0e fix: 避免有,Azure更新安全组规则出错 2019-11-26 20:51:27 +08:00
Qu Xuan
3efd386239 fix: rds创建账号所属项目跟随rds实例 2019-11-26 20:39:03 +08:00
Qu Xuan
d11deb726e fix: 普通后台也返回cloudregion_id信息 2019-11-26 19:12:51 +08:00
Zexi Li
00409a5afd Merge pull request #3893 from swordqiu/automated-cherry-pick-of-#3892-upstream-release-2.12
Automated cherry pick of #3892: fix: baremetal restart fail after deployment
2019-11-26 17:46:02 +08:00
Zexi Li
20895d9d3a Merge pull request #3885 from swordqiu/automated-cherry-pick-of-#3884-upstream-release-2.12
Automated cherry pick of #3884: fix: error in service config format cause service halt
2019-11-26 15:45:39 +08:00
yunion-ci-robot
6858c0bf42 Merge pull request #3878 from wanyaoqi/automated-cherry-pick-of-#3876-upstream-release-2.12
Automated cherry pick of #3876: misc fix
2019-11-26 13:38:27 +08:00
yunion-ci-robot
016812079e Merge pull request #3875 from ioito/automated-cherry-pick-of-#3873-upstream-release-2.12
Automated cherry pick of #3873: fix: 修复rds重置密码未正确接收参数问题
2019-11-26 13:32:28 +08:00
TangBin
98b74e228e huawei disk detach bugfix 2019-11-26 11:41:55 +08:00
Qiu Jian
9e2bf1d7e9 fix: error in service config format cause service halt 2019-11-26 02:55:19 +08:00
Qiu Jian
f91a3d75e1 fix: baremetal restart fail after deployment 2019-11-26 02:42:47 +08:00
Zexi Li
7c5f0144e2 Merge pull request #3890 from swordqiu/automated-cherry-pick-of-#3887-upstream-release-2.12
Automated cherry pick of #3887: fix: host-add-netif requires index
2019-11-26 00:44:31 +08:00
Zexi Li
303c250b5c Merge pull request #3880 from swordqiu/automated-cherry-pick-of-#3879-upstream-release-2.12
Automated cherry pick of #3879: fix: keystone project resource count not set set to zero
2019-11-26 00:41:15 +08:00
Qiu Jian
af4e49da15 fix: host-add-netif requires index 2019-11-25 23:47:49 +08:00
Qiu Jian
39c7b262cd fix: keystone project resource count not set set to zero 2019-11-25 22:26:49 +08:00
wanyaoqi
b99e734ee7 misc fix
- image list filter by uefi
- fix instance sanpshot delete
- guest clean expire server exclude pending deleted servers
- host register abort on network not match
2019-11-25 21:27:18 +08:00
Qu Xuan
a5eb231c7b fix: 修复rds重置密码未正确接收参数问题 2019-11-25 19:19:36 +08:00
yunion-ci-robot
a322c4eccb Merge pull request #3870 from ioito/automated-cherry-pick-of-#3868-upstream-release-2.12
Automated cherry pick of #3868: fix: 避免openstack重装系统,过不了镜像系统盘大小校验
2019-11-25 17:19:28 +08:00
Qu Xuan
392ae25406 fix: 避免openstack重装系统,过不了镜像系统盘大小校验 2019-11-25 15:04:16 +08:00
yunion-ci-robot
ab27e69059 Merge pull request #3865 from zexi/automated-cherry-pick-of-#3863-upstream-release-2.12
Automated cherry pick of #3863: baremetal: fix init baremetals fatal exit
2019-11-25 10:22:27 +08:00
Zexi Li
482f91b598 baremetal: fix init baremetals fatal exit 2019-11-25 09:40:13 +08:00
yunion-ci-robot
24b9d520af Merge pull request #3838 from tb365/automated-cherry-pick-of-#3837-upstream-release-2.12
Automated cherry pick of #3837: redis prepaid instance create bugfix
2019-11-22 22:18:27 +08:00
yunion-ci-robot
fea8acee9c Merge pull request #3859 from ioito/automated-cherry-pick-of-#3857-upstream-release-2.12
Automated cherry pick of #3857: fix: 避免旧密码覆盖新重置的密码
2019-11-22 21:53:26 +08:00
Qu Xuan
6c486bea93 fix: 避免旧密码覆盖新重置的密码 2019-11-22 20:46:29 +08:00
TangBin
f3cab30db7 redis prepaid instance create bugfix 2019-11-22 19:03:53 +08:00
yunion-ci-robot
5faa9d37ad Merge pull request #3842 from wanyaoqi/automated-cherry-pick-of-#3840-upstream-release-2.12
Automated cherry pick of #3840: instance snapshot bugfix
2019-11-22 18:57:25 +08:00
Zexi Li
6c2dfb0d95 Merge pull request #3855 from swordqiu/automated-cherry-pick-of-#3854-upstream-release-2.12
Automated cherry pick of #3854: fix: cloud-region filter by domain not support share_mode
2019-11-22 18:05:31 +08:00
Zexi Li
1deec8fff8 Merge pull request #3849 from swordqiu/automated-cherry-pick-of-#3848-upstream-release-2.12
Automated cherry pick of #3848: fix: user join read-only group response timeout
2019-11-22 18:04:25 +08:00
Qiu Jian
8b8f133bd6 fix: cloud-region filter by domain not support share_mode 2019-11-22 17:44:41 +08:00
Qiu Jian
3c969c5b44 fix: user join read-only group response timeout 2019-11-22 16:19:01 +08:00
Zexi Li
ede5310326 Merge pull request #3845 from rainzm/automated-cherry-pick-of-#3844-upstream-release-2.12
Automated cherry pick of #3844: fix(region): Fix the panic of nil map when syncing snapshotpolicy
2019-11-22 11:38:53 +08:00
郑雨
10b0bdc458 fix(region): Fix the panic of nil map when syncing snapshotpolicy 2019-11-22 10:29:39 +08:00
wanyaoqi
9acd1caf31 instance snapshot bugfix 2019-11-21 20:47:37 +08:00
yunion-ci-robot
98a834ea97 Merge pull request #3835 from wanyaoqi/automated-cherry-pick-of-#3833-upstream-release-2.12
Automated cherry pick of #3833: host complie error
2019-11-21 18:50:26 +08:00
wanyaoqi
6f575a0c36 host complie error 2019-11-21 18:42:03 +08:00
Zexi Li
5ca79012a2 Merge pull request #3826 from wanyaoqi/automated-cherry-pick-of-#3824-upstream-release-2.12
Automated cherry pick of #3824: fix resize disk
2019-11-21 18:22:19 +08:00
yunion-ci-robot
42f788cf60 Merge pull request #3831 from ioito/automated-cherry-pick-of-#3829-upstream-release-2.12
Automated cherry pick of #3829: fix: 清理aliyun rds多余的包年包月参数转换
2019-11-21 16:23:24 +08:00
yunion-ci-robot
f55e44a94c Merge pull request #3817 from tb365/automated-cherry-pick-of-#3813-upstream-release-2.12
Automated cherry pick of #3813: aws upload image bugfix & huawei change default disk type to SAS
2019-11-21 15:37:25 +08:00
Qu Xuan
0b74750d07 fix: 清理aliyun rds多余的包年包月参数转换 2019-11-21 14:59:54 +08:00
wanyaoqi
46d01a63ad fix host register 2019-11-21 10:49:45 +08:00
Zexi Li
3bd0e0578d Merge pull request #3811 from wanyaoqi/automated-cherry-pick-of-#3749-upstream-release-2.12
Automated cherry pick of #3749: hugepage fix
2019-11-21 00:23:09 +08:00
Zexi Li
51f13cb6f1 Merge pull request #3815 from swordqiu/automated-cherry-pick-of-#3809-upstream-release-2.12
Automated cherry pick of #3809: feature: add network-status methods to change status of on-premise network
2019-11-21 00:22:07 +08:00
yunion-ci-robot
ae4a5f73fe Merge pull request #3823 from wanyaoqi/automated-cherry-pick-of-#3798-upstream-release-2.12
Automated cherry pick of #3798: instance snapshot save secgrps
2019-11-21 00:16:23 +08:00
yunion-ci-robot
19db4ea583 Merge pull request #3819 from rainzm/automated-cherry-pick-of-#3786-upstream-release-2.12
Automated cherry pick of #3786: fix(region): Add public/private feature for Guest Image
2019-11-21 00:05:24 +08:00
yunion-ci-robot
a03084b80e Merge pull request #3794 from yousong/automated-cherry-pick-of-#3787-upstream-release-2.12
Automated cherry pick of #3787: networks: 改进创建错误处理
2019-11-20 22:24:24 +08:00
wanyaoqi
2e4c8bdc90 fix resize disk 2019-11-20 22:03:38 +08:00
yunion-ci-robot
16b66b0043 Merge pull request #3807 from tb365/automated-cherry-pick-of-#3806-upstream-release-2.12
Automated cherry pick of #3806: redis acl update bugfix
2019-11-20 21:22:23 +08:00
wanyaoqi
c41df78db9 instance snapshot save secgrps 2019-11-20 21:21:06 +08:00
TangBin
078f7f87d3 add elastic cache extra details 2019-11-20 20:03:20 +08:00
TangBin
724c82c2b1 vm create bugfix 2019-11-20 20:03:20 +08:00
TangBin
11cd177576 eip associate bugfix 2019-11-20 20:03:20 +08:00
TangBin
441e533a43 redis backup restore bugfix 2019-11-20 20:03:20 +08:00
TangBin
26d22319cd redis acl update bugfix 2019-11-20 20:03:20 +08:00
郑雨
0d82b55f79 fix(region): Add public/private feature for Guest Image
Public/private subimages firstly when do public/private for guest image.
Add cmd "guest-image-public" and "guest-image-private".
2019-11-20 19:10:35 +08:00
TangBin
49062aa3f9 aws upload image bugfix & huawei change default disk type to SAS 2019-11-20 19:07:33 +08:00
Qiu Jian
b9c89511a1 feature: add network-status methods to change status of on-premise network 2019-11-20 19:03:37 +08:00
wanyaoqi
cdb676ef90 hugepage fix 2019-11-20 18:44:54 +08:00
Zexi Li
36e853e275 Merge pull request #3803 from rainzm/automated-cherry-pick-of-#3802-upstream-release-2.12
Automated cherry pick of #3802: feat(notify): Add interface contacts/users for Notify
2019-11-20 17:55:26 +08:00
Rain
0218b6ca00 feat(notify): Add interface contacts/users for Notify
The interface "contacts/users" return the users who has contacts or not.
2019-11-20 17:00:19 +08:00
yunion-ci-robot
780d5022d3 Merge pull request #3799 from rainzm/automated-cherry-pick-of-#3772-upstream-release-2.12
Automated cherry pick of #3772: refactor(region): Optimization for snapshotpolicy sync
2019-11-20 16:13:24 +08:00
郑雨
2e06d2ab46 refactor(region): Optimization for snapshotpolicy sync
If the number of added cloudsnapshotpolicy more than 5, we do
clustering for all snapshotpolicies and find suitable one from these.
Otherwise, we find suitable one from database everytimes.
2019-11-20 15:10:47 +08:00
Zexi Li
6bb97acb1e Merge pull request #3796 from swordqiu/automated-cherry-pick-of-#3795-upstream-release-2.12
Automated cherry pick of #3795: fix: recover baremetal status after cdrom operations
2019-11-20 14:35:22 +08:00
Qiu Jian
228fae2d73 fix: recover baremetal status after cdrom operations 2019-11-20 10:13:23 +08:00
Yousong Zhou
7f6435a48a cloudregions: 统一"OneCloud" provider过滤条件 2019-11-20 01:56:16 +00:00
Yousong Zhou
96372ac317 networks: 改进创建错误处理 2019-11-20 01:56:16 +00:00
yunion-ci-robot
ceccc16d86 Merge pull request #3790 from yousong/automated-cherry-pick-of-#3788-upstream-release-2.12
Automated cherry pick of #3788: lbagent: pidfile: add PidFile
2019-11-19 23:23:23 +08:00
yunion-ci-robot
e3582e9bd4 Merge pull request #3783 from yousong/automated-cherry-pick-of-#3778-upstream-release-2.12
Automated cherry pick of #3778: treewide: 避免使用fmt.Print记录日志
2019-11-19 23:16:25 +08:00
Yousong Zhou
26ea46bac2 lbagent: pidfile: remove ReadPidFile() 2019-11-19 12:27:44 +00:00
Yousong Zhou
062cc32f7b lbagent: stop daemons: use agentutils.PidFile 2019-11-19 12:27:44 +00:00
Yousong Zhou
13795ae495 lbagent: haproxy: use agentutils.PidFile 2019-11-19 12:27:44 +00:00
Yousong Zhou
3180fab209 lbagent: gobetween: use agentutils.PidFile 2019-11-19 12:27:44 +00:00
Yousong Zhou
467756521c lbagent: telegraf: use agentutils.PidFile 2019-11-19 12:27:44 +00:00
Yousong Zhou
7a1c1b1daa lbagent: keepalived: use agentutils.PidFile 2019-11-19 12:27:44 +00:00
Yousong Zhou
a648ef13e4 lbagent: pidfile: add PidFile 2019-11-19 12:27:44 +00:00
yunion-ci-robot
bf34e20c3e Merge pull request #3780 from tb365/automated-cherry-pick-of-#3779-upstream-release-2.12
Automated cherry pick of #3779: redis create bugfix & redis acl create bugfix
2019-11-19 19:42:25 +08:00
Yousong Zhou
3834490cca vendor: update sqlchemy 2019-11-19 11:24:57 +00:00
Yousong Zhou
9fb52fd57d treewide: 避免使用fmt.Print记录日志 2019-11-19 11:24:57 +00:00
TangBin
6ea039d2a4 redis create bugfix & redis acl create bugfix 2019-11-19 17:58:07 +08:00
Zexi Li
9506c4a914 Merge pull request #3775 from ioito/automated-cherry-pick-of-#3773-upstream-release-2.12
Automated cherry pick of #3773: fix: 调整存储容量后刷新调度缓存
2019-11-19 16:10:00 +08:00
Qu Xuan
9aa0a87ce8 fix: 调整存储容量后刷新调度缓存 2019-11-19 14:34:34 +08:00
yunion-ci-robot
24c1f2f3ff Merge pull request #3771 from tb365/automated-cherry-pick-of-#3769-upstream-release-2.12
Automated cherry pick of #3769: elastic cache auth_mode status & password reset bugfix
2019-11-19 12:53:25 +08:00
TangBin
894f54bd30 elastic cache auth_mode status & password reset bugfix 2019-11-19 11:48:37 +08:00
Zexi Li
cbcc0f1137 Merge pull request #3764 from swordqiu/automated-cherry-pick-of-#3763-upstream-release-2.12
Automated cherry pick of #3763: fix: cloudaccount list duplicate entries due to join with cloudproviders
2019-11-19 10:49:23 +08:00
Zexi Li
ee1e9cf07f Merge pull request #3733 from yousong/automated-cherry-pick-of-#3731-upstream-release-2.12
Automated cherry pick of #3731: build: 避免并发构建rpm时触发file exists错误
2019-11-19 10:48:08 +08:00
yunion-ci-robot
6b229bec67 Merge pull request #3767 from zexi/automated-cherry-pick-of-#3766-upstream-release-2.12
Automated cherry pick of #3766: region: host list filter by cdrom_boot
2019-11-19 10:13:22 +08:00
Zexi Li
918c2e2fdf region: host list filter by cdrom_boot 2019-11-19 01:45:00 +08:00
yunion-ci-robot
b10e34f90a Merge pull request #3762 from wanyaoqi/automated-cherry-pick-of-#3760-upstream-release-2.12
Automated cherry pick of #3760: allow delete standard and shared image
2019-11-18 21:52:26 +08:00
Qiu Jian
af98bc824b fix: cloudaccount list duplicate entries due to join with cloudproviders 2019-11-18 21:51:26 +08:00
wanyaoqi
f5b871f9a9 allow delete standard and shared image 2019-11-18 21:17:06 +08:00
yunion-ci-robot
5ee81acd38 Merge pull request #3758 from rainzm/automated-cherry-pick-of-#3757-upstream-release-2.12
Automated cherry pick of #3757: fix(region): Cluster automatically when syncing snapshotpolicy
2019-11-18 21:10:23 +08:00
郑雨
07b8db5bd1 fix(region): Cluster automatically when syncing snapshotpolicy
Fix two bug about listing snapshotpolicycache:
1. no accont info 2. filter error
The func 'Key' of snapshotpolicy generate a Identification for
snapshotpolicy. If the key of cloud snapshotpolicy is same with local
snaphotpolicy, the cloud sp became a cache of this local sp.
2019-11-18 20:54:11 +08:00
yunion-ci-robot
38950466e2 Merge pull request #3756 from wanyaoqi/automated-cherry-pick-of-#3754-upstream-release-2.12
Automated cherry pick of #3754: fix login key on clone
2019-11-18 19:44:23 +08:00
yunion-ci-robot
f7767adc4d Merge pull request #3722 from tb365/automated-cherry-pick-of-#3721-upstream-release-2.12
Automated cherry pick of #3721: add elastic cache sku default policy
2019-11-18 19:43:24 +08:00
yunion-ci-robot
2bbaf4e81a Merge pull request #3751 from swordqiu/automated-cherry-pick-of-#3750-upstream-release-2.12
Automated cherry pick of #3750: fix: quick fix user password verification failure
2019-11-18 19:41:25 +08:00
yunion-ci-robot
391dabc4f9 Merge pull request #3716 from tb365/automated-cherry-pick-of-#3711-upstream-release-2.12
Automated cherry pick of #3711: create vm attach eip fix
2019-11-18 19:32:24 +08:00
wanyaoqi
0fd5ff9ecb fix login key on clone 2019-11-18 19:24:17 +08:00
yunion-ci-robot
17dfc3d34d Merge pull request #3691 from tb365/automated-cherry-pick-of-#3690-upstream-release-2.12
Automated cherry pick of #3690: remove useless aws instance type config
2019-11-18 19:22:22 +08:00
yunion-ci-robot
40acdc8c3f Merge pull request #3714 from ioito/automated-cherry-pick-of-#3712-upstream-release-2.12
Automated cherry pick of #3712: fix: 避免匹配到售罄的套餐
2019-11-18 19:14:24 +08:00
Zexi Li
ce73403de9 Merge pull request #3753 from swordqiu/automated-cherry-pick-of-#3679-upstream-release-2.12
Automated cherry pick of #3679: feature: cloud account share_mode support
2019-11-18 17:48:34 +08:00
Qiu Jian
83769d4d58 feature: cloud account share_mode support 2019-11-18 17:45:51 +08:00
TangBin
33a3dbeaaa create vm attach eip fix 2019-11-18 17:44:03 +08:00
TangBin
451de216a0 huawei elastic change spec bugfix 2019-11-18 17:33:14 +08:00
TangBin
13ca3a82b8 add elastic cache sku default policy 2019-11-18 17:33:14 +08:00
Qiu Jian
b6d7e9f238 fix: quick fix user password verification failure 2019-11-18 16:58:36 +08:00
yunion-ci-robot
d5a9e68a71 Merge pull request #3747 from rainzm/automated-cherry-pick-of-#3746-upstream-release-2.12
Automated cherry pick of #3746: fix(region): Set name and status when creating and syncing snapshotpolicycache
2019-11-18 16:15:23 +08:00
郑雨
49cf5caec0 fix(region): Set name and status when creating and syncing snapshotpolicycache
That snapshotpolicycaches has same name is ok. Set name and status
directly when creating and syncing snapshotpolicycache.
2019-11-18 15:38:43 +08:00
yunion-ci-robot
dee8c2d705 Merge pull request #3744 from swordqiu/automated-cherry-pick-of-#3743-upstream-release-2.12
Automated cherry pick of #3743: fix: filter out expire user passwords
2019-11-18 14:50:23 +08:00
yunion-ci-robot
24216d97ca Merge pull request #3729 from swordqiu/automated-cherry-pick-of-#3728-upstream-release-2.12
Automated cherry pick of #3728: fix: always lock login-failed user when PasswordErrorLockCount not initialized
2019-11-18 14:49:22 +08:00
Qiu Jian
7d1d6469d9 fix: filter out expire user passwords 2019-11-18 14:33:24 +08:00
yunion-ci-robot
7754887614 Merge pull request #3741 from rainzm/automated-cherry-pick-of-#3739-upstream-release-2.12
Automated cherry pick of #3739: fix(region): Fix the return value when sycning snapshotpolicy
2019-11-18 14:31:26 +08:00
郑雨
a6dccf3fb6 fix(region): Fix the return value when sycning snapshotpolicy
This is a big bug: the return value of SyncSnapshotPolicies is a empty
value.
2019-11-18 12:50:58 +08:00
yunion-ci-robot
7c4d703271 Merge pull request #3737 from rainzm/automated-cherry-pick-of-#3736-upstream-release-2.12
Automated cherry pick of #3736: fix(region): Add snapshotpolicycache module for yunionapi
2019-11-18 12:46:24 +08:00
郑雨
96d89e4ec7 fix(region): Add snapshotpolicycache module for yunionapi
Remove extra 'models.SnapshotPolicyCache' in the first loop in
handlers.go.
Registered the moduels of snapshotpolicycache for yunionapi.
2019-11-18 11:40:16 +08:00
Yousong Zhou
92e492e00e build: 避免并发构建rpm时触发file exists错误 2019-11-18 02:44:08 +00:00
yunion-ci-robot
6b9a50eb5b Merge pull request #3702 from ioito/automated-cherry-pick-of-#3700-upstream-release-2.12
Automated cherry pick of #3700: fix: 避免仅返回一个zone信息
2019-11-18 09:18:22 +08:00
Qiu Jian
94e3217702 fix: always lock login-failed user when PasswordErrorLockCount not initialized 2019-11-18 08:53:29 +08:00
Zexi Li
db9ce1114e Merge pull request #3726 from swordqiu/automated-cherry-pick-of-#3724-upstream-release-2.12
Automated cherry pick of #3724: update vendor for qcloud cos-go-sdk
2019-11-18 00:36:11 +08:00
Qiu Jian
5f586ec8cd update vendor for qcloud cos-go-sdk 2019-11-16 15:20:25 +08:00
yunion-ci-robot
ee5559801f Merge pull request #3718 from ioito/automated-cherry-pick-of-#3699-upstream-release-2.12
Automated cherry pick of #3699: fix: cpuCmtbound sync for zstack
2019-11-15 20:22:21 +08:00
Qu Xuan
b4c4a14af0 fix: cpuCmtbound sync for zstack 2019-11-15 19:08:01 +08:00
Zexi Li
ec8d401cf1 Merge pull request #3697 from swordqiu/automated-cherry-pick-of-#3696-upstream-release-2.12
Automated cherry pick of #3696: fix: network-delete may fail immidiately after deleting vm
2019-11-15 18:41:07 +08:00
Qu Xuan
48c754b194 fix: 避免匹配到售罄的套餐 2019-11-15 17:52:35 +08:00
yunion-ci-robot
2b2b99a950 Merge pull request #3708 from ioito/automated-cherry-pick-of-#3593-upstream-release-2.12
Automated cherry pick of #3593: fix: 避免公有云绑定秘钥后解密密码为空
2019-11-15 17:18:21 +08:00
yunion-ci-robot
54eed99893 Merge pull request #3671 from tb365/automated-cherry-pick-of-#3670-upstream-release-2.12
Automated cherry pick of #3670: * 修复redis新建无密码及公网访问地址未同步的问题
2019-11-15 16:54:21 +08:00
Qu Xuan
01b6ff6516 fix: 避免公有云绑定秘钥后解密密码为空 2019-11-15 16:15:05 +08:00
Zexi Li
6631b2cc65 Merge pull request #3695 from wanyaoqi/automated-cherry-pick-of-#3693-upstream-release-2.12
Automated cherry pick of #3693: bm register find network
2019-11-15 16:03:07 +08:00
yunion-ci-robot
ea7aaa640a Merge pull request #3689 from tb365/automated-cherry-pick-of-#3687-upstream-release-2.12
Automated cherry pick of #3687: elastic cache purge bugfix
2019-11-15 15:56:21 +08:00
Zexi Li
addfe349f1 Merge pull request #3705 from zexi/automated-cherry-pick-of-#3703-upstream-release-2.12
Automated cherry pick of #3703: webconsole: skip spice access interval check
2019-11-15 15:06:49 +08:00
Zexi Li
36468628cb webconsole: skip spice access interval check 2019-11-15 15:06:45 +08:00
Qu Xuan
d86171f906 fix: 避免仅返回一个zone信息 2019-11-15 14:36:56 +08:00
Qiu Jian
8361b96ef8 fix: network-delete may fail immidiately after deleting vm 2019-11-15 12:40:44 +08:00
wanyaoqi
45177492a5 bm register find network 2019-11-15 12:08:47 +08:00
TangBin
ba2da6707f huawei config vm config fix 2019-11-15 11:45:07 +08:00
TangBin
6efd09592f remove useless aws instance type config 2019-11-15 11:45:06 +08:00
TangBin
4141bd2b7d elastic cache purge bugfix 2019-11-15 11:38:28 +08:00
TangBin
5adeeb145a * 修复redis新建无密码及公网访问地址未同步的问题 2019-11-15 11:34:02 +08:00
yunion-ci-robot
02a8de8993 Merge pull request #3686 from ioito/automated-cherry-pick-of-#3684-upstream-release-2.12
Automated cherry pick of #3684: fix: 避免有些云不能创建default名称安全组
2019-11-15 10:59:20 +08:00
yunion-ci-robot
353e7658dc Merge pull request #3682 from swordqiu/automated-cherry-pick-of-#3681-upstream-release-2.12
Automated cherry pick of #3681: fix: baremetal server rebuild root fail to cache image
2019-11-15 10:32:21 +08:00
Qu Xuan
b4e712fe7d fix: 避免有些云不能创建default名称安全组 2019-11-15 10:31:28 +08:00
yunion-ci-robot
8b9d903098 Merge pull request #3659 from tb365/automated-cherry-pick-of-#3657-upstream-release-2.12
Automated cherry pick of #3657: user-project create api bugfix
2019-11-15 09:35:22 +08:00
Qiu Jian
95dd972ff2 fix: baremetal server rebuild root fail to cache image 2019-11-15 02:35:02 +08:00
yunion-ci-robot
4fcfbf8c08 Merge pull request #3668 from wanyaoqi/automated-cherry-pick-of-#3666-upstream-release-2.12
Automated cherry pick of #3666: gpu add export keys
2019-11-14 23:56:22 +08:00
yunion-ci-robot
fd0eb3e12c Merge pull request #3675 from ioito/automated-cherry-pick-of-#3673-upstream-release-2.12
Automated cherry pick of #3673: fix: 避免region同名问题
2019-11-14 22:07:21 +08:00
yunion-ci-robot
d76f9635f0 Merge pull request #3665 from ioito/automated-cherry-pick-of-#3663-upstream-release-2.12
Automated cherry pick of #3663: fix: aws 安全组desc为必传字段
2019-11-14 21:59:21 +08:00
Qu Xuan
26bc4b10ad fix: 避免region同名问题 2019-11-14 18:31:01 +08:00
wanyaoqi
f9e57aad03 gpu add export keys 2019-11-14 16:23:45 +08:00
Qu Xuan
e6f12a7d35 fix: aws 安全组desc为必传字段 2019-11-14 14:37:19 +08:00
yunion-ci-robot
50fc75aab6 Merge pull request #3661 from swordqiu/automated-cherry-pick-of-#3660-upstream-release-2.12
Automated cherry pick of #3660: fix: check password complexity even if password length is zero
2019-11-14 13:11:20 +08:00
Qiu Jian
5aab6a4672 fix: check password complexity even if password length is zero 2019-11-14 12:55:55 +08:00
yunion-ci-robot
004f7f78ba Merge pull request #3655 from swordqiu/automated-cherry-pick-of-#3654-upstream-release-2.12
Automated cherry pick of #3654: fix: send full reason body for *_fail_reason
2019-11-14 12:41:19 +08:00
yunion-ci-robot
eb92a59297 Merge pull request #3652 from swordqiu/automated-cherry-pick-of-#3649-upstream-release-2.12
Automated cherry pick of #3649: fix: agent-list show zone info
2019-11-14 12:39:20 +08:00
yunion-ci-robot
8ddc46a09f Merge pull request #3647 from wanyaoqi/automated-cherry-pick-of-#3645-upstream-release-2.12
Automated cherry pick of #3645: baremetal register optimize
2019-11-14 12:37:20 +08:00
TangBin
4a3088e23e user-project create api bugfix 2019-11-14 11:56:21 +08:00
Qiu Jian
4b1ae7ee6a fix: send full reason body for *_fail_reason 2019-11-14 11:35:10 +08:00
yunion-ci-robot
6155e6b83e Merge pull request #3608 from yousong/automated-cherry-pick-of-#3606-upstream-release-2.12
Automated cherry pick of #3606: influxdb: 记录结果中的tags
2019-11-14 00:25:20 +08:00
yunion-ci-robot
52542c4797 Merge pull request #3638 from ioito/automated-cherry-pick-of-#3636-upstream-release-2.12
Automated cherry pick of #3636: fix: 避免associationtype异常
2019-11-14 00:10:20 +08:00
Qiu Jian
23288535f0 fix: agent-list show zone info 2019-11-13 23:33:45 +08:00
yunion-ci-robot
d94401c81f Merge pull request #3580 from ioito/automated-cherry-pick-of-#3578-upstream-release-2.12
Automated cherry pick of #3578: fix: 创建数据库时指定账号权限时,避免数据库出现中间状态
2019-11-13 20:31:21 +08:00
wanyaoqi
0a91b14974 baremetal register optimize 2019-11-13 20:24:38 +08:00
Qu Xuan
a349f18ac8 fix: 避免associationtype异常 2019-11-13 19:57:17 +08:00
yunion-ci-robot
0122a10d13 Merge pull request #3596 from tb365/automated-cherry-pick-of-#3595-upstream-release-2.12
Automated cherry pick of #3595: elastic cache sync bugfix
2019-11-13 19:50:19 +08:00
yunion-ci-robot
608a81f23d Merge pull request #3633 from ioito/automated-cherry-pick-of-#3631-upstream-release-2.12
Automated cherry pick of #3631: fix: 避免匹配到64导致version是6
2019-11-13 19:46:19 +08:00
yunion-ci-robot
13e9e0bac2 Merge pull request #3623 from swordqiu/automated-cherry-pick-of-#3621-upstream-release-2.12
Automated cherry pick of #3621: fix: nic teaming/bonding not working properly
2019-11-13 17:49:19 +08:00
Zexi Li
1967734321 Merge pull request #3643 from zexi/automated-cherry-pick-of-#3641-upstream-release-2.12
Automated cherry pick of #3641: climc: fix k8s sa not register
2019-11-13 16:49:53 +08:00
Zexi Li
0472ad2099 climc: fix k8s sa not register 2019-11-13 16:49:01 +08:00
Qu Xuan
1b86e01fa0 fix: 避免匹配到64导致version是6 2019-11-13 14:50:20 +08:00
yunion-ci-robot
a10dbb815a Merge pull request #3629 from rainzm/automated-cherry-pick-of-#3628-upstream-release-2.12
Automated cherry pick of #3628: fix(region): Init database table 'guestgroup_tbl'
2019-11-13 11:37:19 +08:00
郑雨
fb667b4fa1 fix(region): Init database table 'guestgroup_tbl'
That delete models.GroupguestManager in the second loop of InitHandlers
because of useless Groupguest's api cause table 'guestgroup_tbl' will
not init in a new system. So add models.GroupguestManager to the first
loop to accomplish the goal.
2019-11-13 11:34:11 +08:00
TangBin
9731377ad7 elastic cache sync bugfix 2019-11-13 11:09:15 +08:00
Yousong Zhou
16d4459c87 climc: 添加lblistener{,rule}-backend-status命令 2019-11-13 02:42:09 +00:00
Yousong Zhou
df785375cd lblis, lbr: 增加查询后端状态接口 2019-11-13 02:42:09 +00:00
Yousong Zhou
064ee8cba5 lbbackends: 使用yunion.io/pkg/errors 2019-11-13 02:42:09 +00:00
Yousong Zhou
82ba269249 influxdb: 记录结果中的tags 2019-11-13 02:42:09 +00:00
Qu Xuan
90bfc06ddc fix: 创建数据库时指定账号权限时,避免数据库出现中间状态 2019-11-13 10:23:07 +08:00
yunion-ci-robot
14697aea1f Merge pull request #3613 from wanyaoqi/automated-cherry-pick-of-#3611-upstream-release-2.12
Automated cherry pick of #3611: fix resie fs
2019-11-13 01:40:19 +08:00
yunion-ci-robot
4f42e496d1 Merge pull request #3600 from ioito/automated-cherry-pick-of-#3598-upstream-release-2.12
Automated cherry pick of #3598: fix: 支持创建时指定多个安全组
2019-11-13 01:30:19 +08:00
yunion-ci-robot
8c8c2220ca Merge pull request #3592 from wanyaoqi/automated-cherry-pick-of-#3577-upstream-release-2.12
Automated cherry pick of #3577: postpaid expire support premise
2019-11-13 01:18:20 +08:00
yunion-ci-robot
504442e11e Merge pull request #3617 from yousong/automated-cherry-pick-of-#3523-upstream-release-2.12
Automated cherry pick of #3523: lockman: log bug with Errorf
2019-11-13 00:50:19 +08:00
yunion-ci-robot
c8add2b3e4 Merge pull request #3574 from ioito/automated-cherry-pick-of-#3569-upstream-release-2.12
Automated cherry pick of #3569: fix: avolid duplicate secgroup name error when create secgroup
2019-11-13 00:41:20 +08:00
Qiu Jian
e577937dc7 fix: nic teaming/bonding not working properly 2019-11-13 00:10:01 +08:00
Yousong Zhou
1912ba138b vendor: restore a few files to locally managed version 2019-11-12 15:24:40 +00:00
Yousong Zhou
6b4cb1d1b2 vendor: update 2019-11-12 15:24:40 +00:00
yunion-ci-robot
7b8ddc12d3 Merge pull request #3604 from swordqiu/automated-cherry-pick-of-#3603-upstream-release-2.12
Automated cherry pick of #3603: fix: create baremetal server with iso, baremetal register support redfish
2019-11-12 21:44:26 +08:00
yunion-ci-robot
fe5cf5c175 Merge pull request #3584 from ioito/automated-cherry-pick-of-#3582-upstream-release-2.12
Automated cherry pick of #3582: fix: 避免Openstack越过存储检查
2019-11-12 21:43:33 +08:00
Yousong Zhou
d9c6cc2dc4 lockman: test multiple lockman 2019-11-12 13:26:09 +00:00
Yousong Zhou
4348939bcd cloudcommon: options: new options for etcd lockman 2019-11-12 13:26:09 +00:00
Yousong Zhou
2e5cc6bb85 lockman: distributed lockman with etcd 2019-11-12 13:26:09 +00:00
Yousong Zhou
789b09d092 lockman: log bug with Errorf 2019-11-12 13:26:09 +00:00
wanyaoqi
20fb6991c9 fix resie fs 2019-11-12 21:07:35 +08:00
Qiu Jian
30e3c6ac14 fix: create baremetal server with iso, baremetal register support redfish 2019-11-12 20:16:36 +08:00
Qu Xuan
da3122840e fix: 支持创建时指定多个安全组 2019-11-12 20:02:21 +08:00
Zexi Li
5dfdb10a93 Merge pull request #3587 from rainzm/automated-cherry-pick-of-#3576-upstream-release-2.12
Automated cherry pick of #3576: fix(region): Check if group and guest belong to same project
2019-11-12 17:48:02 +08:00
wanyaoqi
1d90829e3a postpaid expire support premise 2019-11-12 17:25:42 +08:00
郑雨
f38a4ec148 fix(region): Check if group and guest belong to same project
If group and guest belong to different projects, return httperrors.ForbiddenError.
Fix the bug that disabled instance group can be binded.
2019-11-12 16:41:45 +08:00
Qu Xuan
fa649cf1c4 fix: 避免Openstack越过存储检查 2019-11-12 15:17:24 +08:00
Qu Xuan
f9639714e4 fix: avolid duplicate secgroup name error when create secgroup 2019-11-12 10:13:08 +08:00
888 changed files with 50410 additions and 11424 deletions

View File

@@ -182,7 +182,6 @@ dep:
mod:
go get $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p'))
go get github.com/Azure/azure-sdk-for-go@latest
go mod tidy
go mod vendor -v

View File

@@ -134,7 +134,11 @@ fi
rpmbuild --define "_topdir $BUILDROOT" -bb $SPEC_FILE
mkdir -p $OUTPUT_DIR
cp -fr $RPM_DIR/* $OUTPUT_DIR/
find $RPM_DIR -type f | while read f; do
d="$(dirname "$f")"
d="$OUTPUT_DIR/${d#$RPM_DIR}"
mkdir -p "$d"
cp $f $d
done
rm -fr $BUILDROOT

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,44 @@
// 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 shell
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type AssociatedBillListOptions struct {
options.BaseListOptions
StartDay int `help:"time range of the associated bills, example: 20060102" required:"true"`
EndDay int `help:"time range of the associated bills, example: 20060102" required:"true"`
ResourceId string `help:"resource id"`
}
R(&AssociatedBillListOptions{}, "associated-bill-list", "List associated bills",
func(s *mcclient.ClientSession, args *AssociatedBillListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.AssociatedBills.List(s, params)
if err != nil {
return err
}
printList(result, modules.AssociatedBills.GetColumns(s))
return nil
})
}

View File

@@ -21,10 +21,12 @@ import (
"yunion.io/x/jsonutils"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
objectshell "yunion.io/x/onecloud/pkg/multicloud/objectstore"
)
func init() {
@@ -105,9 +107,11 @@ func init() {
})
type BucketListObjectsOptions struct {
ID string `help:"ID or name of bucket" json:"-"`
Prefix string `help:"List objects with prefix"`
Recursive bool `help:"List objects recursively"`
ID string `help:"ID or name of bucket" json:"-"`
Prefix string `help:"List objects with prefix"`
Recursive bool `help:"List objects recursively"`
Limit int `help:"maximal items per request"`
PagingMarker string `help:"paging marker"`
}
R(&BucketListObjectsOptions{}, "bucket-object-list", "List objects in a bucket", func(s *mcclient.ClientSession, args *BucketListObjectsOptions) error {
params, err := options.StructToParams(args)
@@ -119,8 +123,11 @@ func init() {
return err
}
arrays, _ := result.GetArray("objects")
listResult := modulebase.ListResult{Data: arrays}
listResult := modulebase.ListResult{}
err = result.Unmarshal(&listResult)
if err != nil {
return err
}
printList(&listResult, []string{})
return nil
})
@@ -159,9 +166,10 @@ func init() {
Path string `help:"Path to file to upload" required:"true"`
ContentLength int64 `help:"Content lenght (bytes)" default:"-1"`
ContentType string `help:"Content type"`
StorageClass string `help:"storage CLass"`
Acl string `help:"object acl." choices:"private|public-read|public-read-write"`
objectshell.ObjectHeaderOptions
}
R(&BucketUploadObjectsOptions{}, "bucket-object-upload", "Upload an object into a bucket", func(s *mcclient.ClientSession, args *BucketUploadObjectsOptions) error {
var body io.Reader
@@ -187,7 +195,9 @@ func init() {
return fmt.Errorf("required content-length")
}
err := modules.Buckets.Upload(s, args.ID, args.KEY, body, args.ContentLength, args.ContentType, args.StorageClass, args.Acl)
meta := args.ObjectHeaderOptions.Options2Header()
err := modules.Buckets.Upload(s, args.ID, args.KEY, body, args.ContentLength, args.StorageClass, args.Acl, meta)
if err != nil {
return err
}
@@ -290,4 +300,27 @@ func init() {
printObject(result)
return nil
})
type BucketSetMetadataOptions struct {
ID string `help:"ID or name of bucket" json:"-"`
Key []string `help:"Optional object key" json:"key"`
objectshell.ObjectHeaderOptions
}
R(&BucketSetMetadataOptions{}, "bucket-set-metadata", "Set metadata of object", func(s *mcclient.ClientSession, args *BucketSetMetadataOptions) error {
input := api.BucketMetadataInput{}
input.Key = args.Key
input.Metadata = args.ObjectHeaderOptions.Options2Header()
err := input.Validate()
if err != nil {
return err
}
result, err := modules.Buckets.PerformAction(s, args.ID, "metadata", jsonutils.Marshal(input))
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -19,6 +19,7 @@ import (
"yunion.io/x/jsonutils"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
@@ -86,6 +87,19 @@ func init() {
R(&options.SAliyunCloudAccountCreateOptions{}, "cloud-account-create-aliyun", "Create an Aliyun cloud account", func(s *mcclient.ClientSession, args *options.SAliyunCloudAccountCreateOptions) error {
params := jsonutils.Marshal(args)
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("Aliyun"), "provider")
options := jsonutils.NewDict()
if len(args.OptionsBillingReportBucket) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
}
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")
}
result, err := modules.Cloudaccounts.Create(s, params)
if err != nil {
return err
@@ -122,6 +136,12 @@ func init() {
if len(args.OptionsBillingReportBucket) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
}
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")
}
@@ -244,6 +264,34 @@ func init() {
if params.Size() == 0 {
return InvalidUpdateError()
}
options := jsonutils.NewDict()
if len(args.OptionsBillingReportBucket) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
}
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")
}
removeOptions := make([]string, 0)
if args.RemoveOptionsBillingReportBucket {
removeOptions = append(removeOptions, "billing_report_bucket")
}
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")
}
result, err := modules.Cloudaccounts.Update(s, args.ID, params)
if err != nil {
return err
@@ -301,6 +349,12 @@ func init() {
if len(args.OptionsBillingReportBucket) > 0 {
options.Add(jsonutils.NewString(args.OptionsBillingReportBucket), "billing_report_bucket")
}
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")
}
@@ -308,6 +362,12 @@ func init() {
if args.RemoveOptionsBillingReportBucket {
removeOptions = append(removeOptions, "billing_report_bucket")
}
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")
}
@@ -653,4 +713,19 @@ func init() {
printObject(result)
return nil
})
type CloudaccountShareModeOptions struct {
ID string `help:"ID or name of cloud account"`
MODE string `help:"cloud account share mode" choices:"account_domain|system|provider_domain"`
}
R(&CloudaccountShareModeOptions{}, "cloud-account-share-mode", "Set share_mode of a cloud account", func(s *mcclient.ClientSession, args *CloudaccountShareModeOptions) error {
input := api.CloudaccountShareModeInput{}
input.ShareMode = args.MODE
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "share-mode", jsonutils.Marshal(input))
if err != nil {
return err
}
printObject(result)
return nil
})
}

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"`
UpdateDingtalk bool `help:"if update dingtalk"`
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"`
}
R(&ContactsUpdateOptions{}, "contact-update", "Create, delete or update contact for user", func(s *mcclient.ClientSession, args *ContactsUpdateOptions) error {
arr := jsonutils.NewArray()
@@ -52,12 +52,14 @@ func init() {
params := jsonutils.NewDict()
params.Add(arr, "contacts")
if args.UpdateDingtalk {
params.Add(jsonutils.JSONTrue, "update_dingtalk")
pulls := jsonutils.NewArray()
for _, pull := range args.Pull {
pulls.Add(jsonutils.NewString(pull))
}
params.Add(pulls, "pull")
contact, err := modules.Contacts.PerformAction(s, args.UID, "update-contact", params)
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
if err != nil {
return err
}
@@ -66,6 +68,22 @@ 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())
params.Set("pull", jsonutils.NewArray(jsonutils.NewString(args.CONTACTTYPE)))
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", 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"`
@@ -78,7 +96,7 @@ func init() {
arr.Add(tmpObj)
params := jsonutils.NewDict()
params.Add(arr, "contacts")
contact, err := modules.Contacts.PerformAction(s, args.UID, "update-contact", params)
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
if err != nil {
return err
}
@@ -133,7 +151,7 @@ func init() {
params.Add(jsonutils.JSONTrue, "details")
result, err := modules.Contacts.Get(s, args.UID, params)
result, err := modules.Contacts.CustomizedGet(s, args.UID, params)
if err != nil {
return err
}
@@ -166,19 +184,10 @@ func init() {
CONTACT string `help:"The contacts details mobile number or email address"`
}
R(&ContactsVerifyOptions{}, "contact-verify-trigger", "Trigger contact verify", func(s *mcclient.ClientSession, args *ContactsVerifyOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.CONTACT_TYPE), "contact_type")
params.Add(jsonutils.NewString(args.CONTACT), "contact")
/*
if len(args.Email) > 0 {
params.Add(jsonutils.NewString(args.Email), "email")
}
if len(args.Mobile) > 0 {
params.Add(jsonutils.NewString(args.Mobile), "mobile")
}
*/
_, err := modules.Contacts.PerformAction(s, args.UID, "verify", params)
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)
if err != nil {
return err
}

View File

@@ -0,0 +1,64 @@
// 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 shell
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type DBInstanceAccountListOptions struct {
options.BaseListOptions
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
}
R(&DBInstanceAccountListOptions{}, "dbinstance-account-list", "List DB instance accounts", func(s *mcclient.ClientSession, opts *DBInstanceAccountListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstanceAccounts.List(s, params)
if err != nil {
return err
}
printList(result, modules.DBInstanceAccounts.GetColumns(s))
return nil
})
type DBInstanceAccountIdOptions struct {
ID string `help:"ID or Name of DBInstanceaccount"`
}
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-show", "Show DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
account, err := modules.DBInstanceAccounts.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(account)
return nil
})
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-delete", "Delete DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
account, err := modules.DBInstanceAccounts.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(account)
return nil
})
}

View File

@@ -312,37 +312,6 @@ func init() {
return nil
})
type DBInstanceAccountListOptions struct {
options.BaseListOptions
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
}
R(&DBInstanceAccountListOptions{}, "dbinstance-account-list", "List DB instance accounts", func(s *mcclient.ClientSession, opts *DBInstanceAccountListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstanceAccounts.List(s, params)
if err != nil {
return err
}
printList(result, modules.DBInstanceAccounts.GetColumns(s))
return nil
})
type DBInstanceAccountIdOptions struct {
ID string `help:"ID or Name of DBInstanceaccount"`
}
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-show", "Show DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
account, err := modules.DBInstanceAccounts.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(account)
return nil
})
type DBInstancePrivilegeListOptions struct {
options.BaseListOptions
DBInstanceaccount string `help:"ID or Name of DBInstanceaccount" json:"dbinstanceaccount"`
@@ -362,4 +331,21 @@ func init() {
return nil
})
type DBInstanceChangeOwnerOptions struct {
ID string `help:"DBInstance to change owner" json:"-"`
PROJECT string `help:"Project ID or change" json:"tenant"`
}
R(&DBInstanceChangeOwnerOptions{}, "dbinstance-change-owner", "Change owner porject of a dbinstance", func(s *mcclient.ClientSession, opts *DBInstanceChangeOwnerOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstance.PerformAction(s, opts.ID, "change-owner", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

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

View File

@@ -53,6 +53,8 @@ func init() {
Uuid string `help:"find host with given system uuid"`
CdromBoot *bool `help:"filter hosts list by cdrom_boot=true|false"`
options.BaseListOptions
}
R(&HostListOptions{}, "host-list", "List hosts", func(s *mcclient.ClientSession, opts *HostListOptions) error {
@@ -133,6 +135,12 @@ func init() {
return nil
})
R(&HostOpsOptions{}, "host-sync-config", "Synchronize config of a host", func(s *mcclient.ClientSession, args *HostOpsOptions) error {
results := modules.Hosts.BatchPerformAction(s, args.ID, "sync-config", nil)
printBatchResults(results, modules.Hosts.GetColumns(s))
return nil
})
R(&HostOpsOptions{}, "host-prepare", "Prepare a host for installation", func(s *mcclient.ClientSession, args *HostOpsOptions) error {
results := modules.Hosts.BatchPerformAction(s, args.ID, "prepare", nil)
printBatchResults(results, modules.Hosts.GetColumns(s))
@@ -200,6 +208,10 @@ func init() {
// AccessIp string `help:"Change access ip, CAUTION!!!!"`
AccessMac string `help:"Change baremetal access MAC, CAUTION!!!!"`
Uuid string `help:"Change baremetal UUID, CAUTION!!!!"`
IpmiUsername string `help:"IPMI user"`
IpmiPassword string `help:"IPMI password"`
IpmiIpAddr string `help:"IPMI ip_addr"`
}
R(&HostUpdateOptions{}, "host-update", "Update information of a host", func(s *mcclient.ClientSession, args *HostUpdateOptions) error {
params := jsonutils.NewDict()
@@ -230,6 +242,15 @@ func init() {
if len(args.Uuid) > 0 {
params.Add(jsonutils.NewString(args.Uuid), "uuid")
}
if len(args.IpmiUsername) > 0 {
params.Add(jsonutils.NewString(args.IpmiUsername), "ipmi_username")
}
if len(args.IpmiPassword) > 0 {
params.Add(jsonutils.NewString(args.IpmiPassword), "ipmi_password")
}
if len(args.IpmiIpAddr) > 0 {
params.Add(jsonutils.NewString(args.IpmiIpAddr), "ipmi_ip_addr")
}
if params.Size() == 0 {
return fmt.Errorf("Not data to update")
}
@@ -352,16 +373,16 @@ func init() {
ID string `help:"ID or Name of host"`
WIRE string `help:"ID or Name of wire to attach"`
MAC string `help:"Mac address of NIC"`
INDEX int64 `help:"nic index"`
Type string `help:"Nic type" choices:"admin|ipmi"`
IpAddr string `help:"IP address"`
Index int64 `help:"nic index" default:"-1"`
}
R(&HostAddNetIfOptions{}, "host-add-netif", "Host add a NIC", func(s *mcclient.ClientSession, args *HostAddNetIfOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.WIRE), "wire")
params.Add(jsonutils.NewString(args.MAC), "mac")
params.Add(jsonutils.JSONTrue, "link_up")
params.Add(jsonutils.NewInt(args.Index), "index")
params.Add(jsonutils.NewInt(args.INDEX), "index")
if len(args.Type) > 0 {
params.Add(jsonutils.NewString(args.Type), "nic_type")
}

View File

@@ -16,6 +16,7 @@ package shell
import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
@@ -165,8 +166,8 @@ func init() {
}
printObject(result)
return nil
},
)
})
R(&GuestImageOptions{}, "guest-image-mark-unprotected", "Mark image protected", func(s *mcclient.ClientSession,
args *GuestImageOptions) error {
@@ -178,7 +179,55 @@ func init() {
}
printObject(result)
return nil
},
})
type GuestImageOperationOptions struct {
ID []string `help:"Guest Image ID or Name"`
}
type GuestImagePublicOptions struct {
GuestImageOperationOptions
Scope string `help:"sharing scope" choices:"system|domain"`
ShareToProject []string `help:"Share to prject"`
}
R(&GuestImageOperationOptions{}, "guest-image-private", "Make a guest image private",
func(s *mcclient.ClientSession, args *GuestImageOperationOptions) error {
if len(args.ID) == 0 {
return errors.Error("No guest image ID provided")
} else if len(args.ID) == 1 {
result, err := modules.GuestImages.PerformAction(s, args.ID[0], "private", nil)
if err != nil {
return err
}
printObject(result)
} else {
results := modules.GuestImages.BatchPerformAction(s, args.ID, "private", nil)
printBatchResults(results, modules.GuestImages.GetColumns(s))
}
return nil
},
)
R(&GuestImagePublicOptions{}, "guest-image-public", "Make a guest image public",
func(s *mcclient.ClientSession, args *GuestImagePublicOptions) error {
params, err := options.StructToParams(args)
if err != nil {
return err
}
if len(args.ID) == 0 {
return errors.Error("No guest image ID provided")
} else if len(args.ID) == 1 {
result, err := modules.GuestImages.PerformAction(s, args.ID[0], "public", params)
if err != nil {
return err
}
printObject(result)
} else {
results := modules.GuestImages.BatchPerformAction(s, args.ID, "public", params)
printBatchResults(results, modules.GuestImages.GetColumns(s))
}
return nil
},
)
}

View File

@@ -138,6 +138,7 @@ func init() {
IsPublic string `help:"filter images public or not(True, False or None)" choices:"true|false"`
IsStandard string `help:"filter images standard or non-standard" choices:"true|false"`
Protected string `help:"filter images by protected" choices:"true|false"`
IsUefi bool `help:"list uefi image"`
Format []string `help:"Disk formats"`
Name string `help:"Name filter"`
}
@@ -155,6 +156,9 @@ func init() {
if len(args.Protected) > 0 {
params.Add(jsonutils.NewString(args.Protected), "protected")
}
if args.IsUefi {
params.Add(jsonutils.JSONTrue, "uefi")
}
if len(args.Tenant) > 0 {
tid, e := modules.Projects.GetId(s, args.Tenant, nil)
if e != nil {

View File

@@ -89,4 +89,11 @@ func init() {
printObject(lblistenerrule)
return nil
})
R(&options.LoadbalancerListenerRuleGetBackendStatusOptions{}, "lblistenerrule-backend-status", "Get lblistenerrule backend status", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerRuleGetBackendStatusOptions) error {
backendStatus, err := modules.LoadbalancerListenerRules.GetSpecific(s, opts.ID, "backend-status", nil)
if err != nil {
return err
}
return printLbBackendStatus(backendStatus)
})
}

View File

@@ -15,13 +15,44 @@
package shell
import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func printLbBackendStatus(backendStatus jsonutils.JSONObject) error {
arr, ok := backendStatus.(*jsonutils.JSONArray)
if !ok {
return fmt.Errorf("want json array, got %s", backendStatus.String())
}
objList, err := arr.GetArray()
if err != nil {
return err
}
listResult := &modulebase.ListResult{
Data: objList,
}
columns := []string{
"id",
"name",
"backend_type",
"backend_id",
"address",
"port",
"weight",
"check_time",
"check_status",
"check_code",
}
printList(listResult, columns)
return nil
}
func init() {
R(&options.LoadbalancerListenerCreateOptions{}, "lblistener-create", "Create lblistener", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerCreateOptions) error {
@@ -99,4 +130,11 @@ func init() {
printObject(lblistener)
return nil
})
R(&options.LoadbalancerListenerGetBackendStatusOptions{}, "lblistener-backend-status", "Get lblistene backend status", func(s *mcclient.ClientSession, opts *options.LoadbalancerListenerGetBackendStatusOptions) error {
backendStatus, err := modules.LoadbalancerListeners.GetSpecific(s, opts.ID, "backend-status", nil)
if err != nil {
return err
}
return printLbBackendStatus(backendStatus)
})
}

View File

@@ -418,7 +418,7 @@ func init() {
})
type NetworkAddressOptions struct {
NETWORK string `help:"if of network to query"`
NETWORK string `help:"id or name of network to query"`
}
R(&NetworkAddressOptions{}, "network-addresses", "Query used addresses of network", func(s *mcclient.ClientSession, args *NetworkAddressOptions) error {
result, err := modules.Networks.GetSpecific(s, args.NETWORK, "addresses", nil)
@@ -433,4 +433,31 @@ func init() {
printList(&listResult, nil)
return nil
})
type NetworkSyncOptions struct {
NETWORK string `help:"id or name of network to sync"`
}
R(&NetworkSyncOptions{}, "network-sync", "Sync network status", func(s *mcclient.ClientSession, args *NetworkSyncOptions) error {
result, err := modules.Networks.PerformAction(s, args.NETWORK, "sync", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type NetworkStatusOptions struct {
NETWORK string `help:"id or name of network to sync" json:"-"`
STATUS string `help:"status of network" choices:"available|unavailable" json:"status"`
Reason string `help:"reason to change status" json:"reason"`
}
R(&NetworkStatusOptions{}, "network-status", "Set on-premise network status", func(s *mcclient.ClientSession, args *NetworkStatusOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Networks.PerformAction(s, args.NETWORK, "status", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -29,20 +29,26 @@ func init() {
*/
type NotificationCreateOptions struct {
Uid []string `help:"The user you wanna sent to (Keystone User ID)"`
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"`
Remark string `help:"Remark or description of the notification"`
Group bool `help:"Send to group"`
CONTACTTYPE string `help:"User's contacts type"`
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"`
Remark string `help:"Remark or description of the notification"`
Group bool `help:"Send to group"`
}
R(&NotificationCreateOptions{}, "notify", "Send a notification to sb", func(s *mcclient.ClientSession, args *NotificationCreateOptions) error {
type NotificationCreateSingleOptions struct {
UID string `help:"The user you wanna sent to (Keystone User ID)"`
NotificationCreateOptions
}
R(&NotificationCreateSingleOptions{}, "notify", "Send a notification to someone", func(s *mcclient.ClientSession,
args *NotificationCreateSingleOptions) error {
msg := notify.SNotifyMessage{}
if args.Group {
msg.Gid = args.Uid
msg.Gid = []string{args.UID}
} else {
msg.Uid = args.Uid
msg.Uid = []string{args.UID}
}
msg.ContactType = notify.TNotifyChannel(args.CONTACTTYPE)
@@ -57,6 +63,35 @@ func init() {
}
return nil
})
type NotificationCreateMultiOptions struct {
Uid []string `help:"The user you wanna sent to (Keystone User ID)"`
NotificationCreateOptions
}
R(&NotificationCreateMultiOptions{}, "notify-batch", "Send a notification to someones",
func(s *mcclient.ClientSession, args *NotificationCreateMultiOptions) error {
msg := notify.SNotifyMessage{}
if args.Group {
msg.Gid = args.Uid
} else {
msg.Uid = args.Uid
}
msg.ContactType = notify.TNotifyChannel(args.CONTACTTYPE)
msg.Topic = args.TOPIC
msg.Priority = notify.TNotifyPriority(args.PRIORITY)
msg.Msg = args.MSG
msg.Remark = args.Remark
err := notify.Notifications.Send(s, msg)
if err != nil {
return err
}
return nil
})
/**
* 发送全局通知
*/
@@ -72,7 +107,7 @@ func init() {
R(&NotificationBroadcastOptions{}, "notify-broadcast", "Send a notification to all online users", func(s *mcclient.ClientSession, args *NotificationBroadcastOptions) error {
msg := notify.SNotifyMessage{}
msg.Broadcast = true
msg.ContactType = notify.TNotifyChannel("webconsole")
msg.ContactType = notify.NotifyByWebConsole
msg.Topic = args.Topic
msg.Priority = notify.TNotifyPriority(args.Priority)
msg.Msg = args.Msg

View File

@@ -34,7 +34,24 @@ func init() {
}
body := jsonutils.NewDict()
body.Add(tmp, args.CONTACTTYPE)
modules.Configs.Create(s, body)
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)
return nil
})

View File

@@ -0,0 +1,90 @@
// 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 shell
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type NotifyTemplateUpdateOptions struct {
CONTACTTYPE string `help:"the contanct type, such as 'email', 'mobile'"`
TOPIC string `help:"the topic of temlate, such as 'VERIFY', 'ALARM'"`
TEMPLATETYPE string `help:"the type of template" choices:"content|title|remote"`
CONTENT string `help:"the content of template"`
}
R(&NotifyTemplateUpdateOptions{}, "notify-template-update", "Create, update contact for user", func(s *mcclient.ClientSession,
args *NotifyTemplateUpdateOptions) error {
arr := jsonutils.NewArray()
tmpObj := jsonutils.NewDict()
tmpObj.Add(jsonutils.NewString(args.TOPIC), "topic")
tmpObj.Add(jsonutils.NewString(args.TEMPLATETYPE), "template_type")
tmpObj.Add(jsonutils.NewString(args.CONTENT), "content")
arr.Add(tmpObj)
params := jsonutils.NewDict()
params.Add(arr, "notifytemplates")
contact, err := modules.NotifyTemplates.PerformAction(s, args.CONTACTTYPE, "update-template", params)
if err != nil {
return err
}
printObject(contact)
return nil
})
type NotifyTemplateDeleteOptions struct {
CONTACTTYPE string `help:"the contanct type, such as 'email', 'mobile'"`
Topic string `help:"the topic of temlate, such as 'VERIFY', 'ALARM'"`
}
R(&NotifyTemplateDeleteOptions{}, "notify-template-delete", "delete notify template",
func(s *mcclient.ClientSession, args *NotifyTemplateDeleteOptions) error {
tmpObj := jsonutils.NewDict()
tmpObj.Add(jsonutils.NewString(args.CONTACTTYPE), "contact_type")
tmpObj.Add(jsonutils.NewString(args.Topic), "topic")
_, err := modules.NotifyTemplates.DeleteContents(s, tmpObj)
if err != nil {
return err
}
return nil
})
type NotifyTemplateListOptions struct {
options.BaseListOptions
}
R(&NotifyTemplateListOptions{}, "notify-template-list", "List all notify template",
func(s *mcclient.ClientSession, args *NotifyTemplateListOptions) error {
params, err := args.BaseListOptions.Params()
if err != nil {
return err
}
result, err := modules.NotifyTemplates.List(s, params)
if err != nil {
return err
}
printList(result, modules.NotifyTemplates.GetColumns(s))
return nil
})
}

View File

@@ -28,6 +28,7 @@ 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()
@@ -36,6 +37,9 @@ 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

@@ -177,6 +177,19 @@ func init() {
},
)
R(&options.ServerCreateOptions{}, "server-check-create-data", "Check create server data", func(s *mcclient.ClientSession, opts *options.ServerCreateOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
server, err := modules.Servers.PerformClassAction(s, "check-create-data", params.JSON(params))
if err != nil {
return err
}
printObject(server)
return nil
})
R(&options.ServerCreateOptions{}, "server-create", "Create a server", func(s *mcclient.ClientSession, opts *options.ServerCreateOptions) error {
params, err := opts.Params()
if err != nil {

View File

@@ -163,8 +163,16 @@ func init() {
type ServiceConfigOptions struct {
SERVICE string `help:"service name or id"`
Config []string `help:"config key=value pair"`
Remove bool `help:"remove config"`
Config []string `help:"config options, can be a JSON, a YAML or a key=value pair, e.g:
* JSON
'{\"default\":{\"password_expiration_seconds\":300}}'
* YAML
default:
password_expiration_seconds: 300
* A key=value pair (under default section)
password_expiration_seconds=300
"`
Remove bool `help:"remove config"`
}
R(&ServiceConfigOptions{}, "service-config", "Add config to service", func(s *mcclient.ClientSession, args *ServiceConfigOptions) error {
config := jsonutils.NewDict()
@@ -174,6 +182,24 @@ func init() {
config.Add(jsonutils.NewString("update"), "action")
}
for _, c := range args.Config {
json, _ := jsonutils.ParseString(c)
if json != nil {
if _, ok := json.(*jsonutils.JSONDict); ok {
subconf := jsonutils.NewDict()
subconf.Add(json, "config")
config.Update(subconf)
continue
}
}
yaml, _ := jsonutils.ParseYAML(c)
if yaml != nil {
if _, ok := yaml.(*jsonutils.JSONDict); ok {
subconf := jsonutils.NewDict()
subconf.Add(yaml, "config")
config.Update(subconf)
continue
}
}
pos := strings.IndexByte(c, '=')
if pos < 0 {
return fmt.Errorf("%s is not a key=value pair", c)

View File

@@ -44,16 +44,13 @@ func init() {
return nil
})
R(&TaskListOptions{}, "region-task-list", "List tasks on region server", func(s *mcclient.ClientSession, suboptions *TaskListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = suboptions.BaseListOptions.Params()
if err != nil {
return err
}
}
type RegionTaskListOptions struct {
ObjName string `help:"object name"`
ObjId string `help:"object id"`
TaskName string `help:"task name"`
}
R(&RegionTaskListOptions{}, "region-task-list", "List tasks on region server", func(s *mcclient.ClientSession, args *RegionTaskListOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.ComputeTasks.List(s, params)
if err != nil {
return err

View File

@@ -149,15 +149,15 @@ func init() {
})
type UserCreateOptions struct {
NAME string `help:"Name of the new user"`
Domain string `help:"Domain"`
Desc string `help:"Description"`
Password string `help:"Password"`
Displayname string `help:"Displayname"`
Email string `help:"Email"`
Mobile string `help:"Mobile"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
NAME string `help:"Name of the new user"`
Domain string `help:"Domain"`
Desc string `help:"Description"`
Password *string `help:"Password"`
Displayname string `help:"Displayname"`
Email string `help:"Email"`
Mobile string `help:"Mobile"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
// DefaultProject string `help:"Default project"`
SystemAccount bool `help:"is a system account?"`
@@ -174,8 +174,8 @@ func init() {
}
params.Add(jsonutils.NewString(domainId), "domain_id")
}
if len(args.Password) > 0 {
params.Add(jsonutils.NewString(args.Password), "password")
if args.Password != nil {
params.Add(jsonutils.NewString(*args.Password), "password")
}
if len(args.Displayname) > 0 {
params.Add(jsonutils.NewString(args.Displayname), "displayname")
@@ -222,16 +222,16 @@ func init() {
})
type UserUpdateOptions struct {
ID string `help:"ID or name of the user"`
Domain string `help:"Domain"`
Name string `help:"New name of the user"`
Password string `help:"New password"`
Desc string `help:"Description"`
Displayname string `help:"Displayname"`
Email string `help:"Email"`
Mobile string `help:"Mobile"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
ID string `help:"ID or name of the user"`
Domain string `help:"Domain"`
Name string `help:"New name of the user"`
Password *string `help:"New password"`
Desc string `help:"Description"`
Displayname string `help:"Displayname"`
Email string `help:"Email"`
Mobile string `help:"Mobile"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
SystemAccount bool `help:"Turn on is_system_account"`
NotSystemAccount bool `help:"Turn off is_system_account"`
@@ -262,8 +262,8 @@ func init() {
if len(args.Name) > 0 {
params.Add(jsonutils.NewString(args.Name), "name")
}
if len(args.Password) > 0 {
params.Add(jsonutils.NewString(args.Password), "password")
if args.Password != nil {
params.Add(jsonutils.NewString(*args.Password), "password")
}
if len(args.Displayname) > 0 {
params.Add(jsonutils.NewString(args.Displayname), "displayname")

View File

@@ -158,4 +158,13 @@ func init() {
printObject(result)
return nil
})
R(&VpcUpdateStatusOptions{}, "vpc-sync", "Synchronize the status of a vpc", func(s *mcclient.ClientSession, args *VpcUpdateStatusOptions) error {
result, err := modules.Vpcs.PerformAction(s, args.ID, "sync", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -661,6 +661,13 @@ InstanceCreate:
items:
type: string
description: 主机组的ID或者Name
secgroups:
type: array
description: 安全组列表
items:
type: string
example: default
description: 安全组名称或ID,建议使用ID
InstanceDisk:

38
go.mod
View File

@@ -13,7 +13,7 @@ require (
github.com/Shopify/sarama v1.20.0 // indirect
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20181116160301-c6838fdc33ed
github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible
github.com/anacrolix/dht v0.0.0-20181129074040-b09db78595aa // indirect
github.com/anacrolix/go-libutp v0.0.0-20180808010927-aebbeb60ea05 // indirect
github.com/anacrolix/log v0.0.0-20180808012509-286fcf906b48 // indirect
@@ -27,13 +27,10 @@ require (
github.com/c-bata/go-prompt v0.2.1
github.com/ceph/go-ceph v0.0.0-20181217221554-e32f9f0f2e94
github.com/coredns/coredns v1.3.0
github.com/coreos/bbolt v1.3.3 // indirect
github.com/coreos/etcd v3.3.10+incompatible // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/denisenkom/go-mssqldb v0.0.0-20190806190131-db2462fef53b // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/dimchansky/utfbom v1.1.0 // indirect
github.com/dnaeon/go-vcr v1.0.1 // indirect
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11 // indirect
@@ -57,10 +54,7 @@ require (
github.com/golang-plus/testing v1.0.0 // indirect
github.com/golang-plus/uuid v1.0.0
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/golang/protobuf v1.3.1
github.com/google/btree v1.0.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/golang/protobuf v1.3.2
github.com/google/gopacket v1.1.17
github.com/google/uuid v1.1.0 // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
@@ -70,9 +64,6 @@ require (
github.com/gorilla/websocket v1.4.0
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.9.2 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead
github.com/huandu/xstrings v1.2.0 // indirect
@@ -80,8 +71,6 @@ require (
github.com/jinzhu/gorm v1.9.1
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.0.1 // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/json-iterator/go v1.1.5 // indirect
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c
github.com/kr/pty v1.1.3
github.com/lib/pq v1.2.0 // indirect
@@ -95,11 +84,8 @@ require (
github.com/mholt/caddy v0.10.11
github.com/miekg/dns v1.1.1
github.com/minio/minio-go v6.0.14+incompatible
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/moul/http2curl v1.0.0
github.com/mozillazg/go-httpheader v0.2.1 // indirect
github.com/mozillazg/go-pinyin v0.15.0
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
github.com/opentracing/opentracing-go v1.0.2 // indirect
@@ -114,30 +100,25 @@ 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/soheilhy/cmux v0.1.4 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.3.0
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181108132626-805d01dd0e2e
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190717101923-c5c1f9751e7f
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4
github.com/tinylib/msgp v1.1.0 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible
github.com/vmware/govmomi v0.19.0
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.3 // indirect
go.etcd.io/etcd v3.3.10+incompatible
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738
go.uber.org/atomic v1.4.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
golang.org/x/net v0.0.0-20191007182048-72f939374954
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20191008105621-543471e840be
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987
google.golang.org/grpc v1.19.0
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
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
@@ -150,12 +131,11 @@ require (
k8s.io/client-go v9.0.0+incompatible
k8s.io/klog v0.1.0 // indirect
k8s.io/kubernetes v1.12.3
sigs.k8s.io/yaml v1.1.0 // indirect
yunion.io/x/jsonutils v0.0.0-20191005115334-bb1c187fc0e7
yunion.io/x/jsonutils v0.0.0-20200303051356-aa609aba0cda
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
yunion.io/x/pkg v0.0.0-20191024065906-00964c53d82f
yunion.io/x/pkg v0.0.0-20200304112442-9dae9351325e
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20191008135637-33eb2e4f6cc7
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
)

99
go.sum
View File

@@ -17,6 +17,7 @@ github.com/DataDog/zstd v1.3.4 h1:LAGHkXuvC6yky+C2CUG2tD7w8QlrUwpue8XwIh0X4AY=
github.com/DataDog/zstd v1.3.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3 h1:gImoAO1xAcC1oDlYmD/X7dggsodGf2DFJOVE5m0ssms=
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3/go.mod h1:u0H9gMieFLxkUy8RS0X8VbFWyPs2815qQAaitRbj6x0=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
github.com/RoaringBitmap/roaring v0.4.16 h1:NholfewybRLOwACgfqfzn/N5xa6keKNs4fP00t0cwLo=
github.com/RoaringBitmap/roaring v0.4.16/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
@@ -32,8 +33,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8 h1:mb7rn6WX8viizO36Nv6VVCBrgwaq01HPrZv1qq07/Yg=
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA=
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20181116160301-c6838fdc33ed h1:8Nj1ihALo/UVM2EnOVQ1EY/kwNKRwLx1GW/z3Y65czY=
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20181116160301-c6838fdc33ed/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible h1:EaK5256H3ELiyaq5O/Zwd6fnghD6DqmZDQmmzzJklUU=
github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/anacrolix/dht v0.0.0-20180412060941-24cbf25b72a4/go.mod h1:hQfX2BrtuQsLQMYQwsypFAab/GvHg8qxwVi4OJdR1WI=
github.com/anacrolix/dht v0.0.0-20181127122252-acaa69c368bb/go.mod h1:Z/mP+H70xwnUv957UXVkTrzYRhKs0mGjS0lyqS331g4=
github.com/anacrolix/dht v0.0.0-20181129074040-b09db78595aa h1:5RyX9Tvqa9oewlJhFihkxe8biS0ojTlrNU3ryqm5g2s=
@@ -78,6 +79,9 @@ github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
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=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
@@ -91,18 +95,20 @@ github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2w
github.com/c-bata/go-prompt v0.2.1 h1:HTPxmnfY4y5x3Myo7Gq4ce989jfnvZIBgdBp6y8bjYM=
github.com/c-bata/go-prompt v0.2.1/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/coredns/coredns v1.3.0 h1:Ubjr8ZrOpEj95/A9dqQqQAG2k5DWEFdg2ZB3tUXuULA=
github.com/coredns/coredns v1.3.0/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0=
github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a h1:W8b4lQ4tFF21aspRGoBuCNV6V2fFJBF+pm1J6OY8Lys=
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -117,6 +123,7 @@ github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyG
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11 h1:m8nX8hsUghn853BJ5qB0lX+VvS6LTJPksWyILFZRYN4=
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11/go.mod h1:s1PfVYYVmTMgCSPtho4LKBDecEHJWtiVDPNv78Z985U=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
@@ -171,6 +178,8 @@ github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang-plus/errors v1.0.0 h1:9Rh4itnph6OYO7wm9u3FUTLMFMKCoL07+bLiYKELxWw=
github.com/golang-plus/errors v1.0.0/go.mod h1:YTFZjOTBcUFieeZe4q+7Umfu/sceSr3XQyBIkTkzpd8=
github.com/golang-plus/testing v1.0.0 h1:azmFWFV44LHK/j/jAkNTbzB2G2b6HdmqF358r73m8kg=
@@ -179,6 +188,7 @@ github.com/golang-plus/uuid v1.0.0 h1:ga84hG89vda++AGpup4N/cbfbM3O4d3R5ON9/jcN6A
github.com/golang-plus/uuid v1.0.0/go.mod h1:pBDDRrdgRHHqyYlj1d1i2gwyBq62Zc+sP2cDiCDkBLI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
@@ -187,6 +197,8 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -200,12 +212,13 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
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/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/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
@@ -223,6 +236,7 @@ github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gosuri/uilive v0.0.0-20170323041506-ac356e6e42cd/go.mod h1:qkLSc0A5EXSP6B04TrN4oQoxqFI7A8XvoXSlJi8cwk8=
@@ -231,12 +245,12 @@ github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282 h1:KFqmdzEPbU7Uck2t
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6tubcjzGMODIVG5hlrCeImaBnZzKF2N8SM=
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.2 h1:S+ef0492XaIknb8LMjcwgW2i3cNTzDYMmDrOThOJNWc=
github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU=
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=
@@ -248,6 +262,8 @@ github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jinzhu/gorm v1.9.1 h1:lDSDtsCt5AGGSKTs8AHlSDbbgif4G4+CKJ8ETBDVHTA=
github.com/jinzhu/gorm v1.9.1/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo=
@@ -260,14 +276,16 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw=
github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c h1:N7A4JCA2G+j5fuFxCsJqjFU/sZe0mj8H0sSoSwbaikw=
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c/go.mod h1:Nn5wlyECw3iJrzi0AhIWg+AJUb4PlRQVW4/3XHH1LZA=
@@ -286,11 +304,14 @@ github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/libvirt/libvirt-go-xml v5.2.0+incompatible h1:ALyVpa0/lFfFaUpb5l0fNBohufmQG6jsOGRCl/nKEi8=
github.com/libvirt/libvirt-go-xml v5.2.0+incompatible/go.mod h1:oBlgD3xOA01ihiK5stbhFzvieyW+jVS6kbbsMVF623A=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-sqlite3 v1.7.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
@@ -327,10 +348,13 @@ github.com/minio/minio-go/v6 v6.0.33 h1:CNThMAZ9bN6OEIP8DulqlYpaXKJ18rgG/Cqm14Q4
github.com/minio/minio-go/v6 v6.0.33/go.mod h1:vaNT59cWULS37E+E9zkuN/BVnKHyXtVGS+b04Boc66Y=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=
@@ -342,6 +366,7 @@ github.com/mozillazg/go-pinyin v0.15.0/go.mod h1:bO+dztNW6O2lSJdYLha7LO3bujXzjjU
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY=
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
@@ -372,15 +397,23 @@ github.com/pquerna/otp v1.2.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
@@ -415,6 +448,9 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -427,19 +463,21 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/syncthing/syncthing v0.14.48-rc.4/go.mod h1:nw3siZwHPA6M8iSfjDCWQ402eqvEIasMQOE8nFOxy7M=
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181108132626-805d01dd0e2e h1:CtKVGXKh2bfmepZ/YogAjvL/CrSy9NGZET500K7arf4=
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181108132626-805d01dd0e2e/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190717101923-c5c1f9751e7f h1:TzE7Cs9HhTyfot4WIoMnbD1rWfD4Jkwy2M3Zs66CaRE=
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190717101923-c5c1f9751e7f/go.mod h1:/4BhymH1yO6ljUGQgcKsd7L3W+pdKRxoRiOuoZPLnGg=
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4 h1:wVKDVTKxaf0ll8ONv22Q+cazYSSmcWt7JJOeQD0LoKQ=
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk=
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e h1:T5PdfK/M1xyrHwynxMIVMWLS7f/qHwfslZphxtGnw7s=
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c h1:5q7IHeqvAA4hWR1CfpTOS7RFsTDC36TaSZ8Dvc00bPk=
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c/go.mod h1:M/I710pXKQToMdqt/D+mJ4QsnW6WDaajyB6DWFmDXBs=
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/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=
@@ -456,9 +494,10 @@ github.com/yunionio/go-ceph v0.0.0-20190912101231-6f05a06b3859 h1:wu596gn6sV3j5w
github.com/yunionio/go-ceph v0.0.0-20190912101231-6f05a06b3859/go.mod h1:8XuBae5AzsgotLArJSewMruYVaQs8AlfsK5jBCG8T9Y=
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 v3.3.10+incompatible h1:qXVcIR1kU3CYLD8zXDseOmBNwg0uaui53e4Wg4uj0rk=
go.etcd.io/etcd v3.3.10+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
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/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
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=
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
@@ -481,6 +520,7 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
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/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=
@@ -497,6 +537,7 @@ golang.org/x/net v0.0.0-20190419010253-1f3472d942ba/go.mod h1:t9HGtf8HONx5eT2rtn
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=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191007182048-72f939374954 h1:JGZucVF/L/TotR719NbujzadOZ2AgnYlqphQGHDCKaU=
@@ -510,6 +551,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180724212812-e072cadbbdc8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -541,12 +584,15 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
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-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
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=
@@ -562,12 +608,15 @@ google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRn
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.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
@@ -591,6 +640,7 @@ 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-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=
k8s.io/apimachinery v0.0.0-20181215012845-4d029f033399 h1:xdXaRQ7uNX4x6NpvxXASvlVXtKa8+WbCXK7Hjr6XZ6c=
@@ -605,19 +655,20 @@ 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/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-20191005115334-bb1c187fc0e7 h1:9NcHs2OFMyN8O8SmJ3sFm5AJSVXP3u1N3avJsbyX3RI=
yunion.io/x/jsonutils v0.0.0-20191005115334-bb1c187fc0e7/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/jsonutils v0.0.0-20200303051356-aa609aba0cda h1:wSwQj3MDGchGYM2RAo1riYhrTz4apH+5XyBnchuDi84=
yunion.io/x/jsonutils v0.0.0-20200303051356-aa609aba0cda/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
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=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
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-20191024065906-00964c53d82f h1:rliduzLUj5k4kuY9kxbMDvMtxAANAOZ/hrsslpGK+fA=
yunion.io/x/pkg v0.0.0-20191024065906-00964c53d82f/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200304112442-9dae9351325e h1:rBfX77+VEBVpe6Xxy2gDa4WB7qbtndWvXcrVKzleF84=
yunion.io/x/pkg v0.0.0-20200304112442-9dae9351325e/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-20191008135637-33eb2e4f6cc7 h1:9bxOxNLNN18mJoR8GDPVtRJIpDBgA3dYmEBsuVDy0O4=
yunion.io/x/sqlchemy v0.0.0-20191008135637-33eb2e4f6cc7/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57 h1:KtQAuLJ00RSUVqkiRmJ1DiDABiw0U3xxXnzD3lGavaY=
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57/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

@@ -25,6 +25,7 @@ import (
"yunion.io/x/onecloud/pkg/apigateway/app"
"yunion.io/x/onecloud/pkg/apigateway/clientman"
"yunion.io/x/onecloud/pkg/apigateway/options"
api "yunion.io/x/onecloud/pkg/apis/apigateway"
app_common "yunion.io/x/onecloud/pkg/cloudcommon/app"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/mcclient"
@@ -35,11 +36,16 @@ func StartService() {
opts := &options.Options
baseOpts := &opts.BaseOptions
commonOpts := &opts.CommonOptions
common_options.ParseOptions(opts, os.Args, "apigateway.conf", "apigateway")
common_options.ParseOptions(opts, os.Args, "apigateway.conf", api.SERVICE_TYPE)
app_common.InitAuth(commonOpts, func() {
log.Infof("Auth complete.")
})
err := app_common.MergeServiceConfig(opts, api.SERVICE_TYPE, api.SERVICE_VERSION)
if err != nil {
log.Fatalf("[MERGE CONFIG] Fail to merge service config %s", err)
}
if opts.DisableModuleApiVersion {
mcclient.DisableApiVersionByModule()
}

View File

@@ -0,0 +1,20 @@
// 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 apigateway
const (
SERVICE_TYPE = "apigateway"
SERVICE_VERSION = ""
)

View File

@@ -0,0 +1,15 @@
// 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 apigateway // import "yunion.io/x/onecloud/pkg/apis/apigateway"

View File

@@ -188,6 +188,7 @@ type ServerCreateInput struct {
EipChargeType string `json:"eip_charge_type,omitempty"`
Eip string `json:"eip,omitempty"`
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
Secgroups []string `json:"secgroups"`
OsType string `json:"os_type"`
// Fill by server

View File

@@ -14,6 +14,13 @@
package compute
import (
"net/http"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/httperrors"
)
const (
BUCKET_OPS_STATS_CHANGE = "stats_change"
@@ -30,3 +37,39 @@ const (
BUCKET_UPLOAD_OBJECT_ACL_HEADER = "X-Yunion-Bucket-Upload-Acl"
BUCKET_UPLOAD_OBJECT_STORAGECLASS_HEADER = "X-Yunion-Bucket-Upload-Storageclass"
)
type BucketObjectsActionInput struct {
Key []string
}
type BucketAclInput struct {
BucketObjectsActionInput
Acl cloudprovider.TBucketACLType
}
func (input *BucketAclInput) Validate() error {
switch input.Acl {
case cloudprovider.ACLPrivate, cloudprovider.ACLAuthRead, cloudprovider.ACLPublicRead, cloudprovider.ACLPublicReadWrite:
// do nothing
default:
return httperrors.NewInputParameterError("acl")
}
return nil
}
type BucketMetadataInput struct {
BucketObjectsActionInput
Metadata http.Header
}
func (input *BucketMetadataInput) Validate() error {
if len(input.Key) == 0 {
return httperrors.NewInputParameterError("key")
}
if len(input.Metadata) == 0 {
return httperrors.NewInputParameterError("metadata")
}
return nil
}

View File

@@ -16,8 +16,11 @@ package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/httperrors"
)
type CloudaccountCreateInput struct {
@@ -27,9 +30,7 @@ type CloudaccountCreateInput struct {
Brand string
IsPublicCloud bool
IsOnPremise bool
Account string
Secret string
AccessUrl string
Tenant string
TenantId string
Name string
Description string
@@ -39,26 +40,22 @@ type CloudaccountCreateInput struct {
AutoCreateProject bool
Options *jsonutils.JSONObject
ProjectName string //OpenStack
DomainName string //OpenStack
Username string //OpenStack Esxi ZStack
Password string //OpenStack Esxi ZStack
AuthUrl string //OpenStack ZStack
AccessKeyId string //Huawei Aliyun Ucloud Aws
AccessKeySecret string //Huawei Aliyun Ucloud Aws
Environment string //Huawei Azure Aws
DirectoryId string //Azure
ClientId string //Azure
ClientSecret string //Azure
Host string //Esxi
Port int //Esxi
Endpoint string
AppId string //Qcloud
SecretId string //Qcloud
SecretKey string //Qcloud
cloudprovider.SCloudaccount
cloudprovider.SCloudaccountCredential
}
type CloudaccountShareModeInput struct {
apis.Meta
ShareMode string
}
func (i CloudaccountShareModeInput) Validate() error {
if len(i.ShareMode) == 0 {
return httperrors.NewMissingParameterError("share_mode")
}
if !utils.IsInStringArray(i.ShareMode, CLOUD_ACCOUNT_SHARE_MODES) {
return httperrors.NewInputParameterError("invalid share_mode %s", i.ShareMode)
}
return nil
}

View File

@@ -92,3 +92,17 @@ const (
CLOUD_ENV_PRIVATE_ON_PREMISE = "private_or_onpremise"
)
const (
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN = "account_domain"
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM = "system"
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN = "provider_domain"
)
var (
CLOUD_ACCOUNT_SHARE_MODES = []string{
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN,
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM,
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN,
}
)

View File

@@ -35,6 +35,7 @@ const (
CITY_TAIPEI = "Taipei" //台北市
CITY_KAOHSIUNG = "Kaohsiung" //高雄市
CITY_CHENG_DU = "Chengdu" //成都
CITY_HE_YUAN = "HeYuan" //河源
CITY_CHONG_QING = "Chongqing" //重庆
// 日本
@@ -49,6 +50,20 @@ const (
CITY_YARRALUMLA = "Yarralumla" //亚拉伦拉
CITY_MELBOURNE = "Melbourne" //墨尔本
//芬兰
CITY_FINLAND = "Finland"
//比利时
CITY_BELGIUM = "Belgium" //比利时
//瑞士
CITY_ZURICH = "Zurich" //苏黎世
CITY_GENEVA = "Geneva" //日内瓦
// 挪威
CITY_STAVANGER = "Stavanger" //斯塔万格
CITY_OSLO = "Oslo" // 奥斯陆
// 马来西亚
CITY_KUALA_LUMPUR = "Kuala Lumpur" //吉隆坡
@@ -85,7 +100,8 @@ const (
CITY_DUBAI = "Dubai" //迪拜
// 德国
CITY_FRANKFURT = "Frankfurt" //法兰克福
CITY_FRANKFURT = "Frankfurt" // 法兰克福
CITY_DELMENHORST = "Delmenhorst" // 代尔门霍斯特
// 韩国
CITY_SEOUL = "Seoul" //首尔
@@ -154,4 +170,6 @@ const (
COUNTRY_CODE_RU = "RU" //俄罗斯
COUNTRY_CODE_NG = "NG" //尼日利亚
COUNTRY_CODE_VN = "VN" //越南
COUNTRY_CODE_CH = "CH" //瑞士
COUNTRY_CODE_NO = "NO" //挪威
)

View File

@@ -56,11 +56,12 @@ const (
BACKUP_MODE_MANUAL = "manual" //手动
//实例数据库状态
DBINSTANCE_DATABASE_CREATING = "creating" //创建中
DBINSTANCE_DATABASE_CREATE_FAILE = "create_failed" //创建失败
DBINSTANCE_DATABASE_RUNNING = "running" //正常
DBINSTANCE_DATABASE_DELETING = "deleting" //删除
DBINSTANCE_DATABASE_DELETE_FAILED = "delete_failed" //删除失败
DBINSTANCE_DATABASE_CREATING = "creating" //创建中
DBINSTANCE_DATABASE_CREATE_FAILE = "create_failed" //创建失败
DBINSTANCE_DATABASE_RUNNING = "running" //正常
DBINSTANCE_DATABASE_GRANT_PRIVILEGE = "grant_privilege" //赋予权限
DBINSTANCE_DATABASE_DELETING = "deleting" //删除
DBINSTANCE_DATABASE_DELETE_FAILED = "delete_failed" //删除失败
//实例用户状态
DBINSTANCE_USER_UNAVAILABLE = "unavailable" //不可用
@@ -107,10 +108,10 @@ const (
ALIYUN_DBINSTANCE_STORAGE_TYPE_CLOUD_SSD = "cloud_ssd" //SSD云盘
//华为云存储类型
HUAWEI_DBINSTANCE_STORAGE_TYPE_SSD = "SSD" //超高IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_SAS = "SAS" //高IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_SATA = "SATA" //普通IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGH = "ULTRAHIGH" //超高IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGHPRO = "ULTRAHIGHPRO"
HUAWEI_DBINSTANCE_STORAGE_TYPE_COMMON = "COMMON"
HUAWEI_DBINSTANCE_STORAGE_TYPE_HIGH = "HIGH"
)
var (

View File

@@ -18,7 +18,7 @@ import "yunion.io/x/onecloud/pkg/apis"
type SDBInstanceDatabasePrivilege struct {
Account string
DBInstancedccountId string
DBInstanceaccountId string
Privilege string
}

View File

@@ -21,6 +21,7 @@ const (
EIP_ASSOCIATE_TYPE_SERVER = "server"
EIP_ASSOCIATE_TYPE_NAT_GATEWAY = "natgateway"
EIP_ASSOCIATE_TYPE_LOADBALANCER = "loadbalancer"
EIP_ASSOCIATE_TYPE_UNKNOWN = "unknown"
EIP_STATUS_READY = "ready"
EIP_STATUS_UNKNOWN = "unknown"

View File

@@ -224,6 +224,7 @@ const (
VM_METADATA_CREATE_PARAMS = "create_params"
VM_METADATA_LOGIN_ACCOUNT = "login_account"
VM_METADATA_LOGIN_KEY = "login_key"
VM_METADATA_LAST_LOGIN_KEY = "last_login_key"
VM_METADATA_LOGIN_KEY_TIMESTAMP = "login_key_timestamp"
VM_METADATA_OS_ARCH = "os_arch"
VM_METADATA_OS_DISTRO = "os_distribution"

View File

@@ -0,0 +1,38 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
type ServerRebuildRootInput struct {
apis.Meta
Image string `json:"image"`
ImageId string `json:"image_id"`
Keypair string `json:"keypair"`
KeypairId string `json:"keypair_id"`
ResetPassword *bool `json:"reset_password"`
Password string `json:"password"`
AutoStart *bool `json:"auto_start"`
AllDisks *bool `json:"all_disks"`
}
func (i ServerRebuildRootInput) GetImageName() string {
if len(i.Image) > 0 {
return i.Image
}
if len(i.ImageId) > 0 {
return i.ImageId
}
return ""
}
func (i ServerRebuildRootInput) GetKeypairName() string {
if len(i.Keypair) > 0 {
return i.Keypair
}
if len(i.KeypairId) > 0 {
return i.KeypairId
}
return ""
}

View File

@@ -14,6 +14,10 @@
package compute
import (
"time"
)
const (
// # DEFAULT_BANDWIDTH = options.default_bandwidth
MAX_BANDWIDTH = 100000
@@ -40,6 +44,8 @@ const (
NETWORK_STATUS_DELETING = "deleting"
NETWORK_STATUS_DELETED = "deleted"
NETWORK_STATUS_DELETE_FAILED = "delete_failed"
NETWORK_STATUS_START_SYNC = "start_sync"
NETWORK_STATUS_SYNCING = "sync"
)
var (
@@ -75,4 +81,5 @@ type SNetworkAddress struct {
OwnerType string
AssociateId string
AssociateType string
CreatedAt time.Time
}

View File

@@ -0,0 +1,23 @@
package compute
const (
ROUTE_TABLE_TYPE_VPC = "VPC" // VPC路由器
ROUTE_TABLE_TYPE_VBR = "VBR" // 边界路由器
)
const (
ROUTE_ENTRY_TYPE_CUSTOM = "Custom" // 自定义路由
ROUTE_ENTRY_TYPE_SYSTEM = "System" // 系统路由
)
const (
Next_HOP_TYPE_INSTANCE = "Instance" // ECS实例。
Next_HOP_TYPE_HAVIP = "HaVip" // 高可用虚拟IP。
Next_HOP_TYPE_VPN = "VpnGateway" // VPN网关。
Next_HOP_TYPE_NAT = "NatGateway" // NAT网关。
Next_HOP_TYPE_NETWORK = "NetworkInterface" // 辅助弹性网卡。
Next_HOP_TYPE_ROUTER = "RouterInterface" // 路由器接口。
Next_HOP_TYPE_IPV6 = "IPv6Gateway" // IPv6网关。
Next_HOP_TYPE_INTERNET = "InternetGateway" // Internet网关。
Next_HOP_TYPE_EGRESS_INTERNET = "EgressInternetGateway" // egress only Internet网关。
)

View File

@@ -37,6 +37,7 @@ type SSecgroupRuleCreateInput struct {
CIDR string
Action string
Description string
Secgroup string
SecgroupId string
}

View File

@@ -49,6 +49,7 @@ const (
// STORAGE_CLOUD_SSD ="cloud_ssd"
STORAGE_LOCAL_BASIC = "local_basic"
STORAGE_LOCAL_SSD = "local_ssd"
STORAGE_LOCAL_PRO = "local_pro"
STORAGE_CLOUD_BASIC = "cloud_basic"
STORAGE_CLOUD_PREMIUM = "cloud_premium"
@@ -59,6 +60,7 @@ const (
// openstack
STORAGE_OPENSTACK_ISCSI = "iscsi"
STORAGE_OPENSTACK_NOVA = "nova"
// Ucloud storage type
STORAGE_UCLOUD_CLOUD_NORMAL = "CLOUD_NORMAL" // 普通云盘

View File

@@ -24,6 +24,8 @@ const (
VPC_STATUS_DELETE_FAILED = "delete_failed"
VPC_STATUS_DELETED = "deleted"
VPC_STATUS_UNKNOWN = "unknown"
VPC_STATUS_START_SYNC = "start_sync"
VPC_STATUS_SYNCING = "sync"
MAX_VPC_PER_REGION = 3

View File

@@ -88,6 +88,17 @@ type CandidateDisk struct {
StorageIds []string `json:"storage_ids"`
}
type CandidateDiskV2 struct {
Index int `json:"index"`
Storages []*CandidateStorage `json:"storages"`
}
type CandidateStorage struct {
Id string
Name string
FreeCapacity int64
}
type CandidateNet struct {
Index int `json:"index"`
NetworkIds []string `json:"network_ids"`

View File

@@ -128,10 +128,13 @@ func (agent *SBaremetalAgent) StartService() error {
return fmt.Errorf("New baremetal manager error: %v", err)
}
err = manager.loadConfigs()
files, err := manager.loadConfigs()
if err != nil {
return fmt.Errorf("Baremetal manager load config error: %v", err)
}
if err := manager.initBaremetals(files); err != nil {
log.Warningf("init baremetals by files err: %v", err)
}
agent.Manager = manager

View File

@@ -54,7 +54,7 @@ func AddHandler2(app *appsrv.Application, method string, prefix string,
func customizeHandlerInfo(info *appsrv.SHandlerInfo) {
if info.GetName(nil) == "baremetal-register" {
info.SetProcessTimeout(time.Second * 180).SetWorkerManager(registerWorkMan)
info.SetProcessTimeout(time.Second * 300).SetWorkerManager(registerWorkMan)
}
}
@@ -218,7 +218,7 @@ func handleServerStatus(ctx *Context, bm *baremetal.SBaremetalInstance, _ bareme
func handleBaremetalRegister(ctx *Context, input *baremetal.BmRegisterInput) {
ctx.DelayProcess(func(data jsonutils.JSONObject) (jsonutils.JSONObject, error) {
baremetal.GetBaremetalManager().RegisterBaremetal(input)
baremetal.GetBaremetalManager().RegisterBaremetal(ctx, input)
return nil, nil
}, nil)
}

View File

@@ -176,13 +176,8 @@ func bmRegisterMiddleware(h bmRegisterFunc) appsrv.FilterHandler {
newCtx.ResponseError(httperrors.NewMissingParameterError("password"))
return
}
ipAddr, err := newCtx.Data().GetString("ip_addr")
if err != nil {
newCtx.ResponseError(httperrors.NewMissingParameterError("ip_addr"))
return
}
ctx, cancel := context.WithTimeout(ctx, time.Second*175)
ctx, cancel := context.WithTimeout(ctx, time.Second*298)
defer cancel()
data := &baremetal.BmRegisterInput{
@@ -196,7 +191,6 @@ func bmRegisterMiddleware(h bmRegisterFunc) appsrv.FilterHandler {
RemoteIp: remoteIp,
Username: username,
Password: password,
IpAddr: ipAddr,
}
h(newCtx, data)

View File

@@ -40,7 +40,6 @@ import (
"yunion.io/x/pkg/utils"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/appsrv"
o "yunion.io/x/onecloud/pkg/baremetal/options"
"yunion.io/x/onecloud/pkg/baremetal/profiles"
"yunion.io/x/onecloud/pkg/baremetal/pxe"
@@ -104,12 +103,16 @@ func (m *SBaremetalManager) GetZoneName() string {
return m.Agent.Zone.Name
}
func (m *SBaremetalManager) loadConfigs() error {
func (m *SBaremetalManager) loadConfigs() ([]os.FileInfo, error) {
m.killAllIPMITool()
files, err := ioutil.ReadDir(m.configPath)
if err != nil {
return err
return nil, err
}
return files, nil
}
func (m *SBaremetalManager) initBaremetals(files []os.FileInfo) error {
bmIds := make([]string, 0)
for _, file := range files {
if file.IsDir() && regutils.MatchUUID(file.Name()) {
@@ -265,10 +268,8 @@ type BmRegisterInput struct {
IpAddr string
}
func (i *BmRegisterInput) responseOk() {
obj := jsonutils.NewDict()
obj.Add(jsonutils.NewString("ok"), "result")
appsrv.SendJSON(i.W, obj)
func (i *BmRegisterInput) responseSucc(bmId string) {
fmt.Fprintf(i.W, bmId)
close(i.C)
}
@@ -287,7 +288,7 @@ func (i *BmRegisterInput) isTimeout() bool {
}
// delay task
func (m *SBaremetalManager) RegisterBaremetal(input *BmRegisterInput) {
func (m *SBaremetalManager) RegisterBaremetal(ctx context.Context, input *BmRegisterInput) {
adminWire, err := m.checkNetworkFromIp(input.RemoteIp)
if input.isTimeout() {
return
@@ -295,21 +296,6 @@ func (m *SBaremetalManager) RegisterBaremetal(input *BmRegisterInput) {
input.responseErr(httperrors.NewBadRequestError("Verify network failed: %s", err))
return
}
ipmiWire, err := m.checkNetworkFromIp(input.IpAddr)
if input.isTimeout() {
return
} else if err != nil {
input.responseErr(httperrors.NewBadRequestError("Verify network failed: %s", err))
return
}
ipmiMac, err := m.checkIpmiInfo(input.Username, input.Password, input.IpAddr)
if input.isTimeout() {
return
} else if err != nil {
input.responseErr(httperrors.NewBadRequestError("IPMI login info not correct: %s", err))
return
}
sshCli, err := m.checkSshInfo(input)
if input.isTimeout() {
@@ -319,6 +305,32 @@ func (m *SBaremetalManager) RegisterBaremetal(input *BmRegisterInput) {
return
}
input.IpAddr, err = m.fetchIpmiIp(sshCli)
if input.isTimeout() {
return
} else if err != nil {
input.responseErr(httperrors.NewBadRequestError("Fetch ipmi address failed: %s", err))
return
}
log.Infof("Find ipmi address %s", input.IpAddr)
ipmiWire, err := m.checkNetworkFromIp(input.IpAddr)
if input.isTimeout() {
return
} else if err != nil {
input.responseErr(httperrors.NewBadRequestError("Verify network failed: %s", err))
return
}
ipmiLanChannel, ipmiMac, err := m.checkIpmiInfo(input.Username, input.Password, input.IpAddr)
if input.isTimeout() {
return
} else if err != nil {
input.responseErr(httperrors.NewBadRequestError("IPMI login info not correct: %s", err))
return
}
err = m.verifyMacAddr(sshCli)
if input.isTimeout() {
return
@@ -330,9 +342,9 @@ func (m *SBaremetalManager) RegisterBaremetal(input *BmRegisterInput) {
registerTask := tasks.NewBaremetalRegisterTask(
m, sshCli, input.Hostname, input.RemoteIp,
input.Username, input.Password, input.IpAddr,
ipmiMac, adminWire, ipmiWire,
ipmiMac, ipmiLanChannel, adminWire, ipmiWire,
)
err = registerTask.CreateBaremetal()
bmId, err := registerTask.CreateBaremetal()
if input.isTimeout() {
return
} else if err != nil {
@@ -340,8 +352,22 @@ func (m *SBaremetalManager) RegisterBaremetal(input *BmRegisterInput) {
return
}
input.responseOk()
registerTask.DoPrepare(sshCli)
input.responseSucc(bmId)
registerTask.DoPrepare(ctx, sshCli)
}
func (m *SBaremetalManager) fetchIpmiIp(sshCli *ssh.Client) (string, error) {
res, err := sshCli.RawRun(`/usr/bin/ipmitool lan print | grep "IP Address "`)
if err != nil {
return "", err
}
if len(res) == 1 {
segs := strings.Fields(res[0])
if len(segs) == 4 {
return strings.TrimSpace(segs[3]), nil
}
}
return "", fmt.Errorf("Failed to find ipmi ip address")
}
func (m *SBaremetalManager) checkNetworkFromIp(ip string) (string, error) {
@@ -407,11 +433,11 @@ func (m *SBaremetalManager) checkSshInfo(input *BmRegisterInput) (*ssh.Client, e
return sshCLi, nil
}
func (m *SBaremetalManager) checkIpmiInfo(username, password, ipAddr string) (net.HardwareAddr, error) {
func (m *SBaremetalManager) checkIpmiInfo(username, password, ipAddr string) (int, net.HardwareAddr, error) {
lanPlusTool := ipmitool.NewLanPlusIPMI(ipAddr, username, password)
sysInfo, err := ipmitool.GetSysInfo(lanPlusTool)
if err != nil {
return nil, err
return -1, nil, err
}
for _, lanChannel := range ipmitool.GetLanChannels(sysInfo) {
@@ -423,9 +449,9 @@ func (m *SBaremetalManager) checkIpmiInfo(username, password, ipAddr string) (ne
if len(config.Mac) == 0 {
continue
}
return config.Mac, nil
return lanChannel, config.Mac, nil
}
return nil, fmt.Errorf("Ipmi can't fetch lan config")
return -1, nil, fmt.Errorf("Ipmi can't fetch lan config")
}
func (m *SBaremetalManager) Stop() {
@@ -1861,7 +1887,7 @@ func (b *SBaremetalInstance) doCronJobs(ctx context.Context) {
for _, job := range b.cronJobs {
now := time.Now().UTC()
if job.NeedsToRun(now) {
log.Debugf("need to run %s", job.Name())
// log.Debugf("need to run %s", job.Name())
func() {
job.StartRun()
defer job.StopRun()

View File

@@ -15,6 +15,7 @@
package tasks
import (
"context"
"fmt"
"net"
"strings"
@@ -27,6 +28,7 @@ import (
"yunion.io/x/onecloud/pkg/baremetal/utils/ipmitool"
"yunion.io/x/onecloud/pkg/cloudcommon/types"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/util/redfish"
"yunion.io/x/onecloud/pkg/util/ssh"
"yunion.io/x/onecloud/pkg/util/sysutils"
)
@@ -44,47 +46,84 @@ type sBaremetalRegisterTask struct {
IpmiPassword string
IpmiIpAddr string
IpmiMac net.HardwareAddr
AdminWire string
IpmiWire string
IpmiLanChannel int
AdminWire string
IpmiWire string
accessNic *types.SNicDevInfo
}
func NewBaremetalRegisterTask(bmManager IBmManager, sshCli *ssh.Client,
hostname, remoteIp, ipmiUsername, ipmiPassword, ipmiIpAddr string,
ipmiMac net.HardwareAddr, adminWire, ipmiWire string) *sBaremetalRegisterTask {
ipmiMac net.HardwareAddr, ipmiLanChannel int, adminWire, ipmiWire string) *sBaremetalRegisterTask {
return &sBaremetalRegisterTask{
BmManager: bmManager,
SshCli: sshCli,
Hostname: hostname,
RemoteIp: remoteIp,
IpmiUsername: ipmiUsername,
IpmiPassword: ipmiPassword,
IpmiIpAddr: ipmiIpAddr,
IpmiMac: ipmiMac,
AdminWire: adminWire,
IpmiWire: ipmiWire,
BmManager: bmManager,
SshCli: sshCli,
Hostname: hostname,
RemoteIp: remoteIp,
IpmiUsername: ipmiUsername,
IpmiPassword: ipmiPassword,
IpmiIpAddr: ipmiIpAddr,
IpmiMac: ipmiMac,
IpmiLanChannel: ipmiLanChannel,
AdminWire: adminWire,
IpmiWire: ipmiWire,
}
}
func (s *sBaremetalRegisterTask) CreateBaremetal() error {
func (s *sBaremetalRegisterTask) getAccessDevMacAddr(ip string) (string, error) {
nicsRet, err := s.SshCli.Run("/sbin/ip -o -4 addr show")
if err != nil {
return "", fmt.Errorf("Failed get access nic %s", err)
}
var dev string
for i := 0; i < len(nicsRet); i++ {
if strings.Contains(nicsRet[i], ip+"/") {
segs := strings.Split(nicsRet[i], " ")
if len(segs) > 1 {
dev = segs[1]
break
}
}
}
if len(dev) == 0 {
return "", fmt.Errorf("Can't get access dev")
}
log.Infof("Access dev is %s", dev)
macRet, err := s.SshCli.Run("/sbin/ip a show " + dev)
if err != nil || len(macRet) < 2 {
return "", fmt.Errorf("Failed get access nic mac address %s", err)
}
segs := strings.Fields(macRet[1])
if len(segs) < 2 {
return "", fmt.Errorf("Failed to find mac address")
}
return segs[1], nil
}
func (s *sBaremetalRegisterTask) CreateBaremetal() (string, error) {
zoneId := s.BmManager.GetZoneId()
ret, err := s.SshCli.Run("/lib/mos/lsnic")
if err != nil {
return fmt.Errorf("Register baremeatl failed on lsnic: %s", err)
return "", fmt.Errorf("Register baremeatl failed on lsnic: %s", err)
}
accessMac, err := s.getAccessDevMacAddr(s.RemoteIp)
if err != nil {
return "", err
}
accessMacAddr, err := net.ParseMAC(accessMac)
if err != nil {
return "", fmt.Errorf("Failed parse access mac %s", accessMac)
}
nicinfo := sysutils.ParseNicInfo(ret)
for _, nic := range nicinfo {
ret, err := s.SshCli.RawRun("/sbin/ip a show " + nic.Dev)
if err != nil {
return fmt.Errorf("Register baremeatl failed on ip command: %s", err)
}
if strings.Index(ret[0], s.RemoteIp) >= 0 {
if nic.Mac.String() == accessMacAddr.String() {
s.accessNic = nic
break
} else {
continue
}
}
if s.accessNic == nil {
@@ -99,21 +138,22 @@ func (s *sBaremetalRegisterTask) CreateBaremetal() error {
params.Set("is_import", jsonutils.JSONTrue)
res, err := modules.Hosts.CreateInContext(s.BmManager.GetClientSession(), params, &modules.Zones, zoneId)
if err != nil {
return fmt.Errorf("Create baremetal failed: %s", err)
return "", fmt.Errorf("Create baremetal failed: %s", err)
}
pxeBm, err := s.BmManager.AddBaremetal(res)
if err != nil {
return fmt.Errorf("BmManager add baremetal failed: %s", err)
return "", fmt.Errorf("BmManager add baremetal failed: %s", err)
}
err = pxeBm.InitAdminNetif(
s.accessNic.Mac, s.AdminWire, api.NIC_TYPE_ADMIN, api.NETWORK_TYPE_PXE, true, s.RemoteIp)
if err != nil {
return fmt.Errorf("BmManager add admin netif failed: %s", err)
return "", fmt.Errorf("BmManager add admin netif failed: %s", err)
}
err = pxeBm.InitAdminNetif(
s.IpmiMac, s.IpmiWire, api.NIC_TYPE_IPMI, api.NETWORK_TYPE_IPMI, true, s.IpmiIpAddr)
if err != nil {
return fmt.Errorf("BmManager add ipmi netif failed: %s", err)
return "", fmt.Errorf("BmManager add ipmi netif failed: %s", err)
}
for _, nic := range nicinfo {
if nic.Dev != s.accessNic.Dev {
@@ -121,22 +161,41 @@ func (s *sBaremetalRegisterTask) CreateBaremetal() error {
}
}
s.baremetal = pxeBm.(IBaremetal)
return nil
bmInstanceId, _ := res.GetString("id")
return bmInstanceId, nil
}
func (s *sBaremetalRegisterTask) update() {
}
func (s *sBaremetalRegisterTask) DoPrepare(cli *ssh.Client) error {
func (s *sBaremetalRegisterTask) doRedfishProbe(ctx context.Context) (redfishSupport bool, cdromBoot bool) {
redfishCli := redfish.NewRedfishDriver(ctx, "https://"+s.IpmiIpAddr, s.IpmiUsername, s.IpmiPassword, false)
if redfishCli != nil {
_, cdInfo, _ := redfishCli.GetVirtualCdromInfo(ctx)
redfishSupport = true
cdromBoot = cdInfo.SupportAction
}
return
}
func (s *sBaremetalRegisterTask) DoPrepare(ctx context.Context, cli *ssh.Client) error {
infos, err := s.prepareBaremetalInfo(cli)
if err != nil {
return err
}
redfishSupport, cdromSupport := s.doRedfishProbe(ctx)
infos.ipmiInfo.IpAddr = s.IpmiIpAddr
infos.ipmiInfo.Username = s.IpmiUsername
infos.ipmiInfo.Password = s.IpmiPassword
infos.ipmiInfo.LanChannel = s.IpmiLanChannel
infos.ipmiInfo.Verified = true
infos.ipmiInfo.Present = true
infos.ipmiInfo.RedfishApi = redfishSupport
infos.ipmiInfo.CdromBoot = cdromSupport
s.updateIpmiInfo(cli)
return s.updateBmInfo(cli, infos)

View File

@@ -106,6 +106,7 @@ func (self *SBaremetalCdromTask) DoInsertISO(ctx context.Context, args interface
if err != nil {
return errors.Wrap(err, "MountVirtualCdrom")
}
self.Baremetal.AutoSyncStatus()
SetTaskComplete(self, nil)
return nil
}
@@ -119,6 +120,7 @@ func (self *SBaremetalCdromTask) DoEjectISO(ctx context.Context, args interface{
if err != nil {
return errors.Wrap(err, "UmountVirtualCdrom")
}
self.Baremetal.AutoSyncStatus()
SetTaskComplete(self, nil)
return nil
}

View File

@@ -688,7 +688,7 @@ func (adapter *MegaRaidAdaptor) storcliIsJBODEnabled() bool {
line = strings.ToLower(line)
if strings.HasPrefix(line, "jbod") {
data := strings.Split(line, " ")
if strings.TrimSpace(data[1]) == "on" {
if strings.TrimSpace(data[len(data)-1]) == "on" {
return true
}
return false

View File

@@ -16,10 +16,10 @@ package app
import (
"context"
"fmt"
"os"
"time"
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/notifyclient"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
@@ -30,23 +30,19 @@ import (
func InitAuth(options *common_options.CommonOptions, authComplete auth.AuthCompletedCallback) {
if len(options.AuthURL) == 0 {
fmt.Println("Missing AuthURL")
os.Exit(1)
log.Fatalln("Missing AuthURL")
}
if len(options.AdminUser) == 0 {
fmt.Println("Mising AdminUser")
os.Exit(1)
log.Fatalln("Mising AdminUser")
}
if len(options.AdminPassword) == 0 {
fmt.Println("Missing AdminPasswd")
os.Exit(1)
log.Fatalln("Missing AdminPasswd")
}
if len(options.AdminProject) == 0 {
fmt.Println("Missing AdminProject")
os.Exit(1)
log.Fatalln("Missing AdminProject")
}
a := auth.NewAuthInfo(

View File

@@ -19,6 +19,7 @@ import (
"database/sql"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/sqlchemy"
@@ -65,19 +66,21 @@ func MergeServiceConfig(opts interface{}, serviceType string, serviceVersion str
if len(serviceId) > 0 {
serviceConf, err := getServiceConfig(s, serviceId)
if err != nil {
return errors.Wrap(err, "getServiceConfig")
log.Errorf("getServiceConfig for %s failed: %s", serviceType, err)
} else {
conf.Update(serviceConf)
merged = true
}
conf.Update(serviceConf)
merged = true
}
commonServiceId, _ := getServiceIdByType(s, consts.COMMON_SERVICE, "")
if len(commonServiceId) > 0 {
commonConf, err := getServiceConfig(s, commonServiceId)
if err != nil {
return errors.Wrap(err, "getServiceConfig common service")
log.Errorf("getServiceConfig for %s failed: %s", consts.COMMON_SERVICE, err)
} else {
conf.Update(commonConf)
merged = true
}
conf.Update(commonConf)
merged = true
}
if merged {
err := conf.Unmarshal(opts)
@@ -89,7 +92,8 @@ func MergeServiceConfig(opts interface{}, serviceType string, serviceVersion str
nconf.Add(conf, "config", "default")
_, err := modules.ServicesV3.PerformAction(s, serviceId, "config", nconf)
if err != nil {
return errors.Wrap(err, "modules.ServicesV3.PerformAction")
// ignore the error
log.Errorf("fail to save config: %s", err)
}
}
}

View File

@@ -401,6 +401,7 @@ func FetchServerCreateInputByJSON(obj jsonutils.JSONObject) (*compute.ServerCrea
if secgroup := jsonutils.GetAnyString(obj, []string{"secgroup", "secgroup_id", "secgrp_id"}); len(secgroup) != 0 {
input.SecgroupId = secgroup
}
input.Secgroups, _ = jsonutils.GetStringArray(obj, "secgroups")
return input, nil
}

View File

@@ -28,6 +28,9 @@ var (
tenantCacheExpireSeconds = 900
nonDefaultDomainProjects = false
defaultPagingLimit int64 = 2048
maxPagingLimit int64 = 2048
)
func SetRegion(region string) {
@@ -61,3 +64,11 @@ func SetNonDefaultDomainProjects(val bool) {
func GetNonDefaultDomainProjects() bool {
return nonDefaultDomainProjects
}
func GetDefaultPagingLimit() int64 {
return defaultPagingLimit
}
func GetMaxPagingLimit() int64 {
return maxPagingLimit
}

View File

@@ -52,9 +52,31 @@ func InitDB(options *common_options.DBOptions) {
}
sqlchemy.SetDB(dbConn)
lm := lockman.NewInMemoryLockManager()
switch options.LockmanMethod {
case "inmemory", "":
log.Infof("using inmemory lockman")
lm := lockman.NewInMemoryLockManager()
lockman.Init(lm)
case "etcd":
log.Infof("using etcd lockman")
tlsCfg, err := options.GetEtcdTLSConfig()
if err != nil {
log.Fatalln(err.Error())
}
lm, err := lockman.NewEtcdLockManager(&lockman.SEtcdLockManagerConfig{
Endpoints: options.EtcdEndpoints,
Username: options.EtcdUsername,
Password: options.EtcdPassword,
LockTTL: options.EtcdLockTTL,
LockPrefix: options.EtcdLockPrefix,
TLS: tlsCfg,
})
if err != nil {
log.Fatalf("etcd lockman: %v", err)
}
lockman.Init(lm)
}
// lm := lockman.NewNoopLockManager()
lockman.Init(lm)
}
func CloseDB() {

View File

@@ -442,7 +442,7 @@ func fetchContextObject(manager IModelManager, ctx context.Context, userCred mcc
func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, ctxIds []dispatcher.SResourceContext) (*modulebase.ListResult, error) {
var err error
var maxLimit int64 = 2048
var maxLimit int64 = consts.GetMaxPagingLimit()
limit, _ := query.Int("limit")
offset, _ := query.Int("offset")
pagingMarker, _ := query.GetString("paging_marker")
@@ -473,6 +473,9 @@ func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.Tok
var totalCnt int
pagingConf := manager.GetPagingConfig()
if pagingConf == nil {
if limit == 0 {
limit = consts.GetDefaultPagingLimit()
}
totalCnt, err = q.CountWithError()
if err != nil {
return nil, err
@@ -572,10 +575,7 @@ func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.Tok
}
nextMarker := ""
if int64(len(retList)) > limit {
markerObj, _ := retList[limit].Get(pagingConf.MarkerField)
if markerObj != nil {
nextMarker = fmt.Sprintf("%s", markerObj)
}
nextMarker, _ = retList[limit].GetString(pagingConf.MarkerField)
retList = retList[:limit]
}
retResult := modulebase.ListResult{
@@ -670,14 +670,14 @@ func getModelExtraDetails(item IModel, ctx context.Context, extra *jsonutils.JSO
err := item.ValidateDeleteCondition(ctx)
if err != nil {
extra.Add(jsonutils.JSONFalse, "can_delete")
extra.Add(jsonutils.NewString(httputils.ErrorMsg(err)), "delete_fail_reason")
extra.Add(jsonutils.NewString(err.Error()), "delete_fail_reason")
} else {
extra.Add(jsonutils.JSONTrue, "can_delete")
}
err = item.ValidateUpdateCondition(ctx)
if err != nil {
extra.Add(jsonutils.JSONFalse, "can_update")
extra.Add(jsonutils.NewString(httputils.ErrorMsg(err)), "update_fail_reason")
extra.Add(jsonutils.NewString(err.Error()), "update_fail_reason")
} else {
extra.Add(jsonutils.JSONTrue, "can_update")
}
@@ -794,16 +794,16 @@ func (dispatcher *DBModelDispatcher) Get(ctx context.Context, idStr string, quer
} else if err != nil {
return nil, err
}
// log.Debugf("Get found %s", model)
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isObjectRbacAllowed(model, userCred, policy.PolicyActionGet)
} else {
isAllow = model.AllowGetDetails(ctx, userCred, query)
}
if !isAllow {
err := isObjectRbacAllowed(model, userCred, policy.PolicyActionGet)
if err != nil {
return nil, err
}
} else if !model.AllowGetDetails(ctx, userCred, query) {
return nil, httperrors.NewForbiddenError("Not allow to get details")
}
if userCred.HasSystemAdminPrivilege() && dispatcher.modelManager.GetSkipLog(ctx, userCred, query) {
appParams := appsrv.AppContextGetParams(ctx)
if appParams != nil {
@@ -831,9 +831,11 @@ func (dispatcher *DBModelDispatcher) GetSpecific(ctx context.Context, idStr stri
specCamel := utils.Kebab2Camel(spec, "-")
modelValue := reflect.ValueOf(model)
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isObjectRbacAllowed(model, userCred, policy.PolicyActionGet, spec)
err := isObjectRbacAllowed(model, userCred, policy.PolicyActionGet, spec)
if err != nil {
return nil, err
}
} else {
funcName := fmt.Sprintf("AllowGetDetails%s", specCamel)
@@ -846,11 +848,9 @@ func (dispatcher *DBModelDispatcher) GetSpecific(ctx context.Context, idStr stri
if len(outs) != 1 {
return nil, httperrors.NewInternalServerError("Invald %s return value", funcName)
}
isAllow = outs[0].Bool()
}
if !isAllow {
return nil, httperrors.NewForbiddenError("%s not allow to get spec %s", dispatcher.Keyword(), spec)
if !outs[0].Bool() {
return nil, httperrors.NewForbiddenError("%s not allow to get spec %s", dispatcher.Keyword(), spec)
}
}
funcName := fmt.Sprintf("GetDetails%s", specCamel)
@@ -1082,13 +1082,12 @@ func (dispatcher *DBModelDispatcher) Create(ctx context.Context, query jsonutils
}
}
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isClassRbacAllowed(dispatcher.modelManager, userCred, ownerId, policy.PolicyActionCreate)
} else {
isAllow = dispatcher.modelManager.AllowCreateItem(ctx, userCred, query, data)
}
if !isAllow {
err := isClassRbacAllowed(dispatcher.modelManager, userCred, ownerId, policy.PolicyActionCreate)
if err != nil {
return nil, err
}
} else if !dispatcher.modelManager.AllowCreateItem(ctx, userCred, query, data) {
return nil, httperrors.NewForbiddenError("Not allow to create item")
}
@@ -1152,13 +1151,12 @@ func (dispatcher *DBModelDispatcher) BatchCreate(ctx context.Context, query json
}
}
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isClassRbacAllowed(manager, userCred, ownerId, policy.PolicyActionCreate)
} else {
isAllow = manager.AllowCreateItem(ctx, userCred, query, data)
}
if !isAllow {
err := isClassRbacAllowed(manager, userCred, ownerId, policy.PolicyActionCreate)
if err != nil {
return nil, err
}
} else if !manager.AllowCreateItem(ctx, userCred, query, data) {
return nil, httperrors.NewForbiddenError("Not allow to create item")
}
@@ -1252,19 +1250,14 @@ func managerPerformCheckCreateData(
query jsonutils.JSONObject,
data jsonutils.JSONObject,
) (jsonutils.JSONObject, error) {
body, err := data.(*jsonutils.JSONDict).Get(manager.Keyword())
if err != nil {
return nil, httperrors.NewGeneralError(err)
}
bodyDict := body.(*jsonutils.JSONDict)
bodyDict := data.(*jsonutils.JSONDict)
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isClassRbacAllowed(manager, userCred, ownerId, policy.PolicyActionPerform, action)
} else {
isAllow = manager.AllowPerformCheckCreateData(ctx, userCred, query, data)
}
if !isAllow {
err := isClassRbacAllowed(manager, userCred, ownerId, policy.PolicyActionPerform, action)
if err != nil {
return nil, err
}
} else if !manager.AllowPerformCheckCreateData(ctx, userCred, query, data) {
return nil, httperrors.NewForbiddenError("not allow to perform %s", action)
}
@@ -1380,16 +1373,21 @@ func reflectDispatcherInternal(
}
}
var isAllow bool
if consts.IsRbacEnabled() {
if model == nil {
ownerId, err := fetchOwnerId(ctx, dispatcher.modelManager, userCred, data)
if err != nil {
return nil, httperrors.NewGeneralError(err)
}
isAllow = isClassRbacAllowed(dispatcher.modelManager, userCred, ownerId, operator, spec)
err = isClassRbacAllowed(dispatcher.modelManager, userCred, ownerId, operator, spec)
if err != nil {
return nil, err
}
} else {
isAllow = isObjectRbacAllowed(model, userCred, operator, spec)
err := isObjectRbacAllowed(model, userCred, operator, spec)
if err != nil {
return nil, err
}
}
} else {
allowFuncName := "Allow" + funcName
@@ -1405,10 +1403,9 @@ func reflectDispatcherInternal(
return nil, httperrors.NewInternalServerError("Invald %s return value", allowFuncName)
}
isAllow = outs[0].Bool()
}
if !isAllow {
return nil, httperrors.NewForbiddenError("%s not allow to %s %s", dispatcher.Keyword(), operator, spec)
if !outs[0].Bool() {
return nil, httperrors.NewForbiddenError("%s not allow to %s %s", dispatcher.Keyword(), operator, spec)
}
}
outs := funcValue.Call(params)
@@ -1495,13 +1492,12 @@ func (dispatcher *DBModelDispatcher) Update(ctx context.Context, idStr string, q
return nil, httperrors.NewGeneralError(err)
}
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isObjectRbacAllowed(model, userCred, policy.PolicyActionUpdate)
} else {
isAllow = model.AllowUpdateItem(ctx, userCred)
}
if !isAllow {
err := isObjectRbacAllowed(model, userCred, policy.PolicyActionUpdate)
if err != nil {
return nil, err
}
} else if !model.AllowUpdateItem(ctx, userCred) {
return nil, httperrors.NewForbiddenError("Not allow to update item")
}
@@ -1599,14 +1595,12 @@ func (dispatcher *DBModelDispatcher) Delete(ctx context.Context, idstr string, q
}
// log.Debugf("Delete %s", model.GetShortDesc(ctx))
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isObjectRbacAllowed(model, userCred, policy.PolicyActionDelete)
} else {
isAllow = model.AllowDeleteItem(ctx, userCred, query, data)
}
if !isAllow {
log.Errorf("not allow to delete")
err := isObjectRbacAllowed(model, userCred, policy.PolicyActionDelete)
if err != nil {
return nil, err
}
} else if !model.AllowDeleteItem(ctx, userCred, query, data) {
return nil, httperrors.NewForbiddenError("%s(%s) not allow to delete", dispatcher.modelManager.KeywordPlural(), model.GetId())
}

View File

@@ -144,27 +144,28 @@ func (dispatcher *DBJointModelDispatcher) Get(ctx context.Context, id1 string, i
} else if err != nil {
return nil, httperrors.NewGeneralError(err)
}
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isJointObjectRbacAllowed(item, userCred, policy.PolicyActionGet)
} else {
isAllow = item.AllowGetJointDetails(ctx, userCred, query, item)
}
if !isAllow {
err := isJointObjectRbacAllowed(item, userCred, policy.PolicyActionGet)
if err != nil {
return nil, err
}
} else if !item.AllowGetJointDetails(ctx, userCred, query, item) {
return nil, httperrors.NewForbiddenError("Not allow to get details")
}
return getItemDetails(dispatcher.JointModelManager(), item, ctx, userCred, query)
}
func attachItems(dispatcher *DBJointModelDispatcher, master IStandaloneModel, slave IStandaloneModel, ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error) {
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isObjectRbacAllowed(master, userCred, policy.PolicyActionPerform, "attach") &&
isObjectRbacAllowed(slave, userCred, policy.PolicyActionPerform, "attach")
} else {
isAllow = dispatcher.JointModelManager().AllowAttach(ctx, userCred, master, slave)
}
if !isAllow {
err := isObjectRbacAllowed(master, userCred, policy.PolicyActionPerform, "attach")
if err != nil {
return nil, err
}
err = isObjectRbacAllowed(slave, userCred, policy.PolicyActionPerform, "attach")
if err != nil {
return nil, err
}
} else if !dispatcher.JointModelManager().AllowAttach(ctx, userCred, master, slave) {
return nil, httperrors.NewForbiddenError("Not allow to attach")
}
// ownerProjId, err := fetchOwnerId(ctx, dispatcher.JointModelManager(), userCred, data)
@@ -236,13 +237,12 @@ func (dispatcher *DBJointModelDispatcher) Update(ctx context.Context, id1 string
return nil, httperrors.NewGeneralError(err)
}
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isJointObjectRbacAllowed(item, userCred, policy.PolicyActionUpdate)
} else {
isAllow = item.AllowUpdateJointItem(ctx, userCred, item)
}
if !isAllow {
err := isJointObjectRbacAllowed(item, userCred, policy.PolicyActionUpdate)
if err != nil {
return nil, err
}
} else if !item.AllowUpdateJointItem(ctx, userCred, item) {
return nil, httperrors.NewForbiddenError("Not allow to update item")
}
@@ -260,14 +260,16 @@ func (dispatcher *DBJointModelDispatcher) Detach(ctx context.Context, id1 string
return nil, httperrors.NewGeneralError(err)
}
var isAllow bool
if consts.IsRbacEnabled() {
isAllow = isObjectRbacAllowed(master, userCred, policy.PolicyActionPerform, "detach") &&
isObjectRbacAllowed(slave, userCred, policy.PolicyActionPerform, "detach")
} else {
isAllow = item.AllowDetach(ctx, userCred, query, data)
}
if !isAllow {
err := isObjectRbacAllowed(master, userCred, policy.PolicyActionPerform, "detach")
if err != nil {
return nil, err
}
err = isObjectRbacAllowed(slave, userCred, policy.PolicyActionPerform, "detach")
if err != nil {
return nil, err
}
} else if !item.AllowDetach(ctx, userCred, query, data) {
return nil, httperrors.NewForbiddenError("Not allow to attach")
}

View File

@@ -386,7 +386,7 @@ func FetchCheckQueryOwnerScope(ctx context.Context, userCred mcclient.TokenCrede
requireScope = queryScope
}
if doCheckRbac && requireScope.HigherThan(allowScope) {
return nil, scope, httperrors.NewForbiddenError(fmt.Sprintf("not enough privilleges(require:%s,allow:%s,query:%s)", requireScope, allowScope, queryScope))
return nil, scope, httperrors.NewForbiddenError(fmt.Sprintf("not enough privilege(require:%s,allow:%s,query:%s)", requireScope, allowScope, queryScope))
}
return ownerId, queryScope, nil
}

View File

@@ -177,6 +177,8 @@ type IModel interface {
IsSharable(reqCred mcclient.IIdentityProvider) bool
CustomizedGetDetailsBody(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)
MarkDeletePreventionOn()
MarkDeletePreventionOff()
}
type IResourceModelManager interface {

View File

@@ -1,4 +1,4 @@
// Copyright 2017 The etcd Authors
// 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.
@@ -12,19 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package clientv3
package lockman
import "context"
import (
"yunion.io/x/log"
)
// TODO: remove this when "FailFast=false" is fixed.
// See https://github.com/grpc/grpc-go/issues/1532.
func readyWait(rpcCtx, clientCtx context.Context, ready <-chan struct{}) error {
select {
case <-ready:
return nil
case <-rpcCtx.Done():
return rpcCtx.Err()
case <-clientCtx.Done():
return clientCtx.Err()
}
type bugFunc func(fmtStr string, fmtArgs ...interface{})
var defaultBugFunc bugFunc = func(fmtStr string, fmtArgs ...interface{}) {
log.Errorf("BUG: "+fmtStr, fmtArgs...)
}
var bug bugFunc = defaultBugFunc

View File

@@ -0,0 +1,267 @@
// 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 lockman
import (
"context"
"crypto/tls"
"fmt"
"runtime/debug"
"strings"
"sync"
"time"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/clientv3/concurrency"
"google.golang.org/grpc"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/pkg/util/atexit"
)
type SEtcdLockRecord struct {
m *sync.Mutex
depth int
pfx string
sess *concurrency.Session
em *concurrency.Mutex
}
func newEtcdLockRecord(ctx context.Context, lockman *SEtcdLockManager, key string) *SEtcdLockRecord {
pfx := fmt.Sprintf("%s/%s", lockman.config.LockPrefix, key)
sess, err := concurrency.NewSession(lockman.cli, concurrency.WithTTL(lockman.config.LockTTL))
if err != nil {
panic(fmt.Sprintf("%s: create etcd session: %v", pfx, err))
}
em := concurrency.NewMutex(sess, pfx)
rec := SEtcdLockRecord{
m: &sync.Mutex{},
depth: 0,
pfx: pfx,
sess: sess,
em: em,
}
return &rec
}
func (rec *SEtcdLockRecord) lockContext(ctx context.Context) {
rec.m.Lock()
defer rec.m.Unlock()
rec.depth += 1
if rec.depth > 32 {
// NOTE callers are responsible for ensuring unlock got called
bug("%s: depth > 32", rec.pfx)
panic(debug.Stack())
}
if err := rec.em.Lock(ctx); err != nil {
msg := fmt.Sprintf("%s: etcd lock: %v", rec.pfx, err)
panic(msg)
}
if debug_log {
log.Infof("%s: lock depth %d\n%s", rec.pfx, rec.depth, debug.Stack())
}
}
func (rec *SEtcdLockRecord) unlockContext(ctx context.Context) (needClean bool) {
rec.m.Lock()
defer rec.m.Unlock()
if debug_log {
log.Infof("%s: unlock depth %d\n%s", rec.pfx, rec.depth, debug.Stack())
}
rec.depth -= 1
if rec.depth <= 0 {
if rec.depth < 0 {
bug("%s: overly unlocked", rec.pfx)
}
// Other players can make progress once lock record got removed
// after this
//
// There is no need to unlock rec.em. Revoke the session lease
// will trigger etcd to do that. Should the remote revoke call
// fail, we expect the lease auto-refresh to stop and the lease
// will expire in known time limit.
closed := false
for i := 0; i < 3; i++ {
if err := rec.sess.Close(); err != nil {
log.Errorf("%s: session close: %s", rec.pfx, err)
if i < 2 {
time.Sleep(time.Second)
}
continue
}
closed = true
break
}
if !closed {
log.Errorf("%s: session close failure", rec.pfx)
}
return true
}
return false
}
type SEtcdLockManagerConfig struct {
Endpoints []string
Username string
Password string
TLS *tls.Config
LockTTL int
LockPrefix string
dialOptions []grpc.DialOption
dialTimeout time.Duration
}
func (config *SEtcdLockManagerConfig) validate() error {
if len(config.Endpoints) == 0 {
return fmt.Errorf("no etcd endpoint configured")
}
if config.dialTimeout <= 0 {
config.dialTimeout = 3 * time.Second
}
if len(config.dialOptions) == 0 {
// let it fail right away
config.dialOptions = []grpc.DialOption{
grpc.WithBlock(),
grpc.WithTimeout(500 * time.Millisecond),
}
}
if config.LockTTL <= 0 {
config.LockTTL = 10
}
config.LockPrefix = strings.TrimSpace(config.LockPrefix)
config.LockPrefix = strings.TrimRight(config.LockPrefix, "/")
if config.LockPrefix == "" {
config.LockPrefix = "/"
}
return nil
}
type SLockTableIndex struct {
key string
holder context.Context
}
type SEtcdLockManager struct {
tableLock *sync.Mutex
lockTable map[SLockTableIndex]*SEtcdLockRecord
config *SEtcdLockManagerConfig
cli *clientv3.Client
}
func NewEtcdLockManager(config *SEtcdLockManagerConfig) (ILockManager, error) {
if err := config.validate(); err != nil {
return nil, err
}
cli, err := clientv3.New(clientv3.Config{
Endpoints: config.Endpoints,
Username: config.Username,
Password: config.Password,
TLS: config.TLS,
DialOptions: config.dialOptions,
DialTimeout: config.dialTimeout,
})
if err != nil {
return nil, errors.Wrap(err, "new etcd client")
}
lockman := SEtcdLockManager{
tableLock: &sync.Mutex{},
lockTable: map[SLockTableIndex]*SEtcdLockRecord{},
cli: cli,
config: config,
}
atexit.Register(atexit.ExitHandler{
Prio: atexit.PRIO_LOG_OTHER,
Reason: "etcd-lockman",
Value: lockman,
Func: atexit.ExitHandlerFunc(lockman.destroyAtExit),
})
return &lockman, nil
}
func (lockman *SEtcdLockManager) destroyAtExit(eh atexit.ExitHandler) {
log.Infof("closing etcd lockman session")
for _, rec := range lockman.lockTable {
if err := rec.sess.Close(); err != nil {
log.Errorf("%s: session close: %v", rec.pfx, err)
}
}
if err := lockman.cli.Close(); err != nil {
log.Errorf("etcd lockman client close: %v", err)
}
}
func (lockman *SEtcdLockManager) getRecordWithLock(ctx context.Context, key string) *SEtcdLockRecord {
lockman.tableLock.Lock()
defer lockman.tableLock.Unlock()
return lockman.getRecord(ctx, key, true)
}
func (lockman *SEtcdLockManager) getRecord(ctx context.Context, key string, alloc bool) *SEtcdLockRecord {
idx := SLockTableIndex{
key: key,
holder: ctx,
}
_, ok := lockman.lockTable[idx]
if !ok {
if !alloc {
return nil
}
lockman.lockTable[idx] = newEtcdLockRecord(ctx, lockman, key)
}
return lockman.lockTable[idx]
}
func (lockman *SEtcdLockManager) LockKey(ctx context.Context, key string) {
record := lockman.getRecordWithLock(ctx, key)
record.lockContext(ctx)
}
func (lockman *SEtcdLockManager) UnlockKey(ctx context.Context, key string) {
lockman.tableLock.Lock()
defer lockman.tableLock.Unlock()
record := lockman.getRecord(ctx, key, false)
if record == nil {
bug("%s: unlock a non-existent lock\n%s", key, debug.Stack())
return
}
needClean := record.unlockContext(ctx)
if needClean {
idx := SLockTableIndex{
key: key,
holder: ctx,
}
delete(lockman.lockTable, idx)
}
}

View File

@@ -0,0 +1,52 @@
// 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 lockman
import (
"sync"
"testing"
"yunion.io/x/onecloud/pkg/util/atexit"
)
func TestEctdLockManager(t *testing.T) {
cfgs := []*testLockManagerConfig{}
shared := newSharedObject()
for i := 0; i < 4; i++ {
lockman, err := NewEtcdLockManager(&SEtcdLockManagerConfig{
Endpoints: []string{"localhost:2379"},
})
if err != nil {
t.Skipf("new etcd lockman: %v", err)
}
cfg := &testLockManagerConfig{
players: 3,
cycles: 3,
lockman: lockman,
shared: shared,
}
cfgs = append(cfgs, cfg)
}
defer atexit.Handle()
wg := &sync.WaitGroup{}
wg.Add(len(cfgs))
for _, cfg := range cfgs {
go func(cfg *testLockManagerConfig) {
testLockManager(t, cfg)
wg.Done()
}(cfg)
}
wg.Wait()
}

View File

@@ -174,7 +174,7 @@ func (lockman *SInMemoryLockManager) UnlockKey(ctx context.Context, key string)
record := lockman.getRecord(ctx, key, false)
if record == nil {
log.Warningf("unlock an none exist lock????")
log.Errorf("BUG: unlock an non-existent lock\n%s", debug.Stack())
return
}

View File

@@ -15,56 +15,17 @@
package lockman
import (
"context"
"sync"
"testing"
"time"
"yunion.io/x/pkg/util/stringutils"
)
type FakeObject struct {
Id string
}
func (o *FakeObject) GetId() string {
return o.Id
}
func (o *FakeObject) Keyword() string {
return "fake"
}
func run(t *testing.T, ctx context.Context, obj ILockedObject, id int, sleep time.Duration) {
t.Logf("ready to run at %d [%p]", id, ctx)
LockObject(ctx, obj)
defer ReleaseObject(ctx, obj)
t.Logf("Acquire obj at %d [%p]", id, ctx)
time.Sleep(sleep)
t.Logf("Release obj at %d [%p]", id, ctx)
}
func TestInMemoryLockManager(t *testing.T) {
Init(NewInMemoryLockManager())
objId := stringutils.UUID4()
cycle := 1
var wg sync.WaitGroup
t.Log("Start")
for id := 0; id <= 3; id += 1 {
wg.Add(1)
go func(localId int) {
t.Logf("Start %d", localId)
ctx := context.WithValue(context.Background(), "ID", localId)
for i := 0; i < cycle; i += 1 {
obj := &FakeObject{Id: objId}
run(t, ctx, obj, localId, time.Duration(localId)*time.Second)
}
wg.Done()
}(id)
lockman := NewInMemoryLockManager()
shared := newSharedObject()
cfg := &testLockManagerConfig{
players: 3,
cycles: 3,
lockman: lockman,
shared: shared,
}
wg.Wait()
testLockManager(t, cfg)
}

View File

@@ -0,0 +1,126 @@
// 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 lockman
import (
"context"
"fmt"
"sync"
"testing"
"time"
"yunion.io/x/pkg/util/stringutils"
)
type FakeObject struct {
Id string
playerId int
playerIdCount int
}
func (o *FakeObject) GetId() string {
return o.Id
}
func (o *FakeObject) Keyword() string {
return "fake"
}
func (o *FakeObject) push(playerId int) {
if o.playerId >= 0 {
if o.playerId != playerId {
panic(fmt.Sprintf("obj locked by %d, locked again by %d", o.playerId, playerId))
}
} else {
if o.playerIdCount != 0 {
panic(fmt.Sprintf("obj unlocked but player id count %d", o.playerIdCount))
}
o.playerId = playerId
}
o.playerIdCount += 1
}
func (o *FakeObject) pop(playerId int) {
if o.playerId != playerId {
panic(fmt.Sprintf("obj previously locked by %d, now unlocked by %d", o.playerId, playerId))
}
o.playerIdCount -= 1
if o.playerIdCount < 0 {
panic(fmt.Sprintf("obj overly unlocked"))
} else if o.playerIdCount == 0 {
o.playerId = -1
}
}
func newSharedObject() *FakeObject {
obj := &FakeObject{
Id: stringutils.UUID4(),
playerId: -1,
playerIdCount: 0,
}
return obj
}
type testLockManagerConfig struct {
players int
cycles int
shared *FakeObject
lockman ILockManager
}
func testLockManager(t *testing.T, cfg *testLockManagerConfig) {
players := cfg.players
cycles := cfg.cycles
shared := cfg.shared
lockman := cfg.lockman
bug = func(fmtStr string, fmtArgs ...interface{}) {
t.Fatalf(fmtStr, fmtArgs...)
}
run := func(ctx context.Context, id int, cycle int, sleep time.Duration) {
key := getObjectKey(shared)
indents := []string{" ", " "}
logpref := fmt.Sprintf("%p: %02d: %p", lockman, id, ctx)
func() {
fmt.Printf("%s: %s >acquire\n", logpref, indents[0])
lockman.LockKey(ctx, key)
shared.push(id)
fmt.Printf("%s: %s >>acquired\n", logpref, indents[1])
}()
defer func() {
fmt.Printf("%s: %s <<release\n", logpref, indents[1])
shared.pop(id)
lockman.UnlockKey(ctx, key)
fmt.Printf("%s: %s <released\n", logpref, indents[0])
}()
time.Sleep(sleep)
}
var wg sync.WaitGroup
for id := 0; id < players; id += 1 {
wg.Add(1)
go func(localId int) {
ctx := context.WithValue(context.Background(), "ID", localId)
for i := 0; i < cycles; i += 1 {
run(ctx, localId, i, time.Duration(localId)*time.Second)
}
wg.Done()
}(id)
}
wg.Wait()
}

View File

@@ -27,6 +27,7 @@ import (
"yunion.io/x/sqlchemy"
"yunion.io/x/onecloud/pkg/cloudcommon/db/lockman"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/util/rbacutils"
@@ -156,16 +157,20 @@ func (manager *SMetadataManager) ListItemFilter(ctx context.Context, q *sqlchemy
}
}
conditions := []sqlchemy.ICondition{}
admin := jsonutils.QueryBoolean(query, "admin", false)
for _, resource := range resources {
if man, ok := ResourceMap[resource]; ok {
resourceView := man.Query().SubQuery()
prefix := sqlchemy.NewStringField(fmt.Sprintf("%s::", man.Keyword()))
field := sqlchemy.CONCAT(man.Keyword(), prefix, resourceView.Field("id"))
sq := resourceView.Query(field)
if !admin && !IsAllowList(rbacutils.ScopeSystem, userCred, man) {
sq = man.FilterByOwner(sq, userCred, man.ResourceScope())
ownerId, queryScope, err := FetchCheckQueryOwnerScope(ctx, userCred, query, man, policy.PolicyActionList, true)
if err != nil {
log.Warningf("FetchCheckQueryOwnerScope.%s error: %v", man.Keyword(), err)
continue
}
sq = man.FilterByOwner(sq, ownerId, queryScope)
sq = man.FilterBySystemAttributes(sq, userCred, query, queryScope)
sq = man.FilterByHiddenSystemAttributes(sq, userCred, query, queryScope)
conditions = append(conditions, sqlchemy.In(q.Field("id"), sq))
} else {
return nil, httperrors.NewInputParameterError("Not support resource %s tag filter", resource)
@@ -224,7 +229,7 @@ func (manager *SMetadataManager) GetJsonValue(model IModel, key string, userCred
type sMetadataChange struct {
Key string
OValue string
NValue string
NValue string `json:",allowempty"`
}
func (manager *SMetadataManager) RemoveAll(ctx context.Context, model IModel, userCred mcclient.TokenCredential) error {

View File

@@ -100,6 +100,14 @@ func (manager *SModelBaseManager) ValidateName(name string) error {
return nil
}
func (model *SModelBase) MarkDeletePreventionOn() {
return
}
func (model *SModelBase) MarkDeletePreventionOff() {
return
}
// list hooks
func (manager *SModelBaseManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool {
return false

View File

@@ -77,7 +77,7 @@ func CheckSync(autoSync bool) bool {
}
} else {
for _, sql := range dropFKSqls {
fmt.Println(sql)
log.Infof("%s;", sql)
}
inSync = false
}
@@ -96,7 +96,7 @@ func CheckSync(autoSync bool) bool {
}
} else {
for _, sql := range sqls {
fmt.Println(sql)
log.Infof("%s;", sql)
}
inSync = false
}

View File

@@ -269,7 +269,7 @@ type SOpsLog struct {
ObjId string `width:"128" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"` // = Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False)
ObjName string `width:"128" charset:"utf8" nullable:"false" list:"user" create:"required"` //= Column(VARCHAR(128, charset='utf8'), nullable=False)
Action string `width:"32" charset:"utf8" nullable:"false" list:"user" create:"required"` //= Column(VARCHAR(32, charset='ascii'), nullable=False)
Notes string `width:"2048" charset:"utf8" list:"user" create:"required"` // = Column(VARCHAR(2048, charset='utf8'))
Notes string `charset:"utf8" list:"user" create:"required"`
ProjectId string `name:"tenant_id" width:"128" charset:"ascii" list:"user" create:"required" index:"true"` // = Column(VARCHAR(ID_LENGTH, charset='ascii'))
Project string `name:"tenant" width:"128" charset:"utf8" list:"user" create:"required"` // tenant = Column(VARCHAR(128, charset='utf8'))

View File

@@ -52,9 +52,7 @@ func getAllProjectResourceCounts() (map[string][]SProjectResourceCount, error) {
if err != nil {
return nil, errors.Wrap(err, "getProjectResourceCount")
}
if len(resCnt) > 0 {
ret[virtman.KeywordPlural()] = resCnt
}
ret[virtman.KeywordPlural()] = resCnt
}
}
return ret, nil

View File

@@ -15,17 +15,20 @@
package db
import (
"fmt"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/util/rbacutils"
)
func IsObjectRbacAllowed(model IModel, userCred mcclient.TokenCredential, action string, extra ...string) bool {
func IsObjectRbacAllowed(model IModel, userCred mcclient.TokenCredential, action string, extra ...string) error {
return isObjectRbacAllowed(model, userCred, action, extra...)
}
func isObjectRbacAllowed(model IModel, userCred mcclient.TokenCredential, action string, extra ...string) bool {
func isObjectRbacAllowed(model IModel, userCred mcclient.TokenCredential, action string, extra ...string) error {
manager := model.GetModelManager()
objOwnerId := model.GetOwnerId()
@@ -65,17 +68,21 @@ func isObjectRbacAllowed(model IModel, userCred mcclient.TokenCredential, action
scope := policy.PolicyManager.AllowScope(userCred, consts.GetServiceType(), manager.KeywordPlural(), action, extra...)
if !requireScope.HigherThan(scope) {
return true
return nil
}
return false
return httperrors.NewForbiddenError(fmt.Sprintf("not enough privillege(require:%s,allow:%s)", requireScope, scope))
}
func isJointObjectRbacAllowed(item IJointModel, userCred mcclient.TokenCredential, action string, extra ...string) bool {
return isObjectRbacAllowed(item.Master(), userCred, action, extra...) || isObjectRbacAllowed(item.Slave(), userCred, action, extra...)
func isJointObjectRbacAllowed(item IJointModel, userCred mcclient.TokenCredential, action string, extra ...string) error {
err1 := isObjectRbacAllowed(item.Master(), userCred, action, extra...)
err2 := isObjectRbacAllowed(item.Slave(), userCred, action, extra...)
if err1 == nil || err2 == nil {
return nil
}
return err1
}
func isClassRbacAllowed(manager IModelManager, userCred mcclient.TokenCredential, objOwnerId mcclient.IIdentityProvider, action string, extra ...string) bool {
func isClassRbacAllowed(manager IModelManager, userCred mcclient.TokenCredential, objOwnerId mcclient.IIdentityProvider, action string, extra ...string) error {
var ownerId mcclient.IIdentityProvider
if userCred != nil {
ownerId = userCred
@@ -113,10 +120,9 @@ func isClassRbacAllowed(manager IModelManager, userCred mcclient.TokenCredential
allowScope := policy.PolicyManager.AllowScope(userCred, consts.GetServiceType(), manager.KeywordPlural(), action, extra...)
if !requireScope.HigherThan(allowScope) {
return true
return nil
}
return false
return httperrors.NewForbiddenError(fmt.Sprintf("not enough privilege(require:%s,allow:%s)", requireScope, allowScope))
}
type IResource interface {

View File

@@ -43,13 +43,23 @@ func (m *SScopedResourceBaseManager) FilterByOwner(q *sqlchemy.SQuery, userCred
}
switch scope {
case rbacutils.ScopeDomain:
q = q.Filter(sqlchemy.Equals(q.Field("domain_id"), userCred.GetDomainId()))
q = q.Filter(sqlchemy.OR(
sqlchemy.Equals(q.Field("domain_id"), userCred.GetProjectDomainId()),
sqlchemy.IsNullOrEmpty(q.Field("domain_id")),
))
case rbacutils.ScopeProject:
q = q.Filter(sqlchemy.Equals(q.Field("tenant_id"), userCred.GetProjectId()))
q = q.Filter(sqlchemy.OR(
sqlchemy.Equals(q.Field("tenant_id"), userCred.GetProjectId()),
sqlchemy.IsNullOrEmpty(q.Field("tenant_id")),
))
}
return q
}
func (m *SScopedResourceBaseManager) FetchOwnerId(ctx context.Context, data jsonutils.JSONObject) (mcclient.IIdentityProvider, error) {
return FetchProjectInfo(ctx, data)
}
func (m *SScopedResourceBaseManager) ValidateCreateData(man IScopedResourceManager, ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
scope, _ := data.GetString("scope")
if scope == "" {

View File

@@ -21,6 +21,7 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/util/rbacutils"
)
@@ -66,12 +67,12 @@ func (model *SStatusStandaloneResourceBase) AllowPerformStatus(ctx context.Conte
}
func (model *SStatusStandaloneResourceBase) PerformStatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error) {
status, err := data.GetString("status")
if err != nil {
return nil, err
status, _ := data.GetString("status")
if len(status) == 0 {
return nil, httperrors.NewMissingParameterError("status")
}
reason, _ := data.GetString("reason")
err = model.SetStatus(userCred, status, reason)
err := model.SetStatus(userCred, status, reason)
return nil, err
}

View File

@@ -66,8 +66,8 @@ func RegistUserCredCacheUpdater() {
auth.RegisterAuthHook(onAuthCompleteUpdateCache)
}
func onAuthCompleteUpdateCache(userCred mcclient.TokenCredential) {
TenantCacheManager.updateTenantCache(userCred)
func onAuthCompleteUpdateCache(ctx context.Context, userCred mcclient.TokenCredential) {
TenantCacheManager.updateTenantCache(ctx, userCred)
UserCacheManager.updateUserCache(userCred)
}
@@ -91,8 +91,8 @@ func (manager *STenantCacheManager) InitializeData() error {
return nil
}
func (manager *STenantCacheManager) updateTenantCache(userCred mcclient.TokenCredential) {
manager.Save(context.Background(), userCred.GetProjectId(), userCred.GetProjectName(),
func (manager *STenantCacheManager) updateTenantCache(ctx context.Context, userCred mcclient.TokenCredential) {
manager.Save(ctx, userCred.GetProjectId(), userCred.GetProjectName(),
userCred.GetProjectDomainId(), userCred.GetProjectDomain())
}
@@ -174,8 +174,13 @@ func (manager *STenantCacheManager) fetchTenantFromKeystone(ctx context.Context,
log.Debugf("fetch empty tenant!!!!\n%s", debug.Stack())
return nil, fmt.Errorf("Empty idStr")
}
// It is to query all domain's project.
query := jsonutils.NewDict()
query.Set("scope", jsonutils.NewString("system"))
s := auth.GetAdminSession(ctx, consts.GetRegion(), "v1")
tenant, err := modules.Projects.GetById(s, idStr, nil)
tenant, err := modules.Projects.GetById(s, idStr, query)
if err != nil {
if je, ok := err.(*httputils.JSONClientError); ok && je.Code == 404 {
return nil, sql.ErrNoRows
@@ -298,9 +303,9 @@ func (manager *STenantCacheManager) Save(ctx context.Context, idStr string, name
obj.Domain = domain
obj.DomainId = domainId
obj.LastCheck = now
err = manager.TableSpec().Insert(obj)
err = manager.TableSpec().InsertOrUpdate(obj)
if err != nil {
return nil, err
return nil, errors.Wrap(err, "InsertOrUpdate")
} else {
return obj, nil
}
@@ -343,14 +348,14 @@ func (manager *STenantCacheManager) findFirstProjectOfDomain(domainId string) (*
return &tenant, nil
}
func (manager *STenantCacheManager) fetchDomainTenantsFromKeystone(domainId string) error {
func (manager *STenantCacheManager) fetchDomainTenantsFromKeystone(ctx context.Context, domainId string) error {
if len(domainId) == 0 {
log.Debugf("fetch empty domain!!!!")
debug.PrintStack()
return fmt.Errorf("Empty domainId")
}
s := auth.GetAdminSession(context.Background(), consts.GetRegion(), "v1")
s := auth.GetAdminSession(ctx, consts.GetRegion(), "v1")
params := jsonutils.Marshal(map[string]string{"domain_id": domainId})
tenants, err := modules.Projects.List(s, params)
if err != nil {
@@ -361,7 +366,7 @@ func (manager *STenantCacheManager) fetchDomainTenantsFromKeystone(domainId stri
tenantName, _ := tenant.GetString("name")
domainId, _ := tenant.GetString("domain_id")
domainName, _ := tenant.GetString("project_domain")
_, err = manager.Save(context.Background(), tenantId, tenantName, domainId, domainName)
_, err = manager.Save(ctx, tenantId, tenantName, domainId, domainName)
if err != nil {
return err
}
@@ -369,11 +374,11 @@ func (manager *STenantCacheManager) fetchDomainTenantsFromKeystone(domainId stri
return nil
}
func (manager *STenantCacheManager) FindFirstProjectOfDomain(domainId string) (*STenant, error) {
func (manager *STenantCacheManager) FindFirstProjectOfDomain(ctx context.Context, domainId string) (*STenant, error) {
tenant, err := manager.findFirstProjectOfDomain(domainId)
if err != nil {
if err == sql.ErrNoRows {
err = manager.fetchDomainTenantsFromKeystone(domainId)
err = manager.fetchDomainTenantsFromKeystone(ctx, domainId)
if err != nil {
return nil, errors.Wrap(err, "fetchDomainTenantsFromKeystone")
}

View File

@@ -19,7 +19,9 @@ import (
"database/sql"
"fmt"
"runtime/debug"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/sqlchemy"
@@ -103,22 +105,33 @@ func (manager *SUserCacheManager) fetchUser(
return user, nil
}
}
return manager.fetchUserFromKeystone(ctx, idStr)
return manager.FetchUserFromKeystone(ctx, idStr)
}
func (manager *SUserCacheManager) fetchUserFromKeystone(ctx context.Context, idStr string) (*SUser, error) {
func (manager *SUserCacheManager) FetchUserFromKeystone(ctx context.Context, idStr string) (*SUser, error) {
if len(idStr) == 0 {
log.Debugf("fetch empty user!!!!\n%s", debug.Stack())
return nil, fmt.Errorf("Empty idStr")
}
// It's to query the full list of users(contains other domain's ones and system ones)
query := jsonutils.NewDict()
query.Set("scope", jsonutils.NewString("system"))
query.Set("system", jsonutils.JSONTrue)
s := auth.GetAdminSession(ctx, consts.GetRegion(), "v1")
user, err := modules.UsersV3.GetById(s, idStr, nil)
user, err := modules.UsersV3.GetById(s, idStr, query)
if err != nil {
if je, ok := err.(*httputils.JSONClientError); ok && je.Code == 404 {
return nil, sql.ErrNoRows
user, err = modules.UsersV3.GetByName(s, idStr, query)
if je, ok := err.(*httputils.JSONClientError); ok && je.Code == 404 {
return nil, sql.ErrNoRows
}
}
if err != nil {
log.Errorf("fetch user %s fail %s", idStr, err)
return nil, errors.Wrap(err, "modules.UsersV3.Get")
}
log.Errorf("fetch user %s fail %s", idStr, err)
return nil, errors.Wrap(err, "modules.UsersV3.Get")
}
id, _ := user.GetString("id")
name, _ := user.GetString("name")
@@ -133,7 +146,7 @@ func (manager *SUserCacheManager) Save(ctx context.Context, idStr string, name s
objo, err := manager.FetchById(idStr)
if err != nil && err != sql.ErrNoRows {
log.Errorf("FetchTenantbyId fail %s", err)
log.Errorf("FetchUserbyId fail %s", err)
return nil, err
}
if err == nil {
@@ -143,6 +156,7 @@ func (manager *SUserCacheManager) Save(ctx context.Context, idStr string, name s
obj.Name = name
obj.Domain = domain
obj.DomainId = domainId
obj.LastCheck = time.Now().UTC()
return nil
})
if err != nil {
@@ -157,7 +171,8 @@ func (manager *SUserCacheManager) Save(ctx context.Context, idStr string, name s
obj.Name = name
obj.Domain = domain
obj.DomainId = domainId
err = manager.TableSpec().Insert(obj)
obj.LastCheck = time.Now().UTC()
err = manager.TableSpec().InsertOrUpdate(obj)
if err != nil {
return nil, err
} else {

View File

@@ -111,6 +111,15 @@ func (manager *SVirtualResourceBaseManager) FilterByHiddenSystemAttributes(q *sq
return q
}
func (model *SVirtualResourceBase) SetProjectInfo(ctx context.Context, userCred mcclient.TokenCredential, projectId, domainId string) error {
_, err := Update(model, func() error {
model.ProjectId = projectId
model.DomainId = domainId
return nil
})
return err
}
func (manager *SVirtualResourceBaseManager) FilterBySystemAttributes(q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject, scope rbacutils.TRbacScope) *sqlchemy.SQuery {
q = manager.SStatusStandaloneResourceBaseManager.FilterBySystemAttributes(q, userCred, query, scope)

View File

@@ -15,6 +15,9 @@
package options
import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"os"
@@ -23,6 +26,7 @@ import (
"yunion.io/x/log"
"yunion.io/x/log/hooks"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/util/reflectutils"
"yunion.io/x/pkg/util/version"
"yunion.io/x/pkg/utils"
@@ -99,6 +103,71 @@ type DBOptions struct {
DebugSqlchemy bool `default:"false" help:"Print SQL executed by sqlchemy"`
QueryOffsetOptimization bool `help:"apply query offset optimization"`
LockmanMethod string `help:"method for lock synchronization" choices:"inmemory|etcd" default:"inmemory"`
EtcdLockPrefix string `help:"prefix of etcd lock records" default:"/locks"`
EtcdLockTTL int `help:"ttl of etcd lock records"`
EtcdEndpoints []string `help:"endpoints of etcd cluster"`
EtcdUsername string `help:"username of etcd cluster"`
EtcdPassword string `help:"password of etcd cluster"`
EtcdUseTLS bool `help:"use tls transport to connect etcd cluster" default:"false"`
EtcdSkipTLSVerify bool `help:"skip tls verification" default:"false"`
EtcdCacert string `help:"path to cacert for connecting to etcd cluster"`
EtcdCert string `help:"path to cert file for connecting to etcd cluster"`
EtcdKey string `help:"path to key file for connecting to etcd cluster"`
}
func (this *DBOptions) GetEtcdTLSConfig() (*tls.Config, error) {
var (
cert tls.Certificate
certLoaded bool
capool *x509.CertPool
)
if this.EtcdCert != "" && this.EtcdKey != "" {
var err error
cert, err = tls.LoadX509KeyPair(this.EtcdCert, this.EtcdKey)
if err != nil {
return nil, errors.Wrap(err, "load etcd cert and key")
}
certLoaded = true
this.EtcdUseTLS = true
}
if this.EtcdCacert != "" {
data, err := ioutil.ReadFile(this.EtcdCacert)
if err != nil {
return nil, errors.Wrap(err, "read cacert file")
}
capool = x509.NewCertPool()
for {
var block *pem.Block
block, data = pem.Decode(data)
if block == nil {
break
}
cacert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
return nil, errors.Wrap(err, "parse cacert file")
}
capool.AddCert(cacert)
}
this.EtcdUseTLS = true
}
if this.EtcdSkipTLSVerify { // it's false by default, true means user intends to use tls
this.EtcdUseTLS = true
}
if this.EtcdUseTLS {
cfg := &tls.Config{
RootCAs: capool,
InsecureSkipVerify: this.EtcdSkipTLSVerify,
}
if certLoaded {
cfg.Certificates = []tls.Certificate{cert}
}
return cfg, nil
}
return nil, nil
}
func (this *DBOptions) GetDBConnection() (dialect, connstr string, err error) {

View File

@@ -102,18 +102,6 @@ var (
Action: PolicyActionGet,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "cloudproviders",
Action: PolicyActionList,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "cloudproviders",
Action: PolicyActionGet,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "cachedimages",
@@ -150,6 +138,18 @@ var (
Action: PolicyActionGet,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "elasticcacheskus",
Action: PolicyActionList,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "elasticcacheskus",
Action: PolicyActionGet,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "secgrouprules",
@@ -162,6 +162,12 @@ var (
Action: PolicyActionList,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "loadbalancerclusters",
Action: PolicyActionList,
Result: rbacutils.Allow,
},
{
Service: "yunionagent",
Resource: "notices",
@@ -180,6 +186,18 @@ var (
Action: PolicyActionCreate,
Result: rbacutils.Allow,
},
{
Service: identityapi.SERVICE_TYPE,
Resource: "services",
Action: PolicyActionGet,
Result: rbacutils.Allow,
},
{
Service: identityapi.SERVICE_TYPE,
Resource: "services",
Action: PolicyActionList,
Result: rbacutils.Allow,
},
},
},
{
@@ -276,6 +294,24 @@ var (
Action: PolicyActionList,
Result: rbacutils.Allow,
},
{
Service: "notify",
Resource: "contacts",
Action: PolicyActionCreate,
Result: rbacutils.Allow,
},
{
Service: "notify",
Resource: "contacts",
Action: PolicyActionUpdate,
Result: rbacutils.Allow,
},
{
Service: "notify",
Resource: "contacts",
Action: PolicyActionDelete,
Result: rbacutils.Allow,
},
},
},
{
@@ -356,6 +392,18 @@ var (
Action: PolicyActionGet,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "cloudproviders",
Action: PolicyActionList,
Result: rbacutils.Allow,
},
{
Service: "compute",
Resource: "cloudproviders",
Action: PolicyActionGet,
Result: rbacutils.Allow,
},
},
},
{

View File

@@ -16,6 +16,7 @@ package policy
import (
"context"
"runtime/debug"
"sort"
"strings"
"sync"
@@ -168,11 +169,6 @@ func (manager *SPolicyManager) start(refreshInterval time.Duration, retryInterva
}
manager.cache = hashcache.NewCache(2048, manager.refreshInterval/2)
err := manager.doSync()
if err != nil {
log.Errorf("doSync error %s", err)
return
}
manager.SyncOnce()
}
@@ -182,9 +178,16 @@ func (manager *SPolicyManager) SyncOnce() {
}
func (manager *SPolicyManager) doSync() error {
defer func() {
if r := recover(); r != nil {
log.Errorf("policyManager doSync error %s", r)
debug.PrintStack()
}
}()
policies, err := DefaultPolicyFetcher()
if err != nil {
// log.Errorf("sync rbac policy failed: %s", err)
log.Errorf("sync rbac policy failed: %s", err)
return errors.Wrap(err, "DefaultPolicyFetcher")
}

View File

@@ -43,6 +43,7 @@ var (
}
computeDomainResources = []string{
"cloudaccounts",
"cloudproviders",
"recyclebins",
}
computeUserResources = []string{

View File

@@ -103,7 +103,7 @@ func (man *SRouteManager) ValidateCreateData(ctx context.Context, userCred mccli
router.Name+"-"+iface.Name+"-"+rand.String(4)),
)
}
return nil, nil
return data, nil
}
func (man *SRouteManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error) {

View File

@@ -115,7 +115,7 @@ func (man *SRuleManager) validateData(ctx context.Context, userCred mcclient.Tok
protoV := validators.NewStringChoicesValidator("match_proto", protoChoices)
srcPortV := validators.NewPortValidator("match_src_port")
destPortV := validators.NewPortValidator("match_dest_port")
actionV := validators.NewStringChoicesValidator("action", protoChoices)
actionV := validators.NewStringChoicesValidator("action", actionChoices)
actionOptsV := validators.NewStringLenRangeValidator("action_options", 0, 256)
if isUpdate {
inIfnameV.Default(rule.MatchInIfname)
@@ -200,7 +200,7 @@ func (man *SRuleManager) ValidateCreateData(ctx context.Context, userCred mcclie
if err := man.validateData(ctx, userCred, ownerId, query, data, nil); err != nil {
return nil, err
}
return nil, nil
return data, nil
}
func (man *SRuleManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error) {

View File

@@ -22,7 +22,6 @@ import (
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
)
@@ -31,9 +30,40 @@ const (
ErrNoSuchProvder = errors.Error("no such provider")
)
type SCloudaccountCredential struct {
ProjectName string //OpenStack
DomainName string //OpenStack
Username string //OpenStack Esxi ZStack
Password string //OpenStack Esxi ZStack
AuthUrl string //OpenStack ZStack
AccessKeyId string //Huawei Aliyun Ucloud Aws
AccessKeySecret string //Huawei Aliyun Ucloud Aws
Environment string //Huawei Azure Aws
DirectoryId string //Azure
ClientId string //Azure
ClientSecret string //Azure
Host string //Esxi
Port int //Esxi
Endpoint string
AppId string //Qcloud
SecretId string //Qcloud
SecretKey string //Qcloud
ClientEmail string //Google
ProjectId string //Google
PrivateKeyId string //Google
PrivateKey string //Google
}
type SCloudaccount struct {
Account string
Secret string
Account string
Secret string
AccessUrl string
}
type ICloudProviderFactory interface {
@@ -45,8 +75,8 @@ type ICloudProviderFactory interface {
GetName() string
ValidateChangeBandwidth(instanceId string, bandwidth int64) error
ValidateCreateCloudaccountData(ctx context.Context, userCred mcclient.TokenCredential, input *api.CloudaccountCreateInput) error
ValidateUpdateCloudaccountCredential(ctx context.Context, userCred mcclient.TokenCredential, data jsonutils.JSONObject, cloudaccount string) (*SCloudaccount, error)
ValidateCreateCloudaccountData(ctx context.Context, userCred mcclient.TokenCredential, input SCloudaccountCredential) (SCloudaccount, error)
ValidateUpdateCloudaccountCredential(ctx context.Context, userCred mcclient.TokenCredential, input SCloudaccountCredential, cloudaccount string) (SCloudaccount, error)
GetSupportedBrands() []string
IsPublicCloud() bool
@@ -203,14 +233,6 @@ func (factory *baseProviderFactory) GetSupportedBrands() []string {
return []string{}
}
func (factory *baseProviderFactory) ValidateCreateCloudaccountData(ctx context.Context, userCred mcclient.TokenCredential, input *api.CloudaccountCreateInput) error {
return httperrors.NewNotImplementedError("Not Implemented ValidateCreateCloudaccountData")
}
func (factory *baseProviderFactory) ValidateUpdateCloudaccountCredential(ctx context.Context, userCred mcclient.TokenCredential, data jsonutils.JSONObject, cloudaccount string) (*SCloudaccount, error) {
return nil, httperrors.NewNotImplementedError("Not Implemented ValidateUpdateCloudaccountCredential")
}
func (factory *baseProviderFactory) GetProvider(providerId, providerName, url, username, password string) (ICloudProvider, error) {
return nil, httperrors.NewNotImplementedError("Not Implemented GetProvider")
}

View File

@@ -22,3 +22,9 @@ type SEip struct {
NetworkExternalId string
IP string
}
type AssociateConfig struct {
InstanceId string
AssociateType string
Bandwidth int
}

View File

@@ -93,6 +93,10 @@ func (region *SFakeOnPremiseRegion) GetISecurityGroupById(id string) (ICloudSecu
return nil, ErrNotSupported
}
func (region *SFakeOnPremiseRegion) GetISecurityGroupByName(vpcId string, name string) (ICloudSecurityGroup, error) {
return nil, ErrNotSupported
}
func (region *SFakeOnPremiseRegion) CreateISecurityGroup(conf *SecurityGroupCreateInput) (ICloudSecurityGroup, error) {
return nil, ErrNotSupported
}

View File

@@ -16,6 +16,7 @@ package cloudprovider
import (
"fmt"
"strings"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/util/osprofile"
@@ -77,7 +78,7 @@ func (vmConfig *SManagedVMCreateConfig) GetConfig(config *jsonutils.JSONDict) er
vmConfig.PublicKey = publicKey
}
//目前所写的userData格式仅支持Linux
if vmConfig.OsType == osprofile.OS_TYPE_LINUX {
if strings.ToLower(vmConfig.OsType) == strings.ToLower(osprofile.OS_TYPE_LINUX) {
adminPublicKey, _ := config.GetString("admin_public_key")
projectPublicKey, _ := config.GetString("project_public_key")
oUserData, _ := config.GetString("user_data")

View File

@@ -70,4 +70,18 @@ type SLoadbalancerListenerRule struct {
BackendGroupType string
Condition string // for aws only
Scheduler string // for qcloud only
HealthCheck string // for qcloud only
HealthCheckType string // for qcloud only
HealthCheckTimeout int // for qcloud only
HealthCheckDomain string // for qcloud only
HealthCheckHttpCode string // for qcloud only
HealthCheckURI string // for qcloud only
HealthCheckInterval int // for qcloud only
HealthCheckRise int // for qcloud only
HealthCheckFail int // for qcloud only
StickySessionCookieTimeout int // for qcloud only
}

View File

@@ -18,7 +18,9 @@ import (
"context"
"fmt"
"io"
"net/http"
"regexp"
"sort"
"strconv"
"strings"
"time"
@@ -42,6 +44,15 @@ const (
ACLPublicRead = TBucketACLType(s3cli.CANNED_ACL_PUBLIC_READ)
ACLPublicReadWrite = TBucketACLType(s3cli.CANNED_ACL_PUBLIC_READ_WRITE)
ACLUnknown = TBucketACLType("")
META_HEADER_CACHE_CONTROL = "Cache-Control"
META_HEADER_CONTENT_TYPE = "Content-Type"
META_HEADER_CONTENT_DISPOSITION = "Content-Disposition"
META_HEADER_CONTENT_ENCODING = "Content-Encoding"
META_HEADER_CONTENT_LANGUAGE = "Content-Language"
META_HEADER_CONTENT_MD5 = "Content-MD5"
META_HEADER_PREFIX = "X-Yunion-Meta-"
)
type SBucketStats struct {
@@ -69,7 +80,7 @@ type SBaseCloudObject struct {
StorageClass string
ETag string
LastModified time.Time
ContentType string
Meta http.Header
}
type SListObjectResult struct {
@@ -138,16 +149,16 @@ type ICloudBucket interface {
SetAcl(acl TBucketACLType) error
ListObjects(prefix string, marker string, delimiter string, maxCount int) (SListObjectResult, error)
GetIObjects(prefix string, isRecursive bool) ([]ICloudObject, error)
CopyObject(ctx context.Context, destKey string, srcBucket, srcKey string, contType string, cannedAcl TBucketACLType, storageClassStr string) error
CopyObject(ctx context.Context, destKey string, srcBucket, srcKey string, cannedAcl TBucketACLType, storageClassStr string, meta http.Header) error
GetObject(ctx context.Context, key string, rangeOpt *SGetObjectRange) (io.ReadCloser, error)
DeleteObject(ctx context.Context, keys string) error
GetTempUrl(method string, key string, expire time.Duration) (string, error)
PutObject(ctx context.Context, key string, input io.Reader, sizeBytes int64, contType string, cannedAcl TBucketACLType, storageClassStr string) error
NewMultipartUpload(ctx context.Context, key string, contType string, cannedAcl TBucketACLType, storageClassStr string) (string, error)
PutObject(ctx context.Context, key string, input io.Reader, sizeBytes int64, cannedAcl TBucketACLType, storageClassStr string, meta http.Header) error
NewMultipartUpload(ctx context.Context, key string, cannedAcl TBucketACLType, storageClassStr string, meta http.Header) (string, error)
UploadPart(ctx context.Context, key string, uploadId string, partIndex int, input io.Reader, partSize int64) (string, error)
CopyPart(ctx context.Context, key string, uploadId string, partIndex int, srcBucketName string, srcKey string, srcOffset int64, srcLength int64) (string, error)
CompleteMultipartUpload(ctx context.Context, key string, uploadId string, partEtags []string) error
@@ -162,7 +173,9 @@ type ICloudObject interface {
GetLastModified() time.Time
GetStorageClass() string
GetETag() string
GetContentType() string
GetMeta() http.Header
SetMeta(ctx context.Context, meta http.Header) error
GetAcl() TBucketACLType
SetAcl(acl TBucketACLType) error
@@ -175,7 +188,7 @@ func ICloudObject2JSONObject(obj ICloudObject) jsonutils.JSONObject {
StorageClass string
ETag string
LastModified time.Time
ContentType string
Meta http.Header
Acl string
}{
Key: obj.GetKey(),
@@ -183,7 +196,7 @@ func ICloudObject2JSONObject(obj ICloudObject) jsonutils.JSONObject {
StorageClass: obj.GetStorageClass(),
ETag: obj.GetETag(),
LastModified: obj.GetLastModified(),
ContentType: obj.GetContentType(),
Meta: obj.GetMeta(),
Acl: string(obj.GetAcl()),
}
return jsonutils.Marshal(obj2)
@@ -209,10 +222,14 @@ func (o *SBaseCloudObject) GetETag() string {
return o.ETag
}
func (o *SBaseCloudObject) GetContentType() string {
return o.ContentType
func (o *SBaseCloudObject) GetMeta() http.Header {
return o.Meta
}
//func (o *SBaseCloudObject) SetMeta(meta http.Header) error {
// return nil
//}
func GetIBucketById(region ICloudRegion, name string) (ICloudBucket, error) {
buckets, err := region.GetIBuckets()
if err != nil {
@@ -240,57 +257,82 @@ func GetIBucketByName(region ICloudRegion, name string) (ICloudBucket, error) {
}
func GetIBucketStats(bucket ICloudBucket) (SBucketStats, error) {
stats := SBucketStats{}
objs, err := bucket.GetIObjects("", true)
stats := SBucketStats{
ObjectCount: -1,
SizeBytes: -1,
}
objs, err := bucket.ListObjects("", "", "", 1000)
if err != nil {
stats.ObjectCount = -1
stats.SizeBytes = -1
return stats, errors.Wrap(err, "GetIObjects")
}
for _, obj := range objs {
if objs.IsTruncated {
return stats, errors.Error("too many objects")
}
for _, obj := range objs.Objects {
stats.SizeBytes += obj.GetSizeBytes()
stats.ObjectCount += 1
}
return stats, nil
}
func GetIObjects(bucket ICloudBucket, objectPrefix string, isRecursive bool) ([]ICloudObject, error) {
type cloudObjectList []ICloudObject
func (a cloudObjectList) Len() int { return len(a) }
func (a cloudObjectList) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a cloudObjectList) Less(i, j int) bool { return a[i].GetKey() < a[j].GetKey() }
func GetPagedObjects(bucket ICloudBucket, objectPrefix string, isRecursive bool, marker string, maxCount int) ([]ICloudObject, string, error) {
delimiter := "/"
if isRecursive {
delimiter = ""
}
if maxCount > 1000 || maxCount <= 0 {
maxCount = 1000
}
ret := make([]ICloudObject, 0)
result, err := bucket.ListObjects(objectPrefix, marker, delimiter, maxCount)
if err != nil {
return nil, "", errors.Wrap(err, "bucket.ListObjects")
}
// Send all objects
for i := range result.Objects {
// if delimited, skip the first object ends with delimiter
if !isRecursive && result.Objects[i].GetKey() == objectPrefix && strings.HasSuffix(objectPrefix, delimiter) {
continue
}
ret = append(ret, result.Objects[i])
marker = result.Objects[i].GetKey()
}
// Send all common prefixes if any.
// NOTE: prefixes are only present if the request is delimited.
if len(result.CommonPrefixes) > 0 {
ret = append(ret, result.CommonPrefixes...)
}
// sort prefix by name in ascending order
sort.Sort(cloudObjectList(ret))
// If next marker present, save it for next request.
if result.NextMarker != "" {
marker = result.NextMarker
}
// If not truncated, no more objects
if !result.IsTruncated {
marker = ""
}
return ret, marker, nil
}
func GetAllObjects(bucket ICloudBucket, objectPrefix string, isRecursive bool) ([]ICloudObject, error) {
ret := make([]ICloudObject, 0)
// Save marker for next request.
var marker string
for {
// Get list of objects a maximum of 1000 per request.
result, err := bucket.ListObjects(objectPrefix, marker, delimiter, 1000)
result, marker, err := GetPagedObjects(bucket, objectPrefix, isRecursive, marker, 1000)
if err != nil {
return nil, errors.Wrap(err, "bucket.ListObjects")
}
// Send all objects
for i := range result.Objects {
if !isRecursive && result.Objects[i].GetKey() == objectPrefix {
continue
}
ret = append(ret, result.Objects[i])
marker = result.Objects[i].GetKey()
}
// Send all common prefixes if any.
// NOTE: prefixes are only present if the request is delimited.
if len(result.CommonPrefixes) > 0 {
ret = append(ret, result.CommonPrefixes...)
}
// If next marker present, save it for next request.
if result.NextMarker != "" {
marker = result.NextMarker
}
// Listing ends result is not truncated, break the loop
if !result.IsTruncated {
ret = append(ret, result...)
if marker == "" {
break
}
}
@@ -323,14 +365,14 @@ func Makedir(ctx context.Context, bucket ICloudBucket, key string) error {
}
}
path := strings.Join(segs, "/") + "/"
err := bucket.PutObject(ctx, path, strings.NewReader(""), 0, "", ACLPrivate, "")
err := bucket.PutObject(ctx, path, strings.NewReader(""), 0, bucket.GetAcl(), "", nil)
if err != nil {
return errors.Wrap(err, "PutObject")
}
return nil
}
func UploadObject(ctx context.Context, bucket ICloudBucket, key string, blocksz int64, input io.Reader, sizeBytes int64, contType string, cannedAcl TBucketACLType, storageClass string, debug bool) error {
func UploadObject(ctx context.Context, bucket ICloudBucket, key string, blocksz int64, input io.Reader, sizeBytes int64, cannedAcl TBucketACLType, storageClass string, meta http.Header, debug bool) error {
if blocksz <= 0 {
blocksz = MAX_PUT_OBJECT_SIZEBYTES
}
@@ -338,7 +380,7 @@ func UploadObject(ctx context.Context, bucket ICloudBucket, key string, blocksz
if debug {
log.Debugf("too small, put object in one shot")
}
return bucket.PutObject(ctx, key, input, sizeBytes, contType, cannedAcl, storageClass)
return bucket.PutObject(ctx, key, input, sizeBytes, cannedAcl, storageClass, meta)
}
partSize := blocksz
partCount := sizeBytes / partSize
@@ -358,7 +400,7 @@ func UploadObject(ctx context.Context, bucket ICloudBucket, key string, blocksz
if debug {
log.Debugf("multipart upload part count %d part size %d", partCount, partSize)
}
uploadId, err := bucket.NewMultipartUpload(ctx, key, contType, cannedAcl, storageClass)
uploadId, err := bucket.NewMultipartUpload(ctx, key, cannedAcl, storageClass, meta)
if err != nil {
return errors.Wrap(err, "bucket.NewMultipartUpload")
}
@@ -394,7 +436,7 @@ func UploadObject(ctx context.Context, bucket ICloudBucket, key string, blocksz
}
func DeletePrefix(ctx context.Context, bucket ICloudBucket, prefix string) error {
objs, err := bucket.GetIObjects(prefix, true)
objs, err := GetAllObjects(bucket, prefix, true)
if err != nil {
return errors.Wrap(err, "bucket.GetIObjects")
}
@@ -407,7 +449,31 @@ func DeletePrefix(ctx context.Context, bucket ICloudBucket, prefix string) error
return nil
}
func CopyObject(ctx context.Context, blocksz int64, dstBucket ICloudBucket, dstKey string, srcBucket ICloudBucket, srcKey string, debug bool) error {
func MergeMeta(src http.Header, dst http.Header) http.Header {
if src != nil && dst != nil {
ret := http.Header{}
for k, vs := range src {
for _, v := range vs {
ret.Add(k, v)
}
}
for k, vs := range dst {
for _, v := range vs {
ret.Add(k, v)
}
}
return ret
} else if src != nil && dst == nil {
return src
} else if src == nil && dst != nil {
return dst
} else {
return nil
}
}
func CopyObject(ctx context.Context, blocksz int64, dstBucket ICloudBucket, dstKey string, srcBucket ICloudBucket, srcKey string, dstMeta http.Header, debug bool) error {
srcObj, err := GetIObject(srcBucket, srcKey)
if err != nil {
return errors.Wrap(err, "GetIObject")
@@ -425,7 +491,7 @@ func CopyObject(ctx context.Context, blocksz int64, dstBucket ICloudBucket, dstK
return errors.Wrap(err, "srcBucket.GetObject")
}
defer srcStream.Close()
err = dstBucket.PutObject(ctx, dstKey, srcStream, sizeBytes, srcObj.GetContentType(), srcObj.GetAcl(), srcObj.GetStorageClass())
err = dstBucket.PutObject(ctx, dstKey, srcStream, sizeBytes, srcObj.GetAcl(), srcObj.GetStorageClass(), MergeMeta(srcObj.GetMeta(), dstMeta))
if err != nil {
return errors.Wrap(err, "dstBucket.PutObject")
}
@@ -449,7 +515,7 @@ func CopyObject(ctx context.Context, blocksz int64, dstBucket ICloudBucket, dstK
if debug {
log.Debugf("multipart upload part count %d part size %d", partCount, partSize)
}
uploadId, err := dstBucket.NewMultipartUpload(ctx, dstKey, srcObj.GetContentType(), srcObj.GetAcl(), srcObj.GetStorageClass())
uploadId, err := dstBucket.NewMultipartUpload(ctx, dstKey, srcObj.GetAcl(), srcObj.GetStorageClass(), MergeMeta(srcObj.GetMeta(), dstMeta))
if err != nil {
return errors.Wrap(err, "bucket.NewMultipartUpload")
}
@@ -513,3 +579,58 @@ func CopyPart(ctx context.Context,
}
return etag, nil
}
func ObjectSetMeta(ctx context.Context,
bucket ICloudBucket, obj ICloudObject,
meta http.Header,
) error {
return bucket.CopyObject(ctx, obj.GetKey(), bucket.GetName(), obj.GetKey(), obj.GetAcl(), obj.GetStorageClass(), meta)
}
func MetaToHttpHeader(metaPrefix string, meta http.Header) http.Header {
hdr := http.Header{}
for k, v := range meta {
if len(v) == 0 || len(v[0]) == 0 {
continue
}
k = http.CanonicalHeaderKey(k)
switch k {
case META_HEADER_CACHE_CONTROL,
META_HEADER_CONTENT_TYPE,
META_HEADER_CONTENT_DISPOSITION,
META_HEADER_CONTENT_ENCODING,
META_HEADER_CONTENT_LANGUAGE,
META_HEADER_CONTENT_MD5:
hdr.Set(k, v[0])
default:
hdr.Set(fmt.Sprintf("%s%s", metaPrefix, k), v[0])
}
}
return hdr
}
func FetchMetaFromHttpHeader(metaPrefix string, headers http.Header) http.Header {
metaPrefix = http.CanonicalHeaderKey(metaPrefix)
meta := http.Header{}
for hdr, vals := range headers {
hdr = http.CanonicalHeaderKey(hdr)
if strings.HasPrefix(hdr, metaPrefix) {
for _, val := range vals {
meta.Add(hdr[len(metaPrefix):], val)
}
}
}
for _, hdr := range []string{
META_HEADER_CONTENT_TYPE,
META_HEADER_CONTENT_ENCODING,
META_HEADER_CONTENT_DISPOSITION,
META_HEADER_CONTENT_LANGUAGE,
META_HEADER_CACHE_CONTROL,
} {
val := headers.Get(hdr)
if len(val) > 0 {
meta.Set(hdr, val)
}
}
return meta
}

View File

@@ -70,6 +70,7 @@ type ICloudRegion interface {
GetIDiskById(id string) (ICloudDisk, error)
GetISecurityGroupById(secgroupId string) (ICloudSecurityGroup, error)
GetISecurityGroupByName(vpcId string, name string) (ICloudSecurityGroup, error)
CreateISecurityGroup(conf *SecurityGroupCreateInput) (ICloudSecurityGroup, error)
CreateIVpc(name string, desc string, cidr string) (ICloudVpc, error)
@@ -227,6 +228,7 @@ type ICloudHost interface {
GetCpuCmtbound() float32
GetMemSizeMB() int
GetMemCmtbound() float32
GetReservedMemoryMb() int
GetStorageSizeMB() int
GetStorageType() string
GetHostType() string
@@ -301,6 +303,7 @@ type ICloudVM interface {
type ICloudNic interface {
GetIP() string
GetMAC() string
InClassicNetwork() bool
GetDriver() string
GetINetwork() ICloudNetwork
}
@@ -321,7 +324,7 @@ type ICloudEIP interface {
Delete() error
Associate(instanceId string) error
Associate(conf *AssociateConfig) error
Dissociate() error
ChangeBandwidth(bw int) error

View File

@@ -61,6 +61,11 @@ func WaitStatusWithInstanceErrorCheck(res ICloudResource, expect string, interva
return ErrTimeout
}
func WaitDeletedWithDelay(res ICloudResource, delay time.Duration, interval time.Duration, timeout time.Duration) error {
time.Sleep(delay)
return WaitDeleted(res, interval, timeout)
}
func WaitDeleted(res ICloudResource, interval time.Duration, timeout time.Duration) error {
startTime := time.Now()
for time.Now().Sub(startTime) < timeout {

View File

@@ -65,23 +65,23 @@ var (
)
type BaremetalStorage struct {
Size int64 `json:"size"`
Size int64 `json:"size,allowzero"`
Driver string `json:"driver"`
Rotate bool `json:"rotate"`
Rotate bool `json:"rotate,allowfalse"`
Dev string `json:"dev,omitempty"`
Sector int64 `json:"sector,omitempty"`
Block int64 `json:"block,omitempty"`
ModuleInfo string `json:"module,omitempty"`
Kernel string `json:"kernel,omitempty"`
PCIClass string `json:"pci_class,omitempty"`
Slot int `json:"slot,omitempty"`
Slot int `json:"slot,allowzero"`
Status string `json:"status,omitempty"`
Adapter int `json:"adapter,omitempty"`
Adapter int `json:"adapter,allowzero"`
Model string `json:"model,omitempty"`
Enclosure int `json:"enclousure,omitempty"`
Enclosure int `json:"enclousure,allowzero"`
MinStripSize int64 `json:"min_strip_size,omitempty"`
MaxStripSize int64 `json:"max_strip_size,omitempty"`
Index int64 `json:"index"`
Index int64 `json:"index,allowzero"`
Addr string `json:"addr,omitempty"`
}

View File

@@ -18,6 +18,7 @@ import (
"context"
"fmt"
"strings"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
@@ -28,6 +29,7 @@ import (
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/compute/models"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/util/billing"
)
@@ -141,6 +143,23 @@ func (self *SAwsGuestDriver) GetDeployStatus() ([]string, error) {
}
func (self *SAwsGuestDriver) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, input *api.ServerCreateInput) (*api.ServerCreateInput, error) {
if len(input.Eip) > 0 || input.EipBw > 0 {
// 未明确指定network时由调度器进行调度跳过support_eip检查
if len(input.Networks) > 0 && len(input.Networks[0].Network) > 0 {
inetwork, err := db.FetchByIdOrName(models.NetworkManager, userCred, input.Networks[0].Network)
if err != nil {
return nil, errors.Wrap(err, "SAwsGuestDriver.ValidateCreateData.Networks.FetchByIdOrName")
}
support_eip := inetwork.(*models.SNetwork).GetMetadataJson("ext:support_eip", nil)
if support_eip != nil {
if ok, _ := support_eip.Bool(); !ok {
return nil, httperrors.NewInputParameterError("network %s associated route table has no internet gateway attached.", inetwork.GetName())
}
}
}
}
return self.SManagedVirtualizedGuestDriver.ValidateCreateData(ctx, userCred, input)
}
@@ -181,11 +200,22 @@ func (self *SAwsGuestDriver) RequestAssociateEip(ctx context.Context, userCred m
return nil, fmt.Errorf("SAwsGuestDriver.RequestAssociateEip fail to find iEIP for eip %s", err)
}
err = extEip.Associate(server.ExternalId)
conf := &cloudprovider.AssociateConfig{
InstanceId: server.ExternalId,
Bandwidth: eip.Bandwidth,
AssociateType: api.EIP_ASSOCIATE_TYPE_SERVER,
}
err = extEip.Associate(conf)
if err != nil {
return nil, fmt.Errorf("SAwsGuestDriver.RequestAssociateEip fail to remote associate EIP %s", err)
}
err = cloudprovider.WaitStatus(extEip, api.EIP_STATUS_READY, 3*time.Second, 60*time.Second)
if err != nil {
return nil, errors.Wrap(err, "SAwsGuestDriver.RequestAssociateEip.WaitStatus")
}
err = eip.AssociateVM(ctx, userCred, server)
if err != nil {
return nil, fmt.Errorf("SAwsGuestDriver.RequestAssociateEip fail to local associate EIP %s", err)

View File

@@ -143,7 +143,3 @@ func (self *SAzureGuestDriver) GetLinuxDefaultAccount(desc cloudprovider.SManage
func (self *SAzureGuestDriver) IsSupportedBillingCycle(bc billing.SBillingCycle) bool {
return false
}
func (self *SAzureGuestDriver) NeedStopForChangeSpec(guest *models.SGuest) bool {
return false
}

View File

@@ -258,12 +258,16 @@ func (self *SBaremetalGuestDriver) RequestGuestCreateAllDisks(ctx context.Contex
if storageCache == nil {
return fmt.Errorf("no valid storage cache")
}
return storageCache.StartImageCacheTask(ctx, task.GetUserCred(), imageId, diskCat.Root.DiskFormat, false, task.GetTaskId())
return storageCache.StartImageCacheTask(ctx, task.GetUserCred(), imageId, "qcow2", false, task.GetTaskId())
}
func (self *SBaremetalGuestDriver) RequestGuestHotAddIso(ctx context.Context, guest *models.SGuest, path string, task taskman.ITask) error {
func (self *SBaremetalGuestDriver) NeedRequestGuestHotAddIso(ctx context.Context, guest *models.SGuest) bool {
return true
}
func (self *SBaremetalGuestDriver) RequestGuestHotAddIso(ctx context.Context, guest *models.SGuest, path string, boot bool, task taskman.ITask) error {
host := guest.GetHost()
return host.StartInsertIsoTask(ctx, task.GetUserCred(), filepath.Base(path), false, task.GetTaskId())
return host.StartInsertIsoTask(ctx, task.GetUserCred(), filepath.Base(path), boot, task.GetTaskId())
}
func (self *SBaremetalGuestDriver) RequestGuestHotRemoveIso(ctx context.Context, guest *models.SGuest, task taskman.ITask) error {
@@ -272,8 +276,7 @@ func (self *SBaremetalGuestDriver) RequestGuestHotRemoveIso(ctx context.Context,
}
func (self *SBaremetalGuestDriver) RequestGuestCreateInsertIso(ctx context.Context, imageId string, guest *models.SGuest, task taskman.ITask) error {
host := guest.GetHost()
return host.StartInsertIsoTask(ctx, task.GetUserCred(), imageId, true, task.GetTaskId())
return guest.StartInsertIsoTask(ctx, imageId, true, guest.HostId, task.GetUserCred(), task.GetTaskId())
}
func (self *SBaremetalGuestDriver) RequestStartOnHost(ctx context.Context, guest *models.SGuest, host *models.SHost, userCred mcclient.TokenCredential, task taskman.ITask) (jsonutils.JSONObject, error) {
@@ -398,6 +401,15 @@ func (self *SBaremetalGuestDriver) GetGuestVncInfo(ctx context.Context, userCred
return data, nil
}
func (self *SBaremetalGuestDriver) RequestRebuildRootDisk(ctx context.Context, guest *models.SGuest, task taskman.ITask) error {
subtask, err := taskman.TaskManager.NewTask(ctx, "ManagedGuestRebuildRootTask", guest, task.GetUserCred(), task.GetParams(), task.GetTaskId(), "", nil)
if err != nil {
return err
}
subtask.ScheduleRun(nil)
return nil
}
func (self *SBaremetalGuestDriver) PerformStart(ctx context.Context, userCred mcclient.TokenCredential, guest *models.SGuest, data *jsonutils.JSONDict) error {
return guest.StartGueststartTask(ctx, userCred, data, "")
}
@@ -455,6 +467,8 @@ func (self *SBaremetalGuestDriver) RequestDeployGuestOnHost(ctx context.Context,
}
if val == "rebuild" && jsonutils.QueryBoolean(task.GetParams(), "auto_start", false) {
config.Set("on_finish", jsonutils.NewString("restart"))
} else if val == "deploy" && jsonutils.QueryBoolean(task.GetParams(), "restart", false) {
config.Set("on_finish", jsonutils.NewString("shutdown"))
}
url := fmt.Sprintf("/baremetals/%s/servers/%s/%s", host.Id, guest.Id, val)
headers := task.GetTaskRequestHeader()

View File

@@ -175,6 +175,9 @@ func (self *SBaseGuestDriver) StartGuestResetTask(guest *models.SGuest, ctx cont
func (self *SBaseGuestDriver) StartGuestRestartTask(guest *models.SGuest, ctx context.Context, userCred mcclient.TokenCredential, isForce bool, parentTaskId string) error {
data := jsonutils.NewDict()
data.Set("is_force", jsonutils.NewBool(isForce))
if err := guest.SetStatus(userCred, api.VM_STOPPING, ""); err != nil {
return err
}
task, err := taskman.TaskManager.NewTask(ctx, "GuestRestartTask", guest, userCred, nil, parentTaskId, "", nil)
if err != nil {
return err
@@ -199,7 +202,11 @@ func (self *SBaseGuestDriver) RequestChangeVmConfig(ctx context.Context, guest *
return fmt.Errorf("Not Implement")
}
func (self *SBaseGuestDriver) RequestGuestHotAddIso(ctx context.Context, guest *models.SGuest, path string, task taskman.ITask) error {
func (self *SBaseGuestDriver) NeedRequestGuestHotAddIso(ctx context.Context, guest *models.SGuest) bool {
return false
}
func (self *SBaseGuestDriver) RequestGuestHotAddIso(ctx context.Context, guest *models.SGuest, path string, boot bool, task taskman.ITask) error {
return fmt.Errorf("Not Implement")
}
@@ -239,6 +246,10 @@ func (self *SBaseGuestDriver) IsSupportedBillingCycle(bc billing.SBillingCycle)
return true
}
func (self *SBaseGuestDriver) IsSupportPostpaidExpire() bool {
return false
}
func (self *SBaseGuestDriver) RequestRenewInstance(guest *models.SGuest, bc billing.SBillingCycle) (time.Time, error) {
return time.Time{}, nil
}
@@ -251,8 +262,8 @@ func (self *SBaseGuestDriver) RequestAssociateEip(ctx context.Context, userCred
return fmt.Errorf("SBaseGuestDriver: Not Implement RequestAssociateEip")
}
func (self *SBaseGuestDriver) NeedStopForChangeSpec(guest *models.SGuest) bool {
return true
func (self *SBaseGuestDriver) NeedStopForChangeSpec(guest *models.SGuest, cpuChanged, memChanged bool) bool {
return false
}
func (self *SBaseGuestDriver) RemoteDeployGuestForCreate(ctx context.Context, userCred mcclient.TokenCredential, guest *models.SGuest, host *models.SHost, desc cloudprovider.SManagedVMCreateConfig) (jsonutils.JSONObject, error) {

View File

@@ -77,7 +77,7 @@ func (self *SContainerDriver) RequestGuestCreateAllDisks(ctx context.Context, gu
return nil
}
func (self *SContainerDriver) RequestGuestHotAddIso(ctx context.Context, guest *models.SGuest, path string, task taskman.ITask) error {
func (self *SContainerDriver) RequestGuestHotAddIso(ctx context.Context, guest *models.SGuest, path string, boot bool, task taskman.ITask) error {
// do nothing, call next stage
task.ScheduleRun(nil)
return nil

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