Compare commits

...

599 Commits

Author SHA1 Message Date
Zexi Li
97b5bd2006 Merge pull request #6741 from swordqiu/automated-cherry-pick-of-#6740-upstream-release-3.2
Automated cherry pick of #6740: fix: xsky recode using endpoint as accesskey key
2020-06-04 21:40:58 +08:00
Zexi Li
9c100c8a92 Merge pull request #6739 from tb365/automated-cherry-pick-of-#6737-upstream-release-3.2
Automated cherry pick of #6737: ctyun sync host wire fix
2020-06-04 21:39:57 +08:00
Zexi Li
8683501e69 Merge pull request #6745 from wanyaoqi/automated-cherry-pick-of-#6744-upstream-release-3.2
Automated cherry pick of #6744: bind mount local image path to container path
2020-06-04 21:24:14 +08:00
Zexi Li
ac47a29a8c Merge pull request #6748 from wanyaoqi/automated-cherry-pick-of-#6173-upstream-release-3.2
Automated cherry pick of #6173: support custom service url
2020-06-04 21:19:53 +08:00
wanyaoqi
b903a2aecb support custom service url 2020-06-04 20:27:44 +08:00
wanyaoqi
4cebf604ab bind mount local image path to container path 2020-06-04 20:21:14 +08:00
Qiu Jian
5da84f7a51 fix: xsky recode using endpoint as accesskey key 2020-06-04 19:22:54 +08:00
tangbin
4ba3437006 ctyun sync host wire fix 2020-06-04 18:53:45 +08:00
Zexi Li
f7dde179d8 Merge pull request #6729 from ioito/automated-cherry-pick-of-#6728-upstream-release-3.2
Automated cherry pick of #6728: fix: 避免openstack session==nil
2020-06-04 15:04:29 +08:00
Qu Xuan
7d505c6dc1 fix: 避免openstack session==nil 2020-06-04 11:24:13 +08:00
Zexi Li
bdbb08c15d Merge pull request #6723 from ioito/automated-cherry-pick-of-#6722-upstream-release-3.2
Automated cherry pick of #6722: fix: 添加region翻译
2020-06-04 10:28:59 +08:00
Zexi Li
b24ec284f7 Merge pull request #6727 from swordqiu/automated-cherry-pick-of-#6726-upstream-release-3.2
Automated cherry pick of #6726: fix: keystone event list fail to find user
2020-06-04 10:26:57 +08:00
Qiu Jian
635827794d fix: keystone event list fail to find user 2020-06-04 08:01:15 +08:00
Qu Xuan
c0ad0c495a fix: 添加region翻译 2020-06-03 20:40:10 +08:00
Zexi Li
728494b9e3 Merge pull request #6721 from ioito/automated-cherry-pick-of-#6720-upstream-release-3.2
Automated cherry pick of #6720: fix: 修复gcp object编码问题
2020-06-03 20:07:46 +08:00
Zexi Li
0585a83a0c Merge pull request #6712 from ioito/automated-cherry-pick-of-#6711-upstream-release-3.2
Automated cherry pick of #6711: fix: 移除默认调度策略
2020-06-03 17:27:30 +08:00
Zexi Li
60b11e8f50 Merge pull request #6719 from tb365/automated-cherry-pick-of-#6696-upstream-release-3.2
Automated cherry pick of #6696: add-enterprise-info-update-climc
2020-06-03 17:26:25 +08:00
Zexi Li
7ec7598037 Merge pull request #6714 from wanyaoqi/automated-cherry-pick-of-#6713-upstream-release-3.2
Automated cherry pick of #6713: isolated device manager:
2020-06-03 17:25:12 +08:00
Qu Xuan
fe8c2c6d51 fix: 修复gcp object编码问题 2020-06-03 16:36:42 +08:00
tangbin
2fb4254d83 add-enterprise-info-update-climc 2020-06-03 16:27:10 +08:00
wanyaoqi
cbbbd29830 isolated device manager:
- fix find boot_vga got No such file or dirtory
2020-06-03 15:50:03 +08:00
Qu Xuan
f70ca13563 fix: 移除默认调度策略 2020-06-03 15:23:08 +08:00
Zexi Li
9f4a4028b8 Merge pull request #6709 from ioito/automated-cherry-pick-of-#6708-upstream-release-3.2
Automated cherry pick of #6708: fix: 转换gcp错误
2020-06-03 13:03:25 +08:00
Qu Xuan
7bbc8afc51 fix: 转换gcp错误 2020-06-03 11:57:28 +08:00
Zexi Li
afdc49d0b5 Merge pull request #6700 from rainzm/automated-cherry-pick-of-#6699-upstream-release-3.2
Automated cherry pick of #6699: feat: Logo and copyright in verify email are same with these in company info
2020-06-03 10:23:57 +08:00
Zexi Li
bea0d7b978 Merge pull request #6703 from ioito/automated-cherry-pick-of-#6702-upstream-release-3.2
Automated cherry pick of #6702: fix: gcp默认创建允许所有地址访问的用户
2020-06-03 10:17:12 +08:00
Zexi Li
562e15c97d Merge pull request #6705 from ioito/automated-cherry-pick-of-#6704-upstream-release-3.2
Automated cherry pick of #6704: fix: 允许gcp创建vpc时不指定cidr
2020-06-03 10:16:50 +08:00
Zexi Li
7211580cfe Merge pull request #6707 from ioito/automated-cherry-pick-of-#6706-upstream-release-3.2
Automated cherry pick of #6706: fix: 避免越过tenantcache过期检查
2020-06-03 10:16:08 +08:00
Qu Xuan
7451ae9f90 fix: 避免越过tenantcache过期检查 2020-06-02 22:18:43 +08:00
Qu Xuan
766d5cf803 fix: 允许gcp创建vpc时不指定cidr 2020-06-02 22:03:17 +08:00
Qu Xuan
040a90587b fix: gcp默认创建允许所有地址访问的用户 2020-06-02 21:47:02 +08:00
Zexi Li
d3f8c71050 Merge pull request #6698 from swordqiu/automated-cherry-pick-of-#6697-upstream-release-3.2
Automated cherry pick of #6697: fix: apigateway expose esxiagent service avaiability
2020-06-02 21:20:24 +08:00
rainzm
3630164960 feat: Logo and copyright in verify email are same with these in company info 2020-06-02 20:55:56 +08:00
Qiu Jian
38b8e24eb0 fix: apigateway expose esxiagent service avaiability 2020-06-02 20:32:30 +08:00
yunion-ci-robot
847c296b64 Merge pull request #6687 from ioito/automated-cherry-pick-of-#6686-upstream-release-3.2
Automated cherry pick of #6686: fix: 避免锁超时
2020-06-02 13:59:44 +08:00
Qu Xuan
2521ec8f91 fix: 避免锁超时 2020-06-02 11:14:33 +08:00
Zexi Li
15f0e8c72c Merge pull request #6681 from ioito/automated-cherry-pick-of-#6680-upstream-release-3.2
Automated cherry pick of #6680: fix: sync s3 bucket status
2020-06-02 10:05:04 +08:00
Zexi Li
6013c0e0d8 Merge pull request #6685 from ioito/automated-cherry-pick-of-#6684-upstream-release-3.2
Automated cherry pick of #6684: fix: gcp path escape for object
2020-06-02 10:04:40 +08:00
Zexi Li
f072ef65fd Merge pull request #6667 from ioito/automated-cherry-pick-of-#6666-upstream-release-3.2
Automated cherry pick of #6666: fix: 安全组规则返回项目id信息
2020-06-02 10:03:24 +08:00
Zexi Li
b3b6a0cf59 Merge pull request #6665 from zhaoxiangchun/automated-cherry-pick-of-#6664-upstream-release-3.2
Automated cherry pick of #6664: 在优化建议资源列表中增加费用信息
2020-06-02 10:02:37 +08:00
Zexi Li
c47f6a77b9 Merge pull request #6676 from ioito/automated-cherry-pick-of-#6675-upstream-release-3.2
Automated cherry pick of #6675: fix: add us-west4 for google region
2020-06-02 09:59:50 +08:00
Zexi Li
b1704b0039 Merge pull request #6671 from wanyaoqi/automated-cherry-pick-of-#6670-upstream-release-3.2
Automated cherry pick of #6670: get snapshots order by created at asc
2020-06-02 09:58:31 +08:00
Qu Xuan
a98ce67684 fix: gcp path escape for object 2020-06-01 19:58:44 +08:00
Qu Xuan
fcc8db69a8 fix: sync s3 bucket status 2020-06-01 18:56:04 +08:00
Qu Xuan
43748db2e2 fix: add us-west4 for google region 2020-06-01 18:26:51 +08:00
wanyaoqi
41673a54c0 get snapshots order by created at asc 2020-06-01 15:09:15 +08:00
Qu Xuan
bd63447bae fix: 安全组规则返回项目id信息 2020-05-29 20:49:52 +08:00
zhaoxiangchun
5ca2c6fcdf 在优化建议资源列表中增加费用信息
另外,在资源进行处理时记录对应的status信息
2020-05-29 19:45:47 +08:00
Zexi Li
f330d01791 Merge pull request #6662 from rainzm/automated-cherry-pick-of-#6661-upstream-release-3.2
Automated cherry pick of #6661: fix(notify): Remove default mobile template
2020-05-29 19:32:24 +08:00
Zexi Li
8fb744be58 Merge pull request #6659 from ioito/automated-cherry-pick-of-#6658-upstream-release-3.2
Automated cherry pick of #6658: fix: byte size fix
2020-05-29 19:14:33 +08:00
rainzm
ec2087f3f0 fix(notify): Remove default mobile template 2020-05-29 18:50:11 +08:00
Qu Xuan
f67011b143 fix: byte size fix 2020-05-29 17:00:01 +08:00
Zexi Li
bb0b831b72 Merge pull request #6649 from swordqiu/automated-cherry-pick-of-#6636-upstream-release-3.2
Automated cherry pick of #6636: fix: ignore match weights when searching matched policysets
2020-05-29 14:20:29 +08:00
Zexi Li
74a1ccec9d Merge pull request #6651 from wanyaoqi/automated-cherry-pick-of-#6650-upstream-release-3.2
Automated cherry pick of #6650: fix migrate with multi local storage
2020-05-29 14:18:54 +08:00
wanyaoqi
c74b41ef1f fix migrate with multi local storage 2020-05-29 11:52:28 +08:00
Qiu Jian
54d3173c15 fix: ignore match weights when searching matched policysets 2020-05-29 11:20:17 +08:00
yunion-ci-robot
dbee0d0eef Merge pull request #6644 from rainzm/automated-cherry-pick-of-#6643-upstream-release-3.2
Automated cherry pick of #6643: feat(notify): Support 'socpe:domain' when list contacts
2020-05-28 19:11:01 +08:00
yunion-ci-robot
6e22bea1cc Merge pull request #6634 from swordqiu/automated-cherry-pick-of-#6631-upstream-release-3.2
Automated cherry pick of #6631: fix: sysadmin cannot convert host in non-default domain
2020-05-28 19:04:01 +08:00
yunion-ci-robot
6fa35f9c7c Merge pull request #6617 from ioito/automated-cherry-pick-of-#6592-upstream-release-3.2
Automated cherry pick of #6592: fix: 通用指定项目到云上创建资源
2020-05-28 19:02:01 +08:00
yunion-ci-robot
62b4fd8240 Merge pull request #6556 from zhaoxiangchun/automated-cherry-pick-of-#6544-upstream-release-3.2
Automated cherry pick of #6544: 类型是onecloud的notifier增加webconsole的alert
2020-05-28 18:59:00 +08:00
rainzm
c3d0ff9e6f feat(notify): Support 'socpe:domain' when list contacts
This is a temporary solution.
2020-05-28 18:57:10 +08:00
Zexi Li
f727fb6d6d Merge pull request #6633 from zhaoxiangchun/automated-cherry-pick-of-#6632-upstream-release-3.2
Automated cherry pick of #6632: 修复优化建议资源列表cloudenv过滤失效的问题
2020-05-28 18:07:08 +08:00
Zexi Li
3198cccd6d Merge pull request #6638 from ioito/automated-cherry-pick-of-#6637-upstream-release-3.2
Automated cherry pick of #6637: fix: 避免因磁盘数量导致创建机器失败
2020-05-28 17:13:55 +08:00
Qu Xuan
62607fb9d2 fix: tmp update 2020-05-28 14:39:42 +08:00
Qu Xuan
11cae0b675 fix: 避免因磁盘数量导致创建机器失败 2020-05-28 12:08:32 +08:00
Qiu Jian
f32538d92d fix: sysadmin cannot convert host in non-default domain 2020-05-27 22:34:08 +08:00
zhaoxiangchun
0afe110088 修复优化建议资源列表cloudenv过滤失效的问题 2020-05-27 22:14:30 +08:00
Zexi Li
158f70613d Merge pull request #6623 from wanyaoqi/automated-cherry-pick-of-#6621-upstream-release-3.2
Automated cherry pick of #6621: host storage misc fix:
2020-05-27 18:04:14 +08:00
Zexi Li
04ee98c6dc Merge pull request #6627 from swordqiu/automated-cherry-pick-of-#6618-upstream-release-3.2
Automated cherry pick of #6618: fix: domain user no previleges to convert host
2020-05-27 18:03:54 +08:00
Zexi Li
913879c95f Merge pull request #6612 from wanyaoqi/automated-cherry-pick-of-#6609-upstream-release-3.2
Automated cherry pick of #6609: fix host name validator
2020-05-27 18:01:21 +08:00
Zexi Li
baa575953b Merge pull request #6581 from yousong/automated-cherry-pick-of-#6580-upstream-release-3.2
Automated cherry pick of #6580: hostman: deprecate k8s_cluster_cidr
2020-05-27 18:00:51 +08:00
Zexi Li
2b62f8d8e2 Merge pull request #6606 from ioito/automated-cherry-pick-of-#6605-upstream-release-3.2
Automated cherry pick of #6605: fix: 移除azure policy sync部分
2020-05-27 17:56:31 +08:00
Zexi Li
f1683f3d03 Merge pull request #6614 from swordqiu/automated-cherry-pick-of-#6613-upstream-release-3.2
Automated cherry pick of #6613: fix: scheduler test ignore quota limit
2020-05-27 17:54:54 +08:00
Zexi Li
eb4780fd78 Merge pull request #6620 from ioito/automated-cherry-pick-of-#6619-upstream-release-3.2
Automated cherry pick of #6619: fix: 避免azure卸载磁盘失败
2020-05-27 17:51:57 +08:00
wanyaoqi
03592086a4 host storage misc fix:
- add accessible timeout
- add force detach host storage
2020-05-27 15:57:07 +08:00
Qu Xuan
abd5c9a03a fix: 避免azure卸载磁盘失败 2020-05-27 15:55:21 +08:00
Qiu Jian
96ea180573 fix: domain user no previleges to convert host 2020-05-27 15:49:34 +08:00
Qu Xuan
9208a70518 fix: 通用指定项目到云上创建资源 2020-05-27 15:31:54 +08:00
Qiu Jian
8feafc1bf4 fix: scheduler test ignore quota limit 2020-05-27 14:48:08 +08:00
Zexi Li
7f7ce94c57 Merge pull request #6608 from yousong/automated-cherry-pick-of-#6607-upstream-release-3.2
Automated cherry pick of #6607: vpcagent: apihelper: use its own options
2020-05-27 14:36:10 +08:00
Zexi Li
0b18d55068 Merge pull request #6590 from swordqiu/automated-cherry-pick-of-#6589-upstream-release-3.2
Automated cherry pick of #6589: fix: retry ipmi probe if redfish-api-probe fails
2020-05-27 14:35:11 +08:00
wanyaoqi
6a5f97f626 fix host name validator 2020-05-26 23:17:52 +08:00
Zexi Li
2e8749eb97 Merge pull request #6604 from ioito/automated-cherry-pick-of-#6603-upstream-release-3.2
Automated cherry pick of #6603: fix: sku status filter
2020-05-26 18:23:51 +08:00
Yousong Zhou
7298c4bf67 hostman: options: remove k8s_cluster_cidr
Remove instead of deprecation.  No user of this option anymore
2020-05-26 17:56:53 +08:00
Qu Xuan
920db3bb60 fix: 移除azure policy sync部分 2020-05-26 17:55:56 +08:00
Yousong Zhou
a91bef28c4 hostman: options: fix default value spec 2020-05-26 17:54:22 +08:00
Yousong Zhou
94d14b1863 vpcagent: models: separate Copy() and CopyJoined() 2020-05-26 17:54:21 +08:00
Yousong Zhou
dd288441b1 vpcagent: apihelper: use CopyJoined() 2020-05-26 17:54:21 +08:00
Yousong Zhou
f86cdbbdad vpcagent: models: add CopyJoined() 2020-05-26 17:54:21 +08:00
Yousong Zhou
c7468440f0 vpcagent: remove unused code 2020-05-26 17:54:21 +08:00
Yousong Zhou
16c4663e7b vpcagent: apihelper: use its own options 2020-05-26 17:54:21 +08:00
Zexi Li
7b5053e77f Merge pull request #6599 from wanyaoqi/automated-cherry-pick-of-#6598-upstream-release-3.2
Automated cherry pick of #6598: fix remotefile fetch image propertites
2020-05-26 17:15:20 +08:00
Zexi Li
13b43caf91 Merge pull request #6595 from ioito/automated-cherry-pick-of-#6594-upstream-release-3.2
Automated cherry pick of #6594: fix: bucket信息修正
2020-05-26 17:14:06 +08:00
Qu Xuan
8201433166 fix: sku status filter 2020-05-26 17:10:02 +08:00
wanyaoqi
fd4830859e fix remotefile fetch image propertites 2020-05-26 15:54:09 +08:00
Qu Xuan
e775515b59 fix: bucket信息修正 2020-05-26 15:09:58 +08:00
Zexi Li
752f9763c1 Merge pull request #6588 from swordqiu/automated-cherry-pick-of-#6587-upstream-release-3.2
Automated cherry pick of #6587: fix: identity_provider details missing fields
2020-05-25 18:34:20 +08:00
Zexi Li
015d7a213d Merge pull request #6583 from zexi/hotfix/k8s-repo-privilege
fix k8s repo privilege
2020-05-25 18:28:53 +08:00
Qiu Jian
216d6cbc89 fix: retry ipmi probe if redfish-api-probe fails 2020-05-25 17:55:08 +08:00
Qiu Jian
01d7c16f84 fix: identity_provider details missing fields 2020-05-25 17:45:22 +08:00
Zexi Li
95db384c6c fix k8s repo privilege 2020-05-25 16:51:57 +08:00
yunion-ci-robot
383ead3988 Merge pull request #6579 from zexi/automated-cherry-pick-of-#6578-upstream-release-3.2
Automated cherry pick of #6578: baremetal: fix forget init lockman pkg
2020-05-25 12:49:55 +08:00
Zexi Li
99cf71401c Merge pull request #6577 from zhaoxiangchun/automated-cherry-pick-of-#6573-upstream-release-3.2
Automated cherry pick of #6573: zstack宿主机监控中增加参数信息进行Unmarshal
2020-05-25 12:18:15 +08:00
Zexi Li
bffdf0cd64 baremetal: fix forget init lockman pkg 2020-05-25 12:17:26 +08:00
zhaoxiangchun
21888984b9 zstack宿主机监控中增加参数信息进行Unmarshal 2020-05-24 17:20:08 +08:00
Zexi Li
a85171ddf1 Merge pull request #6568 from swordqiu/automated-cherry-pick-of-#6567-upstream-release-3.2
Automated cherry pick of #6567: fix: default policy not effective
2020-05-22 22:48:21 +08:00
Zexi Li
3bd9c756db Merge pull request #6566 from rainzm/automated-cherry-pick-of-#6565-upstream-release-3.2
Automated cherry pick of #6565: fix: Support filtering notification with contactType
2020-05-22 22:47:08 +08:00
Zexi Li
e117dd46ed Merge pull request #6559 from ioito/automated-cherry-pick-of-#6558-upstream-release-3.2
Automated cherry pick of #6558: fix: 避免openstack以镜像做系统盘创建失败
2020-05-22 22:45:20 +08:00
Qiu Jian
8d6911a8cb fix: default policy not effective 2020-05-22 22:36:33 +08:00
rainzm
c303d8eafd feat: Supports disabling of feishu and dingtalk notification 2020-05-22 20:54:04 +08:00
rainzm
841224b402 fix: Support filtering notification with contactType 2020-05-22 20:54:04 +08:00
Qu Xuan
e1238af669 fix: 避免openstack以镜像做系统盘创建失败 2020-05-22 20:16:54 +08:00
zhaoxiangchun
909e92040c 类型是onecloud的notifier增加webconsole的alert 2020-05-22 20:04:22 +08:00
Zexi Li
3908877d3b Merge pull request #6547 from ioito/automated-cherry-pick-of-#6534-upstream-release-3.2
Automated cherry pick of #6534: fix: 避免azure uefi重装系统失败
2020-05-22 19:39:09 +08:00
Zexi Li
b8c287b1ad Merge pull request #6546 from rainzm/automated-cherry-pick-of-#6545-upstream-release-3.2
Automated cherry pick of #6545: Fix the problem of field duplication when exporting fields
2020-05-22 19:34:58 +08:00
Zexi Li
8b67811739 Merge pull request #6550 from ioito/automated-cherry-pick-of-#6549-upstream-release-3.2
Automated cherry pick of #6549: fix: 返回项目信息
2020-05-22 19:33:56 +08:00
Zexi Li
cc9e94dbbe Merge pull request #6552 from swordqiu/automated-cherry-pick-of-#6551-upstream-release-3.2
Automated cherry pick of #6551: fix: empty matched policies list for roles
2020-05-22 19:32:18 +08:00
Qiu Jian
1afbe0e44d fix: empty matched policies list for roles 2020-05-22 18:50:18 +08:00
Qu Xuan
6ba2ddf0d7 fix: 返回项目信息 2020-05-22 17:32:24 +08:00
Qu Xuan
d52062137c fix: 加入Azure套餐和镜像的检查 2020-05-22 16:12:52 +08:00
Qu Xuan
cc1e19b025 fix: 避免azure uefi重装系统失败 2020-05-22 16:12:52 +08:00
rainzm
71a7922ca0 Fix the problem of field duplication when exporting fields 2020-05-22 15:54:11 +08:00
Zexi Li
699fa4c458 Merge pull request #6541 from ioito/automated-cherry-pick-of-#6540-upstream-release-3.2
Automated cherry pick of #6540: fix: 避免因io问题导致同步镜像列表为空
2020-05-22 14:43:44 +08:00
Qu Xuan
c8652e7997 fix: 避免因io问题导致同步镜像列表为空 2020-05-22 13:47:09 +08:00
Zexi Li
37f30aca20 Merge pull request #6537 from ioito/automated-cherry-pick-of-#6530-upstream-release-3.2
Automated cherry pick of #6530: fix: aliyun rds backup create fix
2020-05-22 12:36:43 +08:00
Qu Xuan
793a02598a fix: aliyun rds backup create fix 2020-05-22 10:31:15 +08:00
Zexi Li
ff4c3616cf Merge pull request #6512 from ioito/automated-cherry-pick-of-#6511-upstream-release-3.2
Automated cherry pick of #6511: fix: 避免忽略本地allow any云上deny any安全组规则同步
2020-05-22 10:26:59 +08:00
Zexi Li
d282ea5480 Merge pull request #6532 from ioito/automated-cherry-pick-of-#6531-upstream-release-3.2
Automated cherry pick of #6531: fix: gcp bucket文件夹默认设为private
2020-05-22 10:26:06 +08:00
Zexi Li
1d516505e3 Merge pull request #6526 from tb365/automated-cherry-pick-of-#6525-upstream-release-3.2
Automated cherry pick of #6525: aws lbbg cache bugfix
2020-05-22 10:24:45 +08:00
Zexi Li
f3158a09c9 Merge pull request #6510 from wanyaoqi/automated-cherry-pick-of-#6509-upstream-release-3.2
Automated cherry pick of #6509: fix list disk attachable servers
2020-05-22 10:20:31 +08:00
Zexi Li
db4e94d455 Merge pull request #6536 from swordqiu/automated-cherry-pick-of-#6535-upstream-release-3.2
Automated cherry pick of #6535: fix: usage for schetag not accurate
2020-05-22 10:19:27 +08:00
Zexi Li
4d547c5d84 Merge pull request #6529 from ioito/automated-cherry-pick-of-#6528-upstream-release-3.2
Automated cherry pick of #6528: fix: 避免regional network-list --zone导致返回结果为空
2020-05-22 10:18:06 +08:00
Zexi Li
07359651d5 Merge pull request #6519 from swordqiu/automated-cherry-pick-of-#6516-upstream-release-3.2
Automated cherry pick of #6516: fix: system privileges user cannot access system console
2020-05-22 10:15:15 +08:00
yunion-ci-robot
ebf2e84de6 Merge pull request #6506 from ioito/automated-cherry-pick-of-#6505-upstream-release-3.2
Automated cherry pick of #6505: fix: 上传镜像为转换列表之外时,subformat状态异常
2020-05-21 23:09:53 +08:00
Qiu Jian
c9998c2176 fix: usage for schetag not accurate 2020-05-21 22:37:57 +08:00
Qu Xuan
95ded99428 fix: gcp bucket文件夹默认设为private 2020-05-21 20:54:03 +08:00
Qu Xuan
9cdd63299d fix: 避免regional network-list --zone导致返回结果为空 2020-05-21 20:15:47 +08:00
tangbin
e2db897856 aws lbbg cache bugfix 2020-05-21 19:08:23 +08:00
Qiu Jian
41db54737e fix: system privileges user cannot access system console 2020-05-21 18:44:03 +08:00
Qu Xuan
d567916e06 fix: 避免忽略本地allow any云上deny any安全组规则同步 2020-05-21 18:29:54 +08:00
wanyaoqi
60107e5dd1 fix list disk attachable servers 2020-05-21 18:02:39 +08:00
Qu Xuan
ab72632ece fix: 上传镜像为转换列表之外时,subformat状态异常 2020-05-21 17:41:33 +08:00
Zexi Li
df8a942d38 Merge pull request #6502 from zhaoxiangchun/automated-cherry-pick-of-#6500-upstream-release-3.2
Automated cherry pick of #6500: 修复当prestate=alerting,newstate=alerting的情况无法触发notify的问题
2020-05-21 16:38:04 +08:00
Zexi Li
e638c7dfca Merge pull request #6496 from zhaoxiangchun/automated-cherry-pick-of-#6472-upstream-release-3.2
Automated cherry pick of #6472: suggestions  increase time screening range
2020-05-21 16:34:26 +08:00
yunion-ci-robot
e030d683f0 Merge pull request #6498 from wanyaoqi/automated-cherry-pick-of-#6497-upstream-release-3.2
Automated cherry pick of #6497: image cache use lockman
2020-05-21 16:33:45 +08:00
Zexi Li
8e28f9f72d Merge pull request #6490 from rainzm/automated-cherry-pick-of-#6487-upstream-release-3.2
Automated cherry pick of #6487: Fix/esxi
2020-05-21 16:33:27 +08:00
zhaoxiangchun
041a1b2cdc bugfix-优化建议
在删除资源列表的信息时,增加对应的状态值。如果删除失败记录相关日志
2020-05-21 15:18:52 +08:00
zhaoxiangchun
094a3115df 优化建议增加时间筛选范围
1.在时间范围内查询未使用的资源,对于存在解绑的操作,通过查询对应的日志来确定最近的使用时间
2.基于监控的优化建议,增加新的reducer,当有足够多的points时,再进行其他逻辑
2020-05-21 15:18:52 +08:00
zhaoxiangchun
0fb24d91e3 修复当prestate=alerting,newstate=alerting的情况无法触发notify的问题 2020-05-21 13:58:37 +08:00
wanyaoqi
5131057cd8 image cache use lockman 2020-05-21 11:47:32 +08:00
rainzm
9735881e55 fix(esxi): Modify the disk size correctly when creating vm 2020-05-21 10:51:10 +08:00
rainzm
a465548e5e fix(esxi): Detach all disk first when deleting vm 2020-05-21 10:51:10 +08:00
rainzm
5b0b346f12 Kill processes in time & Add debug info 2020-05-21 10:51:10 +08:00
rainzm
caffe7f96f fix(esxi): Remove 'Destory' operation that is unnecessary for VirtualDiskManager 2020-05-21 10:51:10 +08:00
rainzm
1ea7937cdd fix(esxi): Separate detach disk and delete disk when rebuilding.
In previous versions, set
`removeSpec.FileOperation = types.VirtualDeviceConfigSpecFileOperationDestroy'
to delete disk indirectly.

But, when its parent has only one child, the parent will be deleted along with it.
And the consequence is failure to reinstall the system.

Now, detach disk without deleteing backing file and then remove backing
2020-05-21 10:51:10 +08:00
Zexi Li
a3c48265fe Merge pull request #6486 from wanyaoqi/automated-cherry-pick-of-#6485-upstream-release-3.2
Automated cherry pick of #6485: add sys usage
2020-05-21 10:02:33 +08:00
Zexi Li
6caa3be510 Merge pull request #6495 from yousong/automated-cherry-pick-of-#6494-upstream-release-3.2
Automated cherry pick of #6494: guests: include vpc, network info in guest nics list
2020-05-21 10:00:33 +08:00
Yousong Zhou
b9543dd565 guests: include vpc, network info in guest nics list 2020-05-20 22:49:28 +08:00
Zexi Li
1efba08bf2 Merge pull request #6492 from zexi/automated-cherry-pick-of-#6491-upstream-release-3.2
Automated cherry pick of #6491: keystone: fix db not sync
2020-05-20 17:32:20 +08:00
Zexi Li
b19c7cfdcf keystone: fix db not sync 2020-05-20 17:22:13 +08:00
wanyaoqi
4e1acfc028 add sys usage 2020-05-20 15:03:24 +08:00
Zexi Li
d81d99394f Merge pull request #6483 from zexi/automated-cherry-pick-of-#6481-upstream-release-3.2
Automated cherry pick of #6481: region: fix get resource details panic
2020-05-20 14:00:17 +08:00
Zexi Li
6dbd344c10 region: fix get resource details panic 2020-05-20 13:30:56 +08:00
Zexi Li
3b99ebfd03 Merge pull request #6475 from yousong/automated-cherry-pick-of-#6474-upstream-release-3.2
Automated cherry pick of #6474: cloudcommon: rbac: fix typo
2020-05-20 12:54:38 +08:00
Zexi Li
e1f43e29a3 Merge pull request #6470 from zexi/automated-cherry-pick-of-#6463-upstream-release-3.2
Automated cherry pick of #6463: add fuzzy ip matching
2020-05-20 11:09:44 +08:00
Zexi Li
f428ad2abe Merge pull request #6457 from swordqiu/automated-cherry-pick-of-#6456-upstream-release-3.2
Automated cherry pick of #6456: fix: cloudprovider list support filter by zone and cloudregion
2020-05-20 11:09:11 +08:00
Zexi Li
3e9fab0ca0 Merge pull request #6454 from ioito/automated-cherry-pick-of-#6453-upstream-release-3.2
Automated cherry pick of #6453: fix: 优化azure image同步逻辑
2020-05-20 11:08:23 +08:00
Zexi Li
11463ce683 Merge pull request #6435 from ioito/automated-cherry-pick-of-#6434-upstream-release-3.2
Automated cherry pick of #6434: fix: 加入azure镜像vhd检查
2020-05-20 11:07:46 +08:00
Zexi Li
7d1b6a98eb Merge pull request #6448 from ioito/automated-cherry-pick-of-#6427-upstream-release-3.2
Automated cherry pick of #6427: fix: 避免大范围安全组共享
2020-05-20 11:07:23 +08:00
Yousong Zhou
2180e2e361 networks: return HTTP 404 for sql.ErrNoRows 2020-05-20 11:04:50 +08:00
Yousong Zhou
94433b590d wires: default to "default" vpc on creation
Wire creation request right now only makes sense in context of classic
network ("default" vpc)
2020-05-20 11:04:50 +08:00
Yousong Zhou
e5eed9ef2a networks: eliminate a variable 2020-05-20 11:04:50 +08:00
Yousong Zhou
7cd01cf535 guestdrivers: managed: use const api.EIP_STATUS_ASSOCIATE 2020-05-20 11:04:50 +08:00
Yousong Zhou
5d284b392b cloudprovider: fix typo 2020-05-20 11:04:50 +08:00
Yousong Zhou
306f8eabf2 cloudcommon: rbac: fix typo 2020-05-20 11:04:50 +08:00
Zexi Li
b5604f4767 Merge pull request #6469 from zexi/automated-cherry-pick-of-#6468-upstream-release-3.2
Automated cherry pick of #6468: host convert inject dockerd config
2020-05-20 10:44:31 +08:00
tangbin
fd13237ff3 add fuzzy ip matching 2020-05-19 19:15:55 +08:00
Zexi Li
36bef6db5a Merge pull request #6459 from ioito/automated-cherry-pick-of-#6458-upstream-release-3.2
Automated cherry pick of #6458: fix: 修复zstack使用win镜像时userdata base64加密问题
2020-05-19 19:13:49 +08:00
Zexi Li
926ab1e41a Merge pull request #6464 from zexi/automated-cherry-pick-of-#6462-upstream-release-3.2
Automated cherry pick of #6462: region: fix server create params not include specified resource
2020-05-19 19:08:45 +08:00
Zexi Li
ccef3b6aba host convert inject dockerd config 2020-05-19 19:08:11 +08:00
Zexi Li
c95f397ecf region: fix server create params not include specified resource 2020-05-19 17:38:23 +08:00
Qu Xuan
9455c75098 fix: 修复zstack使用win镜像时userdata base64加密问题 2020-05-19 16:46:31 +08:00
Qiu Jian
498aea4d18 fix: cloudprovider list support filter by zone and cloudregion 2020-05-19 16:44:44 +08:00
Qu Xuan
78be10c0a4 fix: 优化azure image同步逻辑 2020-05-19 16:24:23 +08:00
Zexi Li
fdbecf5365 Merge pull request #6452 from swordqiu/automated-cherry-pick-of-#6451-upstream-release-3.2
Automated cherry pick of #6451: fix: policy create fail on initialization phrase
2020-05-19 15:49:13 +08:00
Qiu Jian
d23b1fb08a fix: policy create fail on initialization phrase 2020-05-19 15:25:37 +08:00
Qu Xuan
fa287db5d6 fix: 避免大范围安全组共享 2020-05-19 14:03:24 +08:00
Zexi Li
379877189a Merge pull request #6422 from ioito/automated-cherry-pick-of-#6421-upstream-release-3.2
Automated cherry pick of #6421: fix: 优化标签列表过滤参数
2020-05-19 10:21:44 +08:00
Zexi Li
93179d30a7 Merge pull request #6442 from swordqiu/automated-cherry-pick-of-#6441-upstream-release-3.2
Automated cherry pick of #6441: update lisDescendent scope params
2020-05-19 10:20:24 +08:00
Zexi Li
a5436f2ba0 Merge pull request #6444 from swordqiu/automated-cherry-pick-of-#6443-upstream-release-3.2
Automated cherry pick of #6443: fix: anonymous user may list resources
2020-05-19 10:17:53 +08:00
Zexi Li
4576bb1728 Merge pull request #6440 from zexi/automated-cherry-pick-of-#6436-upstream-release-3.2
Automated cherry pick of #6436: baremetal: fix ssh put empty content file not created
2020-05-19 10:16:16 +08:00
Qiu Jian
f964b93bf8 fix: anonymous user may list resources 2020-05-19 01:13:52 +08:00
Qiu Jian
3cdf2da320 sync storage shared info when syncing local storage 2020-05-18 23:19:58 +08:00
Qiu Jian
7123de13ed update lisDescendent scope params 2020-05-18 23:19:58 +08:00
Zexi Li
9b0dc429c6 Merge pull request #6419 from ioito/automated-cherry-pick-of-#6418-upstream-release-3.2
Automated cherry pick of #6418: 可根据代理过滤云账号
2020-05-18 21:51:20 +08:00
Zexi Li
45f88c907d Merge pull request #6424 from ioito/automated-cherry-pick-of-#6423-upstream-release-3.2
Automated cherry pick of #6423: fix: 避免仅同步一个region时,其余region状态变为准备中
2020-05-18 21:49:10 +08:00
Zexi Li
534e7b4eda Merge pull request #6429 from ioito/automated-cherry-pick-of-#6428-upstream-release-3.2
Automated cherry pick of #6428: fix: 避免设置自动释放后磁盘的expired_at失效
2020-05-18 21:47:53 +08:00
Zexi Li
97cb68397b Merge pull request #6433 from swordqiu/automated-cherry-pick-of-#6432-upstream-release-3.2
Automated cherry pick of #6432: fix: update fields permission tags
2020-05-18 21:47:22 +08:00
Zexi Li
e8b90a9617 baremetal: fix ssh put empty content file not created 2020-05-18 21:46:26 +08:00
Qu Xuan
6281c56333 fix: image-list --sub-format support 2020-05-18 21:22:19 +08:00
Qu Xuan
1fa6b53a34 fix: 加入azure镜像vhd检查 2020-05-18 21:22:18 +08:00
Qiu Jian
5471bd9acf fix: update fields permission tags 2020-05-18 21:01:10 +08:00
Qu Xuan
2f84801b18 fix: 避免设置自动释放后磁盘的expired_at失效 2020-05-18 20:07:03 +08:00
Qu Xuan
963aaf0c33 fix: 避免仅同步一个region时,其余region状态变为准备中 2020-05-18 19:37:14 +08:00
Qu Xuan
168a4c7e9a fix: 优化标签列表过滤参数 2020-05-18 15:31:15 +08:00
Qu Xuan
be7adbea40 根据调度标签过滤网络和存储资源 2020-05-18 12:05:47 +08:00
Qu Xuan
2cdccfcf65 可根据代理过滤云账号 2020-05-18 12:05:46 +08:00
Zexi Li
eb56db7b00 Merge pull request #6404 from swordqiu/automated-cherry-pick-of-#6401-upstream-release-3.2
Automated cherry pick of #6401: fix: fail to explain permission for disabled policy
2020-05-17 14:22:45 +08:00
Zexi Li
8277ae48a6 Merge pull request #6415 from zhaoxiangchun/automated-cherry-pick-of-#6410-upstream-release-3.2
Automated cherry pick of #6410: 修复无法获取vmware宿主机监控数据的问题
2020-05-17 14:17:17 +08:00
Zexi Li
b91f4a2fde Merge pull request #6403 from swordqiu/automated-cherry-pick-of-#6402-upstream-release-3.2
Automated cherry pick of #6402: fix: disable delete standard image
2020-05-17 14:15:27 +08:00
yunion-ci-robot
121f538690 Merge pull request #6409 from rainzm/release/3.2
update vendor for release/3.2
2020-05-17 09:43:37 +08:00
zhaoxiangchun
f8fb9eddc8 修复无法获取vmware宿主机监控数据的问题 2020-05-16 21:23:51 +08:00
rainzm
66e42f2dba update vendor 2020-05-16 21:14:52 +08:00
Zexi Li
411c264890 Merge pull request #6400 from swordqiu/automated-cherry-pick-of-#6394-upstream-release-3.2
Automated cherry pick of #6394: fix: xxx-agent should generally use scope=system to list resources
2020-05-16 17:46:26 +08:00
Zexi Li
4696a51e92 Merge pull request #6396 from swordqiu/automated-cherry-pick-of-#6395-upstream-release-3.2
Automated cherry pick of #6395: fix: server-sync-fix-nics should return errors if vnics ip is not reachable on host
2020-05-16 17:45:25 +08:00
Zexi Li
928ceff800 Merge pull request #6376 from rainzm/automated-cherry-pick-of-#6375-upstream-release-3.2
Automated cherry pick of #6375: Fix/esxi
2020-05-16 17:42:42 +08:00
yunion-ci-robot
f5f83d3b3f Merge pull request #6389 from zexi/automated-cherry-pick-of-#6388-upstream-release-3.2
Automated cherry pick of #6388: region: fix baremetal can't enable public baremetal type network
2020-05-16 17:31:07 +08:00
Qiu Jian
74e784a84d fix: bugfixes 2020-05-16 01:05:40 +08:00
Qiu Jian
6ad68788e5 fix: fail to explain permission for disabled policy 2020-05-16 01:05:40 +08:00
Qiu Jian
4b6723d8fe fix: disable delete standard image 2020-05-16 00:37:04 +08:00
Qiu Jian
b12c644494 fix: xxx-agent should generally use scope=system to list resources 2020-05-15 22:33:03 +08:00
Qiu Jian
16b6186cab fix: server-sync-fix-nics should return errors if vnics ip is not reachable on host 2020-05-15 22:16:54 +08:00
rainzm
e9d0764be9 fix(esxi): Allow the creation of duplicate vcenter machines.
Create vm with name whose vlaue is localVM.Uuid and try to rename again.
2020-05-15 21:36:19 +08:00
rainzm
3e8b854dbe fix(esxi): Add usb to support mouse in vnc viewer 2020-05-15 21:36:19 +08:00
rainzm
cdabc68a71 fix(esxi): Fix GetDriver and add driver log for vdisk.
In GetDriver, return 'name' directly if driverMap is empty.
2020-05-15 21:36:19 +08:00
rainzm
4873635dd8 fix(esxi): Set 'WindowsDefaultAdminUser' as true when deploy vm.
'WindowsDefaultAdminUser' means that the default admin account is
'Administrator' when deploy windows vm.
2020-05-15 21:36:19 +08:00
rainzm
7d1270c968 fix(region): Set default value if rootdisk's driver is empty. 2020-05-15 21:36:19 +08:00
rainzm
4b9f1a409b fix(esxi): Disable automatically add host to the dvs 2020-05-15 21:36:19 +08:00
rainzm
23a03bb24c fix(esxi): Set 'IsInit' as true when rebuildroot
IsInit is true will cause cloudinit enable. When rebuilding root, if there is cloudinit service in the image, it will cover the initialization work we did on the rebuilding.
2020-05-15 21:36:19 +08:00
Zexi Li
62fe9cee88 region: fix baremetal can't enable public baremetal type network 2020-05-15 20:00:09 +08:00
Zexi Li
61a707bd57 Merge pull request #6387 from yousong/automated-cherry-pick-of-#6386-upstream-release-3.2
Automated cherry pick of #6386: vpcagent: ovn: cmp: generate clean args in a single batch
2020-05-15 19:59:27 +08:00
Yousong Zhou
188a0ea9e3 vpcagent: ovnutil: destroy non root obj first
To avoid the following error

	/* Can't happen because of the database schema. */
	ctl_fatal("logical port %s is not part of any logical router",
		  ctx->argv[1]);
2020-05-15 16:34:51 +08:00
Yousong Zhou
fea1e2166e vpcagent: ovn: cmp: generate clean args in a single batch 2020-05-15 16:31:18 +08:00
Zexi Li
3864156c5f Merge pull request #6380 from ioito/automated-cherry-pick-of-#6379-upstream-release-3.2
Automated cherry pick of #6379: fix: 避免backup list未能正常显示rds信息
2020-05-15 15:29:43 +08:00
Zexi Li
6301776f72 Merge pull request #6385 from zexi/automated-cherry-pick-of-#6381-upstream-release-3.2
Automated cherry pick of #6381: scheduler: fix min counter get count not correct
2020-05-15 15:28:34 +08:00
Zexi Li
0f6297aea8 scheduler: fix min counter get count not correct 2020-05-15 15:12:02 +08:00
Qu Xuan
c29528ac54 fix: 避免backup list未能正常显示rds信息 2020-05-15 14:30:19 +08:00
Zexi Li
0a3f041bf7 Merge pull request #6374 from zhaoxiangchun/automated-cherry-pick-of-#6358-upstream-release-3.2
Automated cherry pick of #6358: modify the logic of queryCondition save the  evalMatch
2020-05-15 11:11:15 +08:00
Zexi Li
4b8e100916 Merge pull request #6361 from ioito/automated-cherry-pick-of-#6346-upstream-release-3.2
Automated cherry pick of #6346: fix: 优化windows powershell userdata
2020-05-15 11:09:51 +08:00
Zexi Li
5ad8cb051f Merge pull request #6373 from swordqiu/automated-cherry-pick-of-#6363-upstream-release-3.2
Automated cherry pick of #6363: fix: set public_scope to system for image with is_public=true
2020-05-15 11:08:22 +08:00
zhaoxiangchun
23380f2a00 modify the logic of queryCondition save the evalMatch 2020-05-15 11:07:23 +08:00
Zexi Li
e45ef0a8e1 Merge pull request #6359 from ioito/automated-cherry-pick-of-#6352-upstream-release-3.2
Automated cherry pick of #6352: fix: 优化rds zone同步逻辑
2020-05-15 11:05:46 +08:00
Qiu Jian
e6d240ac79 fix: set public_scope to system for image with is_public=true 2020-05-15 00:34:29 +08:00
Qu Xuan
1cc5eee870 fix: 优化windows powershell userdata 2020-05-14 20:42:47 +08:00
Qu Xuan
9f99f1466b fix: 优化rds zone同步逻辑 2020-05-14 20:24:15 +08:00
Zexi Li
519cbec486 Merge pull request #6357 from zexi/automated-cherry-pick-of-#6353-upstream-release-3.2
Automated cherry pick of #6353: scheduler: filter disabled cloudprovider
2020-05-14 18:59:34 +08:00
Zexi Li
5ed76cd0cf Merge pull request #6345 from tb365/automated-cherry-pick-of-#6344-upstream-release-3.2
Automated cherry pick of #6344: allow delete paramter config
2020-05-14 18:20:50 +08:00
Zexi Li
408a4e33c4 Merge pull request #6339 from swordqiu/automated-cherry-pick-of-#6338-upstream-release-3.2
Automated cherry pick of #6338: fix: avoid using background context
2020-05-14 18:18:58 +08:00
Zexi Li
9104f101eb Merge pull request #6337 from zhaoxiangchun/automated-cherry-pick-of-#6336-upstream-release-3.2
Automated cherry pick of #6336: Modify the logic of rule change execution time
2020-05-14 18:17:53 +08:00
Zexi Li
019d72a694 scheduler: filter disabled cloudprovider 2020-05-14 18:15:53 +08:00
Zexi Li
c23ee27c9f Merge pull request #6348 from zexi/automated-cherry-pick-of-#6347-upstream-release-3.2
Automated cherry pick of #6347: scheduler: set schedtag default strategy if input empty
2020-05-14 17:49:20 +08:00
Zexi Li
fa5f9351d2 scheduler: set schedtag default strategy if input empty 2020-05-14 17:25:50 +08:00
Qiu Jian
db111a8da4 fix: avoid using background context 2020-05-14 16:51:26 +08:00
tangbin
de4c354c7d allow delete paramter config 2020-05-14 15:20:37 +08:00
zhaoxiangchun
acd7fceb91 修改规则执行时间
在将资源数据取到后更新执行时间
2020-05-14 15:00:36 +08:00
Zexi Li
8a7f37dcd1 Merge pull request #6330 from zhaoxiangchun/automated-cherry-pick-of-#6164-upstream-release-3.2
Automated cherry pick of #6164: bugfix mem paginate
2020-05-14 13:02:45 +08:00
Zexi Li
1f8c1f4d13 Merge pull request #6332 from tb365/automated-cherry-pick-of-#6331-upstream-release-3.2
Automated cherry pick of #6331: clear yunionauth cookie
2020-05-14 13:02:20 +08:00
Zexi Li
fd3fb7ba89 Merge pull request #6335 from wanyaoqi/automated-cherry-pick-of-#6333-upstream-release-3.2
Automated cherry pick of #6333: remove statefile in start script
2020-05-14 13:01:45 +08:00
wanyaoqi
6b63ac0af5 fix esxi disk disconnect 2020-05-14 12:28:27 +08:00
wanyaoqi
f50dfaef4c remove statefile in start script 2020-05-14 12:28:27 +08:00
tangbin
346a325e7e clear yunionauth cookie 2020-05-14 11:46:03 +08:00
zhaoxiangchun
9b1aa45a15 修复规则无法禁用的问题 2020-05-14 10:38:39 +08:00
Zexi Li
9e2874caaa Merge pull request #6329 from swordqiu/automated-cherry-pick-of-#6328-upstream-release-3.2
Automated cherry pick of #6328: fix: status-base resource's action log missing owner project/domain
2020-05-14 09:52:32 +08:00
Zexi Li
e0a8fe38d0 Merge pull request #6327 from zexi/automated-cherry-pick-of-#6326-upstream-release-3.2
Automated cherry pick of #6326: region: server create prefer resource fetch by name or id
2020-05-14 09:51:46 +08:00
Qiu Jian
6453e7fa82 fix: status-base resource's action log missing owner project/domain 2020-05-14 01:17:09 +08:00
Zexi Li
ad4d25e0cd Merge pull request #6197 from zhaoxiangchun/automated-cherry-pick-of-#6164-upstream-release-3.2
Automated cherry pick of #6164 bugfix-suggestrule cannot disable
2020-05-14 01:02:08 +08:00
Zexi Li
a3d962894c region: server create prefer resource fetch by name or id 2020-05-14 01:00:18 +08:00
zhaoxiangchun
c1384f29cf merge 2020-05-14 00:29:11 +08:00
zhaoxiangchun
829c6c65fc 修复规则无法禁用的问题 2020-05-14 00:27:34 +08:00
Zexi Li
c106bdc24c Merge pull request #6088 from zhaoxiangchun/automated-cherry-pick-of-#6087-upstream-release-3.2
Automated cherry pick of #6087: 在monitor的package中新增influxdb相关的功能
2020-05-13 23:00:04 +08:00
zhaoxiangchun
d9509a0cf5 基于监控数据的优化建议 2020-05-13 22:45:41 +08:00
zhaoxiangchun
22dccbbb20 在monitor的package中新增influxdb相关的功能
1.可以获取influxdb实例中的databases
2.可以获取指定database中的measurements
3.通过指定measurement获取其中的tags和fileds
2020-05-13 22:45:41 +08:00
Zexi Li
442e95a2c1 Merge pull request #6325 from swordqiu/automated-cherry-pick-of-#6324-upstream-release-3.2
Automated cherry pick of #6324: fix: host agent list use baremetalagents model
2020-05-13 21:20:56 +08:00
Qiu Jian
2089c055f3 fix: host agent list use baremetalagents model 2020-05-13 21:15:38 +08:00
yunion-ci-robot
c52946c5ed Merge pull request #6320 from wanyaoqi/automated-cherry-pick-of-#6319-upstream-release-3.2
Automated cherry pick of #6319: do not close worker chan
2020-05-13 20:18:01 +08:00
wanyaoqi
3e2f5c7af1 do not close worker chan
don't close worker chan after put work, will cause dead loop
2020-05-13 18:58:18 +08:00
Zexi Li
061d31ae0d Merge pull request #6314 from swordqiu/automated-cherry-pick-of-#6305-upstream-release-3.2
Automated cherry pick of #6305: fix: change-owner-candidate-domains not implemented for some resources
2020-05-13 12:46:17 +08:00
Zexi Li
055d01d24e Merge pull request #6303 from yousong/automated-cherry-pick-of-#6302-upstream-release-3.2
Automated cherry pick of #6302: vpcagent: ignore possible external subnets
2020-05-13 12:45:30 +08:00
Zexi Li
b48647abbd Merge pull request #6301 from ioito/automated-cherry-pick-of-#6300-upstream-release-3.2
Automated cherry pick of #6300: fix: 避免provider错乱返回
2020-05-13 12:44:28 +08:00
Zexi Li
34f7a4e6d0 Merge pull request #6298 from ioito/automated-cherry-pick-of-#6297-upstream-release-3.2
Automated cherry pick of #6297: fix: cloud-provider-list support filter by cloudregion
2020-05-13 12:44:02 +08:00
Zexi Li
cb0810c7c2 Merge pull request #6279 from swordqiu/automated-cherry-pick-of-#6241-upstream-release-3.2
Automated cherry pick of #6241: feature: user login into project with highest privilege automatically
2020-05-13 12:43:33 +08:00
Zexi Li
ec9dcb05ee Merge pull request #6310 from ioito/automated-cherry-pick-of-#6306-upstream-release-3.2
Automated cherry pick of #6306: fix: openstack 安全组规则同步
2020-05-13 12:41:55 +08:00
Zexi Li
cfb3c4c184 Merge pull request #6316 from ioito/automated-cherry-pick-of-#6315-upstream-release-3.2
Automated cherry pick of #6315: fix: i-ps -> ips
2020-05-13 10:46:16 +08:00
Zexi Li
cd5d452e86 Merge pull request #6318 from swordqiu/automated-cherry-pick-of-#6317-upstream-release-3.2
Automated cherry pick of #6317: fix: reserved ip owner filter
2020-05-13 10:44:16 +08:00
Zexi Li
e725bdf0ca Merge pull request #6293 from ioito/automated-cherry-pick-of-#6292-upstream-release-3.2
Automated cherry pick of #6292: fix: 优化openstack错误处理
2020-05-13 10:42:45 +08:00
Qiu Jian
04ba1e8300 fix: reserved ip owner filter 2020-05-12 21:13:14 +08:00
Qu Xuan
93222c5827 fix: i-ps -> ips 2020-05-12 20:27:36 +08:00
Qiu Jian
014e159339 fix: change-owner-candidate-domains not implemented for some resources 2020-05-12 18:47:30 +08:00
Yousong Zhou
f7e1676a17 vpcagent: ignore possible external subnets 2020-05-12 18:06:27 +08:00
Qu Xuan
535e9a1861 fix: openstack 安全组规则同步 2020-05-12 17:57:25 +08:00
Qu Xuan
48e35019b3 fix: 避免provider错乱返回 2020-05-12 17:03:12 +08:00
Zexi Li
79f9d69125 Merge pull request #6281 from yousong/automated-cherry-pick-of-#6280-upstream-release-3.2
Automated cherry pick of #6280: cloudcommon: elect: notifyOne on subscribe
2020-05-12 14:22:37 +08:00
Zexi Li
7bec5cbdb8 Merge pull request #6278 from ioito/automated-cherry-pick-of-#6277-upstream-release-3.2
Automated cherry pick of #6277: fix: 支持访问其他服务的标签列表
2020-05-12 14:21:47 +08:00
Qu Xuan
b8104481ee fix: 优化openstack错误处理 2020-05-12 14:09:10 +08:00
Qu Xuan
ebe775338c fix: cloud-provider-list support filter by cloudregion 2020-05-12 14:06:53 +08:00
Zexi Li
fa54acf2c7 Merge pull request #6288 from yousong/automated-cherry-pick-of-#6287-upstream-release-3.2
Automated cherry pick of #6287: region: lbagent: undeploy: make it idempotent
2020-05-12 11:50:05 +08:00
Zexi Li
f01d45d7ed Merge pull request #6283 from yousong/automated-cherry-pick-of-#6282-upstream-release-3.2
Automated cherry pick of #6282: region: lbagents: fix deleting pending_deleted objects
2020-05-12 11:43:42 +08:00
Yousong Zhou
d2197aec70 region: lbagent: undeploy: make it idempotent
Both the following three can result in the same error message "Could not
find the requested service yunion-xx: host"

  -m systemd -a 'name=yunion-xx enabled=no state=stopped daemon_reload=yes'
  -m systemd -a 'name=yunion-xx enabled=no state=stopped daemon_reload=yes force=yes'
  -m service -a 'name=yunion-xx enabled=no state=stopped'

Use of ansibleplaybookv2 is overkill and can break console expectation.
Just turn to shell module for now
2020-05-12 10:38:56 +08:00
Yousong Zhou
51f50c1087 region: lbagents: fix deleting pending_deleted objects
This was broken since the introduction of virtual object
2020-05-12 10:11:01 +08:00
Yousong Zhou
a77aa72d47 cloudcommon: elect: notifyOne on subscribe 2020-05-11 23:27:19 +08:00
Qu Xuan
88af7f7f2f fix: 支持访问其他服务的标签列表 2020-05-11 21:39:59 +08:00
Qiu Jian
e95ea4a0fa detect bmagent and hostagent service 2020-05-11 21:21:15 +08:00
Qiu Jian
6e24efd176 feature: user login into project with highest privilege automatically 2020-05-11 21:21:15 +08:00
Zexi Li
9034bff3cb Merge pull request #6264 from ioito/automated-cherry-pick-of-#6263-upstream-release-3.2
Automated cherry pick of #6263: fix: globalvpc count vpc
2020-05-11 21:09:39 +08:00
Zexi Li
002ac64e8b Merge pull request #6266 from ioito/automated-cherry-pick-of-#6265-upstream-release-3.2
Automated cherry pick of #6265: fix: 避免卸载完已删除的磁盘后,磁盘状态为ready
2020-05-11 21:09:09 +08:00
Zexi Li
4e67c95561 Merge pull request #6271 from zexi/automated-cherry-pick-of-#6270-upstream-release-3.2
Automated cherry pick of #6270: scheduler: get region nil panic
2020-05-11 21:07:38 +08:00
Zexi Li
2d9cc6d99e Merge pull request #6276 from swordqiu/automated-cherry-pick-of-#6275-upstream-release-3.2
Automated cherry pick of #6275: fix: isolated_devices domain filter not working
2020-05-11 21:07:14 +08:00
Qiu Jian
05c206497a fix: isolated_devices domain filter not working 2020-05-11 20:47:58 +08:00
Zexi Li
a3955a36b9 Merge pull request #6269 from ioito/automated-cherry-pick-of-#6268-upstream-release-3.2
Automated cherry pick of #6268: fix: gcp rds 默认不使用vpc网络
2020-05-11 18:17:51 +08:00
Zexi Li
2e13690b5c Merge pull request #6259 from ioito/automated-cherry-pick-of-#6258-upstream-release-3.2
Automated cherry pick of #6258: fix: 避免aliyun磁盘计费类型多次转换
2020-05-11 18:17:04 +08:00
Zexi Li
e22bac2597 scheduler: get region nil panic 2020-05-11 14:58:09 +08:00
Qu Xuan
7840528040 fix: gcp rds 默认不使用vpc网络 2020-05-11 14:52:58 +08:00
Qu Xuan
e8070c171a fix: 避免卸载完已删除的磁盘后,磁盘状态为ready 2020-05-11 14:37:13 +08:00
Qu Xuan
73890e5adb fix: globalvpc count vpc 2020-05-11 14:18:22 +08:00
Qu Xuan
1868ab31eb fix: 避免aliyun磁盘计费类型多次转换 2020-05-11 14:06:03 +08:00
Zexi Li
52200db57b Merge pull request #6220 from swordqiu/automated-cherry-pick-of-#6219-upstream-release-3.2
Automated cherry pick of #6219: fix: 1. vpc, cloudprovider should not violate the sharing limit of cloud account 2. sharing mode of host and attached local storage should be consistent. 3. cannot change owner of shared resource
2020-05-11 12:37:21 +08:00
Zexi Li
4da9c3b427 Merge pull request #6256 from swordqiu/automated-cherry-pick-of-#6252-upstream-release-3.2
Automated cherry pick of #6252: fix: panic when disk has no valid storage_id
2020-05-11 10:01:20 +08:00
yunion-ci-robot
5ae4a4b2de Merge pull request #6231 from tb365/automated-cherry-pick-of-#6230-upstream-release-3.2
Automated cherry pick of #6230: lb acl cache add acl filter
2020-05-11 09:42:56 +08:00
Qiu Jian
dbd88e3288 fix: panic when disk has no valid storage_id 2020-05-11 02:58:43 +08:00
Zexi Li
83c186b616 Merge pull request #6248 from wanyaoqi/automated-cherry-pick-of-#6247-upstream-release-3.2
Automated cherry pick of #6247: fix import from libvirt
2020-05-10 21:35:04 +08:00
Zexi Li
77ac919edb Merge pull request #6236 from tb365/automated-cherry-pick-of-#6232-upstream-release-3.2
Automated cherry pick of #6232: huawei network id fix
2020-05-10 21:33:53 +08:00
wanyaoqi
e8a8416b77 fix import from libvirt 2020-05-10 20:43:24 +08:00
Zexi Li
558c477de1 Merge pull request #6218 from swordqiu/automated-cherry-pick-of-#6200-upstream-release-3.2
Automated cherry pick of #6200: fix: recode sync public_src of cloud resources
2020-05-10 19:50:21 +08:00
Zexi Li
d768fc33f1 Merge pull request #6243 from yousong/automated-cherry-pick-of-#6242-upstream-release-3.2
Automated cherry pick of #6242: disks: reword error message on bad DiskConfig struct
2020-05-10 11:29:03 +08:00
Yousong Zhou
ee13acba43 disks: reword error message on bad DiskConfig struct 2020-05-10 00:18:21 +08:00
yunion-ci-robot
c65a25fa80 Merge pull request #6240 from swordqiu/automated-cherry-pick-of-#6237-upstream-release-3.2
Automated cherry pick of #6237: fix: guestsecgroup-list panic
2020-05-10 00:17:50 +08:00
Qiu Jian
4599988771 fix: guestsecgroup-list panic 2020-05-09 23:06:06 +08:00
Qiu Jian
d85e9be656 fix: init sharing status of default vpc and default secgroup 2020-05-09 22:36:16 +08:00
Qiu Jian
9e06c3a52f fix: allow delete shared resource 2020-05-09 22:36:15 +08:00
Qiu Jian
a51f928af9 fix: 1. vpc, cloudprovider should not violate the sharing limit of cloud account 2. sharing mode of host and attached local storage should be consistent. 3. cannot change owner of shared resource 2020-05-09 22:36:15 +08:00
Qiu Jian
117122c363 fix: recode sync public_src of cloud resources 2020-05-09 21:26:42 +08:00
tangbin
2d61f927a4 huawei network id fix 2020-05-09 20:12:17 +08:00
tangbin
b4b815a30f new local lb backend fix 2020-05-09 19:23:57 +08:00
tangbin
9c50414a0e lb acl cache add acl filter 2020-05-09 19:23:57 +08:00
Zexi Li
2714b6ceb0 Merge pull request #6222 from yousong/automated-cherry-pick-of-#6221-upstream-release-3.2
Automated cherry pick of #6221: cloudprovider: add methods for getting http client
2020-05-09 19:02:14 +08:00
Zexi Li
472c5b2622 Merge pull request #6210 from swordqiu/automated-cherry-pick-of-#6209-upstream-release-3.2
Automated cherry pick of #6209: fix: missing methods for SDomainRegionalCloudResourceKeys
2020-05-09 19:00:06 +08:00
Zexi Li
4ee4a9d872 Merge pull request #6217 from swordqiu/automated-cherry-pick-of-#6216-upstream-release-3.2
Automated cherry pick of #6216: fix: export missing keys && export panic
2020-05-09 18:58:58 +08:00
Zexi Li
89af0eeba1 Merge pull request #6214 from yousong/automated-cherry-pick-of-#6213-upstream-release-3.2
Automated cherry pick of #6213: vpcagent: ovn: explicitly include gateway route in classless routes
2020-05-09 18:57:13 +08:00
Zexi Li
ea7cd16ab3 Merge pull request #6212 from yousong/automated-cherry-pick-of-#6211-upstream-release-3.2
Automated cherry pick of #6211: vpcagent: models: ignore possible external guests
2020-05-09 18:55:39 +08:00
Zexi Li
f89276dd6a Merge pull request #6207 from wanyaoqi/automated-cherry-pick-of-#6206-upstream-release-3.2
Automated cherry pick of #6206: bm register use domain token
2020-05-09 18:54:38 +08:00
Zexi Li
a9bb0087b2 Merge pull request #6226 from yousong/automated-cherry-pick-of-#6225-upstream-release-3.2
Automated cherry pick of #6225: apigateway: handlers: register cloudnet modules
2020-05-09 18:47:42 +08:00
Zexi Li
00ca11f63c Merge pull request #6208 from zexi/automated-cherry-pick-of-#6193-upstream-release-3.2
Automated cherry pick of #6193: baremetal: find baremetal add scope system
2020-05-09 17:48:49 +08:00
Yousong Zhou
3e135e70ae apigateway: handlers: register cloudnet modules 2020-05-09 16:41:08 +08:00
Yousong Zhou
caf6726b12 multicloud: loader: guard against changing proxyFunc of default client 2020-05-09 12:56:29 +08:00
Yousong Zhou
f080a4ca9b multicloud: avoid changing transport of global default http client 2020-05-09 12:56:29 +08:00
Yousong Zhou
b187ca471f cloudprovider: add methods for getting http client
Prepare for following changes to avoid using and changing default
client settings
2020-05-09 12:56:29 +08:00
Qiu Jian
83f2defb24 fix: export missing keys && export panic 2020-05-08 17:44:30 +08:00
Yousong Zhou
daa591e99d vpcagent: ovn: explicitly include gateway route in classless routes 2020-05-08 16:35:52 +08:00
Yousong Zhou
88ac93510b vpcagent: models: ignore possible external guests 2020-05-08 15:46:46 +08:00
Qiu Jian
bf5d38d510 fix: missing methods for SDomainRegionalCloudResourceKeys 2020-05-08 14:16:34 +08:00
Zexi Li
79cecc5c7e baremetal: find baremetal add scope system 2020-05-08 13:46:38 +08:00
wanyaoqi
5fdd93fa2e bm register use domain token 2020-05-08 12:00:19 +08:00
Zexi Li
af9bf353f4 Merge pull request #6205 from tb365/automated-cherry-pick-of-#6204-upstream-release-3.2
Automated cherry pick of #6204: set cookie domain
2020-05-08 11:57:25 +08:00
tangbin
50146557ba set cookie domain 2020-05-08 11:56:17 +08:00
Zexi Li
cc52279ba2 Merge pull request #6201 from tb365/automated-cherry-pick-of-#6190-upstream-release-3.2
Automated cherry pick of #6190: apigateway-yunionauth-domain-setting
2020-05-08 10:29:21 +08:00
tangbin
6320fe1594 apigateway-yunionauth-domain-setting 2020-05-08 10:19:04 +08:00
Zexi Li
aa4cba8e6f Merge pull request #6199 from swordqiu/automated-cherry-pick-of-#6198-upstream-release-3.2
Automated cherry pick of #6198: fix: fail to sync share state for on-premise storages
2020-05-08 10:18:31 +08:00
Zexi Li
8d17139484 Merge pull request #6195 from wanyaoqi/automated-cherry-pick-of-#6194-upstream-release-3.2
Automated cherry pick of #6194: set host list scope system
2020-05-08 10:16:28 +08:00
Qiu Jian
7291e620a3 fix: fail to sync share state for on-premise storages 2020-05-07 20:47:12 +08:00
wanyaoqi
e8dc98ca8d set host list scope system 2020-05-07 20:04:31 +08:00
Zexi Li
012ee72fcb Merge pull request #6189 from zhaoxiangchun/automated-cherry-pick-of-#6185-upstream-release-3.2
Automated cherry pick of #6185: 修复谷歌监控无法获取的问题
2020-05-07 17:21:38 +08:00
yunion-ci-robot
84ea12f86d Merge pull request #6165 from zhaoxiangchun/automated-cherry-pick-of-#6164-upstream-release-3.2
Automated cherry pick of #6164: bugfix mem paginate
2020-05-07 16:51:45 +08:00
Zexi Li
67baa9be6e Merge pull request #6184 from swordqiu/automated-cherry-pick-of-#6183-upstream-release-3.2
Automated cherry pick of #6183: fix: missing perform public/private actionlog
2020-05-07 11:38:40 +08:00
zhaoxiangchun
1a800c99c7 修复谷歌监控无法获取的问题
直接返回调用RestAPI的json格式数据
2020-05-07 11:28:34 +08:00
Zexi Li
e9a4c0fe86 Merge pull request #6182 from swordqiu/automated-cherry-pick-of-#6181-upstream-release-3.2
Automated cherry pick of #6181: fix: shared cloudprovider not accessible
2020-05-07 11:28:26 +08:00
Zexi Li
8d9bddf6da Merge pull request #6180 from swordqiu/automated-cherry-pick-of-#6179-upstream-release-3.2
Automated cherry pick of #6179: fix: shared resource should not be deletable
2020-05-07 11:23:59 +08:00
Zexi Li
5eb616a30c Merge pull request #6169 from yousong/automated-cherry-pick-of-#6168-upstream-release-3.2
Automated cherry pick of #6168: dnsrecords: note that DnsRecordManager is a IAdminSharableVirtualModelManager
2020-05-07 11:23:14 +08:00
Zexi Li
8a9aef390d Merge pull request #6175 from swordqiu/automated-cherry-pick-of-#6174-upstream-release-3.2
Automated cherry pick of #6174: fix: fail to fetch real client ip from httprequest
2020-05-07 11:16:23 +08:00
Qiu Jian
c269437f36 fix: missing perform public/private actionlog 2020-05-07 02:14:49 +08:00
Qiu Jian
92232a5c45 fix: shared cloudprovider not accessible 2020-05-07 01:54:10 +08:00
Qiu Jian
fea14ed51e fix: shared resource should not be deletable 2020-05-07 01:40:23 +08:00
Qiu Jian
5c74ad427f fix: fail to fetch real client ip from httprequest 2020-05-06 22:27:08 +08:00
Yousong Zhou
40282fa5e6 dnsrecords: allow updating only description
This commit includes the following changes

 - Eliminate unused arguments from validateModelData()
 - Remove "records" member of input data unconditionally
 - Allow updates to not include records related parameters, to allow
   updating only "description" without emitting "Empty record" error
2020-05-06 18:42:29 +08:00
Yousong Zhou
356bea1915 dnsrecords: note that DnsRecordManager is a IAdminSharableVirtualModelManager 2020-05-06 18:42:29 +08:00
yunion-ci-robot
e3d062290a Merge pull request #6159 from zhaoxiangchun/automated-cherry-pick-of-#6158-upstream-release-3.2
Automated cherry pick of #6158: bugfix mem paginate
2020-05-06 15:45:44 +08:00
Zexi Li
1817cb1423 Merge pull request #6166 from wanyaoqi/automated-cherry-pick-of-#6150-upstream-release-3.2
Automated cherry pick of #6150: fix update input
2020-05-06 12:35:52 +08:00
wanyaoqi
eda2a39e5a fix update input 2020-05-06 11:55:22 +08:00
zhaoxiangchun
ee55aed03f bugfix mem paginate
通过totoal和offset 与limit比较确定最后返回数据
2020-05-06 11:06:27 +08:00
Zexi Li
70534106e6 Merge pull request #6154 from ioito/automated-cherry-pick-of-#6153-upstream-release-3.2
Automated cherry pick of #6153: fix: secgroupcache权限问题修复
2020-04-30 20:14:01 +08:00
zhaoxiangchun
b20d1ab7bd 修复规则无法禁用的问题 2020-04-30 20:13:30 +08:00
zhaoxiangchun
2ef877bd4d bugfix mem paginate
通过totoal和offset 与limit比较确定最后返回数据
2020-04-30 20:13:30 +08:00
Zexi Li
9103700f33 Merge pull request #6163 from wanyaoqi/automated-cherry-pick-of-#6151-upstream-release-3.2
Automated cherry pick of #6151: fix host details output
2020-04-30 19:08:24 +08:00
wanyaoqi
17676568d8 fix host init without etcd 2020-04-30 18:46:15 +08:00
wanyaoqi
341dda54ca fix host details output 2020-04-30 18:34:42 +08:00
Qu Xuan
0812fc2efe fix: secgroupcache权限问题修复 2020-04-30 15:42:32 +08:00
Zexi Li
7a97d5690b Merge pull request #6148 from rainzm/automated-cherry-pick-of-#6147-upstream-release-3.2
Automated cherry pick of #6147: fix/monitor: AutoScalingNotifier.ShouldNotify should call NotifierBase.ShouldNotify
2020-04-30 14:41:38 +08:00
Zexi Li
70db8a462e Merge pull request #6149 from wanyaoqi/automated-cherry-pick-of-#6145-upstream-release-3.2
Automated cherry pick of #6145: fix host health
2020-04-30 14:41:05 +08:00
wanyaoqi
9b22f51f25 fix host health 2020-04-30 11:32:53 +08:00
Rain
3a09de47b7 fix/monitor: AutoScalingNotifier.ShouldNotify should call NotifierBase.ShouldNotify 2020-04-30 11:31:28 +08:00
Zexi Li
b2c20dac86 Merge pull request #6138 from ioito/automated-cherry-pick-of-#6137-upstream-release-3.2
Automated cherry pick of #6137: fix: 云账号创建可以指定项目
2020-04-30 10:36:36 +08:00
Zexi Li
71be44a29b Merge pull request #6126 from ioito/automated-cherry-pick-of-#6123-upstream-release-3.2
Automated cherry pick of #6123: fix: usage-handler 不统计虚拟的vpc wire
2020-04-30 10:36:14 +08:00
Zexi Li
bab5b137ae Merge pull request #6142 from swordqiu/automated-cherry-pick-of-#6141-upstream-release-3.2
Automated cherry pick of #6141: fix: remove cloudaccount autosync randomness
2020-04-30 10:35:40 +08:00
Zexi Li
0fc6e1a29b Merge pull request #6144 from swordqiu/automated-cherry-pick-of-#6143-upstream-release-3.2
Automated cherry pick of #6143: fix: list lbbg panic
2020-04-30 10:35:07 +08:00
Qiu Jian
4b8ddca41b fix: list lbbg panic 2020-04-29 22:42:53 +08:00
Qiu Jian
2181019270 fix: remove cloudaccount autosync randomness 2020-04-29 22:34:37 +08:00
Zexi Li
fb3ae328c8 Merge pull request #6136 from wanyaoqi/automated-cherry-pick-of-#6034-upstream-release-3.2
Automated cherry pick of #6034: host health check
2020-04-29 21:17:12 +08:00
Zexi Li
60f3b1e6a2 Merge pull request #6128 from swordqiu/automated-cherry-pick-of-#6120-upstream-release-3.2
Automated cherry pick of #6120: fix: sysadmin can override policy violation check
2020-04-29 21:15:44 +08:00
Zexi Li
368a45069e Merge pull request #6125 from tb365/automated-cherry-pick-of-#6124-upstream-release-3.2
Automated cherry pick of #6124: add cookie domain setting option
2020-04-29 21:13:34 +08:00
Qu Xuan
a126f56bfb fix: 云账号创建可以指定项目 2020-04-29 20:06:26 +08:00
wanyaoqi
70fa719942 enable etcd lock 2020-04-29 20:03:06 +08:00
wanyaoqi
e024bdef1b host health check 2020-04-29 19:58:03 +08:00
Zexi Li
b18df612be Merge pull request #6122 from zhaoxiangchun/automated-cherry-pick-of-#6121-upstream-release-3.2
Automated cherry pick of #6121: monitor,对于监控数据nodata,默认不发送邮件
2020-04-29 19:36:05 +08:00
Qiu Jian
ae9838a38b fix: sysadmin can override policy violation check 2020-04-29 17:59:03 +08:00
Qu Xuan
599facb154 fix: usage-handler 不统计虚拟的vpc wire 2020-04-29 17:56:46 +08:00
tangbin
793412b813 add cookie domain setting option 2020-04-29 17:54:42 +08:00
zhaoxiangchun
27e075bfae monitor,对于监控数据nodata,默认不发送邮件 2020-04-29 15:18:23 +08:00
Zexi Li
ba6e8a1656 Merge pull request #6119 from swordqiu/automated-cherry-pick-of-#6118-upstream-release-3.2
Automated cherry pick of #6118: fix: cloud-account-usage vpc/storage not accurate
2020-04-29 13:11:41 +08:00
Zexi Li
e1840785c4 Merge pull request #6112 from swordqiu/automated-cherry-pick-of-#6111-upstream-release-3.2
Automated cherry pick of #6111: fix: prevent policy violation
2020-04-29 13:10:22 +08:00
Zexi Li
8767b92bc2 Merge pull request #6102 from rainzm/automated-cherry-pick-of-#6101-upstream-release-3.2
Automated cherry pick of #6101: fix/autoscaling: Chang the format of CoolingTime
2020-04-29 13:09:35 +08:00
Zexi Li
1fc3614d7c Merge pull request #6096 from ioito/automated-cherry-pick-of-#6095-upstream-release-3.2
Automated cherry pick of #6095: fix: 普通用户可获取rds账号密码
2020-04-29 13:08:07 +08:00
Zexi Li
3b94a82dc4 Merge pull request #6110 from ioito/automated-cherry-pick-of-#6109-upstream-release-3.2
Automated cherry pick of #6109: fix: 避免gcp创建创建文件夹失败
2020-04-29 13:07:32 +08:00
Zexi Li
7a4096c733 Merge pull request #6117 from swordqiu/automated-cherry-pick-of-#6116-upstream-release-3.2
Automated cherry pick of #6116: fix: export files complain duplicate field name error
2020-04-29 13:06:38 +08:00
Qiu Jian
eb67eb6346 fix: cloud-account-usage vpc/storage not accurate 2020-04-29 01:16:18 +08:00
Qiu Jian
ac4832ebf2 fix: export files complain duplicate field name error 2020-04-29 00:56:07 +08:00
yunion-ci-robot
4cdb7513a0 Merge pull request #6104 from ioito/automated-cherry-pick-of-#6103-upstream-release-3.2
Automated cherry pick of #6103: fix: 修复openstack存储同步问题
2020-04-28 23:41:35 +08:00
Qiu Jian
3713cfd967 fix: prevent policy violation 2020-04-28 23:37:26 +08:00
Qu Xuan
ff0e90a593 fix: 避免gcp创建创建文件夹失败 2020-04-28 20:50:31 +08:00
Zexi Li
e4f57eebe0 Merge pull request #6093 from wanyaoqi/automated-cherry-pick-of-#6092-upstream-release-3.2
Automated cherry pick of #6092: gpu host enable huge page
2020-04-28 16:05:23 +08:00
Qu Xuan
d6ae5042b0 fix: 修复openstack存储同步问题 2020-04-28 14:47:34 +08:00
Rain
76788bfa9d fix/as: Set ScalingPolicy's project as its ScalingGroup's project 2020-04-28 11:18:23 +08:00
Rain
f9fcb5e73f fix/autoscaling: Chang the format of CoolingTime 2020-04-28 11:18:23 +08:00
Qu Xuan
c3f13225cd fix: 普通用户可获取rds账号密码 2020-04-28 10:41:08 +08:00
Zexi Li
deac1a9ea4 Merge pull request #6086 from yousong/automated-cherry-pick-of-#6085-upstream-release-3.2
Automated cherry pick of #6085: region: cloudaccounts: re-validate only when proxysetting changed
2020-04-27 20:59:28 +08:00
Zexi Li
396f099098 Merge pull request #6091 from yousong/automated-cherry-pick-of-#6090-upstream-release-3.2
Automated cherry pick of #6090: vpcagent: tmp replacement for db.FindByIndex()
2020-04-27 20:52:19 +08:00
Yousong Zhou
6d9a5c2a70 vpcagent: ad-hoc replacement for db.FindByIndex() 2020-04-27 20:07:34 +08:00
wanyaoqi
41aceac04d gpu host enable huge page 2020-04-27 20:04:03 +08:00
Yousong Zhou
29dcd54f4a region: cloudaccounts: re-validate only when proxysetting changed 2020-04-27 17:36:29 +08:00
Zexi Li
f8a2f31373 Merge pull request #6076 from yousong/automated-cherry-pick-of-#6075-upstream-release-3.2
Automated cherry pick of #6075: vpcagent: work around nics of pending deleted guest
2020-04-27 17:19:02 +08:00
Zexi Li
95aa4a91fe Merge pull request #6080 from ioito/automated-cherry-pick-of-#6079-upstream-release-3.2
Automated cherry pick of #6079: fix: gcp fake region status
2020-04-27 17:17:46 +08:00
Zexi Li
1212dad5b3 Merge pull request #6078 from swordqiu/automated-cherry-pick-of-#6077-upstream-release-3.2
Automated cherry pick of #6077: fix: cloudaccount usage region/zone count not accurate
2020-04-27 17:17:06 +08:00
Zexi Li
36c64afcec Merge pull request #6026 from zhaoxiangchun/automated-cherry-pick-of-#6024-upstream-release-3.2
Automated cherry pick of #6024: lb 负载均衡优化建议
2020-04-27 17:16:18 +08:00
Zexi Li
f90bd32c61 Merge pull request #6082 from wanyaoqi/automated-cherry-pick-of-#6081-upstream-release-3.2
Automated cherry pick of #6081: fix exsi convert disk path
2020-04-27 17:14:34 +08:00
Yousong Zhou
12e9bcca0e vpcagent: models: allow guest to have multiple vpc nics 2020-04-27 17:13:44 +08:00
Yousong Zhou
95ada0fe55 vpcagent: work around nics of pending deleted guest 2020-04-27 17:13:44 +08:00
Zexi Li
933368b4b2 Merge pull request #6069 from ioito/automated-cherry-pick-of-#6068-upstream-release-3.2
Automated cherry pick of #6068: fix: gcp use project name for cloudprovider
2020-04-27 16:03:18 +08:00
wanyaoqi
16af1a4dc0 fix exsi convert disk path 2020-04-27 15:58:09 +08:00
Qu Xuan
06d47bba43 fix: gcp fake region status 2020-04-27 15:56:39 +08:00
Qiu Jian
eb401bd1f8 fix: cloudaccount usage region/zone count not accurate 2020-04-27 15:53:27 +08:00
yunion-ci-robot
81ea86885e Merge pull request #6074 from rainzm/automated-cherry-pick-of-#6073-upstream-release-3.2
Automated cherry pick of #6073: fix/notify: remove 'v2' from email verify url
2020-04-27 14:38:32 +08:00
Qu Xuan
fcb817033c fix: gcp use project name for cloudprovider 2020-04-27 14:16:25 +08:00
Zexi Li
dc43158b59 Merge pull request #6061 from wanyaoqi/automated-cherry-pick-of-#5853-upstream-release-3.2
Automated cherry pick of #5853: host health check
2020-04-27 12:55:14 +08:00
Zexi Li
ce1eef35bd Merge pull request #6063 from rainzm/automated-cherry-pick-of-#6062-upstream-release-3.2
Automated cherry pick of #6062: fix/notify: Add deadline for rpc client
2020-04-27 12:48:02 +08:00
yunion-ci-robot
a6e7042a09 Merge pull request #6045 from tb365/automated-cherry-pick-of-#6041-upstream-release-3.2
Automated cherry pick of #6041: yunionapi reset password fix
2020-04-27 12:12:32 +08:00
Rain
77d4a0ee77 fix/notify: remove 'v2' from email verify url 2020-04-27 11:33:41 +08:00
Zexi Li
5b00f25dc8 Merge pull request #6060 from swordqiu/automated-cherry-pick-of-#6059-upstream-release-3.2
Automated cherry pick of #6059: fix: cloud-account/provider usage not accurate
2020-04-27 10:55:16 +08:00
Zexi Li
587eade0a4 Merge pull request #6053 from wanyaoqi/automated-cherry-pick-of-#6052-upstream-release-3.2
Automated cherry pick of #6052: host fix cmt bound, minor fix
2020-04-27 10:54:55 +08:00
Zexi Li
dc8d122394 Merge pull request #6051 from swordqiu/automated-cherry-pick-of-#6050-upstream-release-3.2
Automated cherry pick of #6050: feature: make baremetal options managed by service config
2020-04-27 10:53:42 +08:00
Zexi Li
9bef06b319 Merge pull request #6055 from rainzm/automated-cherry-pick-of-#6054-upstream-release-3.2
Automated cherry pick of #6054: Fix/auto scaling & guest template
2020-04-27 10:52:12 +08:00
Rain
778b619a59 fix/notify: Add deadline for rpc client 2020-04-27 10:43:54 +08:00
wanyaoqi
342f963e6e host health check 2020-04-27 10:32:34 +08:00
Qiu Jian
1a61a8445f fix: cloud-account/provider usage not accurate 2020-04-27 02:13:18 +08:00
tangbin
3e722dd487 yunionapi reset password fix 2020-04-26 21:50:18 +08:00
Qiu Jian
6d263c3bd1 feature: make baremetal options managed by service config 2020-04-26 21:28:48 +08:00
Zexi Li
3d0e842825 Merge pull request #6046 from tb365/automated-cherry-pick-of-#6042-upstream-release-3.2
Automated cherry pick of #6042: huawei elb cookie timeout fix
2020-04-26 21:06:22 +08:00
Rain
5ed62e22d8 fix/autoscaling: Change Sunday as 7 from 0 2020-04-26 21:05:25 +08:00
Rain
a31c64e726 fix/guesttemplate: Change ResetPassword as true default 2020-04-26 21:05:25 +08:00
Rain
e6c9d50bf3 fix/autoscaling: fix some problem
1. ScalingGroupGuestManger.Query 默认添加 NotEqual(...)
2. ScalingGroup.Scale 扩大锁的粒度,更新冷却时间也挪到这里面
3. climc 中增加 scaling-group-show
2020-04-26 21:05:25 +08:00
Zexi Li
2116475c9f Merge pull request #6021 from swordqiu/automated-cherry-pick-of-#6020-upstream-release-3.2
Automated cherry pick of #6020: fix: opslog FetchOwnerId fail
2020-04-26 21:04:55 +08:00
Zexi Li
5f3009c157 Merge pull request #6023 from yousong/automated-cherry-pick-of-#6022-upstream-release-3.2
Automated cherry pick of #6022: vpcagent: fend off non-onecloud-vpc guest nics
2020-04-26 21:04:42 +08:00
wanyaoqi
6b4c215d66 host fix cmt bound, minor fix 2020-04-26 20:57:07 +08:00
Zexi Li
aab70ad1b8 Merge pull request #6044 from tb365/automated-cherry-pick-of-#6040-upstream-release-3.2
Automated cherry pick of #6040: ctyun subnet create bugfix
2020-04-26 20:31:29 +08:00
tangbin
d3d46e81b3 aws elb health check type fix 2020-04-26 20:09:51 +08:00
tangbin
3f7b410bc2 huawei elb cookie timeout fix 2020-04-26 20:09:51 +08:00
tangbin
ce25fc43d6 ctyun subnet create bugfix 2020-04-26 20:08:42 +08:00
Zexi Li
0b138da714 Merge pull request #6019 from swordqiu/automated-cherry-pick-of-#6013-upstream-release-3.2
Automated cherry pick of #6013: fix: network allocation according to sharing status
2020-04-26 19:59:18 +08:00
Zexi Li
bc44cce0e1 Merge pull request #6039 from wanyaoqi/automated-cherry-pick-of-#6038-upstream-release-3.2
Automated cherry pick of #6038: misc bugfix:
2020-04-26 19:57:46 +08:00
yunion-ci-robot
479665c3fe Merge pull request #6012 from swordqiu/automated-cherry-pick-of-#6008-upstream-release-3.2
Automated cherry pick of #6008: fix: GetOnPremiseNetworkOfIP should return underlay networks
2020-04-26 19:50:31 +08:00
yunion-ci-robot
cd25cc9b33 Merge pull request #6037 from swordqiu/automated-cherry-pick-of-#6036-upstream-release-3.2
Automated cherry pick of #6036: fix: proxysetting attributes should be domain-settable
2020-04-26 19:47:32 +08:00
Yousong Zhou
16815d078d guestnetworks: try allocation of mapped addr on sync 2020-04-26 19:03:24 +08:00
Yousong Zhou
78d39efde7 region: vpcs_mapped_address: fix locking 2020-04-26 19:03:24 +08:00
Yousong Zhou
f2a777c977 region: vpcs_mapped_address: alloc guestnic mapped addr backwards 2020-04-26 19:03:24 +08:00
Yousong Zhou
b8fcf37883 guests: simplify code 2020-04-26 19:03:24 +08:00
Yousong Zhou
47ad14ea4c hostman: options: pack up a Parse() func 2020-04-26 19:03:24 +08:00
Yousong Zhou
1234fb46c5 vpcagent: fend off non-onecloud-vpc guest nics 2020-04-26 19:03:24 +08:00
wanyaoqi
127ce54503 misc bugfix:
- fix get details hosts
- save image enable generate_name
- network auto set dns
- fix servers filter by disk
2020-04-26 18:35:33 +08:00
Zexi Li
82f4f070ab Merge pull request #6029 from ioito/automated-cherry-pick-of-#6028-upstream-release-3.2
Automated cherry pick of #6028: fix: json unmarshal
2020-04-26 18:19:18 +08:00
Qiu Jian
5c42d6eb88 make DIRECT proxysettting default share to system 2020-04-26 17:34:41 +08:00
Qiu Jian
fe213d8bf7 fix: proxysetting attributes should be domain-settable 2020-04-26 17:34:41 +08:00
Zexi Li
8e57a5af9c Merge pull request #6025 from swordqiu/automated-cherry-pick-of-#6006-upstream-release-3.2
Automated cherry pick of #6006: fix: resolve parameter name conflict in google cloud account create input
2020-04-26 16:36:16 +08:00
Qu Xuan
bbeda23bf9 fix: json unmarshal 2020-04-26 15:51:51 +08:00
zhaoxiangchun
383517c0df lb 负载均衡优化建议
通过判断是否包含后端服务器组和后端服务实例进行判断
2020-04-26 11:43:27 +08:00
Qiu Jian
f835b55e4f fix: resolve parameter name conflict in google cloud account create input 2020-04-26 11:43:01 +08:00
Qiu Jian
87b0e7f48a fix: opslog FetchOwnerId fail 2020-04-26 11:37:04 +08:00
Qiu Jian
ca13731a58 fix: network allocation according to sharing status 2020-04-26 00:37:38 +08:00
yunion-ci-robot
d9ec66362e Merge pull request #6015 from zexi/automated-cherry-pick-of-#6014-upstream-release-3.2
Automated cherry pick of #6014: scheduler: fix network predicate get wrong free port
2020-04-26 00:32:31 +08:00
Zexi Li
02ec462b5d scheduler: fix network predicate get wrong free port 2020-04-25 23:24:15 +08:00
Qiu Jian
92d1d1f3a8 fix: GetOnPremiseNetworkOfIP should return underlay networks 2020-04-25 16:31:29 +08:00
Zexi Li
822838035b Merge pull request #6005 from swordqiu/automated-cherry-pick-of-#6004-upstream-release-3.2
Automated cherry pick of #6004: fix: dns name pattern revisited
2020-04-25 10:44:45 +08:00
Qiu Jian
fa820b8740 fix: dns name pattern revisited 2020-04-24 21:55:43 +08:00
yunion-ci-robot
c573880cc7 Merge pull request #5912 from yousong/automated-cherry-pick-of-#5911-upstream-release-3.2
Automated cherry pick of #5911: apis: add ovn distgw const definitions
2020-04-24 21:08:30 +08:00
Zexi Li
6c0f61becd Merge pull request #6003 from swordqiu/automated-cherry-pick-of-#6002-upstream-release-3.2
Automated cherry pick of #6002: fix: code autogen issues
2020-04-24 20:33:22 +08:00
Zexi Li
44e8a0843a Merge pull request #6000 from rainzm/automated-cherry-pick-of-#5978-upstream-release-3.2
Automated cherry pick of #5978: fix/autoscaling: Use UserCred's session but AdminSession to request monitor
2020-04-24 20:30:26 +08:00
Qiu Jian
cbf1818e5c fix: code autogen issues 2020-04-24 20:20:48 +08:00
Rain
87506a8140 fix/autoscaling: Add 'scaling_group_id' for server-list result 2020-04-24 19:39:11 +08:00
Rain
e01292274d fix/autoscaling: Add status 'pending_remove' for ScalingGroup_Guest
The status 'pending_remove' means that the guest described by
ScalingGroup_Guest has been pendingdeleted or deleted.
2020-04-24 19:39:11 +08:00
Rain
e6e95f31a7 fix/autoscaling: Change ScalingPolicy as VirtualResource 2020-04-24 19:39:11 +08:00
Rain
b28c1a0b63 fix/autoscaling: Use UserCred's session but AdminSession to request monitor 2020-04-24 19:39:11 +08:00
Yousong Zhou
96dcd83996 hostman: let sdnagent do port cleanup
ovsutils.CleanHiddenPorts() is buggy in that it has no regards for
patch ports
2020-04-24 18:32:40 +08:00
Yousong Zhou
8eb6c01ecd hostman: options: add ovn_mapped_bridge 2020-04-24 18:32:40 +08:00
Yousong Zhou
2588613598 hostman: options: add allow_xx_vms 2020-04-24 18:32:40 +08:00
Yousong Zhou
417cc017d9 vpcagent: ovn: use network.GuestDns when available 2020-04-24 18:32:40 +08:00
Yousong Zhou
96b58d0455 vpcagent: ovn: manage static routes 2020-04-24 18:32:40 +08:00
Yousong Zhou
5185e93413 vpcagent: ovn: guestnetwork: guard against empty dhcpopt 2020-04-24 18:32:40 +08:00
Yousong Zhou
8cad301846 vpcagent: ovn: rename subnet, guestnetwork ovn obj names 2020-04-24 18:32:40 +08:00
Yousong Zhou
4cb1fbbd8f vpcagent: ovn: use cmp() when claimVpc 2020-04-24 18:32:40 +08:00
Yousong Zhou
08ef2c5cf6 vpcagent: ovn: use cmp() 2020-04-24 18:32:40 +08:00
Yousong Zhou
09d6446d05 vpcagent: add cmp() for search and pre-cleanup 2020-04-24 18:32:40 +08:00
Yousong Zhou
12a79243e0 vpcagent: ovn: make host ls when claimVpc 2020-04-24 18:32:40 +08:00
Yousong Zhou
f9a4085a8f vpcagent: models: include guest, host 2020-04-24 18:32:40 +08:00
Yousong Zhou
6fcfd5a755 guests: always include host_id in desc 2020-04-24 18:32:40 +08:00
Yousong Zhou
012bdbce48 guestnetworks: add vpc id and mapped ip addr info to nic desc 2020-04-24 18:32:40 +08:00
Yousong Zhou
b772f95dbf guestnetworks,hosts: add alloc mapped ip addr for use in onecloud vpc 2020-04-24 18:32:40 +08:00
Yousong Zhou
38ccf7e056 apis: add ovn distgw const definitions 2020-04-24 18:32:40 +08:00
Zexi Li
da5e1e3bfe Merge pull request #5991 from ioito/automated-cherry-pick-of-#5918-upstream-release-3.2
Automated cherry pick of #5918: fix: 修复华为云eneterprise-project-list异常问题
2020-04-24 18:18:08 +08:00
Zexi Li
faf92ef201 Merge pull request #5996 from yousong/automated-cherry-pick-of-#5995-upstream-release-3.2
Automated cherry pick of #5995: lblistener: fix updating lblistener without backend_group field
2020-04-24 18:17:18 +08:00
Zexi Li
91fbb50060 Merge pull request #5994 from yousong/automated-cherry-pick-of-#5993-upstream-release-3.2
Automated cherry pick of #5993: cloudcommon: allow create:"domain" tag
2020-04-24 14:45:51 +08:00
Yousong Zhou
ba1a51c771 lblistener: fix updating lblistener without backend_group field
Fixes dd01610931 ("lblistener: allow setting http/https listener
backendgroup to empty")
2020-04-24 14:22:43 +08:00
Yousong Zhou
26b74b0873 cloudcommon: allow create:"domain" tag
Fixes panic: model manager hosts: column manager_uri has invalid tag
create:"domain", expecting [required optional domain_required
domain_optional admin_required admin_optional]
2020-04-24 14:20:13 +08:00
Qu Xuan
cbd3480309 fix: 修复华为云eneterprise-project-list异常问题 2020-04-24 14:11:25 +08:00
Zexi Li
9176aa3169 Merge pull request #5986 from ioito/automated-cherry-pick-of-#5985-upstream-release-3.2
Automated cherry pick of #5985: fix: 避免rds任务交叉运行
2020-04-24 14:11:02 +08:00
Zexi Li
bb571f40f6 Merge pull request #5987 from ioito/automated-cherry-pick-of-#5881-upstream-release-3.2
Automated cherry pick of #5881: fix: 阿里云资源组同步
2020-04-24 14:10:09 +08:00
Zexi Li
89507e2576 Merge pull request #5989 from ioito/automated-cherry-pick-of-#5903-upstream-release-3.2
Automated cherry pick of #5903: fix: esxi disk project sync
2020-04-24 14:09:47 +08:00
Qu Xuan
5411324d3b fix: esxi disk project sync 2020-04-24 11:34:46 +08:00
Qu Xuan
9e22edbc08 VMware resource pool同步 2020-04-24 11:32:05 +08:00
Qu Xuan
99353d2676 fix: 华为企业项目映射同步 2020-04-24 11:32:05 +08:00
Qu Xuan
8735d4c737 fix: 阿里云资源组同步 2020-04-24 11:32:05 +08:00
Qu Xuan
8c01ba2165 fix: 避免rds任务交叉运行 2020-04-24 11:29:13 +08:00
Zexi Li
afbd1359f2 Merge pull request #5983 from swordqiu/automated-cherry-pick-of-#5982-upstream-release-3.2
Automated cherry pick of #5982: fix: domain resources' field tags should changed to domain tags
2020-04-24 11:15:16 +08:00
Zexi Li
de3e335774 Merge pull request #5972 from swordqiu/automated-cherry-pick-of-#5960-upstream-release-3.2
Automated cherry pick of #5960: fix: opslog create fail
2020-04-24 01:37:38 +08:00
Zexi Li
6ad425e395 Merge pull request #5976 from ioito/automated-cherry-pick-of-#5975-upstream-release-3.2
Automated cherry pick of #5975: fix: 添加cloudevent过滤参数
2020-04-24 01:36:19 +08:00
Zexi Li
b46bf918be Merge pull request #5980 from ioito/automated-cherry-pick-of-#5979-upstream-release-3.2
Automated cherry pick of #5979: fix: cloudevent使用代理优化
2020-04-24 01:35:24 +08:00
Qiu Jian
01a2195c20 fix: domain resources' field tags should changed to domain tags 2020-04-23 22:13:47 +08:00
yunion-ci-robot
87995e2533 Merge pull request #5974 from tb365/automated-cherry-pick-of-#5973-upstream-release-3.2
Automated cherry pick of #5973: aliyun create elb listener fix
2020-04-23 20:24:52 +08:00
Qu Xuan
3363f091b0 fix: cloudevent使用代理优化 2020-04-23 17:53:44 +08:00
Qu Xuan
d071aa1408 fix: 添加cloudevent过滤参数 2020-04-23 17:13:02 +08:00
tangbin
ee392ac8f3 aliyun create elb listener fix 2020-04-23 16:35:08 +08:00
yunion-ci-robot
ab151f0f29 Merge pull request #5938 from ioito/automated-cherry-pick-of-#5915-upstream-release-3.2
Automated cherry pick of #5915: fix: 自动创建项目
2020-04-23 13:40:53 +08:00
Qiu Jian
96ac8267ab fix: opslog create fail 2020-04-23 11:17:51 +08:00
Zexi Li
b65dc463bc Merge pull request #5970 from swordqiu/automated-cherry-pick-of-#5966-upstream-release-3.2
Automated cherry pick of #5966: supermicro redfish support
2020-04-23 09:56:43 +08:00
Qiu Jian
6059e14fe1 supermicro redfish support 2020-04-23 09:32:37 +08:00
Zexi Li
1abed1f794 Merge pull request #5929 from yousong/automated-cherry-pick-of-#5928-upstream-release-3.2
Automated cherry pick of #5928: lbagent: fend off unexpected resources just in case
2020-04-23 00:07:05 +08:00
Zexi Li
3775608d93 Merge pull request #5959 from wanyaoqi/automated-cherry-pick-of-#5958-upstream-release-3.2
Automated cherry pick of #5958: fix check ca cert
2020-04-23 00:05:50 +08:00
Zexi Li
dfa1f7c0bc Merge pull request #5946 from rainzm/automated-cherry-pick-of-#5944-upstream-release-3.2
Automated cherry pick of #5944: fix(region): Add implements about owner for ScalingPolicy and ScalingActivity
2020-04-23 00:04:23 +08:00
Zexi Li
05e88b971a Merge pull request #5962 from swordqiu/automated-cherry-pick-of-#5961-upstream-release-3.2
Automated cherry pick of #5961: fix: clean pending usage caused by pre-validate-create-data
2020-04-23 00:03:06 +08:00
Zexi Li
e2499d23b8 Merge pull request #5925 from swordqiu/automated-cherry-pick-of-#5921-upstream-release-3.2
Automated cherry pick of #5921: fix: FindAnonymousStructPoint needs input as a pointer to struct
2020-04-23 00:02:33 +08:00
Zexi Li
f867795011 Merge pull request #5920 from ioito/automated-cherry-pick-of-#5919-upstream-release-3.2
Automated cherry pick of #5919: fix: 非私有云同步region name
2020-04-22 23:59:36 +08:00
Zexi Li
1e0594c3d5 Merge pull request #5957 from wanyaoqi/automated-cherry-pick-of-#5956-upstream-release-3.2
Automated cherry pick of #5956: support sync disk snapshot status
2020-04-22 23:58:35 +08:00
Zexi Li
6426b8a031 Merge pull request #5933 from ioito/automated-cherry-pick-of-#5931-upstream-release-3.2
Automated cherry pick of #5931: fix: 转换非标准存储类型到lrs
2020-04-22 23:57:25 +08:00
Zexi Li
28937f42e8 Merge pull request #5947 from tb365/automated-cherry-pick-of-#5945-upstream-release-3.2
Automated cherry pick of #5945: huawei elb sync vpc
2020-04-22 23:55:33 +08:00
Zexi Li
124edf9790 Merge pull request #5955 from zexi/automated-cherry-pick-of-#5951-upstream-release-3.2
Automated cherry pick of #5951: baremetal: ensure power up add retries
2020-04-22 23:51:28 +08:00
Qiu Jian
f145b360d6 fix: clean pending usage caused by pre-validate-create-data 2020-04-22 23:40:28 +08:00
yunion-ci-robot
ca7be6fa79 Merge pull request #5942 from tb365/automated-cherry-pick-of-#5927-upstream-release-3.2
Automated cherry pick of #5927: remove aws invalid backendgroup
2020-04-22 23:05:06 +08:00
wanyaoqi
4cf299b0fd fix check ca cert 2020-04-22 22:07:32 +08:00
yunion-ci-robot
6af24165fe Merge pull request #5883 from wanyaoqi/automated-cherry-pick-of-#5879-upstream-release-3.2
Automated cherry pick of #5879: keystone store service cert
2020-04-22 22:06:51 +08:00
wanyaoqi
034b546b16 support sync disk snapshot status 2020-04-22 20:53:47 +08:00
Zexi Li
3b01b23f79 baremetal: ensure power up add retries 2020-04-22 20:41:47 +08:00
tangbin
9f83fefc11 huawei elb sync vpc 2020-04-22 20:30:17 +08:00
Rain
fb1a399f09 fix(region): Add implements about owner for ScalingPolicy and ScalingActivity 2020-04-22 20:28:31 +08:00
Qiu Jian
7bc617fdcd fix: lb FetchCustomizedColumes fixes 2020-04-22 20:20:50 +08:00
Qiu Jian
dc69693c3d fix: is_managed filter is not accurate 2020-04-22 20:20:50 +08:00
Qiu Jian
70804c5cde fix: FindAnonymousStructPoint needs input as a pointer to struct 2020-04-22 20:20:50 +08:00
tangbin
5a2e7ef414 remove aws invalid backendgroup 2020-04-22 19:01:59 +08:00
Qu Xuan
e908f8114d fix: 自动创建项目 2020-04-22 18:56:36 +08:00
Qu Xuan
7dee2a1569 fix: 转换非标准存储类型到lrs 2020-04-22 18:54:05 +08:00
Yousong Zhou
b5183ca9ab lbagent: fend off unexpected resources just in case
As resource we do not know whether they are bad, but surely we know
they are not what we expect
2020-04-22 18:50:30 +08:00
Qu Xuan
12df8c099f fix: 非私有云同步region name 2020-04-22 17:59:40 +08:00
Zexi Li
af2abeec78 Merge pull request #5917 from rainzm/automated-cherry-pick-of-#5916-upstream-release-3.2
Automated cherry pick of #5916: fix(host): No tag when tag's value is empty
2020-04-22 17:41:12 +08:00
Zexi Li
7ad3c66a84 Merge pull request #5914 from rainzm/automated-cherry-pick-of-#5913-upstream-release-3.2
Automated cherry pick of #5913: fix(region): Fix problems for Auto Scaling
2020-04-22 17:38:22 +08:00
Rain
05c42c1081 fix(host): No tag when tag's value is empty 2020-04-22 16:48:53 +08:00
wanyaoqi
bffb8eec65 keystone store service cert 2020-04-22 16:37:02 +08:00
Rain
0bf450a384 fix(region): Fix problems for Auto Scaling
1. ScalingPolicyManager and ScalingActivityManager override ResourceScope.
2. Change 'tenant' as 'project_id' before requesting to forcast.
2020-04-22 16:32:01 +08:00
Zexi Li
20d36f97ef Merge pull request #5901 from ioito/automated-cherry-pick-of-#5900-upstream-release-3.2
Automated cherry pick of #5900: fix: 尽量避免因代理问题导致google request异常
2020-04-22 15:12:14 +08:00
Zexi Li
cf158ea2db Merge pull request #5905 from swordqiu/automated-cherry-pick-of-#5904-upstream-release-3.2
Automated cherry pick of #5904: fix: do not share porject resource by default
2020-04-22 15:10:06 +08:00
Zexi Li
f7a4164243 Merge pull request #5907 from swordqiu/automated-cherry-pick-of-#5906-upstream-release-3.2
Automated cherry pick of #5906: fix: blacklist keystone reset admin password
2020-04-22 15:06:53 +08:00
Qiu Jian
41eb37d64e fix: blacklist keystone reset admin password 2020-04-22 15:02:21 +08:00
Qiu Jian
9ee568b7b8 fix: do not share porject resource by default 2020-04-22 11:52:27 +08:00
Qu Xuan
b0b58648a6 fix: 尽量避免因代理问题导致google request异常 2020-04-22 10:48:26 +08:00
Zexi Li
04879cbc2f Merge pull request #5894 from swordqiu/automated-cherry-pick-of-#5890-upstream-release-3.2
Automated cherry pick of #5890: fix: policy details should carry updated_at and created_at fields
2020-04-22 10:39:32 +08:00
Zexi Li
058dd98a6c Merge pull request #5899 from swordqiu/automated-cherry-pick-of-#5895-upstream-release-3.2
Automated cherry pick of #5895: fix: delete idp also delete users/groups in target domain
2020-04-22 10:34:13 +08:00
Zexi Li
d3caf76dd1 Merge pull request #5885 from ioito/automated-cherry-pick-of-#5884-upstream-release-3.2
Automated cherry pick of #5884: fix: 仅当变更domainId时才需要更新projectId
2020-04-22 10:32:33 +08:00
Qiu Jian
895f161417 fix: delete idp also delete users/groups in target domain 2020-04-22 10:17:58 +08:00
Qiu Jian
f0ab47058f fix: policy details should carry updated_at and created_at fields 2020-04-21 22:44:07 +08:00
Qu Xuan
db8783a51b fix: 仅当变更domainId时才需要更新projectId 2020-04-21 21:14:12 +08:00
Zexi Li
fd67654377 Merge pull request #5876 from swordqiu/automated-cherry-pick-of-#5875-upstream-release-3.2
Automated cherry pick of #5875: fix: list item export recode
2020-04-21 13:03:57 +08:00
Qiu Jian
0edfe50985 fix: list item export recode 2020-04-21 11:46:47 +08:00
Zexi Li
ec78017902 Merge pull request #5874 from swordqiu/automated-cherry-pick-of-#5873-upstream-release-3.2
Automated cherry pick of #5873: fix: cloudaccount is created as system shared by default
2020-04-21 10:27:51 +08:00
Zexi Li
aa01f99ec2 Merge pull request #5878 from swordqiu/automated-cherry-pick-of-#5877-upstream-release-3.2
Automated cherry pick of #5877: fix: adjust scope of isolated_device and reservedips
2020-04-21 10:25:00 +08:00
Qiu Jian
0427445167 fix: adjust scope of isolated_device and reservedips 2020-04-21 00:37:27 +08:00
Qiu Jian
2f6798036f fix: cloudaccount is created as system shared by default 2020-04-20 22:48:50 +08:00
Zexi Li
59b209bec3 Merge pull request #5857 from ioito/automated-cherry-pick-of-#5856-upstream-release-3.2
Automated cherry pick of #5856: fix: show sql connection error
2020-04-20 20:55:32 +08:00
Zexi Li
972cbb15c7 Merge pull request #5855 from rainzm/automated-cherry-pick-of-#5854-upstream-release-3.2
Automated cherry pick of #5854: fix(region): Add CustomizeListFilter for snapshotpolicy
2020-04-20 20:54:41 +08:00
Zexi Li
fae2a304d5 Merge pull request #5871 from rainzm/automated-cherry-pick-of-#5870-upstream-release-3.2
Automated cherry pick of #5870: fix(region): Fix problems for Auto Scaling
2020-04-20 20:53:39 +08:00
Zexi Li
0c2dfa3027 Merge pull request #5864 from zhaoxiangchun/automated-cherry-pick-of-#5863-upstream-release-3.2
Automated cherry pick of #5863: 优化邮件格式
2020-04-20 20:53:07 +08:00
Zexi Li
5272cd132f Merge pull request #5869 from tb365/automated-cherry-pick-of-#5865-upstream-release-3.2
Automated cherry pick of #5865: lblis & lbbg & lbr & lbb create add fetch owner id
2020-04-20 20:51:28 +08:00
zhaoxiangchun
bcce808981 优化邮件格式
1.邮件主题中的报警级别和web页面进行对应
2.向onecloud发送邮件时,通过html/template进行格式化
2020-04-20 20:35:30 +08:00
Rain
bccb6d10eb fix(region): Fix problems for Auto Scaling
1. 支持 scaling group 根据 enable 过滤
2. 周期策略返回开始时间
3. scaling controller 在创建机器之前先调用 scheduler 的 forcast 接口
4. 修复健康状态检查的一个问题
2020-04-20 19:42:51 +08:00
tangbin
c59c4e314a lblis & lbbg & lbr & lbb create add fetch owner id 2020-04-20 19:31:42 +08:00
Rain
6506002703 fix(region): Add CustomizeListFilter for snapshotpolicy 2020-04-20 17:34:25 +08:00
Qu Xuan
58e2d71f15 fix: show sql connection error 2020-04-20 16:49:32 +08:00
675 changed files with 15100 additions and 20643 deletions

View File

@@ -291,9 +291,11 @@ gen-swagger: gen-swagger-check
$(ROOT_DIR)/scripts/codegen.py swagger-code
$(ROOT_DIR)/scripts/codegen.py swagger-yaml
swagger-serve: gen-model-api gen-swagger
swagger-serve-only:
$(ROOT_DIR)/scripts/codegen.py swagger-serve
swagger-serve: gen-model-api gen-swagger swagger-serve-only
swagger-site: gen-model-api gen-swagger
$(ROOT_DIR)/scripts/codegen.py swagger-site

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
SMS_126915025

View File

@@ -26,6 +26,28 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func parseGcpCredential(filename string) (jsonutils.JSONObject, error) {
data, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
authParams, err := jsonutils.Parse(data)
if err != nil {
return nil, err
}
ret := jsonutils.NewDict()
for _, k := range []string{
"client_email",
"project_id",
"private_key_id",
"private_key",
} {
v, _ := authParams.Get(k)
ret.Add(v, fmt.Sprintf("gcp_%s", k))
}
return ret, nil
}
func init() {
type CloudaccountListOptions struct {
@@ -33,6 +55,7 @@ func init() {
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
DistinctField string `help:"distinct field"`
ProxySetting string `help:"Proxy setting id or name"`
}
R(&CloudaccountListOptions{}, "cloud-account-list", "List cloud accounts", func(s *mcclient.ClientSession, args *CloudaccountListOptions) error {
var params *jsonutils.JSONDict
@@ -45,6 +68,9 @@ func init() {
if len(args.Capability) > 0 {
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
}
if len(args.ProxySetting) > 0 {
params.Add(jsonutils.NewString(args.ProxySetting), "proxy_setting")
}
}
if len(args.DistinctField) > 0 {
params.Add(jsonutils.NewString(args.DistinctField), "extra_field")
@@ -149,11 +175,7 @@ func init() {
R(&options.SGoogleCloudAccountCreateOptions{}, "cloud-account-create-google", "Create a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountCreateOptions) error {
params := jsonutils.Marshal(args)
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("Google"), "provider")
data, err := ioutil.ReadFile(args.GoogleJsonFile)
if err != nil {
return err
}
authParams, err := jsonutils.Parse(data)
authParams, err := parseGcpCredential(args.GoogleJsonFile)
if err != nil {
return err
}
@@ -699,11 +721,7 @@ func init() {
})
R(&options.SGoogleCloudAccountUpdateCredentialOptions{}, "cloud-account-update-credential-google", "Update credential of a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateCredentialOptions) error {
data, err := ioutil.ReadFile(args.GoogleJsonFile)
if err != nil {
return err
}
params, err := jsonutils.Parse(data)
params, err := parseGcpCredential(args.GoogleJsonFile)
if err != nil {
return err
}
@@ -826,11 +844,7 @@ func init() {
})
R(&options.SGoogleCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-google", "Update credential of a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateCredentialOptions) error {
data, err := ioutil.ReadFile(args.GoogleJsonFile)
if err != nil {
return err
}
params, err := jsonutils.Parse(data)
params, err := parseGcpCredential(args.GoogleJsonFile)
if err != nil {
return err
}
@@ -1027,4 +1041,12 @@ func init() {
return nil
})
R(&CloudaccountShowOptions{}, "cloud-account-change-owner-candidate-domains", "Show candiate domains of a cloud account changing project", func(s *mcclient.ClientSession, args *CloudaccountShowOptions) error {
result, err := modules.Cloudaccounts.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -34,6 +34,7 @@ func init() {
HasObjectStorage bool `help:"filter cloudproviders that has object storage"`
NoObjectStorage bool `help:"filter cloudproviders that has no object storage"`
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
Cloudregion string `help:"filter cloudproviders by cloudregion"`
}
R(&CloudproviderListOptions{}, "cloud-provider-list", "List cloud providers", func(s *mcclient.ClientSession, args *CloudproviderListOptions) error {
var params *jsonutils.JSONDict
@@ -57,6 +58,10 @@ func init() {
if len(args.Capability) > 0 {
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
}
if len(args.Cloudregion) > 0 {
params.Add(jsonutils.NewString(args.Cloudregion), "cloudregion")
}
}
result, err := modules.Cloudproviders.List(s, params)
if err != nil {
@@ -245,4 +250,13 @@ func init() {
printObject(result)
return nil
})
R(&CloudproviderShowOptions{}, "cloud-provider-change-owner-candidate-domains", "Show candiate domains of a cloud provider changing owner", func(s *mcclient.ClientSession, args *CloudproviderShowOptions) error {
result, err := modules.Cloudproviders.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -15,7 +15,14 @@
package shell
import (
"bufio"
"bytes"
"encoding/base64"
"fmt"
"io/ioutil"
"mime/multipart"
"net/http"
"path/filepath"
"yunion.io/x/jsonutils"
@@ -56,4 +63,78 @@ func init() {
printObject(r)
return nil
})
type EnterpriseUpdateOptions struct {
Name string `help:"Enterprise name"`
Copyright string `help:"The Email"`
Logo string `help:"logo file path"`
LoginLogo string `help:"login page logo file path"`
Favicon string `help:"favicon path"`
}
R(&EnterpriseUpdateOptions{}, "infos-update", "update enterprise info", func(s *mcclient.ClientSession, args *EnterpriseUpdateOptions) error {
var b bytes.Buffer
w := multipart.NewWriter(&b)
if len(args.Name) > 0 {
w.WriteField("name", args.Name)
}
if len(args.Copyright) > 0 {
w.WriteField("copyright", args.Copyright)
}
writeFile := func(filedName, filePath string) error {
if len(filePath) == 0 {
return nil
}
c, err := ioutil.ReadFile(filePath)
if err != nil {
return err
}
var v string
c64 := base64.StdEncoding.EncodeToString(c)
ext := filepath.Ext(filePath)
switch ext {
case ".png":
v = fmt.Sprintf("data:image/png;base64,%s", c64)
case ".jpg":
v = fmt.Sprintf("data:image/jpg;base64,%s", c64)
default:
return fmt.Errorf("only support png/jpg image")
}
err = w.WriteField(filedName, v)
if err != nil {
return err
}
return nil
}
if err := writeFile("logo", args.Logo); err != nil {
return err
}
if err := writeFile("login_logo", args.LoginLogo); err != nil {
return err
}
if err := writeFile("favicon", args.Favicon); err != nil {
return err
}
header := make(http.Header)
header.Set("content-type", fmt.Sprintf("multipart/form-data; boundary=%s", w.Boundary()))
w.Close()
ret, err := modules.Info.Update(s, header, bufio.NewReader(&b))
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -38,7 +38,11 @@ func init() {
if err != nil {
return err
}
printList(result, modules.DBInstanceBackups.GetColumns(s))
if len(opts.ExportFile) > 0 {
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.DBInstanceBackups.GetColumns(s))
} else {
printList(result, modules.DBInstanceBackups.GetColumns(s))
}
return nil
})

View File

@@ -41,7 +41,12 @@ func init() {
if err != nil {
return err
}
printList(result, modules.DBInstance.GetColumns(s))
if len(opts.ExportFile) > 0 {
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.DBInstance.GetColumns(s))
} else {
printList(result, modules.DBInstance.GetColumns(s))
}
return nil
})

View File

@@ -291,4 +291,14 @@ func init() {
printObject(srv)
return nil
})
R(&DiskDetailOptions{}, "disk-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *DiskDetailOptions) error {
result, err := modules.Disks.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -64,14 +64,15 @@ func init() {
})
type EndpointCreateOptions struct {
SERVICE string `help:"Service ID or Name"`
REGION string `help:"Region"`
INTERFACE string `help:"Interface types" choices:"internal|public|admin|console"`
URL string `help:"URL"`
Zone string `help:"Zone"`
Name string `help:"Name"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
SERVICE string `help:"Service ID or Name"`
REGION string `help:"Region"`
INTERFACE string `help:"Interface types" choices:"internal|public|admin|console"`
URL string `help:"URL"`
Zone string `help:"Zone"`
Name string `help:"Name"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
ServiceCertificate string `help:"Service certificate id or name"`
}
R(&EndpointCreateOptions{}, "endpoint-create", "Create endpoint", func(s *mcclient.ClientSession, args *EndpointCreateOptions) error {
params := jsonutils.NewDict()
@@ -95,6 +96,9 @@ func init() {
} else if !args.Enabled && args.Disabled {
params.Add(jsonutils.JSONFalse, "enabled")
}
if len(args.ServiceCertificate) > 0 {
params.Add(jsonutils.NewString(args.ServiceCertificate), "service_certificate")
}
ep, err := modules.EndpointsV3.Create(s, params)
if err != nil {
return err
@@ -104,11 +108,12 @@ func init() {
})
type EndpointUpdateOptions struct {
ID string `help:"ID or name of endpoint"`
Url string `help:"URL"`
Name string `help:"Name"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
ID string `help:"ID or name of endpoint"`
Url string `help:"URL"`
Name string `help:"Name"`
Enabled bool `help:"Enabled"`
Disabled bool `help:"Disabled"`
ServiceCertificate string `help:"Service certificate id or name"`
}
R(&EndpointUpdateOptions{}, "endpoint-update", "Update a endpoint", func(s *mcclient.ClientSession, args *EndpointUpdateOptions) error {
params := jsonutils.NewDict()
@@ -123,6 +128,9 @@ func init() {
} else if !args.Enabled && args.Disabled {
params.Add(jsonutils.JSONFalse, "enabled")
}
if len(args.ServiceCertificate) > 0 {
params.Add(jsonutils.NewString(args.ServiceCertificate), "service_certificate")
}
ep, err := modules.EndpointsV3.Patch(s, args.ID, params)
if err != nil {
return err

View File

@@ -34,8 +34,8 @@ type BaseEventListOptions struct {
OrderBy string `help:"order by specific field"`
Action []string `help:"Log action"`
User []string `help:"filter by operator user"`
Project []string `help:"filter by owner project"`
User string `help:"filter by operator user"`
Project string `help:"filter by owner project"`
PagingMarker string `help:"marker for pagination"`
}
@@ -99,10 +99,10 @@ func doEventList(man modulebase.ResourceManager, s *mcclient.ClientSession, args
params.Add(jsonutils.NewStringArray(args.Action), "action")
}
if len(args.User) > 0 {
params.Add(jsonutils.NewStringArray(args.User), "user")
params.Add(jsonutils.NewString(args.User), "user")
}
if len(args.Project) > 0 {
params.Add(jsonutils.NewStringArray(args.Project), "project")
params.Add(jsonutils.NewString(args.Project), "project")
}
if len(args.Scope) > 0 {
params.Add(jsonutils.NewString(args.Scope), "scope")

View File

@@ -15,6 +15,8 @@
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"
@@ -48,4 +50,32 @@ func init() {
printObject(result)
return nil
})
type GlobalVpcPublicOptions struct {
ID string `help:"ID or name of global vpc" json:"-"`
Scope string `help:"sharing scope" choices:"system|domain"`
SharedDomains []string `help:"share to domains"`
}
R(&GlobalVpcPublicOptions{}, "global-vpc-public", "Make global vpc public", func(s *mcclient.ClientSession, args *GlobalVpcPublicOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.GlobalVpcs.PerformAction(s, args.ID, "public", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type GlobalVpcPrivateOptions struct {
ID string `help:"ID or name of global vpc" json:"-"`
}
R(&GlobalVpcPrivateOptions{}, "global-vpc-private", "Make global vpc private", func(s *mcclient.ClientSession, args *GlobalVpcPrivateOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.GlobalVpcs.PerformAction(s, args.ID, "private", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -224,4 +224,29 @@ func init() {
printObject(sp)
return nil
})
type GroupAddUsersOptions struct {
GROUP string `help:"group Id or Name" json:"-"`
USER []string `help:"list of user id or name" json:"user"`
}
R(&GroupAddUsersOptions{}, "group-add-users", "Add users into group",
func(s *mcclient.ClientSession, args *GroupAddUsersOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Groups.PerformAction(s, args.GROUP, "add-users", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&GroupAddUsersOptions{}, "group-remove-users", "Add users into group",
func(s *mcclient.ClientSession, args *GroupAddUsersOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Groups.PerformAction(s, args.GROUP, "remove-users", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -793,4 +793,26 @@ func init() {
printObject(result)
return nil
})
type HostAutoMigrateOnHostDownOptions struct {
ID string `help:"ID or name of host"`
Enable bool `help:"enable auto migrate"`
Disable bool `help:"disable auto migrate"`
}
R(&HostAutoMigrateOnHostDownOptions{}, "host-auto-migrate-on-host-down", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *HostAutoMigrateOnHostDownOptions) error {
params := jsonutils.NewDict()
if args.Disable {
params.Set("auto_migrate_on_host_down", jsonutils.NewString("disable"))
} else if args.Enable {
params.Set("auto_migrate_on_host_down", jsonutils.NewString("enable"))
} else {
return fmt.Errorf("missing input enable or disable")
}
result, err := modules.Hosts.PerformAction(s, args.ID, "auto-migrate-on-host-down", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -34,6 +34,7 @@ type ImageOptionalOptions struct {
Unprotected bool `help:"Allow image to be deleted"`
Standard bool `help:"Mark image as a standard image"`
Nonstandard bool `help:"Mark image as a non-standard image"`
Public bool `help:"make image public"`
MinDisk int64 `help:"Disk size after expanded, in MB" metavar:"MIN_DISK_SIZE_MB"`
MinRam int64 `help:"Minimal memory size required" metavar:"MIN_RAM_MB"`
VirtualSize int64 `help:"Disk size after expanded, in MB"`
@@ -57,7 +58,6 @@ type ImageOptionalOptions struct {
func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDict, args ImageOptionalOptions) error {
if len(args.Format) > 0 {
params.Add(jsonutils.NewString("bare"), "container-format")
params.Add(jsonutils.NewString(args.Format), "disk-format")
}
if args.Protected && !args.Unprotected {
@@ -70,6 +70,9 @@ func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDi
} else if !args.Standard && args.Nonstandard {
params.Add(jsonutils.JSONFalse, "is_standard")
}
if args.Public {
params.Add(jsonutils.JSONTrue, "is_public")
}
if args.MinDisk > 0 {
params.Add(jsonutils.NewString(fmt.Sprintf("%d", args.MinDisk)), "min_disk")
}
@@ -140,6 +143,7 @@ func init() {
Protected string `help:"filter images by protected" choices:"true|false"`
IsUefi bool `help:"list uefi image"`
Format []string `help:"Disk formats"`
SubFormats []string `help:"Sub formats"`
Name string `help:"Name filter"`
}
R(&ImageListOptions{}, "image-list", "List images", func(s *mcclient.ClientSession, args *ImageListOptions) error {
@@ -170,15 +174,14 @@ func init() {
params.Add(jsonutils.NewString(args.Name), "name")
}
if len(args.Format) > 0 {
if len(args.Format) == 1 {
params.Add(jsonutils.NewString(args.Format[0]), "disk_format")
} else {
fs := jsonutils.NewArray()
for _, f := range args.Format {
fs.Add(jsonutils.NewString(f))
}
params.Add(fs, "disk_formats")
fs := jsonutils.NewArray()
for _, f := range args.Format {
fs.Add(jsonutils.NewString(f))
}
params.Add(fs, "disk_formats")
}
if len(args.SubFormats) > 0 {
params.Add(jsonutils.Marshal(args.SubFormats), "sub_formats")
}
result, err := modules.Images.List(s, params)
if err != nil {
@@ -244,22 +247,6 @@ func init() {
return nil
})
type ImageMembershipOptions struct {
IMAGE string `help:"ID or name of image to share"`
PROJECT string `help:"ID or name of project to share image with"`
}
type ImageMembershipAddOptions struct {
ImageMembershipOptions
CanShare bool `help:"Indicating whether the project can share the image with others"`
}
R(&ImageMembershipAddOptions{}, "image-add-project", "Add a project to private image's membership list", func(s *mcclient.ClientSession, args *ImageMembershipAddOptions) error {
return modules.Images.AddMembership(s, args.IMAGE, args.PROJECT, args.CanShare)
})
R(&ImageMembershipOptions{}, "image-remove-project", "Remove a project from private image's membership list", func(s *mcclient.ClientSession, args *ImageMembershipOptions) error {
return modules.Images.RemoveMembership(s, args.IMAGE, args.PROJECT)
})
type ImageDetailOptions struct {
ID string `help:"Image ID or name"`
}
@@ -278,19 +265,6 @@ func init() {
return nil
})
R(&ImageDetailOptions{}, "image-list-project", "List image members", func(s *mcclient.ClientSession, args *ImageDetailOptions) error {
imgId, e := modules.Images.GetId(s, args.ID, nil)
if e != nil {
return e
}
result, e := modules.Images.ListMemberProjects(s, imgId)
if e != nil {
return e
}
printList(result, modules.Projects.GetColumns(s))
return nil
})
type ImageCancelDeleteOptions struct {
ID string `help:"Image id or name" metavar:"IMAGE"`
}

View File

@@ -99,4 +99,13 @@ func init() {
return nil
})
R(&options.LoadbalancerGetOptions{}, "lb-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *options.LoadbalancerGetOptions) error {
result, err := modules.Loadbalancers.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -38,6 +38,7 @@ func init() {
City string `help:"search networks belongs to a city"`
Usable *bool `help:"search usable networks"`
ServerType string `help:"search networks belongs to a ServerType" choices:"guest|baremetal|container|pxe|ipmi"`
Schedtag string `help:"filter networks by schedtag"`
Status string `help:"filter by network status"`
}
@@ -55,7 +56,11 @@ func init() {
if err != nil {
return err
}
printList(result, modules.Networks.GetColumns(s))
if len(opts.ExportFile) > 0 {
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.Networks.GetColumns(s))
} else {
printList(result, modules.Networks.GetColumns(s))
}
return nil
})
@@ -405,4 +410,21 @@ func init() {
printObject(result)
return nil
})
type NetworkChangeOwnerOptions struct {
ID string `help:"Network to change owner" json:"-"`
PROJECT string `help:"Project ID or change" json:"tenant"`
}
R(&NetworkChangeOwnerOptions{}, "network-change-owner", "Change owner project of a network", func(s *mcclient.ClientSession, args *NetworkChangeOwnerOptions) error {
params, err := options.StructToParams(args)
if err != nil {
return err
}
net, err := modules.Networks.PerformAction(s, args.ID, "change-owner", params)
if err != nil {
return err
}
printObject(net)
return nil
})
}

View File

@@ -15,6 +15,7 @@
package shell
import (
"context"
"fmt"
"io/ioutil"
"strings"
@@ -363,7 +364,7 @@ func init() {
token = s.GetToken()
}
result, err := policy.PolicyManager.ExplainRpc(token, req, args.Name)
result, err := policy.ExplainRpc(context.Background(), token, req, args.Name)
if err != nil {
return err
}
@@ -377,7 +378,7 @@ func init() {
rbacutils.ScopeUser,
rbacutils.ScopeNone,
} {
m := policy.PolicyManager.MatchedPolicies(scope, token)
m := policy.PolicyManager.MatchedPolicyNames(scope, token)
fmt.Println("matched", scope, "policies:", m)
}

View File

@@ -41,6 +41,20 @@ func init() {
printList(result, modules.ScalingGroup.GetColumns(s))
return nil
})
type ScalingGroupShowOptions struct {
ID string
}
R(&ScalingGroupShowOptions{}, "scaling-group-show", "Show scaling group", func(s *mcclient.ClientSession,
args *ScalingGroupShowOptions) error {
result, err := modules.ScalingGroup.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type ScalingGroupCreateOptions struct {
NAME string

View File

@@ -988,6 +988,7 @@ func init() {
config.Hosts[i].HostIp = yamlConfig.Hosts[i].HostIp
config.Hosts[i].XmlFilePath = yamlConfig.Hosts[i].XmlFilePath
config.Hosts[i].Servers = make([]compute.SLibvirtServerConfig, len(yamlConfig.Hosts[i].Servers))
config.Hosts[i].MonitorPath = yamlConfig.Hosts[i].MonitorPath
for j := 0; j < len(yamlConfig.Hosts[i].Servers); j++ {
config.Hosts[i].Servers[j].MacIp = make(map[string]string)
mac := yamlConfig.Hosts[i].Servers[j].Mac
@@ -1010,11 +1011,11 @@ func init() {
if err != nil {
return err
}
for i := 0; i < len(params); i++ {
val := jsonutils.NewDict()
val.Set(modules.Servers.KeywordPlural, params[i])
params[i] = val
}
//for i := 0; i < len(params); i++ {
// val := jsonutils.NewDict()
// val.Set(modules.Servers.KeywordPlural, params[i])
// params[i] = val
//}
results := modules.Servers.BatchPerformClassAction(s, "import-from-libvirt", params)
printBatchResults(results, modules.Servers.GetColumns(s))
@@ -1349,4 +1350,14 @@ func init() {
printObject(result)
return nil
})
R(&options.ServerShowOptions{}, "server-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *options.ServerShowOptions) error {
result, err := modules.Servers.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -0,0 +1,72 @@
// 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/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type ServerSecgroupListOptions struct {
options.BaseListOptions
Server string `help:"ID or Name of Server"`
Secgroup string `help:"Secgroup ID or name"`
}
R(&ServerSecgroupListOptions{}, "server-secgroup-list", "List server secgroup pairs", func(s *mcclient.ClientSession, args *ServerSecgroupListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
var result *modulebase.ListResult
var err error
if len(args.Server) > 0 {
result, err = modules.Serversecgroups.ListDescendent(s, args.Server, params)
} else if len(args.Secgroup) > 0 {
result, err = modules.Serversecgroups.ListDescendent2(s, args.Secgroup, params)
} else {
result, err = modules.Serversecgroups.List(s, params)
}
if err != nil {
return err
}
printList(result, modules.Serversecgroups.GetColumns(s))
return nil
})
type ServerSecgroupDetailOptions struct {
SERVER string `help:"ID or Name of Server"`
SECGROUP string `help:"ID or Name of Security Group"`
}
R(&ServerSecgroupDetailOptions{}, "server-secgroup-show", "Show server security group details", func(s *mcclient.ClientSession, args *ServerSecgroupDetailOptions) error {
query := jsonutils.NewDict()
result, err := modules.Serversecgroups.Get(s, args.SERVER, args.SECGROUP, query)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -0,0 +1,60 @@
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() {
R(&options.ServiceCertificateCreateOptions{}, "service-cert-create", "Create service cert", func(s *mcclient.ClientSession, opts *options.ServiceCertificateCreateOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
cert, err := modules.ServiceCertificatesV3.Create(s, params)
if err != nil {
return err
}
printObject(cert)
return nil
})
type ServiceCertificateGetOptions struct {
ID string `json:"-"`
}
R(&ServiceCertificateGetOptions{}, "service-cert-show", "Show service cert", func(s *mcclient.ClientSession, opts *ServiceCertificateGetOptions) error {
cert, err := modules.ServiceCertificatesV3.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(cert)
return nil
})
type ServiceCertificateListOptions struct {
options.BaseListOptions
}
R(&ServiceCertificateListOptions{}, "service-cert-list", "List service certs", func(s *mcclient.ClientSession, opts *ServiceCertificateListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.ServiceCertificatesV3.List(s, params)
if err != nil {
return err
}
printList(result, modules.ServiceCertificatesV3.GetColumns(s))
return nil
})
type ServiceCertificateDeleteOptions struct {
ID string `json:"-"`
}
R(&ServiceCertificateDeleteOptions{}, "service-cert-delete", "Delete service cert", func(s *mcclient.ClientSession, opts *ServiceCertificateDeleteOptions) error {
cert, err := modules.ServiceCertificatesV3.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(cert)
return nil
})
}

View File

@@ -25,13 +25,15 @@ import (
func init() {
type ServerSkusListOptions struct {
options.BaseListOptions
Cloudregion string `help:"region Id or name"`
Usable bool `help:"Filter usable sku"`
Zone string `help:"zone Id or name"`
City *string `help:"city name,eg. BeiJing"`
Cpu *int `help:"Cpu core count" json:"cpu_core_count"`
Mem *int `help:"Memory size in MB" json:"memory_size_mb"`
Name string `help:"Name of Sku"`
Cloudregion string `help:"region Id or name"`
Usable bool `help:"Filter usable sku"`
Zone string `help:"zone Id or name"`
City *string `help:"city name,eg. BeiJing"`
Cpu *int `help:"Cpu core count" json:"cpu_core_count"`
Mem *int `help:"Memory size in MB" json:"memory_size_mb"`
Name string `help:"Name of Sku"`
PostpaidStatus string `help:"Postpaid status" choices:"soldout|available"`
PrepaidStatus string `help:"Prepaid status" choices:"soldout|available"`
}
R(&ServerSkusListOptions{}, "server-sku-list", "List all avaiable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusListOptions) error {

View File

@@ -29,11 +29,12 @@ func init() {
type StorageListOptions struct {
options.BaseListOptions
Share *bool `help:"Share storage list"`
Local *bool `help:"Local storage list"`
Usable *bool `help:"Usable storage list"`
Zone string `help:"List storages in zone" json:"-"`
Region string `help:"List storages in region"`
Share *bool `help:"Share storage list"`
Local *bool `help:"Local storage list"`
Usable *bool `help:"Usable storage list"`
Zone string `help:"List storages in zone" json:"-"`
Region string `help:"List storages in region"`
Schedtag string `help:"filter storage by schedtag"`
}
R(&StorageListOptions{}, "storage-list", "List storages", func(s *mcclient.ClientSession, opts *StorageListOptions) error {
params, err := options.ListStructToParams(opts)
@@ -215,4 +216,63 @@ func init() {
printObject(storage)
return nil
})
type StorageChangeOwnerOptions struct {
ID string `help:"ID or name of storage" json:"-"`
ProjectDomain string `json:"project_domain" help:"target domain"`
}
R(&StorageChangeOwnerOptions{}, "storage-change-owner", "Change owner domain of storage", func(s *mcclient.ClientSession, args *StorageChangeOwnerOptions) error {
if len(args.ProjectDomain) == 0 {
return fmt.Errorf("empty project_domain")
}
params := jsonutils.Marshal(args)
ret, err := modules.Storages.PerformAction(s, args.ID, "change-owner", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
type StorageForceDetachHost struct {
ID string `help:"ID or name of storage" json:"-"`
Host string `help:"ID or name of host"`
}
R(&StorageForceDetachHost{}, "storage-public", "Force detach host", func(s *mcclient.ClientSession, args *StorageForceDetachHost) error {
params := jsonutils.Marshal(args)
result, err := modules.Storages.PerformAction(s, args.ID, "force-detach-host", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type StoragePublicOptions struct {
ID string `help:"ID or name of storage" json:"-"`
Scope string `help:"sharing scope" choices:"system|domain"`
SharedDomains []string `help:"share to domains"`
}
R(&StoragePublicOptions{}, "storage-public", "Make a storage public", func(s *mcclient.ClientSession, args *StoragePublicOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Storages.PerformAction(s, args.ID, "public", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type StoragePrivateOptions struct {
ID string `help:"ID or name of storage" json:"-"`
}
R(&StoragePrivateOptions{}, "storage-private", "Make a storage private", func(s *mcclient.ClientSession, args *StoragePrivateOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Storages.PerformAction(s, args.ID, "private", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -40,7 +40,11 @@ func init() {
if err != nil {
return err
}
printList(result, modules.UsersV3.GetColumns(s))
if len(args.ExportFile) > 0 {
exportList(result, args.ExportFile, args.ExportKeys, args.ExportTexts, modules.UsersV3.GetColumns(s))
} else {
printList(result, modules.UsersV3.GetColumns(s))
}
return nil
})

View File

@@ -15,6 +15,8 @@
package shell
import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
@@ -47,7 +49,11 @@ func init() {
return err
}
printList(result, modules.Vpcs.GetColumns(s))
if len(opts.ExportFile) > 0 {
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.Vpcs.GetColumns(s))
} else {
printList(result, modules.Vpcs.GetColumns(s))
}
return nil
})
@@ -214,4 +220,21 @@ func init() {
printObject(result)
return nil
})
type VpcChangeOwnerOptions struct {
ID string `help:"ID or name of vpc" json:"-"`
ProjectDomain string `json:"project_domain" help:"target domain"`
}
R(&VpcChangeOwnerOptions{}, "vpc-change-owner", "Change owner domain of vpc", func(s *mcclient.ClientSession, args *VpcChangeOwnerOptions) error {
if len(args.ProjectDomain) == 0 {
return fmt.Errorf("empty project_domain")
}
params := jsonutils.Marshal(args)
ret, err := modules.Vpcs.PerformAction(s, args.ID, "change-owner", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

5
go.mod
View File

@@ -3,7 +3,6 @@ module yunion.io/x/onecloud
go 1.12
require (
cloud.google.com/go v0.50.0
cloud.google.com/go/storage v1.5.0
github.com/360EntSecGroup-Skylar/excelize v1.4.0
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible
@@ -130,10 +129,10 @@ require (
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
yunion.io/x/jsonutils v0.0.0-20200415132054-2bf8a5e94501
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
yunion.io/x/pkg v0.0.0-20200416145704-22c189971435
yunion.io/x/pkg v0.0.0-20200516092703-0a53bc9270aa
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
yunion.io/x/structarg v0.0.0-20200423163001-168d0687be7e
)
replace (

8
go.sum
View File

@@ -1116,11 +1116,11 @@ yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200416145704-22c189971435 h1:Fwf1rjdl+Qmw9BNxQN7wi2lQpYVExV7eBLifd0emHaI=
yunion.io/x/pkg v0.0.0-20200416145704-22c189971435/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200516092703-0a53bc9270aa h1:VizPfW8+mLFEE7W/97zxQJbfdxchi2dn1M/Y7YBwTTc=
yunion.io/x/pkg v0.0.0-20200516092703-0a53bc9270aa/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-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=
yunion.io/x/structarg v0.0.0-20200423163001-168d0687be7e h1:pctCe/EPel3F1B83pJ2q9b34Umd1NdbLW1Yd+Lzur2s=
yunion.io/x/structarg v0.0.0-20200423163001-168d0687be7e/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=

View File

@@ -16,6 +16,7 @@ package handler
import (
"context"
"encoding/base64"
"fmt"
"net/http"
"strings"
@@ -269,6 +270,10 @@ func (h *AuthHandlers) doCredentialLogin(ctx context.Context, req *http.Request,
if err != nil {
return nil, httperrors.NewInputParameterError("get password in body")
}
// try base64 decryption
if decPasswd, err := base64.StdEncoding.DecodeString(passwd); err == nil {
passwd = string(decPasswd)
}
if len(uname) == 0 || len(passwd) == 0 {
return nil, httperrors.NewInputParameterError("username or password is empty")
}
@@ -314,6 +319,35 @@ func (h *AuthHandlers) doCredentialLogin(ctx context.Context, req *http.Request,
}
}
}
if len(tenant) == 0 {
token3, ok := token.(*mcclient.TokenCredentialV3)
if ok {
targetLevel := rbacutils.ScopeProject
targetProjId := ""
for _, r := range token3.Token.RoleAssignments {
level := rbacutils.ScopeProject
if len(r.Policies.System) > 0 {
level = rbacutils.ScopeSystem
} else if len(r.Policies.Domain) > 0 {
level = rbacutils.ScopeDomain
}
if len(targetProjId) == 0 || level.HigherThan(targetLevel) {
targetProjId = r.Scope.Project.Id
targetLevel = level
}
}
if len(targetProjId) > 0 {
ntoken, e := auth.Client().SetProject(targetProjId, "", "", token)
if e != nil {
log.Errorf("fail to change to project %s(%s), reset to empty", targetProjId, e)
} else {
token = ntoken
tenant = targetProjId
body.(*jsonutils.JSONDict).Set("scope", jsonutils.NewString(string(targetLevel)))
}
}
}
}
if len(tenant) == 0 {
s := auth.GetAdminSession(ctx, FetchRegion(req), "")
projects, e := modules.UsersV3.GetProjects(s, token.GetUserId())
@@ -367,7 +401,7 @@ func isUserAllowWebconsole(ctx context.Context, w http.ResponseWriter, req *http
return true
}
func saveCookie(w http.ResponseWriter, name, val string, expire time.Time, base64 bool) {
func saveCookie(w http.ResponseWriter, name, val, domain string, expire time.Time, base64 bool) {
diff := time.Until(expire)
maxAge := int(diff.Seconds())
// log.Println("Set cookie", name, expire, maxAge, val)
@@ -379,6 +413,11 @@ func saveCookie(w http.ResponseWriter, name, val string, expire time.Time, base6
}
// log.Printf("Set coookie: %s - %s\n", val, valenc)
cookie := &http.Cookie{Name: name, Value: valenc, Path: "/", Expires: expire, MaxAge: maxAge, HttpOnly: false}
if len(domain) > 0 {
cookie.Domain = domain
}
http.SetCookie(w, cookie)
}
@@ -400,8 +439,12 @@ func getCookie(r *http.Request, name string) string {
}
}
func clearCookie(w http.ResponseWriter, name string) {
func clearCookie(w http.ResponseWriter, name string, domain string) {
cookie := &http.Cookie{Name: name, Expires: time.Now(), Path: "/", MaxAge: -1, HttpOnly: false}
if len(domain) > 0 {
cookie.Domain = domain
}
http.SetCookie(w, cookie)
}
@@ -458,7 +501,7 @@ func (h *AuthHandlers) postLoginHandler(ctx context.Context, w http.ResponseWrit
httperrors.GeneralServerError(w, err)
return
}
saveCookie(w, constants.YUNION_AUTH_COOKIE, authCookie, token.GetExpires(), true)
saveCookie(w, constants.YUNION_AUTH_COOKIE, authCookie, options.Options.CookieDomain, token.GetExpires(), true)
if len(token.GetProjectId()) > 0 {
if body.Contains("isadmin") {
@@ -466,20 +509,20 @@ func (h *AuthHandlers) postLoginHandler(ctx context.Context, w http.ResponseWrit
if policy.PolicyManager.IsScopeCapable(token, rbacutils.ScopeSystem) {
adminVal, _ = body.GetString("isadmin")
}
saveCookie(w, "isadmin", adminVal, token.GetExpires(), false)
saveCookie(w, "isadmin", adminVal, "", token.GetExpires(), false)
}
if body.Contains("scope") {
scopeStr, _ := body.GetString("scope")
if !policy.PolicyManager.IsScopeCapable(token, rbacutils.TRbacScope(scopeStr)) {
scopeStr = string(rbacutils.ScopeProject)
}
saveCookie(w, "scope", scopeStr, token.GetExpires(), false)
saveCookie(w, "scope", scopeStr, "", token.GetExpires(), false)
}
if body.Contains("domain") {
domainStr, _ := body.GetString("domain")
saveCookie(w, "domain", domainStr, token.GetExpires(), false)
saveCookie(w, "domain", domainStr, "", token.GetExpires(), false)
}
saveCookie(w, "tenant", token.GetProjectId(), token.GetExpires(), false)
saveCookie(w, "tenant", token.GetProjectId(), "", token.GetExpires(), false)
}
setAuthHeader(w, tid)
@@ -502,7 +545,7 @@ func (h *AuthHandlers) postLogoutHandler(ctx context.Context, w http.ResponseWri
if len(tid) > 0 {
clientman.TokenMan.Remove(tid)
}
clearCookie(w, constants.YUNION_AUTH_COOKIE)
clearCookie(w, constants.YUNION_AUTH_COOKIE, options.Options.CookieDomain)
appsrv.Send(w, "")
}
@@ -533,14 +576,6 @@ func FetchRegion(req *http.Request) string {
return ""
}
func fetchDomain(req *http.Request) string {
r, e := req.Cookie("domain")
if e != nil {
return ""
}
return r.Value
}
type role struct {
id string
name string
@@ -570,6 +605,7 @@ func (this *projectRoles) add(roleId, roleName string) {
func (this *projectRoles) getToken(scope rbacutils.TRbacScope, user, userId, domain, domainId string, ip string) mcclient.TokenCredential {
return &mcclient.SSimpleToken{
Token: "faketoken",
Domain: domain,
DomainId: domainId,
User: user,
@@ -609,12 +645,12 @@ func (this *projectRoles) json(user, userId, domain, domainId string, ip string)
}
obj.Add(roles, "roles")
for _, scope := range []rbacutils.TRbacScope{
rbacutils.ScopeSystem,
rbacutils.ScopeDomain,
rbacutils.ScopeProject,
rbacutils.ScopeDomain,
rbacutils.ScopeSystem,
} {
token := this.getToken(scope, user, userId, domain, domainId, ip)
matches := policy.PolicyManager.MatchedPolicies(scope, token)
matches := policy.PolicyManager.MatchedPolicyNames(scope, token)
obj.Add(jsonutils.NewStringArray(matches), fmt.Sprintf("%s_policies", scope))
if len(matches) > 0 {
obj.Add(jsonutils.JSONTrue, fmt.Sprintf("%s_capable", scope))
@@ -646,26 +682,74 @@ func getUserAuthCookie(ctx context.Context, s *mcclient.ClientSession, token mcc
return info.String(), nil
}
func getLBAgentInfo(s *mcclient.ClientSession, token mcclient.TokenCredential) (*jsonutils.JSONDict, error) {
func isLBAgentExists(s *mcclient.ClientSession) (bool, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString("hb_last_seen.isnotempty()"), "filter.0")
params.Add(jsonutils.NewInt(1), "limit")
params.Add(jsonutils.JSONFalse, "details")
lbagents, err := modules.LoadbalancerAgents.List(s, params)
agents, err := modules.LoadbalancerAgents.List(s, params)
if err != nil {
return nil, errors.Wrapf(err, "user %s get lbagent", token.GetUserName())
return false, errors.Wrap(err, "modules.LoadbalancerAgents.List")
}
item := jsonutils.NewDict()
item.Add(jsonutils.NewString(""), "name")
item.Add(jsonutils.NewString("lbagent"), "type")
item.Add(jsonutils.JSONTrue, "as_menu")
if len(lbagents.Data) > 0 {
item.Add(jsonutils.JSONTrue, "status")
if len(agents.Data) > 0 {
return true, nil
} else {
item.Add(jsonutils.JSONFalse, "status")
return false, nil
}
}
func isBaremetalAgentExists(s *mcclient.ClientSession) (bool, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString("agent_type.equals(baremetal)"), "filter.0")
params.Add(jsonutils.NewInt(1), "limit")
params.Add(jsonutils.JSONFalse, "details")
agents, err := modules.Baremetalagents.List(s, params)
if err != nil {
return false, errors.Wrap(err, "modules.Baremetalagents.List")
}
if len(agents.Data) > 0 {
return true, nil
} else {
return false, nil
}
}
func isEsxiAgentExists(s *mcclient.ClientSession) (bool, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString("agent_type.equals(esxiagent)"), "filter.0")
params.Add(jsonutils.NewInt(1), "limit")
params.Add(jsonutils.JSONFalse, "details")
agents, err := modules.Baremetalagents.List(s, params)
if err != nil {
return false, errors.Wrap(err, "modules.Baremetalagents.List esxiagent")
}
if len(agents.Data) > 0 {
return true, nil
} else {
return false, nil
}
}
func isHostAgentExists(s *mcclient.ClientSession) (bool, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.JSONFalse, "show_emulated")
params.Add(jsonutils.JSONFalse, "baremetal")
params.Add(jsonutils.NewString("system"), "scope")
params.Add(jsonutils.NewInt(1), "limit")
params.Add(jsonutils.JSONFalse, "details")
agents, err := modules.Hosts.List(s, params)
if err != nil {
return false, errors.Wrap(err, "modules.LoadbalancerAgents.List")
}
if len(agents.Data) > 0 {
return true, nil
} else {
return false, nil
}
return item, nil
}
func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.TokenCredential, req *http.Request) (*jsonutils.JSONDict, error) {
@@ -741,7 +825,7 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
rbacutils.ScopeDomain,
rbacutils.ScopeProject,
} {
p := policy.PolicyManager.MatchedPolicies(scope, token)
p := policy.PolicyManager.MatchedPolicyNames(scope, token)
data.Add(jsonutils.NewStringArray(p), fmt.Sprintf("%s_policies", scope))
if scope == rbacutils.ScopeSystem {
data.Add(jsonutils.NewStringArray(p), "admin_policies")
@@ -756,43 +840,57 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
menus := jsonutils.NewArray()
k8s := jsonutils.NewArray()
adminToken := auth.AdminCredential()
curReg := FetchRegion(req)
allsrv := adminToken.GetInternalServices(curReg)
alleps := auth.Client().GetServiceCatalog().GetServicesByInterface(curReg, "console")
if allsrv != nil && len(allsrv) > 0 {
for _, srv := range allsrv {
item := jsonutils.NewDict()
item.Add(jsonutils.NewString(""), "name")
item.Add(jsonutils.NewString(srv), "type")
item.Add(jsonutils.JSONTrue, "status")
if srv == "notify" {
item.Add(jsonutils.JSONFalse, "as_menu")
} else {
item.Add(jsonutils.JSONTrue, "as_menu")
}
services.Add(item)
}
} else {
log.Errorf("fail to find services????: %#v %s", adminToken, curReg)
srvCat := auth.Client().GetServiceCatalog()
var allsrv []string
var alleps []mcclient.ExternalService
if srvCat != nil {
allsrv = srvCat.GetInternalServices(curReg)
alleps = srvCat.GetServicesByInterface(curReg, "console")
}
log.Infof("getUserInfo getLBAgentInfo")
lb, err := getLBAgentInfo(s, adminToken)
if err != nil {
log.Errorf("getLBAgentInfo fail %s", err)
} else {
services.Add(lb)
log.Infof("getUserInfo checkAgent exists")
for _, cf := range []struct {
existFunc func(*mcclient.ClientSession) (bool, error)
srvName string
}{
{
existFunc: isLBAgentExists,
srvName: "lbagent",
},
{
existFunc: isBaremetalAgentExists,
srvName: "bmagent",
},
{
existFunc: isHostAgentExists,
srvName: "hostagent",
},
{
existFunc: isEsxiAgentExists,
srvName: "esxiagent",
},
} {
exist, err := cf.existFunc(s)
if err != nil {
log.Errorf("isLBAgentExists fail %s", err)
} else if exist {
allsrv = append(allsrv, cf.srvName)
}
}
if alleps != nil {
for _, ep := range alleps {
item := jsonutils.NewDict()
item.Add(jsonutils.NewString(ep.Url), "url")
item.Add(jsonutils.NewString(ep.Name), "name")
menus.Add(item)
}
for _, srv := range allsrv {
item := jsonutils.NewDict()
item.Add(jsonutils.NewString(srv), "type")
item.Add(jsonutils.JSONTrue, "status")
services.Add(item)
}
for _, ep := range alleps {
item := jsonutils.NewDict()
item.Add(jsonutils.NewString(ep.Url), "url")
item.Add(jsonutils.NewString(ep.Name), "name")
menus.Add(item)
}
log.Infof("getUserInfo modules.Hosts.Get")
@@ -853,7 +951,7 @@ func (h *AuthHandlers) getPermissionDetails(ctx context.Context, w http.Response
if query != nil {
name, _ = query.GetString("policy")
}
result, err := policy.PolicyManager.ExplainRpc(t, body, name)
result, err := policy.ExplainRpc(ctx, t, body, name)
if err != nil {
httperrors.GeneralServerError(w, err)
return
@@ -987,20 +1085,14 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
confirmPwd, _ := body.GetString("password_confirm")
passcode, _ := body.GetString("passcode")
// 1.验证新密码正确
if len(newPwd) < 6 {
httperrors.InputParameterError(w, "new password must have at least 6 characters")
return
}
if newPwd != confirmPwd {
httperrors.InputParameterError(w, "new password mismatch")
return
}
// 2.验证原密码正确且idp_driver为空
// 1.验证原密码正确且idp_driver为空
if isLdapUser(user) {
httperrors.ForbiddenError(w, "not support reset ldap user password")
httperrors.ForbiddenError(w, "not support reset user password")
return
}
@@ -1018,7 +1110,7 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
return
}
// 3.如果已开启MFA验证 随机密码正确
// 2.如果已开启MFA验证 随机密码正确
tid := getAuthToken(req)
if isMfaEnabled(user) {
totp := clientman.TokenMan.GetTotp(tid)
@@ -1029,7 +1121,7 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
}
}
// 4.重置密码清除认证token
// 3.重置密码清除认证token
params := jsonutils.NewDict()
params.Set("password", jsonutils.NewString(newPwd))
ret, err := modules.UsersV3.Patch(s, uid, params)
@@ -1044,7 +1136,7 @@ func (h *AuthHandlers) resetUserPassword(ctx context.Context, w http.ResponseWri
}
func isLdapUser(user jsonutils.JSONObject) bool {
if driver, _ := user.GetString("idp_driver"); driver == "ldap" {
if driver, _ := user.GetString("idp_driver"); len(driver) > 0 {
return true
}

View File

@@ -0,0 +1,19 @@
// 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 handler
import (
_ "yunion.io/x/onecloud/pkg/mcclient/modules/cloudnet"
)

View File

@@ -20,6 +20,7 @@ import (
type GatewayOptions struct {
DefaultRegion string `help:"Use default region while region not specific in api request"`
CookieDomain string `help:"specific yunionauth cookie domain" default:""`
Timeout int `help:"Timeout in seconds, default is 300" default:"300"`

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 baremetal
const (
SERVICE_TYPE = "baremetal"
SERVICE_VERSION = ""
)

View File

@@ -1,4 +1,4 @@
// Copyright 2017, OpenCensus 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,8 +12,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Package ocgrpc contains OpenCensus stats and trace
// integrations for gRPC.
//
// Use ServerHandler for servers and ClientHandler for clients.
package ocgrpc // import "go.opencensus.io/plugin/ocgrpc"
package baremetal // import "yunion.io/x/onecloud/pkg/apis/baremetal"

View File

@@ -22,9 +22,21 @@ import (
)
type CloudeventListInput struct {
apis.VirtualResourceListInput
apis.ModelBaseListInput
compute.ManagedResourceListInput
compute.CloudenvResourceListInput
// 服务类型
Service []string `json:"service"`
// 订阅
Manager []string `json:"manager"`
// 账号
Account []string `json:"account"`
// 操作类型
Action []string `json:"action"`
// 操作日志起始时间
Since time.Time `json:"since"`

View File

@@ -28,4 +28,26 @@ type CachedLoadbalancerAclListInput struct {
apis.SharableVirtualResourceListInput
RegionalFilterListInput
ManagedResourceListInput
LoadbalancerAclFilterListInput
}
type LoadbalancerAclResourceInfo struct {
// 负载均衡ACL名称
Acl string `json:"acl"`
}
type LoadbalancerAclResourceInput struct {
// ACL名称或ID
Acl string `json:"acl"`
// swagger:ignore
// Deprecated
AclId string `json:"acl_id" "yunion:deprecated-by":"acl"`
}
type LoadbalancerAclFilterListInput struct {
LoadbalancerAclResourceInput
// 以ACL名称排序
OrderByAcl string `json:"order_by_acl"`
}

View File

@@ -167,10 +167,11 @@ type CloudaccountCreateInput struct {
IsOnPremise bool
// 指定云账号所属的项目
Tenant string `json:"tenant"`
// Tenant string `json:"tenant"`
// swagger:ignore
TenantId string
// TenantId string
apis.ProjectizedResourceInput
// 启用自动同步
// default: false
@@ -222,6 +223,11 @@ type CloudaccountListInput struct {
// 共享模式
ShareMode []string `json:"share_mode"`
// 代理
ProxySetting string `json:"proxy_setting"`
// swagger:ignore
ProxySettingId string `json:"proxy_setting_id" "yunion:deprecated-by":"proxy_setting"`
}
type ProviderProject struct {
@@ -313,7 +319,7 @@ type CloudaccountUpdateInput struct {
}
type CloudaccountPerformPublicInput struct {
apis.PerformPublicInput
apis.PerformPublicDomainInput
// 共享模式可能值为provider_domain, system
// example: provider_domain

View File

@@ -15,6 +15,7 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/cloudprovider"
)
@@ -103,9 +104,9 @@ const (
)
const (
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN = "account_domain"
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM = "system"
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN = "provider_domain"
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN = apis.CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM = apis.CLOUD_ACCOUNT_SHARE_MODE_SYSTEM
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN = apis.CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN
)
var (

View File

@@ -181,7 +181,7 @@ type ManagedResourceListInput struct {
// 过滤资源是否为非OneCloud内置私有云管理的资源
// default: false
IsManaged bool `json:"is_managed"`
IsManaged *bool `json:"is_managed"`
// 以云账号名称排序
// pattern:asc|desc
@@ -222,6 +222,10 @@ type CloudproviderListInput struct {
UsableResourceListInput
CloudregionResourceInput
ZoneResourceInput
CapabilityListInput
SyncableBaseResourceListInput

View File

@@ -56,6 +56,7 @@ const (
CITY_NAN_JING = "Nanjing" //南京
CITY_FO_SHAN = "Foshan" //佛山
CITY_QUAN_ZHOU = "Quanzhou" //泉州
CITY_NEI_MENG_GU = "Neimenggu" //内蒙古
// 日本
CITY_TOKYO = "Tokyo" //东京
@@ -111,6 +112,7 @@ const (
CITY_US_GOV_WEST = "us-gov-west" //???
CITY_SOUTH_CAROLINA = "South Carolina" //南卡罗来纳州
CITY_SALT_LAKE_CITY = "Salt Lake City" //盐湖城
CITY_LAS_VEGAS = "Las Vegas" //拉斯维加斯
// 英国
CITY_LONDON = "London" //伦敦
@@ -149,6 +151,12 @@ const (
// 巴西
CITY_SAO_PAULO = "Sao Paulo" //圣保罗
// 智利
CITY_SANTIAGO = "Santiago" // 圣地亚哥
// 墨西哥
CITY_MEXICO = "Mexico" // 墨西哥
// 荷兰
CITY_HOLLAND = "Holland" //荷兰
@@ -194,4 +202,6 @@ const (
COUNTRY_CODE_VN = "VN" //越南
COUNTRY_CODE_CH = "CH" //瑞士
COUNTRY_CODE_NO = "NO" //挪威
COUNTRY_CODE_MX = "MX" //墨西哥
COUNTRY_CODE_CL = "CL" //智利
)

View File

@@ -81,10 +81,13 @@ type DBInstancePrivilege struct {
type DBInstanceAccountDetails struct {
apis.StatusStandaloneResourceDetails
apis.ProjectizedResourceInfo
DBInstanceResourceInfo
SDBInstanceAccount
// 账号权限列表
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges,allowempty"`
ProjectId string `json:"tenant_id"`
}

View File

@@ -63,12 +63,14 @@ type DBInstanceDatabaseCreateInput struct {
type DBInstancedatabaseDetails struct {
apis.StatusStandaloneResourceDetails
apis.ProjectizedResourceInfo
DBInstanceResourceInfo
SDBInstanceDatabase
// 数据库权限
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges"`
ProjectId string `json:"tenant_id"`
}
type DBInstanceparameterDetails struct {

View File

@@ -55,4 +55,7 @@ const (
DISK_BACKING_IMAGE = "image"
DISK_SIZE_AUTOEXTEND = -1
DISK_NOT_EXIST = "not_exist"
DISK_EXIST = "exist"
)

View File

@@ -69,16 +69,20 @@ type ElasticcacheFilterListInput struct {
type ElasticcacheAccountDetails struct {
apis.StatusStandaloneResourceDetails
apis.ProjectizedResourceInfo
ElasticcacheResourceInfo
SElasticcacheAccount
ProjectId string `json:"tenant_id"`
}
type ElasticcacheAclDetails struct {
apis.StandaloneResourceDetails
apis.ProjectizedResourceInfo
ElasticcacheResourceInfo
SElasticcacheAcl
ProjectId string `json:"tenant_id"`
}
type ElasticcacheParameterDetails struct {

View File

@@ -18,7 +18,9 @@ import "yunion.io/x/onecloud/pkg/apis"
type ElasticcacheBackupDetails struct {
apis.StatusStandaloneResourceDetails
apis.ProjectizedResourceInfo
ElasticcacheResourceInfo
SElasticcacheBackup
ProjectId string `json:"tenant_id"`
}

View File

@@ -26,6 +26,9 @@ type GlobalVpcDetails struct {
apis.EnabledStatusInfrasResourceBaseDetails
SGlobalVpc
// vpc数量
VpcCount int `json:"vpc_count"`
}
type GlobalVpcResourceInfo struct {

View File

@@ -135,6 +135,7 @@ const (
VM_CONVERT = "convert"
VM_CONVERTING = "converting"
VM_CONVERT_FAILED = "convert_failed"
VM_CONVERTED = "converted"
SHUTDOWN_STOP = "stop"
SHUTDOWN_TERMINATE = "terminate"

View File

@@ -20,13 +20,14 @@ type GuestnetworkDetails struct {
SGuestnetwork
// IP子网名称
Network string
Network string `json:"network"`
}
type GuestnetworkShortDesc struct {
// IP地址
IpAddr string `json:"ip_addr"`
// 是否为外网网卡
// Deprecated
IsExit bool `json:"is_exit"`
// IPv6地址
Ip6Addr string `json:"ip6_addr"`
@@ -34,6 +35,10 @@ type GuestnetworkShortDesc struct {
Mac string `json:"mac"`
// Bonding的配对网卡MAC
TeamWith string `json:"team_with"`
// 所属Vpc
VpcId string `json:"vpc_id"`
// 所属Network
NetworkId string `json:"network_id"`
}
type GuestnetworkListInput struct {

View File

@@ -36,7 +36,7 @@ type ServerListInput struct {
GroupFilterListInput
SecgroupFilterListInput
DiskFilterListInput
//DiskFilterListInput `"yunion:ambiguous-prefix":"storage_"`
ScalingGroupFilterListInput
// 只列出裸金属主机
@@ -63,6 +63,11 @@ type ServerListInput struct {
// 列出可以挂载指定EIP的主机
UsableServerForEip string `json:"usable_server_for_eip"`
// 列出可以挂载磁盘的主机
AttachableServersForDisk string `json:"attachable_servers_for_disk"`
// Deprecated:列出可以挂载磁盘的主机
Disk string `json:"disk" "yunion:deprecated-by":"attachable_servers_for_disk"`
// 按主机资源类型进行排序
// enum: shared,prepaid,dedicated
ResourceType string `json:"resource_type"`

View File

@@ -143,6 +143,10 @@ type HostDetails struct {
CpuCommitRate float64 `json:"cpu_commit_rate"`
// 内存超分率
MemCommitRate float64 `json:"mem_commit_rate"`
// CPU超售比
CpuCommitBound float32 `json:"cpu_commit_bound"`
// 内存超售比
MemCommitBound float32 `json:"mem_commint_bound"`
// 存储大小
Storage int64 `json:"storage"`
// 已使用存储大小
@@ -159,6 +163,8 @@ type HostDetails struct {
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
CanPrepare bool `json:"can_prepare"`
PrepareFailReason string `json:"prepare_fail_reason"`
// 允许开启宿主机健康检查
AllowHealthCheck bool `json:"allow_health_check"`
// 标签
Metadata map[string]string `json:"metadata"`
@@ -245,19 +251,19 @@ type HostAccessAttributes struct {
type HostSizeAttributes struct {
// CPU核数
CpuCount int `json:"cpu_count"`
CpuCount *int `json:"cpu_count"`
// 物理CPU颗数
NodeCount int8 `json:"node_count"`
NodeCount *int8 `json:"node_count"`
// CPU描述信息
CpuDesc string `json:"cpu_desc"`
// CPU频率
CpuMhz int `json:"cpu_mhz"`
CpuMhz *int `json:"cpu_mhz"`
// CPU缓存大小,单位KB
CpuCache string `json:"cpu_cache"`
// 预留CPU大小
CpuReserved int `json:"cpu_reserved"`
CpuReserved *int `json:"cpu_reserved"`
// CPU超分比
CpuCmtbound float32 `json:"cpu_cmtbound"`
CpuCmtbound *float32 `json:"cpu_cmtbound"`
// CPUMicrocode
CpuMicrocode string `json:"cpu_microcode"`
// CPU架构
@@ -268,10 +274,10 @@ type HostSizeAttributes struct {
// 预留内存大小(单位MB)
MemReserved string `json:"mem_reserved"`
// 内存超分比
MemCmtbound float32 `json:"mem_cmtbound"`
MemCmtbound *float32 `json:"mem_cmtbound"`
// 存储大小,单位Mb
StorageSize int `json:"storage_size"`
StorageSize *int `json:"storage_size"`
// 存储类型
StorageType string `json:"storage_type"`
// 存储驱动类型

View File

@@ -123,3 +123,9 @@ const (
BOOT_MODE_PXE = "pxe"
BOOT_MODE_ISO = "iso"
)
const (
HOST_HEALTH_PREFIX = "/onecloud/kvm/host/health"
HOST_HEALTH_STATUS_RUNNING = "running"
HOST_HEALTH_LOCK_PREFIX = "host-health"
)

View File

@@ -54,3 +54,24 @@ type IsolatedDeviceListInput struct {
// 设备VENDOE编号
VendorDeviceId []string `json:"vendor_device_id"`
}
type IsolatedDeviceCreateInput struct {
apis.StandaloneResourceCreateInput
HostResourceInput
// 设备类型USB/GPU
// example: GPU
DevType string `json:"dev_type"`
// 设备型号
// # Specific device name read from lspci command, e.g. `Tesla K40m` ...
Model string `json:"model"`
// PCI地址
// # pci address of `Bus:Device.Function` format, or usb bus address of `bus.addr`
Addr string `json:"addr"`
// 设备VendorId
VendorDeviceId string `json:"vendor_device_id"`
}

View File

@@ -164,7 +164,11 @@ type LoadbalancerAclListInput struct {
type LoadbalancerDetails struct {
apis.VirtualResourceDetails
VpcResourceInfo
ManagedResourceInfo
CloudregionResourceInfo
VpcResourceInfoBase
ZoneResourceInfoBase
NetworkResourceInfoBase

View File

@@ -65,16 +65,21 @@ type NetworkFilterListInput struct {
type NetworkListInput struct {
apis.SharableVirtualResourceListInput
apis.ExternalizedResourceBaseListInput
SchedtagResourceInput
WireFilterListInput
HostResourceInput
UsableResourceListInput
// description: search ip address in network.
// description: Exact matching ip address in network.
// example: 10.168.222.1
Ip string `json:"ip"`
// description: Fuzzy matching ip address in network.
// example: 10.168.222.1
IpMatch string `json:"ip_match"`
IfnameHint []string `json:"ifname_hint"`
// 起始IP地址
GuestIpStart []string `json:"guest_ip_start"`

View File

@@ -56,10 +56,11 @@ const (
TIMER_TYPE_MONTH = "month"
// 加入中 和 加入失败 的不算是 ScalingGroup 的机器
SG_GUEST_STATUS_JOINING = "joining" // 加入中
SG_GUEST_STATUS_READY = "ready" // 正常
SG_GUEST_STATUS_REMOVING = "removing" // 移除中
SG_GUEST_STATUS_REMOVE_FAILED = "remove_failed" // 移除失败
SG_GUEST_STATUS_JOINING = "joining" // 加入中
SG_GUEST_STATUS_READY = "ready" // 正常
SG_GUEST_STATUS_REMOVING = "removing" // 移除中
SG_GUEST_STATUS_REMOVE_FAILED = "remove_failed" // 移除失败
SG_GUEST_STATUS_PENDING_REMOVE = "pending_remove" // 机器进入回收站
// 只有ready状态是正常的
SG_STATUS_READY = "ready" // 正常

View File

@@ -17,7 +17,7 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type ScalingPolicyDetails struct {
apis.StatusStandaloneResourceDetails
apis.VirtualResourceDetails
ScalingGroupResourceInfo
SScalingPolicy
// 定时方式触发
@@ -29,7 +29,7 @@ type ScalingPolicyDetails struct {
}
type ScalingPolicyCreateInput struct {
apis.StandaloneResourceCreateInput
apis.VirtualResourceCreateInput
apis.EnabledBaseResourceCreateInput
// description: scaling_group ID or Name
@@ -67,7 +67,7 @@ type ScalingPolicyCreateInput struct {
}
type ScalingPolicyListInput struct {
apis.StatusStandaloneResourceListInput
apis.VirtualResourceListInput
apis.EnabledResourceBaseListInput
// description: scaling group

View File

@@ -213,3 +213,12 @@ type GuestsecgroupListInput struct {
GuestJointsListInput
SecgroupFilterListInput
}
type GuestsecgroupDetails struct {
GuestJointResourceDetails
SGuestsecgroup
// 安全组名称
Secgroup string `json:"secgroup"`
}

View File

@@ -18,6 +18,9 @@ import "yunion.io/x/onecloud/pkg/apis"
type SecgroupRuleDetails struct {
apis.ResourceBaseDetails
apis.ProjectizedResourceInfo
SSecurityGroupRule
SecurityGroupResourceInfo
ProjectId string `json:"tenant_id"`
}

View File

@@ -77,6 +77,12 @@ type ServerSkuListInput struct {
MemorySizeMb int `json:"memory_size_mb"`
// filter sku by CPU core count
CpuCoreCount []int `json:"cpu_core_count"`
// 后付费状态
PostpaidStatus string `json:"postpaid_status"`
// 预付费状态
PrepaidStatus string `json:"prepaid_status"`
}
type ElasticcacheSkuListInput struct {

View File

@@ -52,4 +52,7 @@ const (
SNAPSHOT_POLICY_CACHE_STATUS_READY = "ready"
SNAPSHOT_POLICY_CACHE_STATUS_DELETING = "deleting"
SNAPSHOT_POLICY_CACHE_STATUS_DELETE_FAILED = "delete_failed"
SNAPSHOT_EXIST = "exist"
SNAPSHOT_NOT_EXIST = "not_exist"
)

View File

@@ -174,6 +174,7 @@ type StorageShareFilterListInput struct {
type StorageListInput struct {
apis.EnabledStatusInfrasResourceBaseListInput
apis.ExternalizedResourceBaseListInput
SchedtagResourceInput
ManagedResourceListInput
ZonalFilterListInput

View File

@@ -0,0 +1,85 @@
package compute
import (
"yunion.io/x/pkg/util/netutils"
)
const (
sVpcMappedCidr = "100.64.0.0/17"
VpcMappedIPMask = 17
sVpcMappedGatewayIP = "100.64.0.1"
VpcMappedGatewayMac = "ee:ee:ee:ee:ee:ee"
// reserved: [100.64.0.2, 100.64.0.127]
// [128, 2176 (128+2048)]
sVpcMappedHostIPStart = "100.64.0.128"
sVpcMappedHostIPEnd = "100.64.8.128"
// reserved: [10.64.8.129, 10.64.8.255]
// [2304, 32511], 30207
sVpcMappedIPStart = "100.64.9.0"
sVpcMappedIPEnd = "100.64.126.255"
// reserved: [10.64.127.0 , 10.64.127.255]
)
var (
vpcMappedCidr netutils.IPV4Prefix
vpcMappedGatewayIP netutils.IPV4Addr
vpcMappedHostIPStart netutils.IPV4Addr
vpcMappedHostIPEnd netutils.IPV4Addr
vpcMappedIPStart netutils.IPV4Addr
vpcMappedIPEnd netutils.IPV4Addr
)
func init() {
mi := func(v netutils.IPV4Addr, err error) netutils.IPV4Addr {
if err != nil {
panic(err.Error())
}
return v
}
mp := func(v netutils.IPV4Prefix, err error) netutils.IPV4Prefix {
if err != nil {
panic(err.Error())
}
return v
}
vpcMappedCidr = mp(netutils.NewIPV4Prefix(sVpcMappedCidr))
vpcMappedGatewayIP = mi(netutils.NewIPV4Addr(sVpcMappedGatewayIP))
vpcMappedHostIPStart = mi(netutils.NewIPV4Addr(sVpcMappedHostIPStart))
vpcMappedHostIPEnd = mi(netutils.NewIPV4Addr(sVpcMappedHostIPEnd))
vpcMappedIPStart = mi(netutils.NewIPV4Addr(sVpcMappedIPStart))
vpcMappedIPEnd = mi(netutils.NewIPV4Addr(sVpcMappedIPEnd))
}
func VpcMappedCidr() netutils.IPV4Prefix {
return vpcMappedCidr
}
func VpcMappedGatewayIP() netutils.IPV4Addr {
return vpcMappedGatewayIP
}
func VpcMappedHostIPStart() netutils.IPV4Addr {
return vpcMappedHostIPStart
}
func VpcMappedHostIPEnd() netutils.IPV4Addr {
return vpcMappedHostIPEnd
}
func VpcMappedIPStart() netutils.IPV4Addr {
return vpcMappedIPStart
}
func VpcMappedIPEnd() netutils.IPV4Addr {
return vpcMappedIPEnd
}

View File

@@ -71,11 +71,11 @@ type WireUpdateInput struct {
apis.InfrasResourceBaseUpdateInput
// bandwidth in MB
Bandwidth int `json:"bandwidth"`
Bandwidth *int `json:"bandwidth"`
// MTU
// example: 1500
Mtu int `json:"mtu"`
Mtu *int `json:"mtu"`
}
type WireListInput struct {

View File

@@ -1297,17 +1297,7 @@ type SLoadbalancerBackendgroupResourceBase struct {
type SLoadbalancerCertificate struct {
apis.SVirtualResourceBase
apis.SExternalizedResourceBase
Certificate string `json:"certificate"`
PrivateKey string `json:"private_key"`
// derived attributes
PublicKeyAlgorithm string `json:"public_key_algorithm"`
PublicKeyBitLen int `json:"public_key_bit_len"`
SignatureAlgorithm string `json:"signature_algorithm"`
Fingerprint string `json:"fingerprint"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
CommonName string `json:"common_name"`
SubjectAlternativeNames string `json:"subject_alternative_names"`
apis.SCertificateResourceBase
}
// SLoadbalancerCertificateResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerCertificateResourceBase.
@@ -1747,7 +1737,7 @@ type SScalingGroupResourceBase struct {
// SScalingPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingPolicy.
type SScalingPolicy struct {
apis.SStatusStandaloneResourceBase
apis.SVirtualResourceBase
SScalingGroupResourceBase
apis.SEnabledResourceBase
TriggerType string `json:"trigger_type"`

View File

@@ -62,3 +62,7 @@ func (ra *SRoleAssignment) GetRoles() []string {
func (ra *SRoleAssignment) GetLoginIp() string {
return ""
}
func (ra *SRoleAssignment) GetTokenString() string {
return "faketoken"
}

View File

@@ -102,6 +102,9 @@ var (
ServiceBlacklistOptionMap = map[string][]string{
"default": []string{
// ############################
// common blacklist options
// ############################
"help",
"version",
"config",
@@ -120,7 +123,9 @@ var (
"session_endpoint_type",
"admin_password",
"admin_project",
"admin_project_domain",
"admin_user",
"admin_domain",
"auth_url",
"enable_ssl",
"ssl_certfile",
@@ -130,6 +135,9 @@ var (
"is_slave_node",
"config_sync_period_seconds",
// ############################
// db blacklist options
// ############################
"sql_connection",
"auto_sync_table",
"exit_after_db_init",
@@ -146,6 +154,43 @@ var (
"etcd_cacert",
"etcd_cert",
"etcd_key",
// ############################
// keystone blacklist options
// ############################
"bootstrap_admin_user_password",
"reset_admin_user_password",
"fernet_key_repository",
// ############################
// baremetal blacklist options
// ############################
"listen_interface",
"access_address",
"listen_address",
"tftp_root",
// "AutoRegisterBaremetal",
"baremetals_path",
// "LinuxDefaultRootUser",
"ipmi_lan_port_shared",
"zone",
"dhcp_lease_time",
"dhcp_renewal_time",
"enable_general_guest_dhcp",
"force_dhcp_probe_ipmi",
"tftp_block_size_in_bytes",
"tftp_max_timeout_retries",
"lengthy_worker_count",
"short_worker_count",
// "default_ipmi_password",
// "default_strong_ipmi_password",
// "windows_default_admin_user",
"cache_path",
"enable_pxe_boot",
"boot_iso_path",
// "status_probe_interval_seconds",
// "log_fetch_interval_seconds",
// "send_metrics_interval_seconds",
},
}
)

View File

@@ -19,6 +19,7 @@ import "yunion.io/x/onecloud/pkg/apis"
type EndpointDetails struct {
apis.StandaloneResourceDetails
SEndpoint
CertificateDetails
// 服务名称,例如keystone, glance, region等
ServiceName string `json:"service_name"`
@@ -26,3 +27,16 @@ type EndpointDetails struct {
// 服务类型,例如identity, image, compute等
ServiceType string `json:"service_type"`
}
type CertificateDetails struct {
apis.SCertificateResourceBase
CertName string `json:"cert_name"`
CertId string `json:"cert_id"`
CaCertificate string `json:"ca_certificate"`
CaPrivateKey string `json:"ca_private_key"`
}
const (
ENDPOINT_ETCD_INTERNAL = "etcd-internal"
)

View File

@@ -42,6 +42,8 @@ type IdentityProviderDetails struct {
// 该认证源关联的所有域的组数量
GroupCount int `json:"group_count,allowempty"`
SIdentityProvider
}
type IdpResourceInfo struct {

View File

@@ -23,6 +23,7 @@ import (
type IdentityBaseResourceCreateInput struct {
apis.StandaloneResourceCreateInput
apis.DomainizedResourceCreateInput
}
type EnabledIdentityBaseResourceCreateInput struct {
@@ -193,8 +194,8 @@ type EndpointListInput struct {
}
type SJoinProjectsInput struct {
Projects []string
Roles []string
Projects []string `json:"projects"`
Roles []string `json:"roles"`
}
func (input SJoinProjectsInput) Validate() error {
@@ -208,11 +209,12 @@ func (input SJoinProjectsInput) Validate() error {
}
type SProjectRole struct {
Project string
Role string
Project string `json:"project"`
Role string `json:"role"`
}
type SLeaveProjectsInput struct {
ProjectRoles []SProjectRole
ProjectRoles []SProjectRole `json:"project_roles"`
}
func (input SLeaveProjectsInput) Validate() error {
@@ -450,3 +452,13 @@ type RoleCreateInput struct {
apis.SharableResourceBaseCreateInput
}
type PerformGroupAddUsersInput struct {
// 带添加用户列表ID或名称
User []string `json:"user"`
}
type PerformGroupRemoveUsersInput struct {
// 带删除用户列表ID或名称
User []string `json:"user"`
}

View File

@@ -55,12 +55,11 @@ type SCredential struct {
// SDomain is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SDomain.
type SDomain struct {
apis.SStandaloneResourceBase
Extra interface{} `json:"extra"`
Enabled *bool `json:"enabled,omitempty"`
IsDomain *bool `json:"is_domain,omitempty"`
DomainId string `json:"domain_id"`
ParentId string `json:"parent_id"`
Displayname string `json:"displayname"`
Extra interface{} `json:"extra"`
Enabled *bool `json:"enabled,omitempty"`
IsDomain *bool `json:"is_domain,omitempty"`
DomainId string `json:"domain_id"`
ParentId string `json:"parent_id"`
}
// SEnabledIdentityBaseResource is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SEnabledIdentityBaseResource.
@@ -72,13 +71,14 @@ type SEnabledIdentityBaseResource struct {
// SEndpoint is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SEndpoint.
type SEndpoint struct {
apis.SStandaloneResourceBase
LegacyEndpointId string `json:"legacy_endpoint_id"`
Interface string `json:"interface"`
ServiceId string `json:"service_id"`
Url string `json:"url"`
Extra interface{} `json:"extra"`
Enabled *bool `json:"enabled,omitempty"`
RegionId string `json:"region_id"`
LegacyEndpointId string `json:"legacy_endpoint_id"`
Interface string `json:"interface"`
ServiceId string `json:"service_id"`
Url string `json:"url"`
Extra interface{} `json:"extra"`
Enabled *bool `json:"enabled,omitempty"`
RegionId string `json:"region_id"`
ServiceCertificateId string `json:"service_certificate_id"`
}
// SFederatedUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFederatedUser.
@@ -164,9 +164,8 @@ type SPolicy struct {
// SProject is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SProject.
type SProject struct {
SIdentityBaseResource
ParentId string `json:"parent_id"`
IsDomain *bool `json:"is_domain,omitempty"`
Displayname string `json:"displayname"`
ParentId string `json:"parent_id"`
IsDomain *bool `json:"is_domain,omitempty"`
}
// SRegion is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRegion.
@@ -190,6 +189,14 @@ type SService struct {
Extra interface{} `json:"extra"`
}
// SServiceCertificate is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SServiceCertificate.
type SServiceCertificate struct {
apis.SStandaloneResourceBase
apis.SCertificateResourceBase
CaCertificate string `json:"ca_certificate"`
CaPrivateKey string `json:"ca_private_key"`
}
// SUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUser.
type SUser struct {
SEnabledIdentityBaseResource

View File

@@ -26,7 +26,7 @@ type GuestImageDetails struct {
apis.SharableVirtualResourceDetails
SGuestImage
ImageIds jsonutils.JSONObject `json:"image_ids"`
ImageIds []string `json:"image_ids"`
//Status string `json:"status"`
Size int64 `json:"size"`

View File

@@ -28,6 +28,9 @@ type ImageListInput struct {
// 列出是否支持UEFI启动的镜像
Uefi *bool `json:"uefi"`
// 根据已转换格式过滤, 可能值为: qcow2, vmdk, vhd, raw等
SubFormats []string `json:"subFormats"`
// 是否为标准镜像
IsStandard *bool `json:"is_standard"`
@@ -61,3 +64,27 @@ type ImageDetails struct {
DisableDelete bool `json:"disable_delete"`
//OssChecksum string `json:"oss_checksum"`
}
type ImageCreateInput struct {
apis.SharableVirtualResourceCreateInput
// 镜像大小, 单位Byte
Size *int64 `json:"size"`
// 镜像格式
DiskFormat string `json:"disk_format"`
// 最小系统盘要求
MinDiskMB *int32 `json:"min_disk"`
// 最小内存要求
MinRamMB *int32 `json:"min_ram"`
// 是否有删除保护
Protected *bool `json:"protected"`
// 是否是标准镜像
IsStandard *bool `json:"is_standard"`
// 是否是主机镜像
IsGuestImage *bool `json:"is_guest_image"`
// 是否是数据盘镜像
IsData *bool `json:"is_data"`
// 镜像属性
Properties map[string]string `json:"properties"`
}

View File

@@ -180,18 +180,22 @@ type GetDetailsStatusOutput struct {
Status string `json:"status"`
}
type PerformPublicInput struct {
type PerformPublicDomainInput struct {
// 共享项目资源的共享范围可能的值为project, domain和system
// pattern: project|domain|system
Scope string `json:"scope"`
// 如果共享范围为项目,则在此列表中指定共享的目标项目
SharedProjects []string `json:"shared_projects"`
// 如果共享范围为域,则在此列表中指定共享的目标域
SharedDomains []string `json:"shared_domains"`
}
type PerformPublicProjectInput struct {
PerformPublicDomainInput
// 如果共享范围为项目,则在此列表中指定共享的目标项目
SharedProjects []string `json:"shared_projects"`
}
type PerformPrivateInput struct {
}
@@ -209,6 +213,11 @@ type PerformEnableInput struct {
type PerformDisableInput struct {
}
type StorageForceDetachHostInput struct {
// Host id or name
Host string `json:"host"`
}
type InfrasResourceBaseCreateInput struct {
DomainLevelResourceCreateInput
@@ -224,3 +233,54 @@ type EnabledStatusInfrasResourceBaseCreateInput struct {
StatusInfrasResourceBaseCreateInput
EnabledBaseResourceCreateInput
}
type OpsLogCreateInput struct {
ModelBaseCreateInput
ObjType string `json:"obj_type"`
ObjId string `json:"obj_id"`
ObjName string `json:"obj_name"`
Action string `json:"action"`
Notes string `json:"notes"`
ProjectId string `json:"tenant_id"`
Project string `json:"tenant"`
ProjectDomainId string `json:"project_domain_id"`
ProjectDomain string `json:"project_domain"`
UserId string `json:"user_id"`
User string `json:"user"`
DomainId string `json:"domain_id"`
Domain string `json:"domain"`
Roles string `json:"roles"`
OwnerDomainId string `json:"owner_domain_id"`
OwnerProjectId string `json:"owner_tenant_id"`
}
// 设置资源的标签(元数据)输入
type PerformMetadataInput map[string]string
// 设置资源的用户标签(元数据)输入
type PerformUserMetadataInput map[string]string
// 全量替换资源的用户标签(元数据)输入
type PerformSetUserMetadataInput map[string]string
// 获取资源的元数据输入
type GetMetadataInput struct {
// 指定需要获取的所有标签的KEY列表如果列表为空则获取全部标签
// 标签分为
//
// | 类型 | 说明 |
// |----------|---------------------------------------------|
// | 系统标签 | 平台定义的标签 |
// | 用户标签 | key以user:为前缀,用户自定义标签 |
// | 外部标签 | key以ext:为前缀,为从其他平台同步过来的标签 |
//
Field []string `json:"field"`
}
// 获取资源标签(元数据)输出
type GetMetadataOutput map[string]string

View File

@@ -14,14 +14,22 @@
package monitor
const (
SUGGEST_ALERT_READY = "ready"
SUGGEST_ALERT_START_DELETE = "start_delete"
SUGGEST_ALERT_DELETE_FAIL = "delete_fail"
SUGGEST_ALERT_DELETING = "deleting"
)
const (
EIP_UN_USED = "EIP_UNUSED"
DISK_UN_USED = "DISK_UNUSED"
LB_UN_USED = "LB_UNUSED"
SCALE_DOWN = "SCALE_DOWN"
SCALE_UP = "SCALE_UP"
DRIVER_ACTION = "DELETE"
EIP_UNUSED_START_DELETE = "start_delete"
EIP_UNUSED_DELETE_FAIL = "delete_fail"
DRIVER_ACTION = "DELETE"
SCALE_DOWN_DRIVER_ACTION = "SCALE_DOWN"
)
type MonitorSuggest string
@@ -29,11 +37,21 @@ type MonitorSuggest string
type MonitorResourceType string
const (
EIP_MONITOR_RES_TYPE = MonitorResourceType("弹性EIP")
DISK_MONITOR_RES_TYPE = MonitorResourceType("云硬盘")
EIP_MONITOR_RES_TYPE = MonitorResourceType("弹性EIP")
DISK_MONITOR_RES_TYPE = MonitorResourceType("云硬盘")
LB_MONITOR_RES_TYPE = MonitorResourceType("负载均衡实例")
SCALE_MONTITOR_RES_TYPE = MonitorResourceType("虚拟机")
)
const (
EIP_MONITOR_SUGGEST = MonitorSuggest("释放未使用的EIP")
DISK_MONITOR_SUGGEST = MonitorSuggest("释放未使用的Disk")
EIP_MONITOR_SUGGEST = MonitorSuggest("释放未使用的EIP")
DISK_MONITOR_SUGGEST = MonitorSuggest("释放未使用的Disk")
LB_MONITOR_SUGGEST = MonitorSuggest("释放未使用的LB")
SCALE_DOWN_MONITOR_SUGGEST = MonitorSuggest("缩减机器配置")
)
const (
LB_UNUSED_NLISTENER = "没有监听"
LB_UNUSED_NBCGROUP = "没有后端服务器组"
LB_UNUSED_NBC = "没有后端服务器"
)

View File

@@ -51,6 +51,7 @@ type SuggestSysAlertDetails struct {
apis.VirtualResourceDetails
compute.CloudregionResourceInfo
RuleName string `json:"rule_name"`
ShowName string `json:"show_name"`
ResType string `json:"res_type"`
Suggest string `json:"suggest"`
Brand string `json:"brand"`

View File

@@ -20,6 +20,25 @@ import (
"yunion.io/x/onecloud/pkg/apis"
)
const (
METRIC_TAG = "TAG"
METRIC_FIELD = "FIELD"
)
var PROPERTY_TYPE = []string{"databases", "measurements", "metric-measurement"}
var METRIC_ATTRI = []string{METRIC_TAG, METRIC_FIELD}
type InfluxMeasurement struct {
apis.Meta
Database string
Measurement string
TagKey []string
TagValue map[string][]string
FieldKey []string
Unit []string
}
type SuggestSysRuleListInput struct {
apis.VirtualResourceListInput
apis.EnabledResourceBaseListInput
@@ -29,10 +48,11 @@ type SuggestSysRuleCreateInput struct {
apis.VirtualResourceCreateInput
// 查询指标周期
Period string `json:"period"`
Type string `json:"type"`
Enabled *bool `json:"enabled"`
Setting *SSuggestSysAlertSetting `json:"setting"`
Period string `json:"period"`
TimeFrom string `json:"time_from"`
Type string `json:"type"`
Enabled *bool `json:"enabled"`
Setting *SSuggestSysAlertSetting `json:"setting"`
}
type SuggestSysRuleUpdateInput struct {
@@ -59,6 +79,8 @@ type SuggestSysRuleDetails struct {
type SSuggestSysAlertSetting struct {
EIPUnused *EIPUnused `json:"eip_unused"`
DiskUnused *DiskUnused `json:"disk_unused"`
LBUnused *LBUnused `json:"lb_unused"`
ScaleRule *ScaleRule `json:"scale_rule"`
}
type EIPUnused struct {
@@ -67,3 +89,25 @@ type EIPUnused struct {
type DiskUnused struct {
}
type LBUnused struct {
}
type ScaleRule []Scale
type Scale struct {
Database string `json:"database"`
Measurement string `json:"measurement"`
//rule operator rule [and|or]
Operator string `json:"operator"`
Field string `json:"field"`
EvalType string `json:"eval_type"`
Threshold float64 `json:"threshold"`
Tag string `json:"tag"`
TagVal string `json:"tag_val"`
}
type ScaleEvalMatch struct {
EvalMatch
ResourceId map[string]string `json:"resource_id"`
}

View File

@@ -88,14 +88,19 @@ type SSuggestSysAlert struct {
apis.SVirtualResourceBase
apis.SEnabledResourceBase
// 监控规则对应的json对象
RuleName string `json:"rule_name"`
MonitorConfig interface{} `json:"monitor_config"`
// 监控规则typeRule Type
Type string `json:"type"`
ResMeta interface{} `json:"res_meta"`
Problem interface{} `json:"problem"`
Suggest string `json:"suggest"`
Action string `json:"action"`
ResId string `json:"res_id"`
// Suggest string `width:"256" list:"user" update:"user"`
Action string `json:"action"`
ResId string `json:"res_id"`
CloudEnv string `json:"cloud_env"`
Provider string `json:"provider"`
Project string `json:"project"`
Cloudaccount string `json:"cloudaccount"`
}
// SSuggestSysRule is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SSuggestSysRule.

View File

@@ -25,3 +25,8 @@ type NotificationDetails struct {
UserList jsonutils.JSONObject `json:"user_list"`
}
type NotificationListInput struct {
Scope string `json:"scope"`
ContactType string `json:"contact_type"`
}

View File

@@ -14,6 +14,10 @@
package apis
import (
"time"
)
type ModelBaseDetails struct {
Meta
@@ -28,7 +32,7 @@ type ModelBaseDetails struct {
// example: true
CanUpdate bool `json:"can_update"`
// 资源不能删除的原因
// 资源不能更新的原因
UpdateFailReason string `json:"update_fail_reason"`
}
@@ -160,3 +164,34 @@ type EnabledStatusInfrasResourceBaseDetails struct {
type ChangeOwnerCandidateDomainsOutput struct {
Candidates []SharedDomain `json:"candidates"`
}
type OpsLogDetails struct {
ModelBaseDetails
Id int64 `json:"id"`
ObjType string `json:"obj_type"`
ObjId string `json:"obj_id"`
ObjName string `json:"obj_name"`
Action string `json:"action"`
Notes string `json:"notes"`
ProjectId string `json:"tenant_id"`
Project string `json:"tenant"`
ProjectDomainId string `json:"project_domain_id"`
ProjectDomain string `json:"project_domain"`
UserId string `json:"user_id"`
User string `json:"user"`
DomainId string `json:"domain_id"`
Domain string `json:"domain"`
Roles string `json:"roles"`
OpsTime time.Time `json:"ops_time"`
OwnerDomainId string `json:"owner_domain_id"`
OwnerProjectId string `json:"owner_project_id"`
OwnerDomain string `json:"owner_domain"`
OwnerProject string `json:"owner_tenant"`
}

View File

@@ -14,7 +14,16 @@
package apis
import "yunion.io/x/onecloud/pkg/util/rbacutils"
import (
"yunion.io/x/onecloud/pkg/util/rbacutils"
"yunion.io/x/onecloud/pkg/util/stringutils2"
)
const (
CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN = "account_domain"
CLOUD_ACCOUNT_SHARE_MODE_SYSTEM = "system"
CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN = "provider_domain"
)
type SAccountShareInfo struct {
IsPublic bool
@@ -22,3 +31,139 @@ type SAccountShareInfo struct {
ShareMode string
SharedDomains []string
}
type SShareInfo struct {
IsPublic bool
PublicScope rbacutils.TRbacScope
SharedDomains []string
SharedProjects []string
}
func (i SAccountShareInfo) GetProjectShareInfo() SShareInfo {
ret := SShareInfo{}
switch i.ShareMode {
case CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN:
ret.IsPublic = true
ret.PublicScope = rbacutils.ScopeDomain
case CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN:
ret.IsPublic = true
ret.PublicScope = rbacutils.ScopeDomain
case CLOUD_ACCOUNT_SHARE_MODE_SYSTEM:
ret.IsPublic = true
if i.IsPublic && i.PublicScope == rbacutils.ScopeSystem {
ret.PublicScope = rbacutils.ScopeSystem
} else {
ret.PublicScope = rbacutils.ScopeDomain
ret.SharedDomains = i.SharedDomains
}
}
return ret
}
func (i SAccountShareInfo) GetDomainShareInfo() SShareInfo {
ret := SShareInfo{}
switch i.ShareMode {
case CLOUD_ACCOUNT_SHARE_MODE_ACCOUNT_DOMAIN:
ret.IsPublic = false
ret.PublicScope = rbacutils.ScopeNone
case CLOUD_ACCOUNT_SHARE_MODE_PROVIDER_DOMAIN:
ret.IsPublic = false
ret.PublicScope = rbacutils.ScopeNone
case CLOUD_ACCOUNT_SHARE_MODE_SYSTEM:
if i.IsPublic && i.PublicScope == rbacutils.ScopeSystem {
ret.IsPublic = true
ret.PublicScope = rbacutils.ScopeSystem
} else if len(i.SharedDomains) > 0 {
ret.IsPublic = true
ret.PublicScope = rbacutils.ScopeDomain
ret.SharedDomains = i.SharedDomains
} else {
ret.IsPublic = false
ret.PublicScope = rbacutils.ScopeNone
}
}
return ret
}
func (i SShareInfo) IsViolate(i2 SShareInfo) bool {
if i.IsPublic && !i2.IsPublic {
return true
} else if !i.IsPublic && i2.IsPublic {
return false
}
// is_public equals
if i.PublicScope.HigherThan(i2.PublicScope) {
return true
} else if i2.PublicScope.HigherThan(i.PublicScope) {
return false
}
// public_scope equals
aNoB, _, bNoA := stringutils2.Split(stringutils2.NewSortedStrings(i.SharedDomains), stringutils2.NewSortedStrings(i2.SharedDomains))
if len(aNoB) > 0 {
return true
} else if len(bNoA) > 0 {
return false
}
// shared_domains equals
aNoB, _, bNoA = stringutils2.Split(stringutils2.NewSortedStrings(i.SharedProjects), stringutils2.NewSortedStrings(i2.SharedProjects))
if len(aNoB) > 0 {
return true
} else if len(bNoA) > 0 {
return false
}
return false
}
func (i SShareInfo) Intersect(i2 SShareInfo) SShareInfo {
if i.IsPublic && !i2.IsPublic {
return i2
} else if !i.IsPublic && i2.IsPublic {
return i
}
// is_public equals
if i.PublicScope.HigherThan(i2.PublicScope) {
return i2
} else if i2.PublicScope.HigherThan(i.PublicScope) {
return i
}
// public_scope equals
_, domains, _ := stringutils2.Split(stringutils2.NewSortedStrings(i.SharedDomains), stringutils2.NewSortedStrings(i2.SharedDomains))
_, projs, _ := stringutils2.Split(stringutils2.NewSortedStrings(i.SharedProjects), stringutils2.NewSortedStrings(i2.SharedProjects))
ret := SShareInfo{
IsPublic: i.IsPublic,
PublicScope: i.PublicScope,
SharedDomains: domains,
SharedProjects: projs,
}
if ret.PublicScope == rbacutils.ScopeProject && len(ret.SharedProjects) == 0 {
ret.IsPublic = false
ret.PublicScope = rbacutils.ScopeNone
}
return ret
}
func (i SShareInfo) Equals(i2 SShareInfo) bool {
if !i.IsViolate(i2) && !i2.IsViolate(i) {
return true
} else {
return false
}
}
func (i *SShareInfo) FixProjectShare() {
if i.PublicScope == rbacutils.ScopeProject && len(i.SharedProjects) == 0 {
i.IsPublic = false
i.PublicScope = rbacutils.ScopeNone
}
}
func (i *SShareInfo) FixDomainShare() {
if i.PublicScope == rbacutils.ScopeProject {
i.IsPublic = false
i.PublicScope = rbacutils.ScopeNone
i.SharedProjects = nil
} else if i.PublicScope == rbacutils.ScopeDomain && len(i.SharedDomains) == 0 {
i.IsPublic = false
i.PublicScope = rbacutils.ScopeNone
}
}

199
pkg/apis/share_test.go Normal file
View File

@@ -0,0 +1,199 @@
// 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 apis
import (
"testing"
"yunion.io/x/onecloud/pkg/util/rbacutils"
)
func TestSShareInfo_IsViolate(t *testing.T) {
cases := []struct {
name string
s1 SShareInfo
s2 SShareInfo
violate1 bool
violate2 bool
}{
{
name: "case1",
s1: SShareInfo{
IsPublic: false,
PublicScope: rbacutils.ScopeNone,
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeSystem,
},
violate1: false,
violate2: true,
},
{
name: "case2",
s1: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeProject,
SharedProjects: []string{"p1"},
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeProject,
SharedProjects: []string{"p2"},
},
violate1: true,
violate2: true,
},
{
name: "case3",
s1: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1"},
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeProject,
SharedProjects: []string{"p2"},
},
violate1: true,
violate2: false,
},
{
name: "case4",
s1: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2"},
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2"},
},
violate1: false,
violate2: false,
},
}
for _, c := range cases {
if c.s1.IsViolate(c.s2) != c.violate1 {
t.Errorf("[%s] s1.violate(s2) want %v", c.name, c.violate1)
} else if c.s2.IsViolate(c.s1) != c.violate2 {
t.Errorf("[%s] s2.violate(s1) want: %v", c.name, c.violate2)
}
}
}
func TestSShareInfo_Intersect(t *testing.T) {
cases := []struct {
name string
s1 SShareInfo
s2 SShareInfo
want SShareInfo
}{
{
name: "case1",
s1: SShareInfo{
IsPublic: false,
PublicScope: rbacutils.ScopeNone,
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeSystem,
},
want: SShareInfo{
IsPublic: false,
PublicScope: rbacutils.ScopeNone,
},
},
{
name: "case2",
s1: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeProject,
SharedProjects: []string{"p1"},
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeProject,
SharedProjects: []string{"p2"},
},
want: SShareInfo{
IsPublic: false,
PublicScope: rbacutils.ScopeNone,
},
},
{
name: "case3",
s1: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1"},
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeProject,
SharedProjects: []string{"p2"},
},
want: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeProject,
SharedProjects: []string{"p2"},
},
},
{
name: "case4",
s1: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2"},
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2"},
},
want: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2"},
},
},
{
name: "case5",
s1: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2", "p4"},
},
s2: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2", "p3"},
},
want: SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeDomain,
SharedDomains: []string{"p1", "p2"},
},
},
}
for _, c := range cases {
inter := c.s1.Intersect(c.s2)
if !inter.Equals(c.want) {
t.Errorf("[%s] intersect got %#v != want %#v", c.name, inter, c.want)
}
}
}

View File

@@ -24,6 +24,21 @@ type SAdminSharableVirtualResourceBase struct {
Records string `json:"records"`
}
// SCertificateResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SCertificateResourceBase.
type SCertificateResourceBase struct {
Certificate string `json:"certificate"`
PrivateKey string `json:"private_key"`
// derived attributes
PublicKeyAlgorithm string `json:"public_key_algorithm"`
PublicKeyBitLen int `json:"public_key_bit_len"`
SignatureAlgorithm string `json:"signature_algorithm"`
Fingerprint string `json:"fingerprint"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
CommonName string `json:"common_name"`
SubjectAlternativeNames string `json:"subject_alternative_names"`
}
// SDomainLevelResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SDomainLevelResourceBase.
type SDomainLevelResourceBase struct {
SStandaloneResourceBase

View File

@@ -83,9 +83,6 @@ func (worker *SWorker) run() {
task := req.(*sWorkerTask)
if task.worker != nil {
task.worker <- worker
// worker channel is buffered
// close the worker channel
close(task.worker)
}
execCallback(task)
} else {

View File

@@ -231,7 +231,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(ctx, input)
baremetal.GetBaremetalManager().RegisterBaremetal(ctx, ctx.userCred, input)
return nil, nil
}, nil)
}

View File

@@ -289,7 +289,7 @@ func (i *BmRegisterInput) isTimeout() bool {
}
// delay task
func (m *SBaremetalManager) RegisterBaremetal(ctx context.Context, input *BmRegisterInput) {
func (m *SBaremetalManager) RegisterBaremetal(ctx context.Context, userCred mcclient.TokenCredential, input *BmRegisterInput) {
adminWire, err := m.checkNetworkFromIp(input.RemoteIp)
if input.isTimeout() {
return
@@ -341,7 +341,7 @@ func (m *SBaremetalManager) RegisterBaremetal(ctx context.Context, input *BmRegi
}
registerTask := tasks.NewBaremetalRegisterTask(
m, sshCli, input.Hostname, input.RemoteIp,
userCred, m, sshCli, input.Hostname, input.RemoteIp,
input.Username, input.Password, input.IpAddr,
ipmiMac, ipmiLanChannel, adminWire, ipmiWire,
)
@@ -377,6 +377,7 @@ func (m *SBaremetalManager) fetchIpmiIp(sshCli *ssh.Client) (string, error) {
func (m *SBaremetalManager) checkNetworkFromIp(ip string) (string, error) {
params := jsonutils.NewDict()
params.Set("ip", jsonutils.NewString(ip))
params.Set("scope", jsonutils.NewString("system"))
params.Set("is_on_premise", jsonutils.JSONTrue)
res, err := modules.Networks.List(m.GetClientSession(), params)
if err != nil {
@@ -403,6 +404,7 @@ func (m *SBaremetalManager) verifyMacAddr(sshCli *ssh.Client) (error, bool) {
for _, nic := range nicinfo {
if len(nic.Mac) > 0 {
params.Set("any_mac", jsonutils.NewString(nic.Mac.String()))
params.Set("scope", jsonutils.NewString("system"))
res, err := modules.Hosts.List(m.GetClientSession(), params)
if err != nil {
return fmt.Errorf("Get hosts info failed: %s", err), false
@@ -750,11 +752,10 @@ func (b *SBaremetalInstance) SyncStatusBackground() {
}()
}
func (b *SBaremetalInstance) InitializeServer(name string) error {
func (b *SBaremetalInstance) InitializeServer(s *mcclient.ClientSession, name string) error {
params := jsonutils.NewDict()
params.Set("name", jsonutils.NewString(name))
_, err := modules.Hosts.PerformAction(
b.manager.GetClientSession(), b.GetId(), "initialize", params)
_, err := modules.Hosts.PerformAction(s, b.GetId(), "initialize", params)
return err
}
@@ -1039,6 +1040,7 @@ func (b *SBaremetalInstance) getSyslinuxPath(filename string, isTftp bool) strin
func (b *SBaremetalInstance) findAccessNetwork(accessIp string) (*types.SNetworkConfig, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(accessIp), "ip")
params.Add(jsonutils.NewString("system"), "scope")
params.Add(jsonutils.JSONTrue, "is_on_premise")
session := b.manager.GetClientSession()
ret, err := modules.Networks.List(session, params)
@@ -1949,6 +1951,8 @@ func (b *SBaremetalInstance) GetConsoleJNLP(ctx context.Context) (string, error)
return bmc.GetIloConsoleJNLP(ctx)
case "dell", "dell inc.":
return bmc.GetIdracConsoleJNLP(ctx, "", "")
case "supermicro":
return bmc.GetSupermicroConsoleJNLP(ctx)
}
return "", httperrors.NewNotImplementedError("Unsupported manufacture %s", manufacture)
}

View File

@@ -55,3 +55,16 @@ type BaremetalOptions struct {
var (
Options BaremetalOptions
)
func OnOptionsChange(oldO, newO interface{}) bool {
oldOpts := oldO.(*BaremetalOptions)
newOpts := newO.(*BaremetalOptions)
changed := false
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
changed = true
}
return changed
}

View File

@@ -272,6 +272,7 @@ func (req *dhcpRequest) findNetworkConf(session *mcclient.ClientSession, filterU
params.Add(jsonutils.JSONTrue, "filter_any")
}
params.Add(jsonutils.JSONTrue, "is_on_premise")
params.Add(jsonutils.NewString("system"), "scope")
ret, err := modules.Networks.List(session, params)
if err != nil {
return nil, err
@@ -299,6 +300,7 @@ func (req *dhcpRequest) findNetworkConf(session *mcclient.ClientSession, filterU
func (req *dhcpRequest) findBaremetalsByUuid(session *mcclient.ClientSession) (*modulebase.ListResult, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(req.ClientGuid), "uuid")
params.Add(jsonutils.NewString("system"), "scope")
ret, err := modules.Hosts.List(session, params)
if err != nil {
return nil, err
@@ -312,6 +314,7 @@ func (req *dhcpRequest) findBaremetalsByUuid(session *mcclient.ClientSession) (*
func (req *dhcpRequest) findBaremetalsOfAnyMac(session *mcclient.ClientSession, isBaremetal bool) (*modulebase.ListResult, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(req.ClientMac.String()), "any_mac")
params.Add(jsonutils.NewString("system"), "scope")
if isBaremetal {
params.Add(jsonutils.JSONTrue, "is_baremetal")
} else {

View File

@@ -21,6 +21,7 @@ import (
"yunion.io/x/log"
api "yunion.io/x/onecloud/pkg/apis/baremetal"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/baremetal"
"yunion.io/x/onecloud/pkg/baremetal/handler"
@@ -28,6 +29,7 @@ import (
"yunion.io/x/onecloud/pkg/baremetal/tasks"
app_common "yunion.io/x/onecloud/pkg/cloudcommon/app"
"yunion.io/x/onecloud/pkg/cloudcommon/cronman"
"yunion.io/x/onecloud/pkg/cloudcommon/db/lockman"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/cloudcommon/service"
"yunion.io/x/onecloud/pkg/hostman/guestfs/fsdriver"
@@ -64,6 +66,9 @@ func (s *BaremetalService) StartService() {
fsdriver.Init(nil)
app := app_common.InitApp(&o.Options.BaseOptions, false)
common_options.StartOptionManager(&o.Options, o.Options.ConfigSyncPeriodSeconds, api.SERVICE_TYPE, api.SERVICE_VERSION, o.OnOptionsChange)
handler.InitHandlers(app)
s.startAgent(app)
@@ -80,6 +85,10 @@ func (s *BaremetalService) StartService() {
}
func (s *BaremetalService) startAgent(app *appsrv.Application) {
// init lockman
lm := lockman.NewInMemoryLockManager()
lockman.Init(lm)
err := baremetal.Start(app)
if err != nil {
log.Fatalf("Start agent error: %v", err)

View File

@@ -306,7 +306,13 @@ func (self *SBaremetalTaskBase) EnsurePowerUp() error {
if err != nil {
return errors.Wrapf(err, "Get power status")
}
maxTries := 10
count := 0
for status == "" || status == types.POWER_STATUS_OFF {
if count > maxTries {
break
}
log.Infof("Try power on %d times, pxe boot %v", count+1, self.PxeBoot)
if status == types.POWER_STATUS_OFF {
if self.PxeBoot {
err = self.Baremetal.DoPXEBoot()
@@ -314,7 +320,7 @@ func (self *SBaremetalTaskBase) EnsurePowerUp() error {
err = self.Baremetal.DoRedfishPowerOn()
}
if err != nil {
return errors.Wrapf(err, "Do boot power on")
log.Warningf("Do boot power on error: %v", err)
}
}
status, err = self.Baremetal.GetPowerStatus()
@@ -328,6 +334,7 @@ func (self *SBaremetalTaskBase) EnsurePowerUp() error {
return err
}
}
count++
}
if status != types.POWER_STATUS_ON {
return fmt.Errorf("Baremetal invalid restart status: %s", status)

View File

@@ -559,6 +559,7 @@ type ipmiIPConfig struct {
func (task *sBaremetalPrepareTask) getIPMIIPConfig(ipAddr string) (*ipmiIPConfig, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(ipAddr), "ip")
params.Add(jsonutils.NewString("system"), "scope")
params.Add(jsonutils.JSONTrue, "is_on_premise")
listRet, err := modules.Networks.List(task.getClientSession(), params)
if err != nil {

View File

@@ -27,6 +27,8 @@ import (
o "yunion.io/x/onecloud/pkg/baremetal/options"
"yunion.io/x/onecloud/pkg/baremetal/utils/ipmitool"
"yunion.io/x/onecloud/pkg/cloudcommon/types"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/util/redfish"
"yunion.io/x/onecloud/pkg/util/ssh"
@@ -55,24 +57,30 @@ type sBaremetalRegisterTask struct {
accessNic *types.SNicDevInfo
}
func NewBaremetalRegisterTask(bmManager IBmManager, sshCli *ssh.Client,
func NewBaremetalRegisterTask(
userCred mcclient.TokenCredential, bmManager IBmManager, sshCli *ssh.Client,
hostname, remoteIp, ipmiUsername, ipmiPassword, ipmiIpAddr string,
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,
IpmiLanChannel: ipmiLanChannel,
AdminWire: adminWire,
IpmiWire: ipmiWire,
sBaremetalPrepareTask: sBaremetalPrepareTask{userCred: userCred},
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) getSession() *mcclient.ClientSession {
return auth.GetSession(context.Background(), s.userCred, o.Options.Region, "v2")
}
func (s *sBaremetalRegisterTask) getAccessDevMacAddr(ip string) (string, error) {
nicsRet, err := s.SshCli.Run("/sbin/ip -o -4 addr show")
if err != nil {
@@ -131,12 +139,12 @@ func (s *sBaremetalRegisterTask) CreateBaremetal() (string, error) {
}
params := jsonutils.NewDict()
params.Set("name", jsonutils.NewString("BM"+strings.Replace(s.accessNic.Mac.String(), ":", "", -1)))
params.Set("name", jsonutils.NewString(strings.Replace(s.accessNic.Mac.String(), ":", "", -1)))
params.Set("access_mac", jsonutils.NewString(s.accessNic.Mac.String()))
params.Set("host_type", jsonutils.NewString("baremetal"))
params.Set("is_baremetal", jsonutils.JSONTrue)
params.Set("is_import", jsonutils.JSONTrue)
res, err := modules.Hosts.CreateInContext(s.BmManager.GetClientSession(), params, &modules.Zones, zoneId)
res, err := modules.Hosts.CreateInContext(s.getSession(), params, &modules.Zones, zoneId)
if err != nil {
return "", fmt.Errorf("Create baremetal failed: %s", err)
}
@@ -177,6 +185,7 @@ func (s *sBaremetalRegisterTask) UpdateBaremetal() (string, error) {
params := jsonutils.NewDict()
params.Set("any_mac", jsonutils.NewString(accessMacAddr.String()))
params.Set("scope", jsonutils.NewString("system"))
res, err := modules.Hosts.List(s.BmManager.GetClientSession(), params)
if err != nil {
return "", fmt.Errorf("Fetch baremetal failed %s", err)
@@ -295,7 +304,7 @@ func (s *sBaremetalRegisterTask) updateBmInfo(cli *ssh.Client, i *baremetalPrepa
}
func (s *sBaremetalRegisterTask) initBaremetalServer() error {
if err := s.baremetal.InitializeServer(s.Hostname); err != nil {
if err := s.baremetal.InitializeServer(s.getSession(), s.Hostname); err != nil {
return fmt.Errorf("Baremteal Create Server Failed %s", err)
}
// if err := s.baremetal.SaveSSHConfig("", ""); err != nil {

View File

@@ -64,7 +64,7 @@ type IBaremetal interface {
GetImageCacheUrl() string
RemoveServer()
InitializeServer(name string) error
InitializeServer(session *mcclient.ClientSession, name string) error
SaveSSHConfig(remoteAddr string, key string) error
ServerLoadDesc() error
}

View File

@@ -70,29 +70,38 @@ func (self *SBaremetalIpmiProbeTask) DoIpmiProbe(ctx context.Context, args inter
}
redfishCli := redfish.NewRedfishDriver(ctx, "https://"+ipmiInfo.IpAddr, ipmiInfo.Username, ipmiInfo.Password, false)
if redfishCli != nil {
return self.doRedfishIpmiProbe(ctx, redfishCli)
} else {
log.Warningf("BMC not redfish-compatible")
ipmiTool := ipmitool.NewLanPlusIPMI(ipmiInfo.IpAddr, ipmiInfo.Username, ipmiInfo.Password)
return self.doRawIpmiProbe(ctx, ipmiTool)
redfishSuccess, err := self.doRedfishIpmiProbe(ctx, redfishCli)
if err == nil {
// success
return nil
}
if redfishSuccess {
return errors.Wrap(err, "doRedfishIpmiProbe")
}
// else, redfish call fails, try IPMI
}
log.Warningf("BMC not redfish-compatible")
ipmiTool := ipmitool.NewLanPlusIPMI(ipmiInfo.IpAddr, ipmiInfo.Username, ipmiInfo.Password)
return self.doRawIpmiProbe(ctx, ipmiTool)
}
func (self *SBaremetalIpmiProbeTask) doRedfishIpmiProbe(ctx context.Context, drv redfish.IRedfishDriver) error {
// return redfishSuccess, error
// redfishSuccess: does Redfish API call success
func (self *SBaremetalIpmiProbeTask) doRedfishIpmiProbe(ctx context.Context, drv redfish.IRedfishDriver) (bool, error) {
confs, err := drv.GetLanConfigs(ctx)
if err != nil {
return errors.Wrap(err, "drv.GetLanConfigs")
return false, errors.Wrap(err, "drv.GetLanConfigs")
}
if len(confs) == 0 {
return errors.Wrap(httperrors.ErrNotFound, "no IPMI lan")
return false, errors.Wrap(httperrors.ErrNotFound, "no IPMI lan")
}
err = self.sendIpmiNicInfo(&confs[0])
if err != nil {
return errors.Wrap(err, "self.sendIpmiNicInfo")
return false, errors.Wrap(err, "self.sendIpmiNicInfo")
}
_, sysInfo, err := drv.GetSystemInfo(ctx)
if err != nil {
return errors.Wrap(err, "drv.GetSystemInfo")
return false, errors.Wrap(err, "drv.GetSystemInfo")
}
updateInfo := make(map[string]interface{})
if len(sysInfo.EthernetNICs) > 0 {
@@ -127,20 +136,20 @@ func (self *SBaremetalIpmiProbeTask) doRedfishIpmiProbe(ctx context.Context, drv
_, err = modules.Hosts.Update(self.Baremetal.GetClientSession(), self.Baremetal.GetId(), updateData)
if err != nil {
log.Errorf("Update baremetal info error: %v", err)
return errors.Wrap(err, "modules.Hosts.Update")
return true, errors.Wrap(err, "modules.Hosts.Update")
}
for i := range sysInfo.EthernetNICs {
mac, err := net.ParseMAC(sysInfo.EthernetNICs[i])
if err == nil {
err = self.sendNicInfo(i, mac)
if err != nil {
return errors.Wrapf(err, "sendNicInfo %d %s", i, mac)
return true, errors.Wrapf(err, "sendNicInfo %d %s", i, mac)
}
}
}
self.Baremetal.SyncStatus("", "Probe Redfish finished")
SetTaskComplete(self, nil)
return nil
return true, nil
}
func (self *SBaremetalIpmiProbeTask) sendIpmiNicInfo(lanConf *types.SIPMILanConfig) error {

View File

@@ -202,6 +202,7 @@ func (agent *SBaseAgent) getZoneByIP(session *mcclient.ClientSession) (jsonutils
}
params.Add(jsonutils.NewString(listenIP.String()), "ip")
params.Add(jsonutils.JSONTrue, "is_on_premise")
params.Add(jsonutils.NewString("system"), "scope")
networks, err := modules.Networks.List(session, params)
if err != nil {
return nil, err

View File

@@ -19,13 +19,17 @@ import (
"time"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apis/identity"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/notifyclient"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modules"
)
func InitAuth(options *common_options.CommonOptions, authComplete auth.AuthCompletedCallback) {
@@ -90,3 +94,19 @@ func InitBaseAuth(options *common_options.BaseOptions) {
}
consts.SetNonDefaultDomainProjects(options.NonDefaultDomainProjects)
}
func FetchEtcdServiceInfo() (*identity.EndpointDetails, error) {
s := auth.GetAdminSession(context.Background(), "", "")
ret, err := modules.EndpointsV3.GetByName(s, identity.ENDPOINT_ETCD_INTERNAL, nil)
if err != nil && errors.Cause(err) == httperrors.ErrNotFound {
return nil, nil
} else if err != nil {
return nil, err
}
endpoint := new(identity.EndpointDetails)
err = ret.Unmarshal(endpoint)
if err != nil {
return nil, errors.Wrap(err, "unmarshal endpoint")
}
return endpoint, nil
}

View File

@@ -304,25 +304,7 @@ func (self *SCronJobManager) Start2(ctx context.Context, electObj *elect.Elect)
self.start(ctx)
return
}
go func() {
ch := make(chan elect.ElectEvent)
electObj.Subscribe(ch)
for {
select {
case ev := <-ch:
log.Infof("cronman: elect event %s: cronman", ev)
switch ev {
case elect.ElectEventWin:
self.start(ctx)
case elect.ElectEventLost:
self.Stop()
}
case <-ctx.Done():
return
}
}
}()
electObj.SubscribeWithAction(ctx, func() { self.start(ctx) }, self.Stop)
}
func (self *SCronJobManager) Start() {

View File

@@ -44,7 +44,7 @@ func InitDB(options *common_options.DBOptions) {
dialect, sqlStr, err := options.GetDBConnection()
if err != nil {
log.Fatalf("Invalid SqlConnection string: %s", options.SqlConnection)
log.Fatalf("Invalid SqlConnection string: %s error: %v", options.SqlConnection, err)
}
dbConn, err := sql.Open(dialect, sqlStr)
if err != nil {

View File

@@ -292,7 +292,7 @@ func FetchCustomizeColumns(
retVal := make([]*jsonutils.JSONDict, ret[0].Len())
for i := 0; i < ret[0].Len(); i += 1 {
jsonDict := ValueToJSONDict(ret[0].Index(i))
jsonDict.Update(jsonutils.Marshal(objs[i]))
jsonDict.Update(jsonutils.Marshal(objs[i]).(*jsonutils.JSONDict))
retVal[i] = jsonDict
}
return retVal, nil

View File

@@ -0,0 +1,20 @@
package db
import (
"time"
)
type SCertificateResourceBase struct {
Certificate string `create:"required" list:"user" update:"user"`
PrivateKey string `create:"required" list:"admin" update:"user"`
// derived attributes
PublicKeyAlgorithm string `create:"optional" list:"user" update:"user"`
PublicKeyBitLen int `create:"optional" list:"user" update:"user"`
SignatureAlgorithm string `create:"optional" list:"user" update:"user"`
Fingerprint string `create:"optional" list:"user" update:"user"`
NotBefore time.Time `create:"optional" list:"user" update:"user"`
NotAfter time.Time `create:"optional" list:"user" update:"user"`
CommonName string `create:"optional" list:"user" update:"user"`
SubjectAlternativeNames string `create:"optional" list:"user" update:"user"`
}

View File

@@ -352,7 +352,7 @@ func Query2List(manager IModelManager, ctx context.Context, userCred mcclient.To
showDetails = true
}
items := make([]interface{}, 0)
extraResults := make([]jsonutils.JSONObject, 0)
extraResults := make([]*jsonutils.JSONDict, 0)
rows, err := q.Rows()
if err != nil && err != sql.ErrNoRows {
return nil, err
@@ -371,17 +371,22 @@ func Query2List(manager IModelManager, ctx context.Context, userCred mcclient.To
return nil, err
}
if exportKeys != nil {
extraData := jsonutils.NewDict()
RowMap, err := q.Row2Map(rows)
if len(exportKeys) > 0 {
rowMap, err := q.Row2Map(rows)
if err != nil {
return nil, err
}
extraKeys := manager.GetExportExtraKeys(ctx, exportKeys, RowMap)
extraData := jsonutils.NewDict()
for k, v := range rowMap {
if len(v) > 0 {
extraData.Add(jsonutils.NewString(v), k)
}
}
extraKeys := manager.GetExportExtraKeys(ctx, exportKeys, rowMap)
if extraKeys != nil {
extraData.Update(extraKeys)
}
err = q.RowMap2Struct(RowMap, item)
err = q.RowMap2Struct(rowMap, item)
if err != nil {
return nil, err
}
@@ -399,26 +404,14 @@ func Query2List(manager IModelManager, ctx context.Context, userCred mcclient.To
}
}
// jsonDict := jsonutils.Marshal(item).(*jsonutils.JSONDict)
// jsonDict = jsonDict.CopyIncludes([]string(listF)...)
// jsonDict.Update(extraData)
// ignore GetExtraDetails since release/3.2
/*if showDetails && !query.Contains("export_keys") {
extraDict, _ := GetExtraDetails(item, ctx, userCred, query, true)
if extraDict != nil {
// Fix for Now
extraDict.Update(jsonDict)
jsonDict = extraDict
}
// jsonDict = getModelExtraDetails(item, ctx, jsonDict)
}*/
// results = append(results, jsonDict)
items = append(items, item)
}
results := make([]jsonutils.JSONObject, len(items))
if showDetails && !query.Contains("export_keys") {
if showDetails || len(exportKeys) > 0 {
var sortedListFields stringutils2.SSortedStrings
if len(fieldFilter) > 0 {
if len(exportKeys) > 0 {
sortedListFields = exportKeys
} else if len(fieldFilter) > 0 {
sortedListFields = stringutils2.NewSortedStrings(fieldFilter)
}
extraRows, err := FetchCustomizeColumns(manager, ctx, userCred, query, items, sortedListFields, true)
@@ -426,9 +419,21 @@ func Query2List(manager IModelManager, ctx context.Context, userCred mcclient.To
if err != nil {
return nil, errors.Wrap(err, "FetchCustomizeColumns")
}
if len(extraRows) == len(results) {
for i := range results {
results[i] = extraRows[i].CopyExcludes(listExcludes...)
jsonDict := extraRows[i].CopyExcludes(listExcludes...)
if i < len(extraResults) {
extraResults[i].Update(jsonDict)
jsonDict = extraResults[i]
}
if len(exportKeys) > 0 {
jsonDict = jsonDict.CopyIncludes(exportKeys...)
}
if len(fieldFilter) > 0 {
jsonDict = jsonDict.CopyIncludes(fieldFilter...)
}
results[i] = jsonDict
}
} else {
return nil, httperrors.NewInternalServerError("FetchCustomizeColumns return incorrect number of results")
@@ -436,8 +441,8 @@ func Query2List(manager IModelManager, ctx context.Context, userCred mcclient.To
} else {
for i := range items {
jsonDict := jsonutils.Marshal(items[i]).(*jsonutils.JSONDict).CopyExcludes(listExcludes...)
if i < len(extraResults) {
jsonDict.Update(extraResults[i])
if len(fieldFilter) > 0 {
jsonDict = jsonDict.CopyIncludes(fieldFilter...)
}
results[i] = jsonDict
}
@@ -648,7 +653,9 @@ func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.Tok
}
if pagingConf != nil {
q = q.Limit(int(limit) + 1)
if limit > 0 {
q = q.Limit(int(limit) + 1)
}
if len(pagingMarker) > 0 {
markers := decodePagingMarker(pagingMarker)
for markerIdx, marker := range markers {
@@ -666,7 +673,7 @@ func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.Tok
return nil, httperrors.NewGeneralError(err)
}
nextMarkers := make([]string, 0)
if int64(len(retList)) > limit {
if limit > 0 && int64(len(retList)) > limit {
for _, markerField := range pagingConf.MarkerFields {
nextMarker, _ := retList[limit].GetString(markerField)
nextMarkers = append(nextMarkers, nextMarker)
@@ -734,8 +741,10 @@ func calculateListResult(data []jsonutils.JSONObject, total, limit, offset int64
}
}
// do limit
if limit > 0 && total > limit {
if limit > 0 && total-offset > limit {
data = data[:limit]
} else {
data = data[:total-offset]
}
}
@@ -1215,6 +1224,12 @@ func (dispatcher *DBModelDispatcher) Create(ctx context.Context, query jsonutils
model, err := DoCreate(dispatcher.modelManager, ctx, userCred, query, data, ownerId)
if err != nil {
// log.Errorf("fail to doCreateItem %s", err)
if CancelPendingUsagesInContext != nil {
err := CancelPendingUsagesInContext(ctx, userCred)
if err != nil {
log.Errorf("CancelPendingUsagesInContext fail %s", err)
}
}
failErr := manager.OnCreateFailed(ctx, userCred, ownerId, query, data)
if failErr != nil {
log.Errorf("manager.OnCreateFailed %s", failErr)
@@ -1407,6 +1422,19 @@ func managerPerformCheckCreateData(
return nil, httperrors.NewForbiddenError("not allow to perform %s", action)
}
if InitPendingUsagesInContext != nil {
ctx = InitPendingUsagesInContext(ctx)
defer func() {
if CancelPendingUsagesInContext != nil {
err := CancelPendingUsagesInContext(ctx, userCred)
if err != nil {
log.Errorf("CancelPendingUsagesInContext fail %s", err)
}
}
}()
}
return ValidateCreateData(manager, ctx, userCred, ownerId, query, bodyDict)
}

View File

@@ -16,8 +16,10 @@ package db
import (
"context"
"database/sql"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/util/reflectutils"
"yunion.io/x/sqlchemy"
@@ -163,3 +165,25 @@ func (manager *SDomainizedResourceBaseManager) FetchCustomizeColumns(
}
return ret
}
func ValidateDomainizedResourceInput(ctx context.Context, input apis.DomainizedResourceInput) (*STenant, apis.DomainizedResourceInput, error) {
domain, err := DefaultDomainFetcher(ctx, input.ProjectDomain)
if err != nil {
if errors.Cause(err) == sql.ErrNoRows {
return nil, input, httperrors.NewResourceNotFoundError2("domain", input.ProjectDomain)
} else {
return nil, input, errors.Wrap(err, "TenantCacheManager.FetchDomainByIdOrName")
}
}
input.ProjectDomain = domain.GetId()
return domain, input, nil
}
func (manager *SDomainizedResourceBaseManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error) {
if keys.Contains("project_domain") {
domainsQ := DefaultDomainQuery().SubQuery()
q = q.LeftJoin(domainsQ, sqlchemy.Equals(q.Field("domain_id"), domainsQ.Field("id")))
q = q.AppendField(domainsQ.Field("name", "project_domain"))
}
return q, nil
}

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