Compare commits

...

396 Commits

Author SHA1 Message Date
Zexi Li
c9b485b9f3 Merge pull request #7548 from wanyaoqi/automated-cherry-pick-of-#7547-upstream-release-3.3
Automated cherry pick of #7547: support diable usb kbd
2020-08-11 18:41:28 +08:00
Zexi Li
22231edba6 Merge pull request #7542 from ioito/automated-cherry-pick-of-#7541-upstream-release-3.3
Automated cherry pick of #7541: fix: separete enabled and status field
2020-08-11 18:39:18 +08:00
wanyaoqi
0742afb487 support diable usb kbd 2020-08-11 15:32:31 +08:00
Qu Xuan
3b036e6c30 fix: separete enabled and status field 2020-08-11 14:54:31 +08:00
Zexi Li
227fa57883 Merge pull request #7536 from wanyaoqi/automated-cherry-pick-of-#7530-upstream-release-3.3
Automated cherry pick of #7530: fix mount xfs
2020-08-11 11:16:20 +08:00
wanyaoqi
5439457bb4 fix usage get storage capbility (#7528) 2020-08-10 20:07:57 +08:00
wanyaoqi
57cd48354f fix mount xfs 2020-08-10 20:03:24 +08:00
屈轩
3c63af8de0 fix: optimized huawei security group get and create operation (#7521)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-08-10 15:37:44 +08:00
wanyaoqi
52488eeb50 set disk status on disk detached (#7518) 2020-08-10 12:05:45 +08:00
Zexi Li
9114556da3 Merge pull request #7516 from zhaoxiangchun/automated-cherry-pick-of-#7512-upstream-release-3.3
Automated cherry pick of #7512: nodealert bugfix:
2020-08-10 11:14:22 +08:00
zhaoxiangchun
abe44154ba nodealert bugfix:
1.重名判断:后端通过resType, nodeName, metric 限制前端可以创建相同metric的报警记录
2020-08-10 10:33:41 +08:00
Zexi Li
89de86a243 Merge pull request #7509 from ioito/automated-cherry-pick-of-#7508-upstream-release-3.3
Automated cherry pick of #7508: fix: avoid nil pointer
2020-08-10 10:24:53 +08:00
tb365
6cdbae22a4 add image upload& s3 upload api (#7515)
Co-authored-by: TangBin <tangbin@yunion.cn>
2020-08-10 10:21:44 +08:00
Qu Xuan
6f5be444c3 fix: avoid nil pointer 2020-08-07 11:16:00 +08:00
Zexi Li
13d165e3c1 Merge pull request #7504 from ioito/hotfix/qx-auto-create-project-fix
fix: backport fix
2020-08-07 11:06:57 +08:00
Zexi Li
d3d977a359 Merge pull request #7499 from ioito/automated-cherry-pick-of-#7498-upstream-release-3.3
Automated cherry pick of #7498: fix: 隐藏auzre经典类型存储
2020-08-07 11:06:07 +08:00
Zexi Li
0f37875b40 Merge pull request #7502 from ioito/automated-cherry-pick-of-#7501-upstream-release-3.3
Automated cherry pick of #7501: fix: 提高zstack认证兼容性
2020-08-07 11:05:14 +08:00
Qu Xuan
bb1752fb7b fix: backport fix 2020-08-06 20:48:49 +08:00
Qu Xuan
b152aa3337 fix: 提高zstack认证兼容性 2020-08-06 19:25:01 +08:00
Qu Xuan
bb01236942 fix: 隐藏auzre经典类型存储 2020-08-06 18:01:11 +08:00
屈轩
7a81820cd3 fix: 增加openstack兼容性 (#7493)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-08-06 11:56:18 +08:00
Zexi Li
525a18dde2 Merge pull request #7485 from wanyaoqi/automated-cherry-pick-of-#7484-upstream-release-3.3
Automated cherry pick of #7484: fix host info get sshkey
2020-08-04 13:51:17 +08:00
wanyaoqi
39bcc36c2d fix host info get sshkey 2020-08-04 10:36:40 +08:00
Zexi Li
138088027e Merge pull request #7481 from swordqiu/automated-cherry-pick-of-#7479-upstream-release-3.3
Automated cherry pick of #7479: fix: typo running_geusts => running_guests
2020-08-03 16:58:40 +08:00
Zexi Li
a023cf56e4 Merge pull request #7475 from ioito/automated-cherry-pick-of-#7474-upstream-release-3.3
Automated cherry pick of #7474: fix: typo
2020-08-03 16:57:44 +08:00
Zexi Li
a17e90ed3b Merge pull request #7478 from swordqiu/automated-cherry-pick-of-#7477-upstream-release-3.3
Automated cherry pick of #7477: fix: filter public network count by zone and region
2020-08-03 16:56:34 +08:00
Qiu Jian
2153a79dcb fix: typo running_geusts => running_guests 2020-08-03 16:33:23 +08:00
Qiu Jian
780cf826c7 fix: filter public network count by zone and region 2020-08-03 15:21:16 +08:00
Qu Xuan
62d2a732e2 fix: typo 2020-08-03 10:56:56 +08:00
Zexi Li
f6409e8511 Merge pull request #7472 from swordqiu/automated-cherry-pick-of-#7470-upstream-release-3.3
Automated cherry pick of #7470: fix: ignore bucket-set-acl not implemented error
2020-08-03 09:25:04 +08:00
Qiu Jian
4cbe29d0c5 fix: ignore bucket-set-acl not implemented error 2020-08-03 02:25:20 +08:00
Zexi Li
221fb3f527 Merge pull request #7469 from zexi/hotfix/update-apis
update apis generate model
2020-08-02 11:15:25 +08:00
Zexi Li
042cd597f6 update apis generate model 2020-08-02 11:13:29 +08:00
Zexi Li
aae065f06f Merge pull request #7468 from zexi/automated-cherry-pick-of-#7455-upstream-release-3.3
Automated cherry pick of #7455: fix: avoid generated codes having duplicate PerformSetScope methods
2020-08-02 10:53:12 +08:00
Qiu Jian
d834f3331e fix: avoid generated codes having duplicate PerformSetScope methods 2020-08-02 10:50:43 +08:00
Zexi Li
703f59760e Merge pull request #7448 from tb365/automated-cherry-pick-of-#7447-upstream-release-3.3
Automated cherry pick of #7447: aws elb listener&rule name too long fix
2020-08-02 10:07:56 +08:00
Zexi Li
5a1935bd54 Merge pull request #7454 from rainzm/automated-cherry-pick-of-#7453-upstream-release-3.3
Automated cherry pick of #7453: opt(scheduler): better sort for hosts when selectHost
2020-08-02 10:04:50 +08:00
屈轩
6e64fc4caa fix: avoid host globalid change (#7466)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-08-02 03:03:03 +08:00
wanyaoqi
8172a551bb fix reauth condition on influxdb not found (#7457) 2020-08-01 21:27:04 +08:00
wanyaoqi
381a2796ba fix cache non lvm disks (#7460) 2020-08-01 21:16:04 +08:00
rainzm
49b0a01b08 opt(scheduler): better sort for hosts when selectHost 2020-08-01 17:35:49 +08:00
Jian Qiu
88497da742 fix: elasticcache_account_reset_password_task.go cherry pick build fail (#7452)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-08-01 16:44:33 +08:00
tangbin
38e02db07f aws elb listener&rule name too long fix 2020-08-01 11:12:39 +08:00
Zexi Li
fbda89ce2a Merge pull request #7419 from rainzm/automated-cherry-pick-of-#7416-upstream-release-3.3
Automated cherry pick of #7416: fix(region): Don't allow address conflicts under vpc
2020-08-01 11:05:54 +08:00
Zexi Li
c11ee3ed56 Merge pull request #7437 from tb365/automated-cherry-pick-of-#7435-upstream-release-3.3
Automated cherry pick of #7435: loadblancer listener modify name fix
2020-08-01 10:58:00 +08:00
rainzm
18f5f9cb8c fix(region): Don't allow address conflicts under vpc
Except for default vpc, vpc and wire have a one-to-one correspondence.
So prohibiting the address conflict of wire does not avoid
the address conflict of default vpc.
2020-08-01 10:51:52 +08:00
tangbin
bb500edc81 fix redis reset account password action log 2020-08-01 10:51:21 +08:00
tangbin
d9488f552e loadblancer listener modify name fix 2020-08-01 10:50:24 +08:00
Zexi Li
b39e4e37e3 Merge pull request #7440 from swordqiu/automated-cherry-pick-of-#7438-upstream-release-3.3
Automated cherry pick of #7438: fix: sync share mode between vpc and wire
2020-08-01 10:39:43 +08:00
Zexi Li
880f889d4a Merge pull request #7442 from wanyaoqi/automated-cherry-pick-of-#7441-upstream-release-3.3
Automated cherry pick of #7441: fix deploy admin auth key
2020-08-01 00:05:55 +08:00
wanyaoqi
7ad7774f80 fix deploy admin auth key 2020-07-31 23:23:06 +08:00
Zexi Li
e64f249453 baremetal: fix hpssactl split last LV size out of limit (#7427) 2020-07-31 22:49:03 +08:00
Qiu Jian
9dfed28459 fix: sync share mode between vpc and wire 2020-07-31 22:31:06 +08:00
Zexi Li
dd7967dd65 Merge pull request #7434 from zexi/automated-cherry-pick-of-#7433-upstream-release-3.3
Automated cherry pick of #7433: capability: public network count filter by default vpc
2020-07-31 20:42:35 +08:00
Zexi Li
80ae1b6cde capability: public network count filter by default vpc 2020-07-31 20:29:57 +08:00
Zexi Li
b513216421 Merge pull request #7418 from ioito/automated-cherry-pick-of-#7417-upstream-release-3.3
Automated cherry pick of #7417: fix: avoid lost backend params
2020-07-31 18:07:39 +08:00
Zexi Li
a0b464b8d6 Merge pull request #7414 from ioito/automated-cherry-pick-of-#7413-upstream-release-3.3
Automated cherry pick of #7413: fix: openstack win image user data need encode
2020-07-31 18:06:41 +08:00
Zexi Li
d29b105efc Merge pull request #7406 from ioito/automated-cherry-pick-of-#7405-upstream-release-3.3
Automated cherry pick of #7405: fix: avoid account sync deadlock
2020-07-31 18:05:24 +08:00
Zexi Li
1cf42ccfcc Merge pull request #7409 from swordqiu/automated-cherry-pick-of-#7400-upstream-release-3.3
Automated cherry pick of #7400: fix: ignore general s3 set acl not implemented error
2020-07-31 18:04:12 +08:00
Zexi Li
353384f32a Merge pull request #7396 from yousong/automated-cherry-pick-of-#7395-upstream-release-3.3
Automated cherry pick of #7395: apis: compute: move struct defs
2020-07-31 18:03:26 +08:00
屈轩
92d8437c45 fix: 避免glance metadata-list project scope无权限 (#7403)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-07-31 18:01:39 +08:00
屈轩
65cd074ffa fix: 优化openstack项目认证 (#7398)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-07-31 18:00:09 +08:00
屈轩
5dc8296332 fix: 避免在仅调整虚拟机磁盘时opslog日志记录mem cpu异常 (#7393)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-07-31 17:56:57 +08:00
Qu Xuan
46fa77b29b fix: avoid lost backend params 2020-07-31 17:19:20 +08:00
Qu Xuan
c39de392c3 fix: openstack win image user data need encode 2020-07-31 16:54:47 +08:00
wanyaoqi
a2d562ccaa fix panic on storage failed get host (#7391) 2020-07-31 16:43:33 +08:00
Qiu Jian
7e47d7aeb4 fix: ignore general s3 set acl not implemented error 2020-07-31 16:38:51 +08:00
Qu Xuan
01f384cf80 fix: avoid account sync deadlock 2020-07-31 16:32:31 +08:00
Yousong Zhou
5833f1a905 lblisteners: remove unused acl_name field 2020-07-30 20:51:54 +08:00
Yousong Zhou
04abe448f1 lblisteners: list: show acl name 2020-07-30 20:51:54 +08:00
Yousong Zhou
ab71f5e6c6 lblisteners: list: show certificate name 2020-07-30 20:51:54 +08:00
Yousong Zhou
8a79c0f708 apis: compute: move struct defs 2020-07-30 20:51:53 +08:00
Zexi Li
c3bab46d23 Merge pull request #7388 from rainzm/automated-cherry-pick-of-#7387-upstream-release-3.3
Automated cherry pick of #7387: fix(region): zone from guesttemplate's preferzone maybe nil
2020-07-30 17:41:39 +08:00
rainzm
5ee9698218 fix(region): zone from guesttemplate's preferzone maybe nil 2020-07-30 16:12:03 +08:00
Zexi Li
925caf9111 Merge pull request #7352 from ioito/automated-cherry-pick-of-#7318-upstream-release-3.3
Automated cherry pick of #7318: fix: openstack多项目问题
2020-07-30 15:53:36 +08:00
Zexi Li
cc6f22d9d7 Merge pull request #7385 from ioito/automated-cherry-pick-of-#7384-upstream-release-3.3
Automated cherry pick of #7384: fix: avoid parse json err nil pointer
2020-07-30 15:15:33 +08:00
Qu Xuan
816b29267c fix: openstack多项目问题 2020-07-30 14:43:55 +08:00
Qu Xuan
f9b51a9f54 fix: avoid parse json err nil pointer 2020-07-30 11:31:57 +08:00
Zexi Li
14ddc69b40 Merge pull request #7379 from ioito/automated-cherry-pick-of-#7378-upstream-release-3.3
Automated cherry pick of #7378: fix: 添加阿里云rds备份恢复限制条件
2020-07-29 21:38:42 +08:00
Zexi Li
d1a2fe39a7 Merge pull request #7377 from swordqiu/automated-cherry-pick-of-#7375-upstream-release-3.3
Automated cherry pick of #7375: fix: change owner should check required domain list
2020-07-29 17:31:52 +08:00
Qu Xuan
ba953f20ce fix: 添加阿里云rds备份恢复限制条件 2020-07-29 16:55:41 +08:00
Qiu Jian
04b4ab3760 fix: change owner should check required domain list 2020-07-29 13:01:54 +08:00
Zexi Li
8fa3e77995 Merge pull request #7373 from ioito/automated-cherry-pick-of-#7358-upstream-release-3.3
Automated cherry pick of #7358: fix: 普通视图下,安全组仅统计可看到的vm count
2020-07-29 10:27:14 +08:00
Zexi Li
583d783ce6 Merge pull request #7372 from zexi/automated-cherry-pick-of-#7371-upstream-release-3.3
Automated cherry pick of #7371: region: schedtag list support resource_types
2020-07-28 20:57:33 +08:00
Zexi Li
fecb127100 Merge pull request #7360 from ioito/automated-cherry-pick-of-#7359-upstream-release-3.3
Automated cherry pick of #7359: fix: 修复vm绑定重复安全组
2020-07-28 20:55:54 +08:00
Qu Xuan
6b2cb20f4c fix: 普通视图下,安全组仅统计可看到的vm count 2020-07-28 20:53:10 +08:00
Zexi Li
632aef4fab Merge pull request #7369 from ioito/automated-cherry-pick-of-#7368-upstream-release-3.3
Automated cherry pick of #7368: fix: 同步sku与磁盘类型关系
2020-07-28 20:48:04 +08:00
Zexi Li
65562c25f5 region: schedtag list support resource_types 2020-07-28 20:46:27 +08:00
Qu Xuan
28a80ac52e fix: 同步sku与磁盘类型关系 2020-07-28 19:47:26 +08:00
Zexi Li
843c52c221 Merge pull request #7365 from zexi/automated-cherry-pick-of-#7364-upstream-release-3.3
Automated cherry pick of #7364: adjust schedule resource condition width
2020-07-28 18:50:23 +08:00
屈轩
bd6b45aaef fix: 避免创建rds备份时对rds进行一些操作 (#7355)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-07-28 18:47:58 +08:00
Zexi Li
7103f4e716 adjust schedule resource condition width 2020-07-28 18:36:58 +08:00
Qu Xuan
f03d021aa5 fix: 修复vm绑定重复安全组 2020-07-28 18:12:55 +08:00
Zexi Li
0b8baeef6a Merge pull request #7349 from wanyaoqi/automated-cherry-pick-of-#7348-upstream-release-3.3
Automated cherry pick of #7348: fix schedtag list output
2020-07-27 20:26:55 +08:00
wanyaoqi
2ac39e704a fix schedtag list output 2020-07-27 20:24:40 +08:00
Zexi Li
df63c8ddde Merge pull request #7339 from rainzm/automated-cherry-pick-of-#7338-upstream-release-3.3
Automated cherry pick of #7338: fix(region): Remove default secgroup for esxi guest
2020-07-27 19:49:19 +08:00
Zexi Li
e0b9cec7e8 Merge pull request #7344 from rainzm/automated-cherry-pick-of-#7343-upstream-release-3.3
Automated cherry pick of #7343: fix: modify list details for guesttemplate
2020-07-27 19:48:22 +08:00
Zexi Li
4d96c8fc75 Merge pull request #7347 from swordqiu/automated-cherry-pick-of-#7346-upstream-release-3.3
Automated cherry pick of #7346: fix: add default perform allow policy to sysadmin
2020-07-27 19:47:24 +08:00
Qiu Jian
3f09d00198 fix: add default perform allow policy to sysadmin 2020-07-27 19:11:17 +08:00
Zexi Li
738425170b Merge pull request #7337 from yousong/automated-cherry-pick-of-#7336-upstream-release-3.3
Automated cherry pick of #7336: guests: guests with vpc nics are available for eip association
2020-07-27 15:54:58 +08:00
Zexi Li
27a4696a6d Merge pull request #7323 from swordqiu/automated-cherry-pick-of-#7321-upstream-release-3.3
Automated cherry pick of #7321: fix: choose candidate list from the list returned from backend
2020-07-27 15:54:03 +08:00
Zexi Li
ce13c0cbe9 Merge pull request #7320 from ioito/automated-cherry-pick-of-#7319-upstream-release-3.3
Automated cherry pick of #7319: fix: 单独添加更新账单文件日志
2020-07-27 15:52:53 +08:00
Zexi Li
3617855bcb Merge pull request #7317 from zhaoxiangchun/automated-cherry-pick-of-#7316-upstream-release-3.3
Automated cherry pick of #7316: 修复统一报警bug
2020-07-27 15:51:55 +08:00
Zexi Li
0d66aaa734 Merge pull request #7326 from swordqiu/automated-cherry-pick-of-#7324-upstream-release-3.3
Automated cherry pick of #7324: fix: schedtag should be system resource
2020-07-27 15:50:04 +08:00
Zexi Li
b68c40e5a5 Merge pull request #7331 from swordqiu/automated-cherry-pick-of-#7330-upstream-release-3.3
Automated cherry pick of #7330: fix: do accessibility check when dissociate eip from resource
2020-07-27 15:22:23 +08:00
Zexi Li
c40ececb34 Merge pull request #7329 from tb365/automated-cherry-pick-of-#7327-upstream-release-3.3
Automated cherry pick of #7327: huawei fetch regions&projects fix
2020-07-27 15:22:00 +08:00
rainzm
a66ba3f391 Add metadata for GuestTempalte details 2020-07-27 15:17:55 +08:00
rainzm
02b30326fd Add network info when list scalingGroup details 2020-07-27 15:17:55 +08:00
rainzm
d06d2026f4 fix: modify list details for guesttemplate 2020-07-27 15:17:55 +08:00
Zexi Li
35ddf5da65 Merge pull request #7334 from swordqiu/automated-cherry-pick-of-#7332-upstream-release-3.3
Automated cherry pick of #7332: fix: cloud account delete may fail due to inconsistent status
2020-07-27 15:13:09 +08:00
rainzm
cd01258555 fix(region): Remove default secgroup for esxi guest
1. InitializeData remove all secgroup_id of esxi guest from database
2. Set input.SecgroupId as empty for guest whose GetMaxSecurityGroupCount
return 0
2020-07-27 14:53:45 +08:00
Yousong Zhou
2270704c4f guests: guests with vpc nics are available for eip association 2020-07-27 11:01:47 +08:00
屈轩
f2456d2364 fix: 避免status_code>=400并且resp为空时err为nil (#7265)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-07-27 04:42:52 +08:00
yunion-ci-robot
8d1d9ece01 Merge pull request #7312 from ioito/automated-cherry-pick-of-#7310-upstream-release-3.3
Automated cherry pick of #7310: fix: 支持多项目安全组规则过滤
2020-07-26 00:03:54 +08:00
Qiu Jian
f624ab1529 fix: cloud account delete may fail due to inconsistent status 2020-07-25 23:10:24 +08:00
Qiu Jian
ded8da0016 fix: do accessibility check when dissociate eip from resource 2020-07-24 22:54:41 +08:00
yunion-ci-robot
58ed07b4e3 Merge pull request #7304 from wanyaoqi/automated-cherry-pick-of-#7302-upstream-release-3.3
Automated cherry pick of #7302: fix clone clean pending usage
2020-07-24 22:52:43 +08:00
zhaoxiangchun
6193221764 修改报警消息模版:
1.模版中使用ftm.sprintf
  对float类型进行转换,避免消息中数值以十进制的指数次格式显示,提高可读性
2.增加text/tempalte,解决飞书等消息中消息内容被编码的问题
2020-07-24 22:41:11 +08:00
zhaoxiangchun
bb66e2d197 修复统一报警bug
1.对系统内置的规则的处理,可以进行正确判断推送消息
2.一些初始化,validate的判断逻辑的修改
2020-07-24 22:41:11 +08:00
tangbin
92fbc44b6d go fmt 2020-07-24 18:29:15 +08:00
tangbin
d93edbe427 go fmt 2020-07-24 18:29:14 +08:00
tangbin
a4d89b1f6c host upload template check 2020-07-24 18:29:14 +08:00
tangbin
5255df021e huawei fetch regions&projects fix 2020-07-24 18:29:14 +08:00
Qiu Jian
4d33d1a703 fix: schedtag should be system resource 2020-07-24 17:04:45 +08:00
Qiu Jian
c90c0944c1 fix: choose candidate list from the list returned from backend 2020-07-24 16:44:23 +08:00
Qu Xuan
e7fc9b94b0 fix: 单独添加更新账单文件日志 2020-07-24 14:31:36 +08:00
Zexi Li
7512e48236 Merge pull request #7292 from wanyaoqi/automated-cherry-pick-of-#7143-upstream-release-3.3
Automated cherry pick of #7143: - add precheck for perform action
2020-07-24 10:48:14 +08:00
Zexi Li
bb6e4b4610 Merge pull request #7315 from wanyaoqi/automated-cherry-pick-of-#7314-upstream-release-3.3
Automated cherry pick of #7314: rename vgname centos
2020-07-24 10:47:01 +08:00
wanyaoqi
7ef340fb68 rename vgname centos 2020-07-23 21:33:26 +08:00
Qu Xuan
fef5147ae4 fix: 支持多项目安全组规则过滤 2020-07-23 20:36:27 +08:00
Zexi Li
afed84a502 Merge pull request #7309 from swordqiu/automated-cherry-pick-of-#7303-upstream-release-3.3
Automated cherry pick of #7303: fix: domain resource domain share to system when non_default_domain_projects off
2020-07-23 20:34:08 +08:00
wanyaoqi
a329cd536b fix clone clean pending usage 2020-07-23 18:38:34 +08:00
wanyaoqi
32b36ee10e capabilites add available host count 2020-07-23 18:16:23 +08:00
Qiu Jian
671d202271 fix: domain resource domain share to system when non_default_domain_projects off 2020-07-23 17:57:59 +08:00
Zexi Li
7e629b3c80 Merge pull request #7295 from wanyaoqi/automated-cherry-pick-of-#7294-upstream-release-3.3
Automated cherry pick of #7294: fix snapshot clean pending usage
2020-07-23 13:48:03 +08:00
Zexi Li
3d3ff3f866 Merge pull request #7280 from rainzm/automated-cherry-pick-of-#7279-upstream-release-3.3
Automated cherry pick of #7279: feat(scheduler): Change the action for guests with backup and instanceGroup
2020-07-23 13:36:20 +08:00
wanyaoqi
2c27db42c2 fix snapshot clean pending usage 2020-07-23 11:35:39 +08:00
Zexi Li
18dd47c713 Merge pull request #7287 from tb365/automated-cherry-pick-of-#7286-upstream-release-3.3
Automated cherry pick of #7286: apigateway host imports data validate
2020-07-22 21:43:39 +08:00
wanyaoqi
ec933e4805 - add precheck for perform action
- auto switch to backup

- add sync cleand schedule cache

- add reconcile with backup

- add manual reconcile backup
2020-07-22 21:12:32 +08:00
tangbin
2ff5d2aaf4 format fix 2020-07-22 17:50:13 +08:00
tangbin
b5aceb67f9 fix empty else 2020-07-22 17:50:13 +08:00
tangbin
2794c84ac0 fix host import 2020-07-22 17:50:11 +08:00
tangbin
ce9646f9e9 fix huawei delete resource 2020-07-22 17:50:10 +08:00
tangbin
be8da39ce1 fix huawei elb disable healthcheck 2020-07-22 17:50:10 +08:00
tangbin
dacc8adce1 lb sync project fix 2020-07-22 17:50:10 +08:00
tangbin
b79c410b0e add more log 2020-07-22 17:50:09 +08:00
tangbin
b5754d2e3d apigateway host imports data validate 2020-07-22 17:50:09 +08:00
Zexi Li
8a6ee6c9ab Merge pull request #7277 from ioito/automated-cherry-pick-of-#7276-upstream-release-3.3
Automated cherry pick of #7276: fix: 避免未能导出共享安全组规则
2020-07-22 13:55:41 +08:00
Zexi Li
309c1ca3f1 Merge pull request #7274 from swordqiu/automated-cherry-pick-of-#7273-upstream-release-3.3
Automated cherry pick of #7273: fix: image upload not clean pending usage
2020-07-22 13:54:37 +08:00
Zexi Li
f3bc3ca51d Merge pull request #7282 from rainzm/automated-cherry-pick-of-#7281-upstream-release-3.3
Automated cherry pick of #7281: fix(esxi): Select correct unitNumber for ide control when creating disk
2020-07-22 13:52:22 +08:00
Rain Zheng
7c82002903 fix(esxi): Select correct unitNumber for ide control when creating disk 2020-07-21 20:48:39 +08:00
rainzm
2a0c16c6f3 feat(scheduler): Change the action for guests with backup and instanceGroup
1. 对于主机组的打散功能,放在调度的最后单独处理。
2. 主备机的调度,通过在主机和备机之间设置一个粒度为1的主机组来实现。
3. 虚拟机的调度默认打散,在打散的基础上,选择容量大的宿主机。
3. 主备机中,主机和备机的默认打散流程分散开,互不影响。
2020-07-21 20:34:36 +08:00
Qu Xuan
1c4e9e00a5 fix: 避免未能导出共享安全组规则 2020-07-21 17:14:18 +08:00
yunion-ci-robot
3599904eee Merge pull request #7271 from zexi/automated-cherry-pick-of-#7270-upstream-release-3.3
Automated cherry pick of #7270: baremetal: set zone when enable netif
2020-07-21 11:48:24 +08:00
Qiu Jian
ba983df32b fix: image upload not clean pending usage 2020-07-21 01:43:04 +08:00
yunion-ci-robot
194105f4d3 Merge pull request #7268 from tb365/automated-cherry-pick-of-#7267-upstream-release-3.3
Automated cherry pick of #7267: fix GetOrCreateVpcForClassicNetwork
2020-07-20 20:49:28 +08:00
Zexi Li
ea374ac0c0 Merge pull request #7263 from tb365/automated-cherry-pick-of-#7237-upstream-release-3.3
Automated cherry pick of #7237: huawei eip delete fix
2020-07-20 20:47:39 +08:00
Zexi Li
df4d88e195 baremetal: set zone when enable netif 2020-07-20 20:45:06 +08:00
tangbin
f9c4221125 fix GetOrCreateVpcForClassicNetwork 2020-07-20 18:28:48 +08:00
Zexi Li
f246c47a33 Merge pull request #7258 from yousong/bugfix/yousong-lbagent-create-influxdb
[3.3] region: lbagents: skip tls check for default influxdb endpoint url
2020-07-20 12:21:51 +08:00
tangbin
fdcaa1c8e7 huawei eip delete fix 2020-07-20 10:52:31 +08:00
Yousong Zhou
7f7aef031a region: lbagents: skip tls check for default influxdb endpoint url 2020-07-20 09:01:50 +08:00
Zexi Li
1451a75646 Merge pull request #7239 from rainzm/automated-cherry-pick-of-#7238-upstream-release-3.3
Automated cherry pick of #7238: fix: default vpc must be shared globally
2020-07-20 02:09:39 +08:00
Zexi Li
5c57493f5b Merge pull request #7240 from ioito/automated-cherry-pick-of-#7225-upstream-release-3.3
Automated cherry pick of #7225: fix: rds备份恢复优化
2020-07-20 02:07:41 +08:00
Zexi Li
af2bf4e8cd Merge pull request #7229 from wanyaoqi/automated-cherry-pick-of-#7228-upstream-release-3.3
Automated cherry pick of #7228: fix server sync status
2020-07-20 02:06:28 +08:00
Zexi Li
42fbf12d66 Merge pull request #7235 from ioito/automated-cherry-pick-of-#7234-upstream-release-3.3
Automated cherry pick of #7234: fix: globalvpc跟随云账号共享
2020-07-20 02:05:09 +08:00
Zexi Li
1ec53dbf7f Merge pull request #7257 from zhaoxiangchun/automated-cherry-pick-of-#7256-upstream-release-3.3
Automated cherry pick of #7256: 修复监控报警规则删除的问题
2020-07-20 02:03:50 +08:00
Zexi Li
37c2e004fb Merge pull request #7233 from tb365/automated-cherry-pick-of-#7231-upstream-release-3.3
Automated cherry pick of #7231: acl delete condition fix
2020-07-20 02:02:36 +08:00
zhaoxiangchun
c65fc0f1dc 修复监控报警规则删除的问题 2020-07-19 21:29:13 +08:00
Zexi Li
c371e04aaf Merge pull request #7249 from wanyaoqi/automated-cherry-pick-of-#7248-upstream-release-3.3
Automated cherry pick of #7248: fix error output
2020-07-19 20:53:47 +08:00
Zexi Li
9c61ce86cc Merge pull request #7255 from zexi/automated-cherry-pick-of-#7254-upstream-release-3.3
Automated cherry pick of #7254: scheduler: fix storage filter duplicate error message
2020-07-19 20:52:53 +08:00
Zexi Li
d6b1fa02d8 scheduler: fix storage filter duplicate error message 2020-07-19 20:26:56 +08:00
Zexi Li
e3cd4be117 Merge pull request #7253 from swordqiu/automated-cherry-pick-of-#7251-upstream-release-3.3
Automated cherry pick of #7251: fix: quota usage not updated after disk resizing
2020-07-19 20:25:12 +08:00
Qiu Jian
508f30901a fix: quota usage not updated after disk resizing 2020-07-19 13:25:04 +08:00
wanyaoqi
18bae18498 fix error output 2020-07-19 12:35:04 +08:00
Qu Xuan
ecb7249a1d fix: rds备份恢复优化 2020-07-18 20:47:47 +08:00
rainzm
fa67bd8312 fix: default vpc must be shared globally
1. For default vpc, prohibit private operation.
2. For default vpc, prohibit public operation without scope 'system'.
2020-07-18 19:42:19 +08:00
Qu Xuan
f8471832e9 fix: globalvpc跟随云账号共享 2020-07-17 20:46:32 +08:00
tangbin
3e5eceeefa acl delete condition fix 2020-07-17 20:44:52 +08:00
wanyaoqi
0e617ec137 fix server sync status 2020-07-17 20:25:16 +08:00
Zexi Li
9b1ea9f303 Merge pull request #7226 from ioito/automated-cherry-pick-of-#7224-upstream-release-3.3
Automated cherry pick of #7224: fix: 过滤可用eip
2020-07-17 20:25:09 +08:00
Zexi Li
94555e348c Merge pull request #7222 from ioito/automated-cherry-pick-of-#7221-upstream-release-3.3
Automated cherry pick of #7221: fix: 避免乌兰察布区域拉取资源异常
2020-07-17 20:24:01 +08:00
Qu Xuan
23e17fe0a1 fix: 过滤可用eip 2020-07-17 20:16:27 +08:00
Qu Xuan
a443975f7e fix: 避免乌兰察布区域拉取资源异常 2020-07-17 18:52:52 +08:00
Zexi Li
5cd0873ee8 Merge pull request #7217 from rainzm/automated-cherry-pick-of-#7216-upstream-release-3.3
Automated cherry pick of #7216: fix: prefetch image error when create guest with vmware template
2020-07-17 10:16:36 +08:00
Zexi Li
7e796affb3 Merge pull request #7214 from tb365/automated-cherry-pick-of-#7213-upstream-release-3.3
Automated cherry pick of #7213: sync classic redis fix
2020-07-17 10:15:48 +08:00
Zexi Li
4b2cb45b0c Merge pull request #7204 from yousong/automated-cherry-pick-of-#7202-upstream-release-3.3
Automated cherry pick of #7202: mcclient: options: loadbalanceragents: yum as the default deploy method
2020-07-17 10:15:10 +08:00
Zexi Li
dde94aa754 Merge pull request #7199 from yousong/automated-cherry-pick-of-#7198-upstream-release-3.3
Automated cherry pick of #7198: ansibleserver: register metadata manager
2020-07-17 10:11:56 +08:00
Zexi Li
771d8b42aa Merge pull request #7196 from ioito/automated-cherry-pick-of-#7195-upstream-release-3.3
Automated cherry pick of #7195: fix: sec rule export missing fields
2020-07-17 10:10:23 +08:00
Zexi Li
544b62c683 Merge pull request #7193 from wanyaoqi/automated-cherry-pick-of-#7192-upstream-release-3.3
Automated cherry pick of #7192: add params auto_migrate_on_host_down
2020-07-17 10:09:09 +08:00
Zexi Li
1c2c0c75f4 Merge pull request #7211 from ioito/automated-cherry-pick-of-#7210-upstream-release-3.3
Automated cherry pick of #7210: fix: not work for network-list --zones
2020-07-17 10:08:15 +08:00
rainzm
4ef5267a85 fix: prefetch image error when create guest with vmware template
1. Only need the corresponding vmware template in the vcenter where the host is
located.
2. Chose storagecache which cacheimage is ready before deploying.
2020-07-16 21:37:14 +08:00
tangbin
30aa75e047 sync classic redis fix 2020-07-16 20:29:20 +08:00
yunion-ci-robot
1b29a59d8f Merge pull request #7203 from zexi/automated-cherry-pick-of-#7201-upstream-release-3.3
Automated cherry pick of #7201: webconsole: fix old session make new session closed
2020-07-16 20:22:18 +08:00
Qu Xuan
d6b83fbbf8 fix: not work for network-list --zones 2020-07-16 19:06:04 +08:00
Yousong Zhou
f30b191d05 region: lbagents: turn off guest src check 2020-07-16 18:50:05 +08:00
Yousong Zhou
4a0d019b6e region: loadbalanceragents: yum as the default method 2020-07-16 18:50:05 +08:00
Yousong Zhou
5218f8aab3 mcclient: options: loadbalanceragents: yum as the default deploy method 2020-07-16 18:50:05 +08:00
Zexi Li
37ee6f8446 webconsole: fix old session make new session closed 2020-07-16 18:49:54 +08:00
Yousong Zhou
e5dd8efd7a build: ansibleserver: use native alpine, include openssh 2020-07-16 18:09:52 +08:00
Yousong Zhou
916943a7c2 ansibleserver: register metadata manager
To quash the following error in log

  [E 200716 15:20:40 db.(*SMetadataResourceBaseModelManager).FetchCustomizeColumns(metadataresource.go:136)] FetchQueryObjectsByIds metadata fail Error 1146: Table 'yunionansible.metadata_tbl' doesn't exist
2020-07-16 18:09:52 +08:00
Qu Xuan
cee24b2a7d fix: sec rule export missing fields 2020-07-16 17:14:17 +08:00
wanyaoqi
b806e536f1 add params auto_migrate_on_host_down 2020-07-16 15:03:05 +08:00
Zexi Li
0bfba15dfc Merge pull request #7172 from ioito/automated-cherry-pick-of-#7171-upstream-release-3.3
Automated cherry pick of #7171: fix: 修复cloudid get权限问题
2020-07-16 11:19:23 +08:00
Zexi Li
a933d5d7a8 Merge pull request #7175 from ioito/automated-cherry-pick-of-#7174-upstream-release-3.3
Automated cherry pick of #7174: fix: 添加secgroup rule过滤参数
2020-07-16 11:18:49 +08:00
Zexi Li
c09174dd39 Merge pull request #7187 from ioito/automated-cherry-pick-of-#7186-upstream-release-3.3
Automated cherry pick of #7186: fix: clouduser's cloudgroups info
2020-07-16 11:18:09 +08:00
Zexi Li
1a36e3a512 Merge pull request #7189 from ioito/automated-cherry-pick-of-#7188-upstream-release-3.3
Automated cherry pick of #7188: fix: check azure image format when rebuild root
2020-07-16 11:09:31 +08:00
Zexi Li
cac1db5391 Merge pull request #7178 from ioito/automated-cherry-pick-of-#7177-upstream-release-3.3
Automated cherry pick of #7177: fix: 避免华为云安全组规则删除失败
2020-07-16 10:15:30 +08:00
Qu Xuan
1b5b8081f1 fix: check azure image format when rebuild root 2020-07-15 18:48:00 +08:00
Zexi Li
52e02d85b9 Merge pull request #7184 from wanyaoqi/automated-cherry-pick-of-#7151-upstream-release-3.3
Automated cherry pick of #7151: disable procutils print error info
2020-07-15 17:43:06 +08:00
Zexi Li
14f10307c1 Merge pull request #7182 from wanyaoqi/automated-cherry-pick-of-#7181-upstream-release-3.3
Automated cherry pick of #7181: misc ha guest fix
2020-07-15 17:42:44 +08:00
Qu Xuan
64599b4819 fix: 避免华为云安全组规则删除失败 2020-07-15 17:13:55 +08:00
Qu Xuan
fb229f6c79 fix: clouduser's cloudgroups info 2020-07-15 17:09:23 +08:00
wanyaoqi
65408519ae misc ha guest fix 2020-07-15 17:06:02 +08:00
wanyaoqi
4831aee2dc disable procutils print error info 2020-07-15 17:02:11 +08:00
Qu Xuan
a5fc7c807c fix: 添加secgroup rule过滤参数 2020-07-15 14:31:43 +08:00
Qu Xuan
09f2b2af26 fix: 修复cloudid get权限问题 2020-07-15 11:08:17 +08:00
Zexi Li
2b923eb5b7 Merge pull request #7169 from wanyaoqi/automated-cherry-pick-of-#7168-upstream-release-3.3
Automated cherry pick of #7168: fix list guests on host
2020-07-15 10:45:59 +08:00
Zexi Li
ebe81b9c51 Merge pull request #7167 from ioito/automated-cherry-pick-of-#7166-upstream-release-3.3
Automated cherry pick of #7166: fix: 修复cloudid用户列表权限问题
2020-07-15 10:35:58 +08:00
Zexi Li
b31f35ba26 Merge pull request #7159 from yousong/automated-cherry-pick-of-#7158-upstream-release-3.3
Automated cherry pick of #7158: iproute2: address: make Exact idempotent
2020-07-15 10:34:36 +08:00
Zexi Li
f9c6a23280 Merge pull request #7165 from tb365/automated-cherry-pick-of-#7163-upstream-release-3.3
Automated cherry pick of #7163: cloudprovider usable filter with zone
2020-07-15 10:33:59 +08:00
wanyaoqi
f09eb6690d fix list guests on host 2020-07-14 22:34:48 +08:00
Qu Xuan
c003f78f62 fix: azure 支持权限 2020-07-14 21:24:24 +08:00
Qu Xuan
26434683c4 fix: 修复cloudid用户列表权限问题 2020-07-14 21:10:59 +08:00
tangbin
26757cb8d8 cloudprovider usable filter with zone 2020-07-14 19:55:51 +08:00
Zexi Li
c90420b61f Merge pull request #7156 from ioito/automated-cherry-pick-of-#7155-upstream-release-3.3
Automated cherry pick of #7155: fix: 优化webconsole代码&bugfix
2020-07-14 17:53:04 +08:00
Yousong Zhou
4b6d385e1a iproute2: address: make Exact idempotent
Idempotence against address not available for Exact is not a bad idea if
we look at the name of that func

This should accomodate the race condition where keepalived will remove
vips should the primary address used for vrrp comms is removed, causing
later addr del to fail with "cannot assign requested address"
2020-07-14 16:41:48 +08:00
Qu Xuan
ea3097240e fix: 优化webconsole代码&bugfix 2020-07-14 15:08:58 +08:00
Zexi Li
1881789981 Merge pull request #7153 from zexi/automated-cherry-pick-of-#7152-upstream-release-3.3
Automated cherry pick of #7152: climc: refactor k8s resource
2020-07-14 12:19:35 +08:00
Zexi Li
a6db3d353c climc: refactor k8s resource 2020-07-14 11:45:39 +08:00
Zexi Li
4882ead845 Merge pull request #7146 from rainzm/automated-cherry-pick-of-#7145-upstream-release-3.3
Automated cherry pick of #7145: fix guest template health check
2020-07-14 11:35:43 +08:00
Zexi Li
8a8d0e1cb3 Merge pull request #7148 from rainzm/automated-cherry-pick-of-#7147-upstream-release-3.3
Automated cherry pick of #7147: fix: mo.VirtualMachine's Config maybe nil
2020-07-14 11:34:43 +08:00
Zexi Li
bb2e014514 Merge pull request #7144 from zexi/hotfix/remove-informer-informer-3.3
remove informer code for release/3.3
2020-07-14 11:34:08 +08:00
rainzm
0420266b7d fix: mo.VirtualMachine's Config maybe nil 2020-07-13 23:09:57 +08:00
rainzm
550883197f fix guest template health check 2020-07-13 22:56:18 +08:00
Zexi Li
a365a0f459 remove informer code for release/3.3 2020-07-13 21:40:02 +08:00
Zexi Li
5d82212284 Merge pull request #7137 from tb365/automated-cherry-pick-of-#7135-upstream-release-3.3
Automated cherry pick of #7135: user batch register bugfix
2020-07-13 21:28:44 +08:00
Zexi Li
99caf7b142 Merge pull request #7141 from ioito/automated-cherry-pick-of-#7140-upstream-release-3.3
Automated cherry pick of #7140: fix: 修复阿里云同步安全组规则异常问题
2020-07-13 21:24:31 +08:00
Qu Xuan
2f42e9e5f4 fix: 修复阿里云同步安全组规则异常问题 2020-07-13 20:45:41 +08:00
tangbin
b52eb8491c user batch register bugfix 2020-07-13 14:58:26 +08:00
Zexi Li
32638ac3c0 Merge pull request #7131 from wanyaoqi/automated-cherry-pick-of-#7130-upstream-release-3.3
Automated cherry pick of #7130: vendor update: update jsonutils
2020-07-10 20:18:12 +08:00
Zexi Li
2bc5db8d20 Merge pull request #7126 from wanyaoqi/automated-cherry-pick-of-#7125-upstream-release-3.3
Automated cherry pick of #7125: - fix local storage init local man
2020-07-10 20:15:39 +08:00
wanyaoqi
d335c570c6 vendor update: update jsonutils 2020-07-10 16:18:54 +08:00
wanyaoqi
fe472cbf49 - fix local storage init local man
- fix rbd set storage info
2020-07-10 14:48:58 +08:00
Zexi Li
c17436cdb0 Merge pull request #7124 from swordqiu/automated-cherry-pick-of-#7123-upstream-release-3.3
Automated cherry pick of #7123: hotfix: vpc change owners with wire
2020-07-10 10:27:44 +08:00
Zexi Li
a2d7854fb7 Merge pull request #7122 from wanyaoqi/automated-cherry-pick-of-#7121-upstream-release-3.3
Automated cherry pick of #7121: misc fix
2020-07-10 10:27:15 +08:00
Zexi Li
39776f339a Merge pull request #7120 from ioito/automated-cherry-pick-of-#7119-upstream-release-3.3
Automated cherry pick of #7119: fix: 避免google clouduser同步权限异常
2020-07-10 10:26:51 +08:00
Qiu Jian
c97e2ab1c2 hotfix: vpc change owners with wire 2020-07-10 01:50:28 +08:00
wanyaoqi
5070775cd3 misc fix 2020-07-09 22:22:12 +08:00
Qu Xuan
7056fa01b4 fix: 避免google clouduser同步权限异常 2020-07-09 21:37:33 +08:00
Zexi Li
3f391649c6 Merge pull request #7117 from ioito/automated-cherry-pick-of-#7116-upstream-release-3.3
Automated cherry pick of #7116: fix: 修复vpc同步异常问题
2020-07-09 21:23:11 +08:00
Zexi Li
f73e11b0bd Merge pull request #7107 from wanyaoqi/automated-cherry-pick-of-#7106-upstream-release-3.3
Automated cherry pick of #7106: fix set storage info bind mount
2020-07-09 21:23:00 +08:00
Zexi Li
99cf724d2c Merge pull request #7114 from ioito/automated-cherry-pick-of-#7113-upstream-release-3.3
Automated cherry pick of #7113: fix: 避免越界访问
2020-07-09 21:21:17 +08:00
Qu Xuan
ef6d0c2adc fix: 修复vpc同步异常问题 2020-07-09 21:05:09 +08:00
Qu Xuan
09ccf107cb fix: 避免越界访问 2020-07-09 20:24:41 +08:00
yunion-ci-robot
cea59e8794 Merge pull request #7105 from tb365/automated-cherry-pick-of-#7096-upstream-release-3.3
Automated cherry pick of #7096: update vendor
2020-07-09 16:13:57 +08:00
wanyaoqi
18a023f2fb fix set storage info bind mount 2020-07-09 14:54:53 +08:00
Zexi Li
4c1d9e5e0f Merge pull request #7103 from swordqiu/automated-cherry-pick-of-#7102-upstream-release-3.3
Automated cherry pick of #7102: fix: opslog show the owners operation logs only
2020-07-09 14:18:55 +08:00
Zexi Li
db43b87568 Merge pull request #7101 from swordqiu/automated-cherry-pick-of-#7100-upstream-release-3.3
Automated cherry pick of #7100: fix: remove default allow policy for storages
2020-07-09 14:06:59 +08:00
Zexi Li
25d34f34b0 Merge pull request #7099 from ioito/automated-cherry-pick-of-#7098-upstream-release-3.3
Automated cherry pick of #7098: fix: cloudid 权限修复
2020-07-09 14:03:37 +08:00
tangbin
13f44debcd update vendor 2020-07-09 13:42:03 +08:00
Qiu Jian
a186f25871 fix: opslog show the owners operation logs only 2020-07-09 11:26:13 +08:00
Qiu Jian
8f7223b1d6 fix: remove default allow policy for storages 2020-07-09 11:15:19 +08:00
Qu Xuan
05c730acea fix: cloudid 权限修复 2020-07-09 10:46:50 +08:00
Zexi Li
b921d993ab Merge pull request #7097 from ioito/automated-cherry-pick-of-#7083-upstream-release-3.3
Automated cherry pick of #7083: fix: cloudid 异常修复
2020-07-08 21:26:09 +08:00
Zexi Li
434e0d8be2 Merge pull request #7094 from ioito/automated-cherry-pick-of-#7093-upstream-release-3.3
Automated cherry pick of #7093: fix: 修复资源组云上同步异常问题
2020-07-08 21:24:25 +08:00
Qu Xuan
b4ed259633 fix: cloudid 异常修复 2020-07-08 21:01:19 +08:00
Qu Xuan
89cb75bfeb fix: 修复资源组云上同步异常问题 2020-07-08 16:25:41 +08:00
Zexi Li
1ca0859d51 Merge pull request #7092 from ioito/automated-cherry-pick-of-#7091-upstream-release-3.3
Automated cherry pick of #7091: fix: 修复qcloud同步权限组异常问题
2020-07-08 14:10:42 +08:00
Zexi Li
f62bd8968e Merge pull request #7086 from ioito/automated-cherry-pick-of-#7085-upstream-release-3.3
Automated cherry pick of #7085: fix: 避免请求中国区iam异常
2020-07-08 14:10:19 +08:00
Zexi Li
136f2c547d Merge pull request #7080 from ioito/automated-cherry-pick-of-#7079-upstream-release-3.3
Automated cherry pick of #7079: fix: 修复腾讯云操作日志时间异常问题
2020-07-08 14:09:32 +08:00
Zexi Li
1caf8b6c0b Merge pull request #7089 from ioito/automated-cherry-pick-of-#7088-upstream-release-3.3
Automated cherry pick of #7088: fix: 修复azure 项目同步问题
2020-07-08 01:38:02 +08:00
Zexi Li
8f6b72bb82 Merge pull request #7084 from swordqiu/automated-cherry-pick-of-#7069-upstream-release-3.3
Automated cherry pick of #7069: fix: perform private on vpc will private all wires if no networks in wires
2020-07-07 22:37:45 +08:00
Qu Xuan
21178638f0 fix: 修复qcloud同步权限组异常问题 2020-07-07 19:48:53 +08:00
Qu Xuan
e8ff39a011 fix: 修复azure 项目同步问题 2020-07-07 18:44:09 +08:00
Qu Xuan
5f9b6622f0 fix: 避免请求中国区iam异常 2020-07-07 16:56:45 +08:00
Qiu Jian
2286ef19b4 fix: perform private on vpc will private all wires if no networks in wires 2020-07-07 16:14:28 +08:00
Qu Xuan
8a1d2d1eaf fix: 修复腾讯云操作日志时间异常问题 2020-07-07 14:58:49 +08:00
Zexi Li
adc50ec864 Merge pull request #7055 from ioito/automated-cherry-pick-of-#7054-upstream-release-3.3
Automated cherry pick of #7054: fix: 避免cloudprovider同步缺失
2020-07-07 14:49:03 +08:00
Zexi Li
4963d750fb Merge pull request #7060 from ioito/automated-cherry-pick-of-#7059-upstream-release-3.3
Automated cherry pick of #7059: fix: cloud poilcy count
2020-07-07 14:48:17 +08:00
Zexi Li
8bc891590d Merge pull request #7072 from ioito/automated-cherry-pick-of-#7066-upstream-release-3.3
Automated cherry pick of #7066: fix: json request 支持自定义匹配err
2020-07-07 14:46:44 +08:00
Zexi Li
efbf033c2d Merge pull request #7052 from ioito/automated-cherry-pick-of-#7050-upstream-release-3.3
Automated cherry pick of #7050: fix: google rds regional and zonal
2020-07-07 14:45:44 +08:00
Zexi Li
4fe7006920 Merge pull request #7078 from ioito/automated-cherry-pick-of-#7077-upstream-release-3.3
Automated cherry pick of #7077: fix: 修复elastic cache sku zone_id异常问题
2020-07-07 14:44:12 +08:00
Zexi Li
5e0d66d5df Merge pull request #7075 from ioito/automated-cherry-pick-of-#7074-upstream-release-3.3
Automated cherry pick of #7074: fix: 分开统计安全组关联虚拟机数量
2020-07-07 14:43:35 +08:00
Qu Xuan
76906efea2 fix: 修复elastic cache sku zone_id异常问题 2020-07-07 12:11:58 +08:00
Qu Xuan
a997cf4982 fix: 分开统计安全组关联虚拟机数量 2020-07-07 11:49:11 +08:00
Qu Xuan
6ac6768e36 fix: json request 支持自定义匹配err 2020-07-07 11:16:58 +08:00
Zexi Li
acdc1dafd3 Merge pull request #7068 from swordqiu/automated-cherry-pick-of-#7067-upstream-release-3.3
Automated cherry pick of #7067: fix: remove default host list policy
2020-07-07 11:14:44 +08:00
Zexi Li
b60c97822d Merge pull request #7057 from yousong/automated-cherry-pick-of-#7056-upstream-release-3.3
Automated cherry pick of #7056: vpcagent: ClaimVpcGuestDnsRecords: guard against pending_deleted guests
2020-07-07 11:13:53 +08:00
Zexi Li
279d1398cc Merge pull request #7062 from rainzm/automated-cherry-pick-of-#7061-upstream-release-3.3
Automated cherry pick of #7061: Update docker image onecloud-base and its references
2020-07-07 11:12:46 +08:00
Qiu Jian
eb342a70ab fix: remove default host list policy 2020-07-06 22:05:40 +08:00
rainzm
eb7b055ca2 Update docker image onecloud-base and its references 2020-07-06 21:00:22 +08:00
Qu Xuan
367d3f1470 fix: cloud poilcy count 2020-07-06 17:17:32 +08:00
Yousong Zhou
821283952d vpcagent: ClaimVpcGuestDnsRecords: guard against pending_deleted guests 2020-07-06 16:45:22 +08:00
Qu Xuan
e7cd84275e fix: 避免cloudprovider同步缺失 2020-07-06 16:27:06 +08:00
Zexi Li
4bd60ccd38 Merge pull request #7051 from zhaoxiangchun/automated-cherry-pick-of-#7046-upstream-release-3.3
Automated cherry pick of #7046: 增加influxdb的tag 的一些filter
2020-07-06 11:47:14 +08:00
Qu Xuan
79d0169855 fix: google rds regional and zonal 2020-07-06 11:18:25 +08:00
zhaoxiangchun
5db35871eb 增加influxdb的tag 的一些filter 2020-07-06 11:09:29 +08:00
Zexi Li
21d67a4297 Merge pull request #7043 from swordqiu/automated-cherry-pick-of-#7042-upstream-release-3.3
Automated cherry pick of #7042: feature: project filter that list jointable projects for user or group
2020-07-04 12:11:27 +08:00
Zexi Li
dcf4e3ebf2 Merge pull request #7032 from ioito/automated-cherry-pick-of-#7031-upstream-release-3.3
Automated cherry pick of #7031: fix: 避免azure同步资源组异常
2020-07-04 12:10:34 +08:00
Zexi Li
d15259cd5e Merge pull request #7037 from swordqiu/automated-cherry-pick-of-#7036-upstream-release-3.3
Automated cherry pick of #7036: fix: cloud account sync may block
2020-07-04 12:04:53 +08:00
Qiu Jian
b49272eb35 feature: project filter that list jointable projects for user or group 2020-07-04 11:35:13 +08:00
Qiu Jian
6133b1a5cc fix: cloud account sync may block 2020-07-04 10:23:39 +08:00
Qu Xuan
fcf1e193b9 fix: 避免azure同步资源组异常 2020-07-03 20:49:12 +08:00
Zexi Li
35f75db920 Merge pull request #7010 from ioito/automated-cherry-pick-of-#7009-upstream-release-3.3
Automated cherry pick of #7009: fix: 取消aliyun lb scheduler创建限制
2020-07-03 19:24:33 +08:00
Zexi Li
42ad035e56 Merge pull request #7030 from ioito/automated-cherry-pick-of-#7029-upstream-release-3.3
Automated cherry pick of #7029: fix: 避免slave zoneid异常
2020-07-03 19:23:55 +08:00
Qu Xuan
f303512a7c fix: 避免slave zoneid异常 2020-07-03 19:06:15 +08:00
Zexi Li
5ff0613ef3 Merge pull request #7026 from ioito/automated-cherry-pick-of-#7025-upstream-release-3.3
Automated cherry pick of #7025: fix: clouduser can_delete always be false
2020-07-03 18:43:37 +08:00
yunion-ci-robot
c5d448cbb3 Merge pull request #7028 from rainzm/automated-cherry-pick-of-#7027-upstream-release-3.3
Automated cherry pick of #7027: Update Dockerfile.ansibleserver
2020-07-03 18:33:44 +08:00
rainzm
69a4b12724 Update Dockerfile.ansibleserver 2020-07-03 18:22:59 +08:00
Zexi Li
b63dc0f91d Merge pull request #7021 from ioito/automated-cherry-pick-of-#7020-upstream-release-3.3
Automated cherry pick of #7020: fix: 优化安全组list速度,并发挥rule规则信息
2020-07-03 17:39:33 +08:00
Qu Xuan
acf641be26 fix: 同步不需要判断账号是否有iam权限 2020-07-03 17:38:09 +08:00
Qu Xuan
a54a9c05b1 fix: clouduser can_delete always be false 2020-07-03 17:18:58 +08:00
yunion-ci-robot
1ace096c5b Merge pull request #6987 from swordqiu/automated-cherry-pick-of-#6986-upstream-release-3.3
Automated cherry pick of #6986: fix: validate candiate ip for sync-fix-nics
2020-07-03 16:35:27 +08:00
Qu Xuan
dc3ef5c61e fix: 优化安全组list速度,并发挥rule规则信息 2020-07-03 15:53:02 +08:00
Zexi Li
5533d5131b Merge pull request #7003 from ioito/automated-cherry-pick-of-#6961-upstream-release-3.3
Automated cherry pick of #6961: fix: 优化sku同步逻辑
2020-07-03 11:40:19 +08:00
Zexi Li
31a4822aea Merge pull request #7019 from ioito/automated-cherry-pick-of-#7017-upstream-release-3.3
Automated cherry pick of #7017: fix: 修复cloudid同步问题
2020-07-03 11:39:12 +08:00
Qu Xuan
9c62343075 fix: 公有云子账号加域属性 2020-07-03 11:15:19 +08:00
Qu Xuan
544c19f3ce fix: 修复cloudid同步问题 2020-07-03 11:15:19 +08:00
yunion-ci-robot
7e30803175 Merge pull request #7002 from tb365/automated-cherry-pick-of-#7000-upstream-release-3.3
Automated cherry pick of #7000: cluster_d required->optional
2020-07-02 20:29:27 +08:00
Zexi Li
25c20ec6f8 Merge pull request #7004 from ioito/automated-cherry-pick-of-#6998-upstream-release-3.3
Automated cherry pick of #6998: fix: manager_id资源隔离获取
2020-07-02 20:20:35 +08:00
Zexi Li
4b2086e0b4 Merge pull request #7013 from zexi/automated-cherry-pick-of-#7012-upstream-release-3.3
Automated cherry pick of #7012: monitor: reduce subscription mysql usage
2020-07-02 20:19:25 +08:00
Zexi Li
220fc57201 Merge pull request #7007 from wanyaoqi/automated-cherry-pick-of-#7006-upstream-release-3.3
Automated cherry pick of #7006: bind mount nfs storage path
2020-07-02 17:35:25 +08:00
Zexi Li
de889ec6cc monitor: reduce subscription mysql usage 2020-07-02 17:34:26 +08:00
Qu Xuan
82d0f5c03f fix: 取消aliyun lb scheduler创建限制 2020-07-02 15:44:19 +08:00
wanyaoqi
5db73a6670 bind mount nfs storage path 2020-07-02 14:34:16 +08:00
Qu Xuan
66fc71cc81 fix: manager_id资源隔离获取 2020-07-02 14:27:53 +08:00
Qu Xuan
04427515fa fix: 优化sku同步逻辑 2020-07-02 14:26:46 +08:00
tangbin
87cf251d2d cluster_d required->optional 2020-07-02 11:55:15 +08:00
Zexi Li
029233a5a4 Merge pull request #6995 from rainzm/automated-cherry-pick-of-#6994-upstream-release-3.3
Automated cherry pick of #6994: fix: Override Master and Slave for scalinggroup_guest
2020-07-02 10:34:50 +08:00
Zexi Li
57ae145034 Merge pull request #6989 from rainzm/automated-cherry-pick-of-#6988-upstream-release-3.3
Automated cherry pick of #6988: update jsonutils
2020-07-02 10:34:20 +08:00
Zexi Li
6f72aadf39 Merge pull request #6997 from tb365/automated-cherry-pick-of-#6996-upstream-release-3.3
Automated cherry pick of #6996: copyright api update
2020-07-02 10:24:25 +08:00
tangbin
a3245195ab copyright api update 2020-07-01 20:02:25 +08:00
Zexi Li
eb6d0ed5f0 Merge pull request #6985 from lvyangyang/automated-cherry-pick-of-#6913-upstream-release-3.3
Automated cherry pick of #6913: add: region/openstack 迁移接入
2020-07-01 19:29:56 +08:00
Zexi Li
160a315d7b Merge pull request #6991 from rainzm/automated-cherry-pick-of-#6990-upstream-release-3.3
Automated cherry pick of #6990: fix the bug introduced in #6643
2020-07-01 19:26:28 +08:00
rainzm
23c76dc796 fix: Override Master and Slave for scalinggroup_guest 2020-07-01 17:23:59 +08:00
rainzm
9685684876 fix the bug introduced in #6643 2020-07-01 16:52:27 +08:00
rainzm
b4884e3dde update jsonutils 2020-07-01 16:32:03 +08:00
Zexi Li
22c915d617 Merge pull request #6968 from ioito/automated-cherry-pick-of-#6903-upstream-release-3.3
Automated cherry pick of #6903: fix: 修正项目映射同步
2020-07-01 16:29:55 +08:00
lvyangyang
386746365d add: region/openstack 迁移接入 2020-07-01 16:28:29 +08:00
Zexi Li
f97c397b13 Merge pull request #6983 from ioito/automated-cherry-pick-of-#6982-upstream-release-3.3
Automated cherry pick of #6982: fix: capability for cloudid
2020-07-01 14:36:54 +08:00
Qiu Jian
41a9d92421 fix: validate candiate ip for sync-fix-nics 2020-07-01 14:17:58 +08:00
Qu Xuan
781cc3ed6b fix: capability for cloudid 2020-07-01 11:21:10 +08:00
Zexi Li
f8938b819c Merge pull request #6973 from ioito/automated-cherry-pick-of-#6972-upstream-release-3.3
Automated cherry pick of #6972: fix: 修复cloudid问题
2020-06-30 23:08:10 +08:00
Zexi Li
87043ebb5c Merge pull request #6976 from wanyaoqi/automated-cherry-pick-of-#6975-upstream-release-3.3
Automated cherry pick of #6975: fix deploy backup server order
2020-06-30 23:07:28 +08:00
wanyaoqi
207cd93fe0 fix deploy backup server order 2020-06-30 22:02:40 +08:00
Qu Xuan
45819e6c12 fix: 避免未本地缓存usercache 2020-06-30 21:09:24 +08:00
Qu Xuan
223c9439b1 fix: 修复cloudid问题 2020-06-30 21:09:23 +08:00
Zexi Li
9fb62eb504 Merge pull request #6955 from wanyaoqi/automated-cherry-pick-of-#6954-upstream-release-3.3
Automated cherry pick of #6954: include system usage
2020-06-30 12:07:58 +08:00
Zexi Li
8842b97ca0 Merge pull request #6963 from ioito/automated-cherry-pick-of-#6962-upstream-release-3.3
Automated cherry pick of #6962: fix: 避免同步不到其他域的云账号
2020-06-30 12:06:42 +08:00
Zexi Li
5ecb97d532 Merge pull request #6967 from ioito/automated-cherry-pick-of-#6966-upstream-release-3.3
Automated cherry pick of #6966: fix: 修复权限组权限同步异常问题
2020-06-30 12:03:38 +08:00
Zexi Li
e20e308ac6 Merge pull request #6965 from swordqiu/automated-cherry-pick-of-#6964-upstream-release-3.3
Automated cherry pick of #6964: fix: reduce totp verification overhead
2020-06-30 12:01:39 +08:00
Zexi Li
10052eb330 Merge pull request #6971 from yousong/automated-cherry-pick-of-#6970-upstream-release-3.3
Automated cherry pick of #6970: cloudcommon: taskman: fix table insert
2020-06-30 11:59:57 +08:00
Yousong Zhou
986878289e cloudcommon: taskman: fix table insert
Fix the following error

	run error: reflect: NumField of non-struct type *taskman.STask

Fixes 08cd41b60d ("cloudcommon: taskman: SetModelManager")

Reported-by: Qu Xuan <quxuan@yunionyun.com>
2020-06-30 11:55:49 +08:00
Qu Xuan
e31334b471 fix: 支持同步project标签到本地资源 2020-06-30 11:51:26 +08:00
Qu Xuan
b25295bf03 fix: 修正项目映射同步 2020-06-30 11:51:26 +08:00
Qu Xuan
21a09d29d6 fix: 修复权限组权限同步异常问题 2020-06-30 10:55:23 +08:00
Zexi Li
5de04ebdf4 Merge pull request #6948 from swordqiu/automated-cherry-pick-of-#6947-upstream-release-3.3
Automated cherry pick of #6947: fix: disable domain sharing if non_default_domain_projects turned off
2020-06-30 10:48:18 +08:00
Qiu Jian
265bbc6e77 fix: reduce totp verification overhead 2020-06-30 02:32:25 +08:00
Qu Xuan
ef0242d15b fix: 避免同步不到其他域的云账号 2020-06-29 20:35:07 +08:00
Zexi Li
0d1826644b Merge pull request #6958 from yousong/automated-cherry-pick-of-#6957-upstream-release-3.3
Automated cherry pick of #6957: cloudcommon: taskman: SetModelManager
2020-06-29 19:36:59 +08:00
Zexi Li
77d1ac7056 Merge pull request #6956 from wanyaoqi/automated-cherry-pick-of-#6950-upstream-release-3.3
Automated cherry pick of #6950: - add server pending deleted for host details
2020-06-29 19:36:09 +08:00
Zexi Li
d20654575c Merge pull request #6953 from rainzm/automated-cherry-pick-of-#6952-upstream-release-3.3
Automated cherry pick of #6952: fix: Error occurs when suitableWire exists or all suitableNetwork exist.
2020-06-29 19:27:32 +08:00
Yousong Zhou
60293ef052 cloudcommon: tablespec: informer: use %#v to log bad obj
Fixes 145c88f79b ("cloudcommon: tablespec: informer: log obj type")
2020-06-29 14:47:14 +08:00
Yousong Zhou
db9789c868 cloudcommon: taskman: SetModelManager 2020-06-29 14:47:14 +08:00
wanyaoqi
8751082487 - add server pending deleted for host details
- host list by server networks

- guest networks return wire id
2020-06-29 11:41:00 +08:00
wanyaoqi
89ec83fec3 include system usage 2020-06-28 20:44:01 +08:00
rainzm
030a2edfb9 fix: Error occurs when suitableWire exists or all suitableNetwork exist. 2020-06-28 16:59:36 +08:00
Qiu Jian
a23f57da4d fix: disable domain sharing if non_default_domain_projects turned off 2020-06-28 13:25:38 +08:00
Zexi Li
561465e7e8 Merge pull request #6944 from yousong/automated-cherry-pick-of-#6943-upstream-release-3.3
Automated cherry pick of #6943: lb: include cluster name info in details
2020-06-28 09:01:37 +08:00
Yousong Zhou
5f49670e18 lb: include cluster name info in details 2020-06-24 18:54:10 +08:00
Zexi Li
fa521da2cd Merge pull request #6934 from wanyaoqi/automated-cherry-pick-of-#6933-upstream-release-3.3
Automated cherry pick of #6933: server name enable upper case
2020-06-24 17:42:22 +08:00
Zexi Li
fb0e4e093f Merge pull request #6919 from ioito/automated-cherry-pick-of-#6918-upstream-release-3.3
Automated cherry pick of #6918: fix: 避免azure同步项目失败
2020-06-24 12:59:34 +08:00
Zexi Li
6a64efb7e5 Merge pull request #6927 from ioito/automated-cherry-pick-of-#6926-upstream-release-3.3
Automated cherry pick of #6926: fix: google资源名称兼容处理
2020-06-23 23:29:32 +08:00
Zexi Li
2fa8e1b658 Merge pull request #6937 from swordqiu/automated-cherry-pick-of-#6936-upstream-release-3.3
Automated cherry pick of #6936: fix: sort quota list result by usage rate
2020-06-23 23:27:54 +08:00
Zexi Li
202f6b4be2 Merge pull request #6932 from swordqiu/automated-cherry-pick-of-#6931-upstream-release-3.3
Automated cherry pick of #6931: fix: keystone project resource count not accurate
2020-06-23 23:26:38 +08:00
Qiu Jian
9012180b60 fix: sort quota list result by usage rate 2020-06-23 22:23:34 +08:00
Zexi Li
33d9ef948a Merge pull request #6922 from swordqiu/automated-cherry-pick-of-#6921-upstream-release-3.3
Automated cherry pick of #6921: fix: simplify forbidden user login message
2020-06-23 21:25:58 +08:00
wanyaoqi
6f20638f8b server name enable upper case 2020-06-23 21:05:30 +08:00
Qiu Jian
161db6d95f fix: keystone project resource count not accurate 2020-06-23 21:03:30 +08:00
Qu Xuan
4f5a2ff433 fix: google资源名称兼容处理 2020-06-23 20:30:31 +08:00
Qiu Jian
611b9e9b5e fix: simplify forbidden user login message 2020-06-23 17:47:20 +08:00
Qu Xuan
f8cce28926 fix: 避免azure同步项目失败 2020-06-23 17:32:25 +08:00
Zexi Li
965b51c633 Merge pull request #6914 from wanyaoqi/automated-cherry-pick-of-#6904-upstream-release-3.3
Automated cherry pick of #6904: fix get storage capabilities with null field
2020-06-23 11:53:52 +08:00
Zexi Li
20443286f6 Merge pull request #6915 from ioito/automated-cherry-pick-of-#6912-upstream-release-3.3
Automated cherry pick of #6912: optimized: 支持ip和端口过滤安全组
2020-06-23 11:52:27 +08:00
Qu Xuan
f12192f1c4 optimized: 支持ip和端口过滤安全组 2020-06-23 11:26:09 +08:00
wanyaoqi
615fe1da8b fix get storage capabilities with null field 2020-06-23 10:54:27 +08:00
yunion-ci-robot
0ec55c87c1 Merge pull request #6907 from wanyaoqi/automated-cherry-pick-of-#6906-upstream-release-3.3
Automated cherry pick of #6906: disable dhclient
2020-06-22 23:42:03 +08:00
wanyaoqi
9a6c26de1c disable dhclient 2020-06-22 21:30:27 +08:00
Zexi Li
c44a8e0b77 Merge pull request #6894 from yousong/automated-cherry-pick-of-#6893-upstream-release-3.3
Automated cherry pick of #6893: cloudcommon: app: cosmetic change
2020-06-22 09:15:19 +08:00
Zexi Li
afaf9406e8 Merge pull request #6900 from yousong/automated-cherry-pick-of-#6899-upstream-release-3.3
Automated cherry pick of #6899: cloudcommon: tablespec: informer: log obj type
2020-06-22 09:10:18 +08:00
Yousong Zhou
f1dfcd5e06 keystone: passwords: SetModelManager
To quash avoid informer error "virtual object is nil"
2020-06-21 18:53:28 +08:00
Yousong Zhou
7d47ac4dd7 keystone: config: SetModelManager for whitelisted config
To quash avoid informer error "virtual object is nil"
2020-06-21 18:53:28 +08:00
Yousong Zhou
2f79c99dc7 cloudcommon: tablespec: informer: log obj type 2020-06-21 18:53:28 +08:00
Yousong Zhou
aeba29c4b3 cloudcommon: policy: fix interval and oneshot sync
Reduce CPU utilization caused by queued time.AfterFunc calls
2020-06-21 18:33:41 +08:00
Yousong Zhou
28e83a3125 cloudcommon: app: cosmetic change 2020-06-21 18:33:41 +08:00
507 changed files with 12010 additions and 5734 deletions

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:1.0.0
ADD ./_output/bin/ansibleserver /opt/yunion/bin/ansibleserver
ADD ./_output/alpine-build/bin/ansibleserver /opt/yunion/bin/ansibleserver

View File

@@ -1,13 +1,12 @@
FROM frolvlad/alpine-glibc:glibc-2.28
FROM alpine:3.11.6
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"
MAINTAINER "Yousong Zhou <zhouyousong@yunionyun.com>"
ENV TZ Asia/Shanghai
RUN mkdir -p /opt/yunion/bin
RUN apk update && \
apk add --no-cache tzdata git ansible ca-certificates && \
rm -rf /var/cache/apk/*
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# openssh-client, for ansible ssh connection
# git, ca-certificates, for fetching ansible roles
RUN set -x \
&& apk update \
&& apk add openssh-client \
&& apk add ansible \
&& apk add tzdata git ca-certificates \
&& rm -rf /var/cache/apk/*

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/apigateway /opt/yunion/bin/apigateway

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/cloudevent /opt/yunion/bin/cloudevent

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/cloudid /opt/yunion/bin/cloudid

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/cloudnet /opt/yunion/bin/cloudnet

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/devtool /opt/yunion/bin/devtool

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
COPY ./build/esxi-agent/root/opt/ /opt/
ADD ./_output/bin/esxi-agent /opt/yunion/bin/esxi-agent

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/keystone /opt/yunion/bin/keystone

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
COPY ./build/notify/root/opt/ /opt/
ADD ./_output/bin/notify /opt/yunion/bin/notify

View File

@@ -7,7 +7,7 @@ ENV TZ Asia/Shanghai
RUN mkdir -p /opt/yunion/bin
RUN apk update && \
apk add --no-cache tzdata ca-certificates && \
apk add --no-cache tzdata curl busybox-extras tcpdump strace ca-certificates && \
rm -rf /var/cache/apk/*
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
COPY ./build/region/root/opt/ /opt/
ADD ./_output/bin/region /opt/yunion/bin/region

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/s3gateway /opt/yunion/bin/s3gateway

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/scheduler /opt/yunion/bin/scheduler

View File

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

View File

@@ -28,6 +28,7 @@ func init() {
ClouduserId string `json:"clouduser_id"`
CloudpolicyId string `json:"cloudpolicy_id"`
Usable bool `json:"usable"`
}
R(&CloudgroupListOptions{}, "cloud-group-list", "List cloud groups", func(s *mcclient.ClientSession, opts *CloudgroupListOptions) error {
params, err := options.ListStructToParams(opts)

View File

@@ -15,6 +15,8 @@
package compute
import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
@@ -78,4 +80,30 @@ func init() {
printObject(result)
return nil
})
R(&GlobalVpcShowOptions{}, "global-vpc-change-owner-candidate-domains", "Show candiate domains of a global vpc for changing owner", func(s *mcclient.ClientSession, args *GlobalVpcShowOptions) error {
result, err := modules.GlobalVpcs.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type GlobalVpcChangeOwnerOptions struct {
ID string `help:"ID or name of vpc" json:"-"`
ProjectDomain string `json:"project_domain" help:"target domain"`
}
R(&GlobalVpcChangeOwnerOptions{}, "global-vpc-change-owner", "Change owner domain of a global vpc", func(s *mcclient.ClientSession, args *GlobalVpcChangeOwnerOptions) error {
if len(args.ProjectDomain) == 0 {
return fmt.Errorf("empty project_domain")
}
params := jsonutils.Marshal(args)
ret, err := modules.GlobalVpcs.PerformAction(s, args.ID, "change-owner", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -145,6 +145,15 @@ func init() {
},
)
R(&GuestTemplateOptions{}, "server-template-inspect", "Inspect server template", func(s *mcclient.ClientSession, opts *GuestTemplateOptions) error {
tem, err := modules.GuestTemplate.PerformAction(s, opts.ID, "inspect", jsonutils.JSONNull)
if err != nil {
return err
}
printObject(tem)
return nil
})
type GuestTemplatePublicOptions struct {
ID string `help:"ID or Name of server template"`
PublicScope string `help:"public scope"`

View File

@@ -111,10 +111,11 @@ func init() {
type SchedulerCleanCacheOptions struct {
HostId string `help:"ID of host" short-token:"h"`
SessionId string `help:"Session id" short-token:"s"`
Sync bool `help:"Sync do clean sched cache"`
}
R(&SchedulerCleanCacheOptions{}, "scheduler-clean-cache", "Clean scheduler hosts cache",
func(s *mcclient.ClientSession, args *SchedulerCleanCacheOptions) error {
err := modules.SchedManager.CleanCache(s, args.HostId, args.SessionId)
err := modules.SchedManager.CleanCache(s, args.HostId, args.SessionId, args.Sync)
if err != nil {
return err
}

View File

@@ -25,33 +25,20 @@ import (
func init() {
type SecGroupRulesListOptions struct {
options.BaseListOptions
Secgroup string `help:"Secgroup ID or Name"`
Direction string `help:"filter Direction of rule" choices:"in|out"`
Protocol string `help:"filter Protocol of rule" choices:"any|tcp|udp|icmp"`
Action string `help:"filter Actin of rule" choices:"allow|deny"`
Secgroup string `help:"Secgroup ID or Name"`
SecgroupName string `help:"Search rules by fuzzy secgroup name"`
Projects []string `help:"Filter rules by project"`
Direction string `help:"filter Direction of rule" choices:"in|out"`
Protocol string `help:"filter Protocol of rule" choices:"any|tcp|udp|icmp"`
Action string `help:"filter Actin of rule" choices:"allow|deny"`
Ports string `help:"filter Ports of rule"`
Ip string `help:"filter cidr of rule"`
}
R(&SecGroupRulesListOptions{}, "secgroup-rule-list", "List all security group", func(s *mcclient.ClientSession, args *SecGroupRulesListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
if len(args.Secgroup) > 0 {
params.Add(jsonutils.NewString(args.Secgroup), "secgroup")
}
if len(args.Direction) > 0 {
params.Add(jsonutils.NewString(args.Direction), "direction")
}
if len(args.Protocol) > 0 {
params.Add(jsonutils.NewString(args.Protocol), "protocol")
}
if len(args.Action) > 0 {
params.Add(jsonutils.NewString(args.Action), "action")
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.SecGroupRules.List(s, params)
if err != nil {

View File

@@ -29,23 +29,15 @@ func init() {
Equals string `help:"Secgroup ID or Name, filter secgroups whose rules equals the specified one"`
Server string `help:"Filter secgroups bound to specified server"`
options.BaseListOptions
Ip string `help:"Filter secgroup by ip"`
Ports string `help:"Filter secgroup by ports"`
Direction string `help:"Filter secgroup by ports" choices:"all|in|out"`
}
R(&SecGroupsListOptions{}, "secgroup-list", "List all security group", func(s *mcclient.ClientSession, args *SecGroupsListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
if len(args.Equals) > 0 {
params.Add(jsonutils.NewString(args.Equals), "equals")
}
if len(args.Server) > 0 {
params.Add(jsonutils.NewString(args.Server), "server")
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.SecGroups.List(s, params)
if err != nil {

View File

@@ -298,6 +298,12 @@ func init() {
return nil
})
R(&options.ServerIdsOptions{}, "server-reconcile-backup", "Reconcile backup server", func(s *mcclient.ClientSession, opts *options.ServerIdsOptions) error {
ret := modules.Servers.BatchPerformAction(s, opts.ID, "reconcile-backup", nil)
printBatchResults(ret, modules.Servers.GetColumns(s))
return nil
})
R(&options.ServerIdsOptions{}, "server-create-backup", "Create backup guest", func(s *mcclient.ClientSession, opts *options.ServerIdsOptions) error {
ret := modules.Servers.BatchPerformAction(s, opts.ID, "create-backup", nil)
printBatchResults(ret, modules.Servers.GetColumns(s))
@@ -1146,6 +1152,7 @@ func init() {
ID string `help:"ID or name of VM"`
DisableIsaSerial string `help:"disable isa serial device" choices:"true|false"`
DisablePvpanic string `help:"disable pvpanic device" choices:"true|false"`
DisableUsbKbd string `help:"disable usb kbd" choices:"true|false"`
}
R(&ServerQemuParams{}, "server-set-qemu-params", "config qemu params", func(s *mcclient.ClientSession,
@@ -1157,6 +1164,9 @@ func init() {
if len(opts.DisablePvpanic) > 0 {
params.Set("disable_pvpanic", jsonutils.NewString(opts.DisablePvpanic))
}
if len(opts.DisableUsbKbd) > 0 {
params.Set("disable_usb_kbd", jsonutils.NewString(opts.DisableUsbKbd))
}
result, err := modules.Servers.PerformAction(s, opts.ID, "set-qemu-params", params)
if err != nil {
return err

View File

@@ -54,6 +54,7 @@ type ImageOptionalOptions struct {
Hypervisor []string `help:"Prefer hypervisor type" choices:"kvm|esxi|baremetal|container|openstack|ctyun"`
DiskDriver string `help:"Perfer disk driver" choices:"virtio|scsi|pvscsi|ide|sata"`
NetDriver string `help:"Preferred network driver" choices:"virtio|e1000|vmxnet3"`
DisableUsbKbd bool `help:"Disable usb keyboard on this image(for hypervisor kvm)"`
}
func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDict, args ImageOptionalOptions) error {
@@ -131,6 +132,9 @@ func addImageOptionalOptions(s *mcclient.ClientSession, params *jsonutils.JSONDi
if len(args.Hypervisor) > 0 {
params.Add(jsonutils.NewString(strings.Join(args.Hypervisor, ",")), "properties", "hypervisor")
}
if args.DisableUsbKbd {
params.Add(jsonutils.NewString("true"), "properties", "disable_usb_kbd")
}
return nil
}
@@ -252,7 +256,7 @@ func init() {
}
type ImageDeleteOptions struct {
ID []string `help:"Image ID or name"`
ID []string `help:"Image ID or name" json:"-"`
OverridePendingDelete *bool `help:"Delete image directly instead of pending delete" short-token:"f"`
}
R(&ImageDeleteOptions{}, "image-delete", "Delete a image", func(s *mcclient.ClientSession, args *ImageDeleteOptions) error {

View File

@@ -188,6 +188,19 @@ func initKubeCluster() {
return nil
})
R(&o.ClusterSyncOptions{}, cmdN("sync"), "Sync cluster k8s resources", func(s *mcclient.ClientSession, args *o.ClusterSyncOptions) error {
param, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "sync", param)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.IdentOptions{}, cmdN("public"), "Make cluster public", func(s *mcclient.ClientSession, args *o.IdentOptions) error {
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "public", nil)
if err != nil {

View File

@@ -43,7 +43,6 @@ func init() {
initRepo()
initChart()
initRelease()
initReleaseApps()
// kubernetes original resources
initRaw()

View File

@@ -30,7 +30,7 @@ import (
)
func getPrinterRowValue(printer k8s.ListPrinter, obj jsonutils.JSONObject, col string) interface{} {
getFuncName := fmt.Sprintf("Get%s", strings.Title(col))
getFuncName := fmt.Sprintf("Get_%s", strings.Title(col))
manValue := reflect.ValueOf(printer)
funcValue := manValue.MethodByName(getFuncName)
if !funcValue.IsValid() || funcValue.IsNil() {

View File

@@ -22,8 +22,10 @@ import (
func initRbac() {
//cmdRole := initK8sNamespaceResource("rbacrole", k8s.RbacRoles)
initK8sNamespaceResource("rbacrole", k8s.RbacRoles)
initK8sNamespaceResource("rbacrolebinding", k8s.RbacRoleBindings)
initK8sNamespaceResource("rbac-role", k8s.RbacRoles)
initK8sNamespaceResource("rbac-rolebinding", k8s.RbacRoleBindings)
initK8sClusterResource("rbac-clusterrole", k8s.RbacClusterRoles)
initK8sClusterResource("rbac-clusterrolebinding", k8s.RbacClusterRoleBindings)
initK8sNamespaceResource("serviceaccount", k8s.ServiceAccounts)
//cmdRoleN := cmdRole.CommandNameFactory
}

View File

@@ -1,67 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package k8s
import (
"fmt"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
o "yunion.io/x/onecloud/pkg/mcclient/options/k8s"
)
func initReleaseApps() {
cmdN := func(app string) string {
return resourceCmdN(fmt.Sprintf("app-%s", app), "create")
}
R(&o.AppCreateOptions{}, cmdN("meter"), "Create yunion meter helm release", func(s *mcclient.ClientSession, args *o.AppCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.MeterReleaseApps.Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.AppCreateOptions{}, cmdN("servicetree"), "Create yunion servicetree helm release", func(s *mcclient.ClientSession, args *o.AppCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.ServicetreeReleaseApps.Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.AppCreateOptions{}, cmdN("notify"), "Create yunion notify helm release", func(s *mcclient.ClientSession, args *o.AppCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.NotifyReleaseApps.Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -35,6 +35,7 @@ func init() {
Copyright string `help:"The copyright"`
Email string `help:"The Email"`
Docs *string `help:"the Docs website address"`
License *string `help:"the license generator website address"`
}
R(&CopyrightUpdateOptions{}, "copyright-update", "update copyright", func(s *mcclient.ClientSession, args *CopyrightUpdateOptions) error {
@@ -47,6 +48,10 @@ func init() {
params.Add(jsonutils.NewString(*args.Docs), "docs")
}
if args.License != nil {
params.Add(jsonutils.NewString(*args.License), "license")
}
if len(args.Copyright) > 0 {
params.Add(jsonutils.NewString(args.Copyright), "copyright")
}

View File

@@ -0,0 +1,47 @@
package monitor
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CommonAlertListOptions struct {
options.BaseListOptions
// 报警类型
AlertType string `help:"common alert type" choices:"normal|system"`
Level string `help:"common alert notify level" choices:"normal|important|fatal"`
}
R(&CommonAlertListOptions{}, "commonalert-list", "List commonalert", func(s *mcclient.ClientSession,
args *CommonAlertListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.CommonAlertManager.List(s, params)
if err != nil {
return nil
}
printList(result, modules.CommonAlertManager.GetColumns(s))
return nil
})
type CommonAlertDeleteOptions struct {
ID string `help:"ID of alart"`
Force bool `help:"force to delete alert"`
}
R(&CommonAlertDeleteOptions{}, "commonalert-delete", "List commonalert", func(s *mcclient.ClientSession,
args *CommonAlertDeleteOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewBool(args.Force), "force")
object, err := modules.CommonAlertManager.Delete(s, args.ID, params)
if err != nil {
return err
}
printObject(object)
return nil
})
}

View File

@@ -18,17 +18,21 @@ import (
"fmt"
"os"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/structarg"
"yunion.io/x/onecloud/pkg/multicloud/google"
_ "yunion.io/x/onecloud/pkg/multicloud/google/shell"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/shellutils"
)
type BaseOptions struct {
Debug bool `help:"debug mode"`
Help bool `help:"Show help"`
AuthFile string `help:"google cloud auth json file path" default:"$GOOGLE_AUTH_FILE"`
ClientEmail string `help:"Client email" default:"$GOOGLE_CLIENT_EMAIL"`
ProjectID string `help:"Project ID" default:"$GOOGLE_PROJECT_ID"`
PrivateKeyID string `help:"Private Key ID" default:"$GOOGLE_PRIVATE_KEY_ID"`
@@ -78,6 +82,20 @@ func showErrorAndExit(e error) {
}
func newClient(options *BaseOptions) (*google.SRegion, error) {
if len(options.AuthFile) > 0 {
jsonStr, err := fileutils2.FileGetContents(options.AuthFile)
if err != nil {
return nil, errors.Wrap(err, "FileGetContents")
}
jsonCfg, err := jsonutils.ParseString(jsonStr)
if err != nil {
return nil, errors.Wrap(err, "jsonutils.ParseString")
}
options.ClientEmail, _ = jsonCfg.GetString("client_email")
options.PrivateKeyID, _ = jsonCfg.GetString("private_key_id")
options.PrivateKey, _ = jsonCfg.GetString("private_key")
options.ProjectID, _ = jsonCfg.GetString("project_id")
}
if len(options.ClientEmail) == 0 {
return nil, fmt.Errorf("Missing ClientEmail")
}

8
go.mod
View File

@@ -131,13 +131,13 @@ require (
k8s.io/cluster-bootstrap v0.17.3
k8s.io/kubernetes v1.16.0
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9
yunion.io/x/jsonutils v0.0.0-20200710080709-7ca71cdb9383
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982
yunion.io/x/pkg v0.0.0-20200713121502-18154120c49b
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20200608080702-9b6683aa048c
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7
yunion.io/x/sqlchemy v0.0.0-20200702064124-195445bc4b11
yunion.io/x/structarg v0.0.0-20200708124353-ea9a441ecaf8
)
replace (

23
go.sum
View File

@@ -94,7 +94,9 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/a8m/mark v0.1.1-0.20170507133748-44f2db618845/go.mod h1:c8Mh99Cw82nrsAnPgxQSZHkswVOJF7/MqZb1ZdvriLM=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8 h1:mb7rn6WX8viizO36Nv6VVCBrgwaq01HPrZv1qq07/Yg=
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180112035716-b5829a0278c8/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA=
@@ -1016,6 +1018,7 @@ google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
@@ -1123,10 +1126,9 @@ vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74 h1:A15C6VdVRWvmQ9pAJHrUs9yan5qKlYH7uaRxHg1kRbk=
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9 h1:s7sobXxn4ckRHdjIaA91Rnfy2kreV/+dN3P2pQLg7F0=
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
yunion.io/x/jsonutils v0.0.0-20200710080709-7ca71cdb9383 h1:XEhTD+FGjBjEIWwcY0Ez1lY3oTTzjUOcRgH/i4eFM5A=
yunion.io/x/jsonutils v0.0.0-20200710080709-7ca71cdb9383/go.mod h1:3U5hspYn9apQHaXKY+fJ4Qgwjey32Kc+Mq+mUe9NamQ=
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d h1:59zrDL7Ft+hDukguJRmLr/Gdu/9V75x+yX99ovZwfaA=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3 h1:5Wc5hkB8PtMudmHuzCyok960RuOa9I55imIGrigSdjs=
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
@@ -1134,12 +1136,13 @@ yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7 h1:gjqNa2uQzIEXyySsbvVz0Ult
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982 h1:VnE92PZ2DOBn7qOKHHHPrwo4tPsjrxET/xDyWfMFQHI=
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200708071451-a663dc94e16b h1:wwPzH8iMRYjtaSM2pBN7nOqeZxR4XW5wdz2VE1KH/Ug=
yunion.io/x/pkg v0.0.0-20200708071451-a663dc94e16b/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200713121502-18154120c49b h1:Ov/eKwwNeQje7SggkopExzcCW/GfaUouvXkcY6RUEcM=
yunion.io/x/pkg v0.0.0-20200713121502-18154120c49b/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-20200608080702-9b6683aa048c h1:/i93mWSKLYUq8RsaXGbMpwwnkGi09wL/HdCBiexL/+c=
yunion.io/x/sqlchemy v0.0.0-20200608080702-9b6683aa048c/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7 h1:HjWH0gG/5KzvCxItnzRxizfAnMOvGcxPfsEOFwOGBhQ=
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
yunion.io/x/sqlchemy v0.0.0-20200702064124-195445bc4b11 h1:srrssomGJLh4OaDaY/1so+2FUBjZxdwQx/1pZ6403YU=
yunion.io/x/sqlchemy v0.0.0-20200702064124-195445bc4b11/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20200708124353-ea9a441ecaf8 h1:35Q2ce/gI2cuVhsuLS7WsL2K9SxwMEtWTopt/99iYsk=
yunion.io/x/structarg v0.0.0-20200708124353-ea9a441ecaf8/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=

View File

@@ -39,6 +39,7 @@ func InitHandlers(app *appsrv.Application) {
db.InitAllManagers()
db.RegisterModelManager(db.OpsLog)
db.RegisterModelManager(db.Metadata)
db.RegisterModelManager(db.UserCacheManager)
db.RegisterModelManager(db.TenantCacheManager)
for _, manager := range []db.IModelManager{

View File

@@ -230,6 +230,9 @@ func doTenantLogin(ctx context.Context, w http.ResponseWriter, req *http.Request
} else {
otpVerified = true
}
} else {
// if totp disabled, then assume totp been verified
otpVerified = true
}
token, e = auth.Client().SetProject(tenantId, "", "", token)
@@ -396,7 +399,7 @@ func isUserAllowWebconsole(ctx context.Context, w http.ResponseWriter, req *http
return false
}
if !jsonutils.QueryBoolean(usr, "allow_web_console", true) {
httperrors.ForbiddenError(w, "forbidden user %q login from web", usr.String())
httperrors.ForbiddenError(w, "user forbidden login from web")
return false
}
return true
@@ -536,6 +539,11 @@ func (h *AuthHandlers) postLoginHandler(ctx context.Context, w http.ResponseWrit
httperrors.GeneralServerError(w, err)
return
}
} else {
// if totp is disabled, assume totp been verified
totp := clientman.TokenMan.GetTotp(tid)
totp.MarkVerified()
clientman.TokenMan.SaveTotp(tid)
}
appsrv.Send(w, qrcode)

View File

@@ -0,0 +1,129 @@
package handler
import (
"bytes"
"context"
"fmt"
"io"
"mime/multipart"
"net/http"
"strconv"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modules"
)
func readImageForm(r *multipart.Reader) (map[string]string, *multipart.Part, error) {
params := make(map[string]string)
maxValueBytes := int64(10 << 20)
for {
p, err := r.NextPart()
if err == io.EOF {
break
}
if err != nil {
return nil, nil, err
}
name := p.FormName()
if name == "" {
continue
}
filename := p.FileName()
var b bytes.Buffer
_, hasContentTypeHeader := p.Header["Content-Type"]
if !hasContentTypeHeader && filename == "" {
// value, store as string in memory
n, err := io.CopyN(&b, p, maxValueBytes+1)
if err != nil && err != io.EOF {
return nil, nil, err
}
maxValueBytes -= n
if maxValueBytes < 0 {
return nil, nil, multipart.ErrMessageTooLarge
}
params[name] = b.String()
continue
}
if name == "image" || name == "file" {
return params, p, nil
} else {
return nil, nil, fmt.Errorf("no file uploaded")
}
}
return nil, nil, fmt.Errorf("empty form")
}
func imageUploadHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
reader, e := r.MultipartReader()
if e != nil {
httperrors.InvalidInputError(w, "无效的表单")
return
}
p, f, e := readImageForm(reader)
if e != nil {
httperrors.InvalidInputError(w, "无效的表单")
return
}
params := jsonutils.NewDict()
name, ok := p["name"]
if !ok {
httperrors.InvalidInputError(w, "缺少镜像名称")
return
}
params.Add(jsonutils.NewString(name), "name")
_imageSize, ok := p["image_size"]
if !ok {
httperrors.InvalidInputError(w, "缺少文件信息")
return
}
imageSize, e := strconv.ParseInt(_imageSize, 10, 64)
if e != nil {
httperrors.InvalidInputError(w, "文件信息错误")
return
}
// add all other params
for k, v := range p {
if k == "name" || k == "image_size" {
continue
}
params.Add(jsonutils.NewString(v), k)
}
token := AppContextToken(ctx)
s := auth.GetSession(ctx, token, FetchRegion(r), "")
res, e := modules.Images.Upload(s, params, f, imageSize)
if e != nil {
httperrors.GeneralServerError(w, e)
return
} else {
appsrv.SendJSON(w, res)
}
}
func uploadHandlerInfo(method, prefix string, handler func(context.Context, http.ResponseWriter, *http.Request)) *appsrv.SHandlerInfo {
log.Debugf("%s - %s", method, prefix)
hi := appsrv.SHandlerInfo{}
hi.SetMethod(method)
hi.SetPath(prefix)
hi.SetHandler(handler)
hi.SetProcessTimeout(6 * time.Hour)
hi.SetWorkerManager(GetUploaderWorker())
return &hi
}

View File

@@ -112,15 +112,15 @@ func FetchAuthToken(f func(context.Context, http.ResponseWriter, *http.Request))
return
}
// 启用双因子认证
t := AppContextToken(ctx)
if isUserEnableTotp(ctx, r, t) {
tid := getAuthToken(r)
totp := clientman.TokenMan.GetTotp(tid)
if !totp.IsVerified() {
httperrors.UnauthorizedError(w, "TOTP authentication failed")
return
}
// t := AppContextToken(ctx)
// if isUserEnableTotp(ctx, r, t) {
tid := getAuthToken(r)
totp := clientman.TokenMan.GetTotp(tid)
if !totp.IsVerified() {
httperrors.UnauthorizedError(w, "TOTP authentication failed")
return
}
// }
f(ctx, w, r)
}

View File

@@ -20,6 +20,7 @@ import (
"encoding/csv"
"fmt"
"net/http"
"strconv"
"strings"
"time"
@@ -28,6 +29,7 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apigateway/options"
"yunion.io/x/onecloud/pkg/appctx"
@@ -37,6 +39,7 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/util/httputils"
)
const (
@@ -57,6 +60,12 @@ const (
BATCH_HOST_REGISTER_QUANTITY_LIMITATION = 1000
)
var (
BatchHostRegisterTemplate = []string{HOST_MAC, HOST_NAME, HOST_IPMI_ADDR_OPTIONAL, HOST_IPMI_USERNAME_OPTIONAL, HOST_IPMI_PASSWORD_OPTIONAL}
BatchHostISORegisterTemplate = []string{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR}
BatchHostPXERegisterTemplate = []string{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR_OPTIONAL}
)
func FetchSession(ctx context.Context, r *http.Request, apiVersion string) *mcclient.ClientSession {
token := AppContextToken(ctx)
session := auth.GetSession(ctx, token, FetchRegion(r), apiVersion)
@@ -82,6 +91,10 @@ func (h *MiscHandler) Bind(app *appsrv.Application) {
app.AddHandler3(uploader)
app.AddHandler(GET, prefix+"downloads/<template_id>", FetchAuthToken(h.getDownloadsHandler))
app.AddHandler(POST, prefix+"piuploads", FetchAuthToken(h.postPIUploads)) // itsm process instances upload api
imageUploader := uploadHandlerInfo("POST", prefix+"/imageutils/upload", FetchAuthToken(imageUploadHandler))
app.AddHandler3(imageUploader)
s3upload := uploadHandlerInfo(POST, prefix+"s3uploads", FetchAuthToken(h.postS3UploadHandler))
app.AddHandler3(s3upload)
}
func UploadHandlerInfo(method, prefix string, handler func(context.Context, http.ResponseWriter, *http.Request)) *appsrv.SHandlerInfo {
@@ -170,20 +183,43 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
return
}
// check header line
titlesOk := false
for _, t := range [][]string{BatchHostRegisterTemplate, BatchHostISORegisterTemplate, BatchHostPXERegisterTemplate} {
if len(t) == len(rows[0]) {
for _, title := range rows[0] {
if !utils.IsInStringArray(title, t) {
break
}
}
titlesOk = true
}
}
if !titlesOk {
httperrors.InputParameterError(w, "template file is invalid.please check.")
return
}
paramKeys := []string{}
for _, title := range rows[0] {
i1 := -1
i2 := -1
for i, title := range rows[0] {
switch title {
case HOST_MAC:
paramKeys = append(paramKeys, "access_mac")
case HOST_NAME:
paramKeys = append(paramKeys, "name")
case HOST_IPMI_ADDR, HOST_IPMI_ADDR_OPTIONAL:
i1 = i
paramKeys = append(paramKeys, "ipmi_ip_addr")
case HOST_IPMI_USERNAME, HOST_IPMI_USERNAME_OPTIONAL:
paramKeys = append(paramKeys, "ipmi_username")
case HOST_IPMI_PASSWORD, HOST_IPMI_PASSWORD_OPTIONAL:
paramKeys = append(paramKeys, "ipmi_password")
case HOST_MNG_IP_ADDR, HOST_MNG_IP_ADDR_OPTIONAL:
i2 = i
paramKeys = append(paramKeys, "access_ip")
default:
e := httperrors.NewInternalServerError("empty file content")
@@ -199,8 +235,33 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
return
}
ips := []string{}
hosts := bytes.Buffer{}
for _, row := range rows[1:] {
var e *httputils.JSONClientError
if i1 >= 0 && len(row[i1]) > 0 {
i1Ip := fmt.Sprintf("%d-%s", i1, row[i1])
if utils.IsInStringArray(i1Ip, ips) {
e = httperrors.NewDuplicateIdError("ip", row[i1])
} else {
ips = append(ips, i1Ip)
}
}
if i2 >= 0 && len(row[i2]) > 0 {
i2Ip := fmt.Sprintf("%d-%s", i2, row[i2])
if utils.IsInStringArray(i2Ip, ips) {
e = httperrors.NewDuplicateIdError("ip", row[i2])
} else {
ips = append(ips, i2Ip)
}
}
if e != nil {
httperrors.JsonClientError(w, e)
return
}
hosts.WriteString(strings.Join(row, ",") + "\n")
}
@@ -297,18 +358,6 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
return
}
if _, ok := names[name]; ok {
e := httperrors.NewClientError("row %d duplicate name %s", rowIdx, name)
httperrors.JsonClientError(w, e)
return
} else {
names[name] = true
_, err := modules.UsersV3.Get(s, name, nil)
if err == nil {
continue
}
}
domainId, ok := domains[domain]
if !ok {
if len(domain) == 0 {
@@ -327,6 +376,18 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
domains[domain] = id
}
if _, ok := names[name+"/"+domainId]; ok {
e := httperrors.NewClientError("row %d duplicate name %s", rowIdx, name)
httperrors.JsonClientError(w, e)
return
} else {
names[name+"/"+domainId] = true
_, err := modules.UsersV3.Get(s, name, nil)
if err == nil {
continue
}
}
user := jsonutils.NewDict()
user.Add(jsonutils.NewString(name), "name")
user.Add(jsonutils.NewString(domainId), "domain_id")
@@ -375,21 +436,21 @@ func (mh *MiscHandler) getDownloadsHandler(ctx context.Context, w http.ResponseW
var content bytes.Buffer
switch template {
case "BatchHostRegister":
records := [][]string{{HOST_MAC, HOST_NAME, HOST_IPMI_ADDR_OPTIONAL, HOST_IPMI_USERNAME_OPTIONAL, HOST_IPMI_PASSWORD_OPTIONAL}}
records := [][]string{BatchHostRegisterTemplate}
content, err = writeXlsx("hosts", records)
if err != nil {
httperrors.InternalServerError(w, "internal server error")
return
}
case "BatchHostISORegister":
records := [][]string{{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR}}
records := [][]string{BatchHostISORegisterTemplate}
content, err = writeXlsx("hosts", records)
if err != nil {
httperrors.InternalServerError(w, "internal server error")
return
}
case "BatchHostPXERegister":
records := [][]string{{HOST_NAME, HOST_IPMI_ADDR, HOST_IPMI_USERNAME, HOST_IPMI_PASSWORD, HOST_MNG_IP_ADDR_OPTIONAL}}
records := [][]string{BatchHostPXERegisterTemplate}
content, err = writeXlsx("hosts", records)
if err != nil {
httperrors.InternalServerError(w, "internal server error")
@@ -453,6 +514,61 @@ func (mh *MiscHandler) postPIUploads(ctx context.Context, w http.ResponseWriter,
appsrv.SendJSON(w, resp)
}
func (mh *MiscHandler) postS3UploadHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
reader, e := r.MultipartReader()
if e != nil {
log.Debugf("postS3UploadHandler.MultipartReader %s", e)
httperrors.InvalidInputError(w, "invalid form")
return
}
p, f, e := readImageForm(reader)
if e != nil {
log.Debugf("postS3UploadHandler.readImageForm %s", e)
httperrors.InvalidInputError(w, "invalid form")
return
}
bucket_id, ok := p["bucket_id"]
if !ok {
httperrors.MissingParameterError(w, "bucket_id")
return
}
key, ok := p["key"]
if !ok {
httperrors.MissingParameterError(w, "key")
return
}
_content_length, ok := p["content_length"]
if !ok {
httperrors.MissingParameterError(w, "content_length")
return
}
content_length, e := strconv.ParseInt(_content_length, 10, 64)
if e != nil {
httperrors.InvalidInputError(w, "invalid content_length %s", _content_length)
return
}
storage_class, _ := p["storage_class"]
acl, _ := p["acl"]
token := AppContextToken(ctx)
s := auth.GetSession(ctx, token, FetchRegion(r), "")
meta := http.Header{}
meta.Set("Content-Type", "application/octet-stream")
e = modules.Buckets.Upload(s, bucket_id, key, f, content_length, storage_class, acl, meta)
if e != nil {
httperrors.GeneralServerError(w, e)
return
}
appsrv.SendJSON(w, jsonutils.NewDict())
}
func writeCsv(records [][]string) (bytes.Buffer, error) {
var content bytes.Buffer
content.WriteString("\xEF\xBB\xBF") // 写入UTF-8 BOM, 防止office打开后中文乱码

View File

@@ -80,6 +80,9 @@ type CloudgroupListInput struct {
// 根据权限过滤权限组
CloudpolicyId string `json:"cloudpolicy_id"`
// 是否可用
Usable *bool `json:"usable"`
}
type SCloudIdBaseResource struct {
@@ -105,15 +108,7 @@ type CloudgroupDetails struct {
type CloudgroupCreateInput struct {
apis.StatusInfrasResourceBaseCreateInput
// 平台
//
// | 云平台 | 说明 |
// |----------|---------------------------------------------|
// | Google | 支持 |
// | Aliyun | 支持 |
// | Huawei | 支持 |
// | Azure | 支持 |
// | Qcloud | 支持 |
// 平台, 目前支持Qcloud,Google,Azure,Aliyun,Huawei,Aws
Provider string `json:"provider"`
// 权限Id列表, 权限provider必须和权限组provider一致
@@ -123,84 +118,36 @@ type CloudgroupCreateInput struct {
type CloudgroupAddUserInput struct {
// 用户Id
//
// | 云平台 | 说明 |
// |----------|---------------------------------------------|
// | Google | 不支持 |
// | Aliyun | 支持 |
// | Huawei | 支持 |
// | Azure | 支持 |
// | 腾讯云 | 支持 |
ClouduserId string `json:"clouduser_id"`
}
type CloudgroupRemoveUserInput struct {
// 用户Id
//
// | 云平台 | 说明 |
// |----------|---------------------------------------------|
// | Google | 不支持 |
// | Aliyun | 支持 |
// | Huawei | 支持 |
// | Azure | 支持 |
// | 腾讯云 | 支持 |
ClouduserId string `json:"clouduser_id"`
}
type CloudgroupAttachPolicyInput struct {
// 权限Id
//
// | 云平台 | 说明 |
// |----------|---------------------------------------------|
// | Google | 不支持 |
// | Aliyun | 支持 |
// | Huawei | 支持 |
// | Azure | 不支持 |
// | 腾讯云 | 支持 |
CloudpolicyId string `json:"cloudpolicy_id"`
}
type CloudgroupSetUsersInput struct {
// 公有云子账号Ids
//
// | 云平台 | 说明 |
// |----------|---------------------------------------------|
// | Google | 支持 |
// | Aliyun | 支持 |
// | Huawei | 支持 |
// | Azure | 支持 |
// | 腾讯云 | 支持 |
ClouduserIds []string `json:"clouduser_ids"`
}
type CloudgroupSetPoliciesInput struct {
// 权限Ids
//
// | 云平台 | 说明 |
// |----------|---------------------------------------------|
// | Google | 支持 |
// | Aliyun | 支持 |
// | Huawei | 支持 |
// | Azure | 不支持 |
// | 腾讯云 | 支持 |
CloudpolicyIds []string `json:"cloudpolicy_ids"`
}
type CloudgroupDetachPolicyInput struct {
// 权限Id
//
// | 云平台 | 说明 |
// |----------|---------------------------------------------|
// | Google | 不支持 |
// | Aliyun | 支持 |
// | Huawei | 支持 |
// | Azure | 不支持 |
// | 腾讯云 | 支持 |
CloudpolicyId string `json:"cloudpolicy_id"`
}

View File

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

View File

@@ -35,7 +35,7 @@ const (
)
type ClouduserCreateInput struct {
apis.StatusUserResourceCreateInput
apis.StatusDomainLevelUserResourceCreateInput
apis.StatusBaseResourceCreateInput
// 云订阅ID
@@ -88,7 +88,7 @@ type ClouduserCreateInput struct {
// | Google | 至少需要一个初始权限 |
// | Aliyun | 支持 |
// | Huawei | 不支持 |
// | Azure | 支持 |
// | Azure | 支持 |
// | 腾讯云 | 支持 |
CloudpolicyIds []string `json:"cloudpolicy_ids"`
@@ -100,7 +100,7 @@ type ClouduserCreateInput struct {
}
type ClouduserListInput struct {
apis.StatusUserResourceListInput
apis.StatusDomainLevelUserResourceListInput
CloudaccountResourceListInput
CloudproviderResourceListInput
@@ -113,7 +113,7 @@ type ClouduserListInput struct {
}
type ClouduserDetails struct {
apis.StatusUserResourceDetails
apis.StatusDomainLevelUserResourceDetails
SClouduser
CloudaccountResourceDetails

View File

@@ -22,10 +22,9 @@ import (
type SCloudaccount struct {
apis.SStandaloneResourceBase
apis.SDomainizedResourceBase
Provider string `json:"provider"`
Brand string `json:"brand"`
IamLoginUrl string `json:"iam_login_url"`
IsSupportCloudId *bool `json:"is_support_cloud_id,omitempty"`
Provider string `json:"provider"`
Brand string `json:"brand"`
IamLoginUrl string `json:"iam_login_url"`
}
// SCloudaccountResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudaccountResourceBase.
@@ -103,7 +102,7 @@ type SCloudproviderResourceBase struct {
// SClouduser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SClouduser.
type SClouduser struct {
apis.SStatusUserResourceBase
apis.SStatusDomainLevelUserResourceBase
apis.SExternalizedResourceBase
SCloudproviderResourceBase
SCloudaccountResourceBase

View File

@@ -289,7 +289,7 @@ type ServerConfigs struct {
// 虚拟机高可用(创建备机)
// default: false
// requried: false
// required: false
Backup bool `json:"backup"`
// 创建虚拟机数量
@@ -471,7 +471,8 @@ type ServerCreateInput struct {
// swagger:ignore
OsType string `json:"os_type"`
// swagger:ignore
DisableUsbKbd bool `json:"disable_usb_kbd"`
// swagger:ignore
OsProfile jsonutils.JSONObject `json:"__os_profile__"`
// swagger:ignore

View File

@@ -30,24 +30,3 @@ type CachedLoadbalancerAclListInput struct {
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

@@ -31,24 +31,3 @@ type CachedLoadbalancerCertificateListInput struct {
RegionalFilterListInput
LoadbalancerCertificateFilterListInput
}
type LoadbalancerCertificateResourceInfo struct {
// 负载均衡证书名称
Certificate string `json:"certificate"`
}
type LoadbalancerCertificateResourceInput struct {
// 证书名称或ID
Certificate string `json:"certificate"`
// swagger:ignore
// Deprecated
CertificateId string `json:"certificate_id" "yunion:deprecated-by":"certificate"`
}
type LoadbalancerCertificateFilterListInput struct {
LoadbalancerCertificateResourceInput
// 以证书名称排序
OrderByCertificate string `json:"order_by_certificate"`
}

View File

@@ -180,9 +180,9 @@ type CloudaccountCreateInput struct {
// 自动同步间隔时间
SyncIntervalSeconds int `json:"sync_interval_seconds"`
// 自动根据云上项目或订阅创建本地项目
// 自动根据云上项目或订阅创建本地项目, OpenStack此参数为true
// default: false
AutoCreateProject bool `json:"auto_create_project"`
AutoCreateProject *bool `json:"auto_create_project"`
// 额外信息,例如账单的access key
Options *jsonutils.JSONDict `json:"options"`

View File

@@ -251,3 +251,23 @@ type CloudproviderUpdateInput struct {
type CloudproviderCreateInput struct {
}
type CloudproviderGetStorageClassInput struct {
CloudregionResourceInput
}
type CloudproviderGetStorageClassOutput struct {
// 对象存储存储类型
StorageClasses []string `json:"storage_classes"`
}
type CloudproviderGetCannedAclInput struct {
CloudregionResourceInput
}
type CloudproviderGetCannedAclOutput struct {
// Bucket支持的预置ACL列表
BucketCannedAcls []string `json:"bucket_canned_acls"`
// Object支持的预置ACL列表
ObjectCannedAcls []string `json:"object_canned_acls"`
}

View File

@@ -109,7 +109,7 @@ type DBInstanceCreateInput struct {
// | ----- | ------ | --- |
// | 华为云 |ha, single, replica| |
// | 阿里云 |basic, high_availability, always_on, finance||
// | Google |SECOND_GEN | FIRST_GEN 目前谷歌已弃用|
// | Google |Zonal, Regional | |
// 翻译:
// basic: 基础版
// high_availability: 高可用
@@ -118,7 +118,8 @@ type DBInstanceCreateInput struct {
// ha: 高可用
// single: 单机
// replica: 只读
// SECNOD_GEN: 第二代
// Zonal: 单区域
// Regional: 区域级
// required: true
Category string `json:"category"`
@@ -178,9 +179,22 @@ type SDBInstanceChangeConfigInput struct {
type SDBInstanceRecoveryConfigInput struct {
apis.Meta
DBInstancebackup string
DBInstancebackupId string `json:"dbinstancebackup_id"`
Databases map[string]string `json:"databases,allowempty"`
// swagger:ignore
DBInstancebackup string `json:"dbinstancebackup" "yunion:deprecated-by":"dbinstancebackup_id"`
// 备份Id
//
//
// | 平台 | 支持引擎 | 说明 |
// | ----- | ------ | --- |
// | 华为云 |MySQL, SQL Server | 仅SQL Server支持恢复到当前实例 |
// | 阿里云 |MySQL, SQL Server | MySQL要求必须开启单库单表恢复功能 并且只能是MySQL 8.0 高可用版本地SSD盘MySQL 5.7 高可用版本地SSD盘或MySQL 5.6 高可用版, MySQL仅支持恢复到当前实例|
// | Google |MySQL, PostgreSQL, SQL Server | PostgreSQL备份恢复时要求实例不能有副本 |
DBInstancebackupId string `json:"dbinstancebackup_id"`
// 数据库信息, 例如 {"src":"dest"} 是将备份中的src数据库恢复到目标实例的dest数据库中, 阿里云此参数为必传
// example: {"sdb1":"ddb1"}
Databases map[string]string `json:"databases,allowempty"`
}
type DBInstanceListInput struct {

View File

@@ -70,13 +70,13 @@ type SDBInstanceSetPrivilegesInput struct {
type DBInstancePrivilege struct {
// 数据库名称
Database string
Database string `json:"database"`
// 账号名称
Account string
Account string `json:"account"`
// 数据库Id
DBInstancedatabaseId string
DBInstancedatabaseId string `json:"dbinstancedatabase_id"`
// 权限
Privileges string
Privileges string `json:"privileges"`
}
type DBInstanceAccountDetails struct {

View File

@@ -16,19 +16,20 @@ package compute
const (
//实例状态
DBINSTANCE_DEPLOYING = "deploying" //部署中
DBINSTANCE_RUNNING = "running" //运行中
DBINSTANCE_REBOOTING = "rebooting" //重启中
DBINSTANCE_MIGRATING = "migrating" //迁移中
DBINSTANCE_BACKING_UP = "backing_up" //备份中
DBINSTANCE_RESTORING = "restoring" //备份恢复中
DBINSTANCE_RESTORE_FAILED = "restore_failed"
DBINSTANCE_IMPORTING = "importing" //数据导入中
DBINSTANCE_CLONING = "cloning" //克隆
DBINSTANCE_DELETING = "deleting" //删除
DBINSTANCE_DELETE_FAILED = "delete_failed" //删除失败
DBINSTANCE_MAINTENANCE = "maintenance" //维护中
DBINSTANCE_UNKNOWN = "unknown"
DBINSTANCE_DEPLOYING = "deploying" //部署中
DBINSTANCE_RUNNING = "running" //运行中
DBINSTANCE_REBOOTING = "rebooting" //重启中
DBINSTANCE_MIGRATING = "migrating" //迁移中
DBINSTANCE_BACKING_UP = "backing_up" //备份中
DBINSTANCE_BACKING_UP_FAILED = "backing_up_failed" //备份失败
DBINSTANCE_RESTORING = "restoring" //备份恢复中
DBINSTANCE_RESTORE_FAILED = "restore_failed"
DBINSTANCE_IMPORTING = "importing" //数据导入
DBINSTANCE_CLONING = "cloning" //克隆
DBINSTANCE_DELETING = "deleting" //删除
DBINSTANCE_DELETE_FAILED = "delete_failed" //删除失败
DBINSTANCE_MAINTENANCE = "maintenance" //维护中
DBINSTANCE_UNKNOWN = "unknown"
DBINSTANCE_CHANGE_CONFIG = "change_config" //调整配置
DBINSTANCE_CHANGE_CONFIG_FAILED = "change_config_failed" //调整配置失败
@@ -103,6 +104,10 @@ const (
HUAWEI_DBINSTANCE_CATEGORY_SINGLE = "single" //单机
HUAWEI_DBINSTANCE_CATEGORY_REPLICA = "replica" //只读
//谷歌云实例类型
GOOGLE_DBINSTANCE_CATEGORY_REGIONAL = "Regional" // 高可用性(区域级)
GOOGLE_DBINSTANCE_CATEGORY_ZONAL = "Zonal" // 单个地区
//阿里云存储类型
ALIYUN_DBINSTANCE_STORAGE_TYPE_LOCAL_SSD = "local_ssd" //本地盘SSD盘
ALIYUN_DBINSTANCE_STORAGE_TYPE_CLOUD_ESSD = "cloud_essd" //ESSD云盘

View File

@@ -16,9 +16,16 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
const (
EXTERNAL_PROJECT_STATUS_AVAILABLE = "available" // 可用
EXTERNAL_PROJECT_STATUS_UNAVAILABLE = "unavailable" // 不可用
EXTERNAL_PROJECT_STATUS_CREATING = "creating" // 创建中
EXTERNAL_PROJECT_STATUS_DELETING = "deleting" // 删除中
EXTERNAL_PROJECT_STATUS_UNKNOWN = "unknown" // 未知
)
type ExternalProjectDetails struct {
apis.StandaloneResourceDetails
apis.ProjectizedResourceInfo
apis.VirtualResourceDetails
ManagedResourceInfo
SExternalProject

View File

@@ -64,6 +64,23 @@ type ZonalFilterListBase struct {
OrderByZone string `json:"order_by_zone"`
}
func (input ZonalFilterListBase) ZoneList() []string {
zoneStr := input.Zone
if len(zoneStr) > 0 {
input.Zones = append(input.Zones, zoneStr)
}
return input.Zones
}
func (input ZonalFilterListBase) FirstZone() string {
if len(input.Zone) > 0 {
return input.Zone
}
if len(input.Zones) > 0 {
return input.Zones[0]
}
return ""
}
func (input ZonalFilterListInput) ZoneList() []string {
zoneStr := input.Zone
if len(zoneStr) > 0 {

View File

@@ -21,6 +21,8 @@ type GuestnetworkDetails struct {
// IP子网名称
Network string `json:"network"`
// 所属Wire
WireId string `json:"wire_id"`
}
type GuestnetworkShortDesc struct {

View File

@@ -69,8 +69,8 @@ type ServerListInput struct {
// 按主机资源类型进行排序
// enum: shared,prepaid,dedicated
ResourceType string `json:"resource_type"`
// 返回开启主备机功能的主
GetBackupGuestsOnHost *bool `json:"get_backup_guests_on_host"`
// 返回该宿主机上的所有虚拟机,包括备份
GetAllGuestsOnHost string `json:"get_all_guests_on_host"`
// 根据宿主机 SN 过滤
// HostSn string `json:"host_sn"`
@@ -340,3 +340,8 @@ type GuestSaveToTemplateInput struct {
// The generate name of guest template
GenerateName string `json:"generate_name"`
}
type GuestSyncFixNicsInput struct {
// 需要修正的IP地址列表
Ip []string `json:"ip"`
}

View File

@@ -57,6 +57,7 @@ type GuestTemplateDetails struct {
Secgroups []string `json:"secgroups"`
Zone string `json:"zone"`
ZoneId string `json:"zone_id"`
Brand string `json:"brand"`
ConfigInfo GuestTemplateConfigInfo `json:"config_info"`
@@ -71,9 +72,7 @@ type GuestTemplateListInput struct {
}
type GuestTemplateConfigInfo struct {
Region string `json:"region"`
Zone string `json:"zone"`
Hypervisor string `json:"hypervisor"`
Metadata map[string]string `json:"metadata"`
Secgroup string `json:"secgroup"`
Sku GuestTemplateSku `json:"sku"`
Disks []GuestTemplateDisk `json:"disks"`

View File

@@ -108,6 +108,8 @@ type HostListInput struct {
Uuid []string `json:"uuid"`
// 主机启动模式, 可能值位PXE和ISO
BootMode []string `json:"boot_mode"`
// 虚拟机所在的二层网络
ServerIdForNetwork string `json:"server_id_for_network"`
}
type HostDetails struct {
@@ -119,9 +121,10 @@ type HostDetails struct {
Schedtags []SchedtagShortDescDetails `json:"schedtags"`
ServerId string `json:"server_id"`
Server string `json:"server"`
ServerIps string `json:"server_ips"`
ServerId string `json:"server_id"`
Server string `json:"server"`
ServerIps string `json:"server_ips"`
ServerPendingDeleted bool `json:"server_pending_deleted"`
// 网卡数量
NicCount int `json:"nic_count"`
// 网卡详情
@@ -138,7 +141,7 @@ type HostDetails struct {
NonsystemGuests int `json:"nonsystem_guests"`
// 运行中云主机数量
// example: 2
RunningGuests int `json:"running_geusts"`
RunningGuests int `json:"running_guests"`
// CPU超分率
CpuCommitRate float64 `json:"cpu_commit_rate"`
// 内存超分率
@@ -164,7 +167,8 @@ type HostDetails struct {
CanPrepare bool `json:"can_prepare"`
PrepareFailReason string `json:"prepare_fail_reason"`
// 允许开启宿主机健康检查
AllowHealthCheck bool `json:"allow_health_check"`
AllowHealthCheck bool `json:"allow_health_check"`
AutoMigrateOnHostDown bool `json:"auto_migrate_on_host_down"`
// reserved resource for isolated device
ReservedResourceForGpu IsolatedDeviceReservedResourceInput `json:"reserved_resource_for_gpu"`

View File

@@ -61,8 +61,7 @@ type CachedimageListInput struct {
}
type ExternalProjectListInput struct {
apis.StandaloneResourceListInput
apis.ProjectizedResourceListInput
apis.VirtualResourceListInput
apis.ExternalizedResourceBaseListInput
ManagedResourceListInput

View File

@@ -50,6 +50,9 @@ type InstanceSnapshotDetails struct {
// 快照列表
Snapshots []SimpleSnapshot `json:"snapshots"`
Properties map[string]string `json:"properties"`
// 主机快照大小
Size int `json:"size"`
}
type InstanceSnapshotListInput struct {

View File

@@ -170,6 +170,8 @@ type LoadbalancerDetails struct {
ManagedResourceInfo
CloudregionResourceInfo
LoadbalancerClusterResourceInfo
VpcResourceInfoBase
ZoneResourceInfoBase
NetworkResourceInfoBase

View File

@@ -23,3 +23,24 @@ type LoadbalancerAclDetails struct {
SLoadbalancerAcl
}
type LoadbalancerAclResourceInfo struct {
// 负载均衡ACL名称
Acl string `json:"acl"`
}
type LoadbalancerAclResourceInput struct {
// ACL名称或ID
AclId string `json:"acl_id"`
// swagger:ignore
// Deprecated
Acl string `json:"acl" "yunion:deprecated-by":"acl_id"`
}
type LoadbalancerAclFilterListInput struct {
LoadbalancerAclResourceInput
// 以ACL名称排序
OrderByAcl string `json:"order_by_acl"`
}

View File

@@ -20,3 +20,24 @@ type LoadbalancerCertificateDetails struct {
apis.VirtualResourceDetails
SLoadbalancerCertificate
}
type LoadbalancerCertificateResourceInfo struct {
// 负载均衡证书名称
Certificate string `json:"certificate"`
}
type LoadbalancerCertificateResourceInput struct {
// 证书名称或ID
Certificate string `json:"certificate"`
// swagger:ignore
// Deprecated
CertificateId string `json:"certificate_id" "yunion:deprecated-by":"certificate"`
}
type LoadbalancerCertificateFilterListInput struct {
LoadbalancerCertificateResourceInput
// 以证书名称排序
OrderByCertificate string `json:"order_by_certificate"`
}

View File

@@ -19,11 +19,12 @@ import "yunion.io/x/onecloud/pkg/apis"
type LoadbalancerListenerDetails struct {
apis.VirtualResourceDetails
LoadbalancerResourceInfo
LoadbalancerAclResourceInfo
LoadbalancerCertificateResourceInfo
SLoadbalancerListener
BackendGroup string `json:"backend_group"`
AclName string `json:"acl_name"`
CertificateName string `json:"certificate_name"`
OriginCertificateId string `json:"origin_certificate_id"`
}

View File

@@ -134,9 +134,15 @@ type ScalingGroupDetails struct {
// example: OneCloud
Brand string `json:"brand"`
// description: 网络ID
// example: net-12345
Networks []string `json:"networks"`
// description: 网络信息
Networks []ScalingGroupNetwork `json:"networks"`
}
type ScalingGroupNetwork struct {
Id string `json:"id"`
Name string `json:"name"`
GuestIpStart string `json:"guest_ip_start"`
GuestIpEnd string `json:"guest_ip_end"`
}
type ScalingGroupResourceInfo struct {

View File

@@ -65,7 +65,7 @@ type SchedtagListInput struct {
apis.ScopedResourceBaseListInput
// fitler by resource_type
ResourceType string `json:"resource_type"`
ResourceType []string `json:"resource_type"`
// swagger:ignore
// Deprecated
// filter by type, alias for resource_type
@@ -86,6 +86,7 @@ type SchedtagDetails struct {
HostCount int `json:"host_count"`
ServerCount int `json:"server_count"`
OtherCount int `json:"other_count"`
ResourceCount int `json:"resource_count"`
JoinModelKeyword string `json:"join_model_keyword"`
}

View File

@@ -145,8 +145,18 @@ type SecgroupListInput struct {
// pattern:asc|desc
OrderByGuestCnt string `json:"order_by_guest_cnt"`
// 是否被修改
IsDirty *bool `json:"is_dirty"`
// 模糊过滤规则中含有指定ip的安全组
// example: 10.10.2.1
Ip string `json:"ip"`
// 精确匹配规则中含有指定端口的安全组
// example: 100-200
Ports string `json:"ports"`
// 指定过滤规则的方向(仅在指定ip或ports时生效) choices: all|in|out
// default: all
// example: in
Direction string `json:"direction"`
}
type SecurityGroupCacheListInput struct {
@@ -164,12 +174,18 @@ type SecurityGroupRuleListInput struct {
apis.ResourceBaseListInput
SecgroupFilterListInput
Projects []string `json:"projects"`
// 以direction字段过滤安全组规则
Direction string `json:"direction"`
// 以action字段过滤安全组规则
Action string `json:"action"`
// 以protocol字段过滤安全组规则
Protocol string `json:"protocol"`
// 以ports字段过滤安全组规则
Ports string `json:"ports"`
// 根据ip模糊匹配安全组规则
Ip string `json:"ip"`
}
type SecgroupResourceInput struct {
@@ -179,6 +195,9 @@ type SecgroupResourceInput struct {
// Deprecated
// filter by secgroup_id
SecgroupId string `json:"secgroup_id" "yunion:deprecated-by":"secgroup"`
// 模糊匹配安全组规则名称
SecgroupName string `json:"secgroup_name"`
}
type SecgroupFilterListInput struct {
@@ -193,15 +212,22 @@ type SecgroupDetails struct {
SSecurityGroup
// 关联云主机数量
GuestCnt int `json:"guest_cnt"`
GuestCnt int `json:"guest_cnt,allowempty"`
// 关联此安全组的云主机is_system为true数量
SystemGuestCnt int `json:"system_guest_cnt,allowempty"`
// admin_secgrp_id为此安全组的云主机数量
AdminGuestCnt int `json:"admin_guest_cnt,allowempty"`
// 安全组缓存数量
CacheCnt int `json:"cache_cnt"`
CacheCnt int `json:"cache_cnt,allowempty"`
// 规则信息
Rules string `json:"rules"`
Rules []SSecurityGroupRule `json:"rules"`
// 入方向规则信息
InRules string `json:"in_rules"`
InRules []SSecurityGroupRule `json:"in_rules"`
// 出方向规则信息
OutRules string `json:"out_rules"`
OutRules []SSecurityGroupRule `json:"out_rules"`
}
type SecurityGroupResourceInfo struct {

View File

@@ -127,7 +127,7 @@ var (
STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_ZSTACK_CEPH, STORAGE_GPFS,
}
HOST_STORAGE_LOCAL_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_ZSTACK_LOCAL_STORAGE}
HOST_STORAGE_LOCAL_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_OPENSTACK_NOVA}
STORAGE_LIMITED_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_NAS, STORAGE_RBD, STORAGE_NFS, STORAGE_GPFS}

View File

@@ -202,8 +202,6 @@ type SCloudaccount struct {
ProxySettingId string `json:"proxy_setting_id"`
// 公有云子账号登录地址
IamLoginUrl string `json:"iam_login_url"`
// 是否支持创建公有云子账号
IsSupportCloudId *bool `json:"is_support_cloud_id,omitempty"`
}
// SCloudprovider is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudprovider.
@@ -731,10 +729,11 @@ type SElasticip struct {
// SExternalProject is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SExternalProject.
type SExternalProject struct {
apis.SStandaloneResourceBase
apis.SProjectizedResourceBase
apis.SVirtualResourceBase
apis.SExternalizedResourceBase
SManagedResourceBase
// 归属云账号ID
CloudaccountId string `json:"cloudaccount_id"`
}
// SGlobalVpc is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGlobalVpc.
@@ -868,6 +867,20 @@ type SGuestTemplateResourceBase struct {
GuestTemplateId string `json:"guest_template_id"`
}
// SGuestcdrom is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestcdrom.
type SGuestcdrom struct {
Id string `json:"id"`
// = Column(VARCHAR(36, charset='ascii'), primary_key=True)
ImageId string `json:"image_id"`
// Column(VARCHAR(36, charset='ascii'), nullable=True)
Name string `json:"name"`
// Column(VARCHAR(64, charset='ascii'), nullable=True)
Path string `json:"path"`
// Column(VARCHAR(256, charset='ascii'), nullable=True)
Size int `json:"size"`
UpdateVersion int `json:"update_version"`
}
// SGuestdisk is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestdisk.
type SGuestdisk struct {
SGuestJointsBase
@@ -987,11 +1000,10 @@ type SHost struct {
OvnVersion string `json:"ovn_version"`
IsBaremetal bool `json:"is_baremetal"`
// 是否处于维护状态
IsMaintenance bool `json:"is_maintenance"`
LastPingAt time.Time `json:"last_ping_at"`
EnableHealthCheck bool `json:"enable_health_check"`
ResourceType string `json:"resource_type"`
RealExternalId string `json:"real_external_id"`
IsMaintenance bool `json:"is_maintenance"`
EnableHealthCheck bool `json:"enable_health_check"`
ResourceType string `json:"resource_type"`
RealExternalId string `json:"real_external_id"`
// 是否为导入的宿主机
IsImport bool `json:"is_import"`
// 是否允许PXE启动
@@ -1179,8 +1191,7 @@ type SLoadbalancer struct {
AddressType string `json:"address_type"`
// 网络类型
NetworkType string `json:"network_type"`
// 负载均衡集群Id
ClusterId string `json:"cluster_id"`
SLoadbalancerClusterResourceBase
// 计费类型
ChargeType string `json:"charge_type"`
// 套餐名称
@@ -1246,12 +1257,9 @@ type SLoadbalancerAgentDeployment struct {
// SLoadbalancerAgentParams is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParams.
type SLoadbalancerAgentParams struct {
KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"`
HaproxyConfTmpl string `json:"haproxy_conf_tmpl"`
TelegrafConfTmpl string `json:"telegraf_conf_tmpl"`
Vrrp SLoadbalancerAgentParamsVrrp `json:"vrrp"`
Haproxy SLoadbalancerAgentParamsHaproxy `json:"haproxy"`
Telegraf SLoadbalancerAgentParamsTelegraf `json:"telegraf"`
KeepalivedConfTmpl string `json:"keepalived_conf_tmpl"`
HaproxyConfTmpl string `json:"haproxy_conf_tmpl"`
TelegrafConfTmpl string `json:"telegraf_conf_tmpl"`
}
// SLoadbalancerAgentParamsHaproxy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerAgentParamsHaproxy.
@@ -1377,7 +1385,7 @@ type SLoadbalancerHTTPRedirect struct {
// SLoadbalancerHTTPSListener is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SLoadbalancerHTTPSListener.
type SLoadbalancerHTTPSListener struct {
CertificateId string `json:"certificate_id"`
SLoadbalancerCertificateResourceBase
CachedCertificateId string `json:"cached_certificate_id"`
TLSCipherPolicy string `json:"tls_cipher_policy"`
EnableHttp2 bool `json:"enable_http2"`
@@ -1425,8 +1433,8 @@ type SLoadbalancerListener struct {
BackendIdleTimeout int `json:"backend_idle_timeout"`
AclStatus string `json:"acl_status"`
AclType string `json:"acl_type"`
AclId string `json:"acl_id"`
CachedAclId string `json:"cached_acl_id"`
SLoadbalancerAclResourceBase
CachedAclId string `json:"cached_acl_id"`
SLoadbalancerRateLimiter
SLoadbalancerTCPListener
SLoadbalancerUDPListener
@@ -1493,6 +1501,16 @@ type SManagedResourceBase struct {
ManagerId string `json:"manager_id"`
}
// SNatDEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatDEntry.
type SNatDEntry struct {
SNatEntry
ExternalIP string `json:"external_ip"`
ExternalPort int `json:"external_port"`
InternalIP string `json:"internal_ip"`
InternalPort int `json:"internal_port"`
IpProtocol string `json:"ip_protocol"`
}
// SNatEntry is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNatEntry.
type SNatEntry struct {
apis.SStatusInfrasResourceBase
@@ -1523,6 +1541,25 @@ type SNatgatewayResourceBase struct {
NatgatewayId string `json:"natgateway_id"`
}
// SNetInterface is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetInterface.
type SNetInterface struct {
Mac string `json:"mac"`
// Column(VARCHAR(36, charset='ascii'), primary_key=True)
BaremetalId string `json:"baremetal_id"`
// Column(VARCHAR(36, charset='ascii'), nullable=True)
WireId string `json:"wire_id"`
// Column(VARCHAR(36, charset='ascii'), nullable=True)
Rate int `json:"rate"`
// Column(Integer, nullable=True) # Mbps
NicType string `json:"nic_type"`
// Column(VARCHAR(36, charset='ascii'), nullable=True)
Index byte `json:"index"`
// Column(TINYINT, nullable=True)
LinkUp bool `json:"link_up"`
// Column(Boolean, nullable=True)
Mtu int16 `json:"mtu"`
}
// SNetwork is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SNetwork.
type SNetwork struct {
apis.SSharableVirtualResourceBase
@@ -1697,8 +1734,6 @@ type SScalingAlarm struct {
Value float64 `json:"value"`
// Real-time cumulate number
RealCumulate int `json:"real_cumulate"`
// Last trigger time
LastTriggerTime time.Time `json:"last_trigger_time"`
}
// SScalingGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroup.
@@ -1729,10 +1764,6 @@ type SScalingGroup struct {
HealthCheckGov int `json:"health_check_gov"`
LoadbalancerBackendPort int `json:"loadbalancer_backend_port"`
LoadbalancerBackendWeight int `json:"loadbalancer_backend_weight"`
// Time to allow scale
AllowScaleTime time.Time `json:"allow_scale_time"`
// NextCheckTime descripe the next time to check instance's health
NextCheckTime time.Time `json:"next_check_time"`
}
// SScalingGroupGuest is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SScalingGroupGuest.
@@ -1856,7 +1887,8 @@ type SSecurityGroupCache struct {
SManagedResourceBase
SSecurityGroupResourceBase
// 虚拟私有网络外部Id
VpcId string `json:"vpc_id"`
VpcId string `json:"vpc_id"`
ExternalProjectId string `json:"external_project_id"`
}
// SSecurityGroupResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SSecurityGroupResourceBase.

View File

@@ -151,6 +151,9 @@ type ProjectListInput struct {
UserFilterListInput
GroupFilterListInput
// 过滤出指定用户或者组可以加入的项目
Jointable *bool `json:"jointable"`
}
type DomainListInput struct {

View File

@@ -92,6 +92,20 @@ type SFederatedUser struct {
DisplayName string `json:"display_name"`
}
// SFederationProtocol is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFederationProtocol.
type SFederationProtocol struct {
Id string `json:"id"`
IdpId string `json:"idp_id"`
MappingId string `json:"mapping_id"`
}
// SFernetKey is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SFernetKey.
type SFernetKey struct {
Type string `json:"type"`
Index int `json:"index"`
Key string `json:"key"`
}
// SGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SGroup.
type SGroup struct {
SIdentityBaseResource
@@ -129,28 +143,45 @@ type SIdmapping struct {
EntityType string `json:"entity_type"`
}
// SIdpRemoteIds is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SIdpRemoteIds.
type SIdpRemoteIds struct {
IdpId string `json:"idp_id"`
RemoteId string `json:"remote_id"`
}
// SImpliedRole is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SImpliedRole.
type SImpliedRole struct {
PriorRoleId string `json:"prior_role_id"`
ImpliedRoleId string `json:"implied_role_id"`
}
// SLocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SLocalUser.
type SLocalUser struct {
apis.SResourceBase
Id int `json:"id"`
UserId string `json:"user_id"`
DomainId string `json:"domain_id"`
Name string `json:"name"`
FailedAuthCount int `json:"failed_auth_count"`
FailedAuthAt time.Time `json:"failed_auth_at"`
Id int `json:"id"`
UserId string `json:"user_id"`
DomainId string `json:"domain_id"`
Name string `json:"name"`
FailedAuthCount int `json:"failed_auth_count"`
}
// SNonlocalUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SNonlocalUser.
type SNonlocalUser struct {
DomainId string `json:"domain_id"`
Name string `json:"name"`
UserId string `json:"user_id"`
}
// SPassword is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPassword.
type SPassword struct {
apis.SResourceBase
Id int `json:"id"`
LocalUserId int `json:"local_user_id"`
Password string `json:"password"`
ExpiresAt time.Time `json:"expires_at"`
SelfService bool `json:"self_service"`
PasswordHash string `json:"password_hash"`
CreatedAtInt int64 `json:"created_at_int"`
ExpiresAtInt int64 `json:"expires_at_int"`
Id int `json:"id"`
LocalUserId int `json:"local_user_id"`
Password string `json:"password"`
SelfService bool `json:"self_service"`
PasswordHash string `json:"password_hash"`
CreatedAtInt int64 `json:"created_at_int"`
ExpiresAtInt int64 `json:"expires_at_int"`
}
// SPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SPolicy.
@@ -168,6 +199,12 @@ type SProject struct {
IsDomain *bool `json:"is_domain,omitempty"`
}
// SProjectExtended is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SProjectExtended.
type SProjectExtended struct {
SProject
DomainName string `json:"domain_name"`
}
// SRegion is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SRegion.
type SRegion struct {
apis.SStandaloneResourceBase
@@ -181,6 +218,17 @@ type SRole struct {
apis.SSharableBaseResource
}
// SScopeResource is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SScopeResource.
type SScopeResource struct {
DomainId string `json:"domain_id"`
ProjectId string `json:"project_id"`
OwnerId string `json:"owner_id"`
RegionId string `json:"region_id"`
ServiceId string `json:"service_id"`
Resource string `json:"resource"`
Count int `json:"count"`
}
// SService is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SService.
type SService struct {
apis.SStandaloneResourceBase
@@ -213,6 +261,13 @@ type SUser struct {
EnableMfa *bool `json:"enable_mfa,omitempty"`
}
// SUserOption is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUserOption.
type SUserOption struct {
UserId string `json:"user_id"`
OptionId string `json:"option_id"`
OptionValue string `json:"option_value"`
}
// SUsergroupMembership is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUsergroupMembership.
type SUsergroupMembership struct {
apis.SResourceBase

View File

@@ -50,6 +50,7 @@ const (
IMAGE_IS_READONLY = "is_readonly"
IMAGE_PARTITION_TYPE = "partition_type"
IMAGE_INSTALLED_CLOUDINIT = "installed_cloud_init"
IMAGE_DISABLE_USB_KBD = "disable_usb_kbd"
IMAGE_STATUS_UPDATING = "updating"
)

View File

@@ -62,9 +62,44 @@ type SImage struct {
OssChecksum string `json:"oss_checksum"`
}
// SImageMember is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageMember.
type SImageMember struct {
SImagePeripheral
Member string `json:"member"`
CanShare bool `json:"can_share"`
}
// SImagePeripheral is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImagePeripheral.
type SImagePeripheral struct {
apis.SResourceBase
Id int `json:"id"`
ImageId string `json:"image_id"`
}
// SImageProperty is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageProperty.
type SImageProperty struct {
SImagePeripheral
Name string `json:"name"`
Value string `json:"value"`
}
// SImageSubformat is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageSubformat.
type SImageSubformat struct {
SImagePeripheral
Format string `json:"format"`
Size int64 `json:"size"`
Location string `json:"location"`
Checksum string `json:"checksum"`
FastHash string `json:"fast_hash"`
Status string `json:"status"`
TorrentSize int64 `json:"torrent_size"`
TorrentLocation string `json:"torrent_location"`
TorrentChecksum string `json:"torrent_checksum"`
TorrentStatus string `json:"torrent_status"`
}
// SImageTag is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageTag.
type SImageTag struct {
SImagePeripheral
Value string `json:"value"`
}

View File

@@ -75,9 +75,11 @@ type SharableVirtualResourceCreateInput struct {
SharableResourceBaseCreateInput
}
type StatusUserResourceCreateInput struct {
StatusBaseResourceCreateInput
UserResourceCreateInput
type StatusDomainLevelUserResourceCreateInput struct {
StatusDomainLevelResourceCreateInput
// 本地用户Id若为空则使用当前用户Id作为此参数值
OwnerId string `json:"owner_id"`
}
type UserResourceCreateInput struct {

View File

@@ -53,16 +53,24 @@ type ProjectizedResourceListInput struct {
OrderByTenant string `json:"order_by_tenant" "yunion:deprecated-by":"order_by_project"`
}
type StatusUserResourceListInput struct {
StatusResourceBaseListInput
UserResourceListInput
type StatusDomainLevelUserResourceListInput struct {
StatusDomainLevelResourceListInput
// 查询指定的用户ID或名称拥有的资源
User string `json:"user"`
// swagger:ignore
// Deprecated
// Filter by userId
UserId string `json:"user_id" "yunion:deprecated-by":"user"`
}
type UserResourceListInput struct {
StandaloneResourceListInput
ScopedResourceInput
// list in admin mode
// swagger:ignore
// Is an admin call? equivalent to scope=system
// Deprecated
Admin *bool `json:"admin"`
// 查询指定的用户ID或名称拥有的资源

View File

@@ -23,6 +23,8 @@ const (
CommonAlertFieldOpt_Division = "/"
)
var CommonAlertLevels = []string{"normal", "important", "fatal"}
type CommonAlertCreateInput struct {
CommonMetricInputQuery
AlertCreateInput

View File

@@ -79,6 +79,16 @@ type SDataSource struct {
IsDefault *bool `json:"is_default,omitempty"`
}
// SMeterAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SMeterAlert.
type SMeterAlert struct {
SV1Alert
}
// SNodeAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SNodeAlert.
type SNodeAlert struct {
SV1Alert
}
// SNotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SNotification.
type SNotification struct {
apis.SVirtualResourceBase
@@ -124,3 +134,8 @@ type SSuggestSysRule struct {
Setting interface{} `json:"setting"`
ExecTime time.Time `json:"exec_time"`
}
// SV1Alert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SV1Alert.
type SV1Alert struct {
SAlert
}

View File

@@ -121,8 +121,11 @@ type MetadataResourceInfo struct {
Metadata map[string]string `json:"metadata"`
}
type StatusUserResourceDetails struct {
UserResourceDetails
type StatusDomainLevelUserResourceDetails struct {
StatusDomainLevelResourceDetails
// 用户名称
OwnerName string `json:"owner_name"`
}
type UserResourceDetails struct {

View File

@@ -99,9 +99,60 @@ type SJointResourceBase struct {
// SKeystoneCacheObject is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SKeystoneCacheObject.
type SKeystoneCacheObject struct {
SStandaloneResourceBase
DomainId string `json:"domain_id"`
Domain string `json:"domain"`
LastCheck time.Time `json:"last_check"`
DomainId string `json:"domain_id"`
Domain string `json:"domain"`
}
// SMetadata is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SMetadata.
type SMetadata struct {
// 资源类型
// example: network
ObjType string `json:"obj_type"`
// 资源ID
// example: 87321a70-1ecb-422a-8b0c-c9aa632a46a7
ObjId string `json:"obj_id"`
// 资源组合ID
// example: network::87321a70-1ecb-422a-8b0c-c9aa632a46a7
Id string `json:"id"`
// 标签KEY
// exmaple: 部门
Key string `json:"key"`
// 标签值
// example: 技术部
Value string `json:"value"`
// 是否被删除
Deleted bool `json:"deleted"`
}
// SOpsLog is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SOpsLog.
type SOpsLog struct {
Id int64 `json:"id"`
// = Column(BigInteger, primary_key=True)
ObjType string `json:"obj_type"`
// = Column(VARCHAR(40, charset='ascii'), nullable=False)
ObjId string `json:"obj_id"`
// = Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False)
ObjName string `json:"obj_name"`
// = Column(VARCHAR(128, charset='utf8'), nullable=False)
Action string `json:"action"`
// = Column(VARCHAR(32, charset='ascii'), nullable=False)
Notes string `json:"notes"`
ProjectId string `json:"tenant_id"`
// = Column(VARCHAR(ID_LENGTH, charset='ascii'))
Project string `json:"tenant"`
ProjectDomainId string `json:"project_domain_id"`
ProjectDomain string `json:"project_domain"`
UserId string `json:"user_id"`
// = Column(VARCHAR(ID_LENGTH, charset='ascii'))
User string `json:"user"`
// = Column(VARCHAR(128, charset='utf8'))
DomainId string `json:"domain_id"`
Domain string `json:"domain"`
Roles string `json:"roles"`
// BillingType string `width:"64" charset:"ascii" default:"postpaid" list:"user" create:"user"` // billing_type = Column(VARCHAR(64, charset='ascii'), nullable=True)
OpsTime time.Time `json:"ops_time"`
OwnerDomainId string `json:"owner_domain_id"`
OwnerProjectId string `json:"owner_tenant_id"`
}
// SProjectizedResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SProjectizedResourceBase.
@@ -178,6 +229,13 @@ type SStatusDomainLevelResourceBase struct {
SStatusResourceBase
}
// SStatusDomainLevelUserResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SStatusDomainLevelUserResourceBase.
type SStatusDomainLevelUserResourceBase struct {
SStatusDomainLevelResourceBase
// 本地用户Id
OwnerId string `json:"owner_id"`
}
// SStatusInfrasResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SStatusInfrasResourceBase.
type SStatusInfrasResourceBase struct {
SInfrasResourceBase
@@ -196,10 +254,14 @@ type SStatusStandaloneResourceBase struct {
SStatusResourceBase
}
// SStatusUserResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SStatusUserResourceBase.
type SStatusUserResourceBase struct {
SUserResourceBase
SStatusResourceBase
// STenant is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.STenant.
type STenant struct {
SKeystoneCacheObject
}
// SUser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SUser.
type SUser struct {
SKeystoneCacheObject
}
// SUserResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db.SUserResourceBase.

View File

@@ -249,11 +249,17 @@ func (adapter *HPSARaidAdaptor) buildRaid(level string, devs []*baremetal.Bareme
return fmt.Errorf("getLastArray: %v", err)
}
cmds := []string{}
for _, sz := range conf.Size[1:] {
restSize := conf.Size[1:]
for idx, sz := range restSize {
isLast := idx == len(restSize)-1
sizeStr := fmt.Sprintf("size=%d", sz)
if isLast {
sizeStr = "size=max"
}
args = []string{"controller", fmt.Sprintf("slot=%d", adapter.index),
"array", array, "create", "type=ld",
fmt.Sprintf("raid=%s", level),
fmt.Sprintf("size=%d", sz),
sizeStr,
}
args = append(args, params...)
cmds = append(cmds, GetCommand(args...))

View File

@@ -84,8 +84,9 @@ func InitAuth(options *common_options.CommonOptions, authComplete auth.AuthCompl
func InitBaseAuth(options *common_options.BaseOptions) {
if options.EnableRbac {
policy.EnableGlobalRbac(time.Duration(options.RbacPolicySyncPeriodSeconds)*time.Second,
time.Duration(options.RbacPolicySyncFailedRetrySeconds)*time.Second,
policy.EnableGlobalRbac(
time.Second*time.Duration(options.RbacPolicySyncPeriodSeconds),
time.Second*time.Duration(options.RbacPolicySyncFailedRetrySeconds),
options.RbacDebug,
)
}

View File

@@ -27,8 +27,6 @@ import (
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/db/lockman"
"yunion.io/x/onecloud/pkg/cloudcommon/etcd"
"yunion.io/x/onecloud/pkg/cloudcommon/informer"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
)
@@ -80,6 +78,7 @@ func InitDB(options *common_options.DBOptions) {
}
// lm := lockman.NewNoopLockManager()
/* disable informer feature on release/3.3
if len(options.EtcdEndpoints) != 0 {
log.Infof("using etcd as resource informer backend")
tlsCfg, err := options.GetEtcdTLSConfig()
@@ -99,6 +98,7 @@ func InitDB(options *common_options.DBOptions) {
}
informer.Init(informerBackend)
}
*/
}
func CloseDB() {

View File

@@ -857,6 +857,11 @@ func (dispatcher *DBModelDispatcher) tryGetModelProperty(ctx context.Context, pr
modelValue := reflect.ValueOf(dispatcher.modelManager)
params := []interface{}{ctx, userCred, query}
funcValue := modelValue.MethodByName(funcName)
if !funcValue.IsValid() || funcValue.IsNil() {
return nil, nil
}
if consts.IsRbacEnabled() {
ownerId, err := fetchOwnerId(ctx, dispatcher.modelManager, userCred, query)
if err != nil {
@@ -883,10 +888,6 @@ func (dispatcher *DBModelDispatcher) tryGetModelProperty(ctx context.Context, pr
}
}
funcValue := modelValue.MethodByName(funcName)
if !funcValue.IsValid() || funcValue.IsNil() {
return nil, nil
}
outs, err := callFunc(funcValue, funcName, params...)
if err != nil {
return nil, httperrors.NewInternalServerError("reflect call %s fail %s", funcName, err)
@@ -1483,6 +1484,9 @@ func (dispatcher *DBModelDispatcher) PerformAction(ctx context.Context, idStr st
lockman.LockObject(ctx, model)
defer lockman.ReleaseObject(ctx, model)
if err := model.PreCheckPerformAction(ctx, userCred, action, query, data); err != nil {
return nil, err
}
return objectPerformAction(dispatcher, model, reflect.ValueOf(model), ctx, userCred, action, query, data)
}

View File

@@ -77,6 +77,10 @@ func (model *SDomainizedResourceBase) GetChangeOwnerCandidateDomainIds() []strin
return nil
}
func (model *SDomainizedResourceBase) GetChangeOwnerRequiredDomainIds() []string {
return nil
}
func ValidateCreateDomainId(domainId string) error {
if !consts.GetNonDefaultDomainProjects() && domainId != identity.DEFAULT_DOMAIN_ID {
return httperrors.NewForbiddenError("project in non-default domain is prohibited")

View File

@@ -24,6 +24,7 @@ import (
"yunion.io/x/sqlchemy"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/util/logclient"
@@ -133,6 +134,9 @@ func (model *SDomainLevelResourceBase) AllowPerformChangeOwner(ctx context.Conte
}
func (model *SDomainLevelResourceBase) PerformChangeOwner(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformChangeDomainOwnerInput) (jsonutils.JSONObject, error) {
if !consts.GetNonDefaultDomainProjects() {
return nil, errors.Wrap(httperrors.ErrForbidden, "not allow to change owner of domain resource if non_default_domain_projects is turned off")
}
if model.GetIStandaloneModel().IsShared() {
return nil, errors.Wrap(httperrors.ErrForbidden, "cannot change owner of shared resource")
}
@@ -162,6 +166,11 @@ func (model *SDomainLevelResourceBase) PerformChangeOwner(ctx context.Context, u
if len(candidates) > 0 && !utils.IsInStringArray(ownerId.GetProjectDomainId(), candidates) {
return nil, errors.Wrap(httperrors.ErrForbidden, "target domain not in change owner candidate list")
}
requires := model.GetIDomainLevelModel().GetChangeOwnerRequiredDomainIds()
log.Debugf("%s required domains: %s", model.Keyword(), requires)
if len(requires) > 0 && !utils.IsInStringArray(ownerId.GetProjectDomainId(), requires) {
return nil, errors.Wrap(httperrors.ErrForbidden, "target domain not in change owner required list")
}
if !IsAdminAllowPerform(userCred, model, "change-owner") {
return nil, errors.Wrap(httperrors.ErrNotSufficientPrivilege, "require system privileges")

View File

@@ -27,7 +27,7 @@ import (
// +onecloud:model-api-gen
type SExternalizedResourceBase struct {
// 外部Id, 对用公有云私有资源自身的Id
ExternalId string `width:"256" charset:"utf8" index:"true" list:"user" create:"admin_optional" update:"admin" json:"external_id"`
ExternalId string `width:"256" charset:"utf8" index:"true" list:"user" create:"domain_optional" update:"admin" json:"external_id"`
}
type SExternalizedResourceBaseManager struct{}
@@ -67,7 +67,14 @@ func SetExternalId(model IExternalizedModel, userCred mcclient.TokenCredential,
}
func FetchByExternalId(manager IModelManager, idStr string) (IExternalizedModel, error) {
return FetchByExternalIdAndManagerId(manager, idStr, func(q *sqlchemy.SQuery) *sqlchemy.SQuery {
return q
})
}
func FetchByExternalIdAndManagerId(manager IModelManager, idStr string, filter func(q *sqlchemy.SQuery) *sqlchemy.SQuery) (IExternalizedModel, error) {
q := manager.Query().Equals("external_id", idStr)
q = filter(q)
count, err := q.CountWithError()
if err != nil {
return nil, err

View File

@@ -22,6 +22,7 @@ import (
"yunion.io/x/sqlchemy"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/util/rbacutils"
@@ -200,6 +201,9 @@ func (model *SInfrasResourceBase) PerformChangeOwner(
query jsonutils.JSONObject,
input apis.PerformChangeDomainOwnerInput,
) (jsonutils.JSONObject, error) {
if !consts.GetNonDefaultDomainProjects() {
return nil, errors.Wrap(httperrors.ErrForbidden, "not allow to change owner of domain resource if non_default_domain_projects is turned off")
}
if model.IsShared() {
return nil, errors.Wrap(httperrors.ErrInvalidStatus, "cannot change owner when shared!")
}
@@ -248,6 +252,15 @@ func (model *SInfrasResourceBase) SaveSharedInfo(src apis.TOwnerSource, ctx cont
}
func (model *SInfrasResourceBase) SyncShareState(ctx context.Context, userCred mcclient.TokenCredential, shareInfo apis.SAccountShareInfo) {
if !consts.GetNonDefaultDomainProjects() {
if model.PublicSrc != string(apis.OWNER_SOURCE_LOCAL) {
model.SaveSharedInfo(apis.OWNER_SOURCE_CLOUD, ctx, userCred, apis.SShareInfo{
IsPublic: true,
PublicScope: rbacutils.ScopeSystem,
})
}
return
}
si := shareInfo.GetDomainShareInfo()
if model.PublicSrc != string(apis.OWNER_SOURCE_LOCAL) {
model.SaveSharedInfo(apis.OWNER_SOURCE_CLOUD, ctx, userCred, si)

View File

@@ -162,6 +162,7 @@ type IModel interface {
// allow perform action
AllowPerformAction(ctx context.Context, userCred mcclient.TokenCredential, action string, query jsonutils.JSONObject, data jsonutils.JSONObject) bool
PerformAction(ctx context.Context, userCred mcclient.TokenCredential, action string, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
PreCheckPerformAction(ctx context.Context, userCred mcclient.TokenCredential, action string, query jsonutils.JSONObject, data jsonutils.JSONObject) error
// update hooks
ValidateUpdateCondition(ctx context.Context) error

View File

@@ -0,0 +1,51 @@
package lockman
import "context"
type SBaseLockManager struct {
manager ILockManager
}
func NewBaseLockManger(m ILockManager) *SBaseLockManager {
return &SBaseLockManager{manager: m}
}
func (m *SBaseLockManager) LockClass(ctx context.Context, manager ILockedClass, projectId string) {
key := getClassKey(manager, projectId)
m.manager.LockKey(ctx, key)
}
func (m *SBaseLockManager) ReleaseClass(ctx context.Context, manager ILockedClass, projectId string) {
key := getClassKey(manager, projectId)
m.manager.UnlockKey(ctx, key)
}
func (m *SBaseLockManager) LockObject(ctx context.Context, model ILockedObject) {
key := getObjectKey(model)
m.manager.LockKey(ctx, key)
}
func (m *SBaseLockManager) ReleaseObject(ctx context.Context, model ILockedObject) {
key := getObjectKey(model)
m.manager.UnlockKey(ctx, key)
}
func (m *SBaseLockManager) LockRawObject(ctx context.Context, resName string, resId string) {
key := getRawObjectKey(resName, resId)
m.manager.LockKey(ctx, key)
}
func (m *SBaseLockManager) ReleaseRawObject(ctx context.Context, resName string, resId string) {
key := getRawObjectKey(resName, resId)
m.manager.UnlockKey(ctx, key)
}
func (m *SBaseLockManager) LockJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject) {
key := getJointObjectKey(model, model2)
m.manager.LockKey(ctx, key)
}
func (m *SBaseLockManager) ReleaseJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject) {
key := getJointObjectKey(model, model2)
m.manager.UnlockKey(ctx, key)
}

View File

@@ -167,6 +167,7 @@ type SLockTableIndex struct {
}
type SEtcdLockManager struct {
*SBaseLockManager
tableLock *sync.Mutex
lockTable map[SLockTableIndex]*SEtcdLockRecord
@@ -203,6 +204,7 @@ func NewEtcdLockManager(config *SEtcdLockManagerConfig) (ILockManager, error) {
Value: lockman,
Func: atexit.ExitHandlerFunc(lockman.destroyAtExit),
})
lockman.SBaseLockManager = NewBaseLockManger(&lockman)
return &lockman, nil
}

View File

@@ -135,12 +135,17 @@ func (rec *SInMemoryLockRecord) unlockContext(ctx context.Context) (needClean bo
}
type SInMemoryLockManager struct {
*SBaseLockManager
tableLock *sync.Mutex
lockTable map[string]*SInMemoryLockRecord
}
func NewInMemoryLockManager() ILockManager {
lockMan := SInMemoryLockManager{tableLock: &sync.Mutex{}, lockTable: make(map[string]*SInMemoryLockRecord)}
lockMan := SInMemoryLockManager{
tableLock: &sync.Mutex{},
lockTable: make(map[string]*SInMemoryLockRecord),
}
lockMan.SBaseLockManager = NewBaseLockManger(&lockMan)
return &lockMan
}

View File

@@ -31,6 +31,15 @@ type ILockedObject interface {
type ILockManager interface {
LockKey(ctx context.Context, key string)
UnlockKey(ctx context.Context, key string)
LockClass(ctx context.Context, manager ILockedClass, projectId string)
ReleaseClass(ctx context.Context, manager ILockedClass, projectId string)
LockObject(ctx context.Context, model ILockedObject)
ReleaseObject(ctx context.Context, model ILockedObject)
LockRawObject(ctx context.Context, resName string, resId string)
ReleaseRawObject(ctx context.Context, resName string, resId string)
LockJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject)
ReleaseJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject)
}
func getClassKey(manager ILockedClass, projectId string) string {
@@ -64,41 +73,33 @@ func Init(man ILockManager) {
}
func LockClass(ctx context.Context, manager ILockedClass, projectId string) {
key := getClassKey(manager, projectId)
_lockman.LockKey(ctx, key)
_lockman.LockClass(ctx, manager, projectId)
}
func ReleaseClass(ctx context.Context, manager ILockedClass, projectId string) {
key := getClassKey(manager, projectId)
_lockman.UnlockKey(ctx, key)
_lockman.ReleaseClass(ctx, manager, projectId)
}
func LockObject(ctx context.Context, model ILockedObject) {
key := getObjectKey(model)
_lockman.LockKey(ctx, key)
_lockman.LockObject(ctx, model)
}
func ReleaseObject(ctx context.Context, model ILockedObject) {
key := getObjectKey(model)
_lockman.UnlockKey(ctx, key)
_lockman.ReleaseObject(ctx, model)
}
func LockRawObject(ctx context.Context, resName string, resId string) {
key := getRawObjectKey(resName, resId)
_lockman.LockKey(ctx, key)
_lockman.LockRawObject(ctx, resName, resId)
}
func ReleaseRawObject(ctx context.Context, resName string, resId string) {
key := getRawObjectKey(resName, resId)
_lockman.UnlockKey(ctx, key)
_lockman.ReleaseRawObject(ctx, resName, resId)
}
func LockJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject) {
key := getJointObjectKey(model, model2)
_lockman.LockKey(ctx, key)
_lockman.LockJointObject(ctx, model, model2)
}
func ReleaseJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject) {
key := getJointObjectKey(model, model2)
_lockman.UnlockKey(ctx, key)
_lockman.ReleaseJointObject(ctx, model, model2)
}

View File

@@ -21,6 +21,7 @@ import (
)
type SNoopLockManager struct {
*SBaseLockManager
}
func (lockman *SNoopLockManager) LockKey(ctx context.Context, key string) {
@@ -33,5 +34,6 @@ func (lockman *SNoopLockManager) UnlockKey(ctx context.Context, key string) {
func NewNoopLockManager() ILockManager {
lockMan := SNoopLockManager{}
lockMan.SBaseLockManager = NewBaseLockManger(&lockMan)
return &lockMan
}

View File

@@ -22,6 +22,7 @@ import (
type IOwnerResourceBaseModel interface {
GetChangeOwnerCandidateDomainIds() []string
GetChangeOwnerRequiredDomainIds() []string
}
type IManagedResourceBase interface {

View File

@@ -497,6 +497,13 @@ func (model *SModelBase) PerformAction(ctx context.Context, userCred mcclient.To
return nil, httperrors.NewActionNotFoundError("Action %s not found", action)
}
func (model *SModelBase) PreCheckPerformAction(
ctx context.Context, userCred mcclient.TokenCredential,
action string, query jsonutils.JSONObject, data jsonutils.JSONObject,
) error {
return nil
}
// update hooks
func (model *SModelBase) AllowUpdateItem(ctx context.Context, userCred mcclient.TokenCredential) bool {
return false

View File

@@ -625,17 +625,11 @@ func (self *SOpsLogManager) FilterByOwner(q *sqlchemy.SQuery, ownerId mcclient.I
}
case rbacutils.ScopeProject:
if len(ownerId.GetProjectId()) > 0 {
q = q.Filter(sqlchemy.OR(
sqlchemy.Equals(q.Field("owner_tenant_id"), ownerId.GetProjectId()),
sqlchemy.Equals(q.Field("tenant_id"), ownerId.GetProjectId()),
))
q = q.Filter(sqlchemy.Equals(q.Field("tenant_id"), ownerId.GetProjectId()))
}
case rbacutils.ScopeDomain:
if len(ownerId.GetProjectDomainId()) > 0 {
q = q.Filter(sqlchemy.OR(
sqlchemy.Equals(q.Field("owner_domain_id"), ownerId.GetProjectDomainId()),
sqlchemy.Equals(q.Field("domain_id"), ownerId.GetProjectDomainId()),
))
q = q.Filter(sqlchemy.Equals(q.Field("domain_id"), ownerId.GetProjectDomainId()))
}
default:
// systemScope, no filter

View File

@@ -20,6 +20,7 @@ import (
"fmt"
"net/http"
"reflect"
"sort"
"strings"
"yunion.io/x/jsonutils"
@@ -481,7 +482,7 @@ func (manager *SQuotaBaseManager) listDomainQuotaHandler(ctx context.Context, w
httperrors.GeneralServerError(w, err)
return
}
manager.sendQuotaList(w, quotaList)
manager.sendQuotaList(w, sortQuotaByUsage(quotaList))
}
func (manager *SQuotaBaseManager) sendQuotaList(w http.ResponseWriter, quotaList []jsonutils.JSONObject) {
@@ -524,7 +525,7 @@ func (manager *SQuotaBaseManager) listProjectQuotaHandler(ctx context.Context, w
httperrors.GeneralServerError(w, err)
return
}
manager.sendQuotaList(w, quotaList)
manager.sendQuotaList(w, sortQuotaByUsage(quotaList))
}
func (manager *SQuotaBaseManager) listQuotas(ctx context.Context, userCred mcclient.TokenCredential, targetDomainId string, targetProjectId string, domainOnly bool, primaryOnly bool, refresh bool) ([]jsonutils.JSONObject, error) {
@@ -616,3 +617,33 @@ func (manager *SQuotaBaseManager) listQuotas(ctx context.Context, userCred mccli
}
return ret, nil
}
type tQuotaResultList []jsonutils.JSONObject
func (a tQuotaResultList) Len() int { return len(a) }
func (a tQuotaResultList) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a tQuotaResultList) Less(i, j int) bool { return usageRateOfQuota(a[i]) > usageRateOfQuota(a[j]) }
func usageRateOfQuota(quota jsonutils.JSONObject) float32 {
maxRate := float32(0)
quotaMap, _ := quota.GetMap()
for k, v := range quotaMap {
usageK := fmt.Sprintf("usage.%s", k)
if usageV, ok := quotaMap[usageK]; ok {
intV, _ := v.Int()
if intV > 0 {
intUsageV, _ := usageV.Int()
rate := float32(intUsageV) / float32(intV)
if maxRate < rate {
maxRate = rate
}
}
}
}
return maxRate
}
func sortQuotaByUsage(quotaList []jsonutils.JSONObject) []jsonutils.JSONObject {
sort.Sort(tQuotaResultList(quotaList))
return quotaList
}

View File

@@ -71,6 +71,7 @@ type IQuotaManager interface {
checkSetPendingQuota(ctx context.Context, userCred mcclient.TokenCredential, quota IQuota) error
cancelPendingUsage(ctx context.Context, userCred mcclient.TokenCredential, localUsage IQuota, cancelUsage IQuota, save bool) error
cancelUsage(ctx context.Context, userCred mcclient.TokenCredential, usage IQuota) error
addUsage(ctx context.Context, userCred mcclient.TokenCredential, usage IQuota) error
getQuotaCount(ctx context.Context, request IQuota, pendingKey IQuotaKeys) (int, error)
FetchIdNames(ctx context.Context, idMap map[string]map[string]string) (map[string]map[string]string, error)

View File

@@ -113,6 +113,17 @@ func (manager *SQuotaBaseManager) _cancelUsage(ctx context.Context, userCred mcc
return manager.changeUsage(ctx, userCred, usage, false)
}
func (manager *SQuotaBaseManager) addUsage(ctx context.Context, userCred mcclient.TokenCredential, usage IQuota) error {
LockQuota(ctx, manager, usage)
defer ReleaseQuota(ctx, manager, usage)
return manager._addUsage(ctx, userCred, usage)
}
func (manager *SQuotaBaseManager) _addUsage(ctx context.Context, userCred mcclient.TokenCredential, usage IQuota) error {
return manager.changeUsage(ctx, userCred, usage, true)
}
func (manager *SQuotaBaseManager) changeUsage(ctx context.Context, userCred mcclient.TokenCredential, usage IQuota, isAdd bool) error {
usages, err := manager.usageStore.GetParentQuotas(ctx, usage.GetKeys())
if err != nil {

View File

@@ -87,6 +87,20 @@ func cancelUsage(ctx context.Context, userCred mcclient.TokenCredential, usage I
}
}
func AddUsages(ctx context.Context, userCred mcclient.TokenCredential, usages []db.IUsage) {
for _, usage := range usages {
addUsage(ctx, userCred, usage.(IQuota))
}
}
func addUsage(ctx context.Context, userCred mcclient.TokenCredential, usage IQuota) {
manager := getQuotaManager(usage)
err := manager.addUsage(ctx, userCred, usage)
if err != nil {
log.Errorf("cancelUsage %s fail: %s", jsonutils.Marshal(usage), err)
}
}
func GetQuotaCount(ctx context.Context, request IQuota, pendingKeys IQuotaKeys) (int, error) {
manager := getQuotaManager(request)
return manager.getQuotaCount(ctx, request, pendingKeys)

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