Compare commits

...

648 Commits

Author SHA1 Message Date
Zexi Li
5466a88ac3 Merge pull request #9115 from yousong/automated-cherry-pick-of-#9109-upstream-release-3.1
Automated cherry pick of #9109: fix(host): make sure it won't match vpc guests by accident
2020-12-01 20:22:08 +08:00
Yousong Zhou
3a23f64836 fix(host): make sure it won't match vpc guests by accident 2020-12-01 15:34:34 +08:00
yunion-ci-robot
cc48edc32d Merge pull request #8530 from rainzm/automated-cherry-pick-of-#8525-upstream-release-3.1
Automated cherry pick of #8525: fix(esxi): no callback in uploadHandler
2020-10-28 00:57:41 +08:00
rainzm
a77dfee4d3 fix(esxi): filter vmdk item in lease.info 2020-10-27 21:35:55 +08:00
rainzm
e70c1244e3 fix(esxi): use correct device index
1. Sort devices via their Key.
2. There is no relationship between vdisk index and vnics length.
2020-10-27 21:35:55 +08:00
rainzm
bc8ee81afd fix(esxi): no callback in uploadHandler 2020-10-27 21:35:55 +08:00
yunion-ci-robot
be3d7a4fbb Merge pull request #8318 from rainzm/automated-cherry-pick-of-#8314-upstream-release-3.1
Automated cherry pick of #8314: feat(esxi): do not specify portkey in NewVNIC
2020-10-16 10:40:34 +08:00
rainzm
3f8c5fd12c feat(esxi): do not specify portkey in NewVNIC 2020-10-16 08:25:36 +08:00
Zexi Li
d06343b6cf Merge pull request #8262 from rainzm/automated-cherry-pick-of-#8232-upstream-release-3.1
Automated cherry pick of #8232: fix(esxi): search template from whole vCenter
2020-10-13 10:08:24 +08:00
rainzm
19335a1fbf fix(esxi): use system disk of template only when cloning vm
1. Create a driver if necessary.
2. After cloning the virtual machine, remove all data disks.
3. Create new data disks.
2020-10-12 17:51:33 +08:00
rainzm
999f6e2dba fix(esxi): search template from whole vCenter 2020-10-12 17:51:33 +08:00
yunion-ci-robot
6f94124e81 Merge pull request #8198 from rainzm/automated-cherry-pick-of-#8194-upstream-release-3.1
Automated cherry pick of #8194: fix(esxi): check nil value when NewVirtualMachine
2020-10-10 19:05:16 +08:00
yunion-ci-robot
fa457b0461 Merge pull request #8222 from yousong/automated-cherry-pick-of-#8218-upstream-release-3.1
Automated cherry pick of #8218: webconsole: ssh: each argument on its own line
2020-10-10 15:34:49 +08:00
Yousong Zhou
38778aae06 webconsole: ssh: add keyboard-interactive as an option
For ESXi 6.0

  Authentications that can continue: publickey,keyboard-interactive
2020-10-10 14:48:17 +08:00
Yousong Zhou
38cd512516 webconsole: ssh: each argument on its own line 2020-10-10 14:47:41 +08:00
yunion-ci-robot
23cc211deb Merge pull request #8187 from yousong/automated-cherry-pick-of-#8183-upstream-release-3.1
Automated cherry pick of #8183: vpcagent: ovn: increase dhcp lease, renew, rebind time
2020-10-10 11:56:13 +08:00
rainzm
48d764dd36 fix(esxi): check nil value when NewVirtualMachine 2020-10-10 11:39:06 +08:00
Yousong Zhou
d708af7781 vpcagent: ovn: increase dhcp lease, renew, rebind time 2020-10-09 10:29:12 +08:00
Zexi Li
4e806ed185 Merge pull request #7965 from zexi/automated-cherry-pick-of-#7961-upstream-release-3.1
Automated cherry pick of #7961: region: fix network schedtag not cleanup when network deleted
2020-09-18 12:45:13 +08:00
Zexi Li
0ac14febc8 region: fix network schedtag not cleanup when network deleted 2020-09-18 10:40:32 +08:00
Zexi Li
a1b2a4ddcd Merge pull request #7874 from rainzm/automated-cherry-pick-of-#7870-upstream-release-3.1
Automated cherry pick of #7870: fix(esxiagent): add HostDelayTaskWorkerCount
2020-09-11 20:56:12 +08:00
Zexi Li
f405cb921b Merge pull request #7866 from wanyaoqi/automated-cherry-pick-of-#7836-upstream-release-3.1
Automated cherry pick of #7836: host: fix rbd storage cache iso image
2020-09-11 20:54:01 +08:00
rainzm
112026b778 fix(esxiagent): add HostDelayTaskWorkerCount
之前,HostDelayWorker 是通过 hostutils.InitWorkerManager 来初始化,
worker的数量依赖于options.HostOptions.DefaultRequestWorkerCount, 因为
这个options没有经过初始化,所以就是0,导致worker count的数量变为1。

现在增加了 HostDelayTaskWorkerCount 来管理这个count,默认值为8。
2020-09-11 17:23:46 +08:00
wanyaoqi
b230711ded host: fix rbd storage cache iso image 2020-09-10 23:21:36 +08:00
yunion-ci-robot
716d4d2172 Merge pull request #7849 from rainzm/automated-cherry-pick-of-#7845-upstream-release-3.1
Automated cherry pick of #7845: Feat & Fix & Refactor for ESXi
2020-09-10 09:41:57 +08:00
rainzm
182777e677 fix(region): add RequestSyncstatusOnHost for SESXiGuestDriver
esxi 平台 Guest 进行 syncstatus 和其他平台有所区别,Vcenter 可能会更改
 VM 所在的 Host,所以在 Host 上寻找 VM 可能会出现 ErrNotFound。此时,应该
主动去整个 datacenter 中寻找 VM,然后更改 Host,进行同步。
2020-09-09 22:01:35 +08:00
rainzm
2fdb1430a4 fix(esxi): fetch templatevm from datacenter before clone vm
这里应该和image_cache那里保持一直,对template的获取应该从datacenter
中获取,而不是host。
2020-09-09 22:00:02 +08:00
rainzm
bb1f439a04 refactor(esxi): replace GetTemplateVMById with FetchTemplateVMById
FetchTemplateVMById 更好,因为它更轻量,更快。
2020-09-09 22:00:02 +08:00
rainzm
595be9b0ed feat(esxicli): better vm operator
现在,可以通过Datacenter来获取vm,不一定要指定HostIp,
Datacenter和HostIp必须指定一个。
2020-09-09 22:00:02 +08:00
rainzm
1f9b473521 feat(esxi): support fetchVM form datacenter 2020-09-09 22:00:02 +08:00
rainzm
6f47aa8ad3 refactor(esxi): fetchVms and fetchHardwareInfo
1. fetchHardwareInfo 只有一种error,原因是moVM的某些字段为nil,这种情况下,完全可以打印日志直接返回。
2. fetchVms 现在只返回[]*SVirtualMachine, 进一步的过滤(是不是template)交给调用者。
2020-09-09 22:00:02 +08:00
yunion-ci-robot
c2c981c40f Merge pull request #7826 from rainzm/automated-cherry-pick-of-#7821-upstream-release-3.1
Automated cherry pick of #7821: fix(esxiagent): return image extid not id
2020-09-08 20:23:54 +08:00
rainzm
3eefd80d84 fix(esxiagent): return image extid not id
调用 disk/image_cache 接口的Task StorageCacheImageTask 会根据回调
回来数据中的 image_id,来设置 storagecachedimage 中的 externalid,
所以这里的 image_id 应该是 externalid。
2020-09-08 15:35:00 +08:00
wanyaoqi
97d438e4a4 fix get storage capacity on init' (#7690) 2020-09-01 01:01:36 +08:00
Zexi Li
3aec0a110e Merge pull request #7626 from wanyaoqi/automated-cherry-pick-of-#7623-upstream-release-3.1
Automated cherry pick of #7623: fix gpfs check mountpoint
2020-08-25 17:41:28 +08:00
wanyaoqi
ab5245bd29 fix gpfs check mountpoint 2020-08-25 15:53:25 +08:00
Zexi Li
3eb4a31c46 Merge pull request #7578 from rainzm/automated-cherry-pick-of-#7575-upstream-release-3.1
Automated cherry pick of #7575: fix: GetIImages correctly without 'image_cache' dir
2020-08-16 23:42:03 +08:00
rainzm
e5a5439ac9 fix: GetIImages correctly without 'image_cache' dir
After creating vms, there is no dir named 'image_cache' exists in
storage of esxi. So handle this case to not affecte the synchronization of the
VMware Template.
2020-08-14 20:37:30 +08:00
Zexi Li
41e2a194e4 Merge pull request #7538 from wanyaoqi/automated-cherry-pick-of-#7530-upstream-release-3.1
Automated cherry pick of #7530: fix mount xfs
2020-08-11 11:16:53 +08:00
wanyaoqi
64c801dbca fix mount xfs 2020-08-10 20:06:19 +08:00
Zexi Li
34fa66230b Merge pull request #7450 from tb365/automated-cherry-pick-of-#7447-upstream-release-3.1
Automated cherry pick of #7447: aws elb listener&rule name too long fix
2020-08-02 10:08:50 +08:00
wanyaoqi
1fd2b2eebc fix cache non lvm disks (#7462) 2020-08-01 21:13:02 +08:00
tangbin
72e99816a2 aws elb listener&rule name too long fix 2020-08-01 11:13:20 +08:00
Zexi Li
1cf5771607 Merge pull request #7424 from rainzm/automated-cherry-pick-of-#7416-upstream-release-3.1
Automated cherry pick of #7416: fix(region): Don't allow address conflicts under vpc
2020-08-01 11:06:03 +08:00
rainzm
91efa6f48d 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:53:09 +08:00
Zexi Li
400a87221d Merge pull request #7444 from wanyaoqi/automated-cherry-pick-of-#7441-upstream-release-3.1
Automated cherry pick of #7441: fix deploy admin auth key
2020-08-01 00:07:09 +08:00
wanyaoqi
7e6fb93a3e fix deploy admin auth key 2020-07-31 23:27:05 +08:00
Zexi Li
f91526f96f baremetal: fix hpssactl split last LV size out of limit (#7429) 2020-07-31 22:38:00 +08:00
Zexi Li
e5cabfb3a8 Merge pull request #7422 from ioito/automated-cherry-pick-of-#7417-upstream-release-3.1
Automated cherry pick of #7417: fix: avoid lost backend params
2020-07-31 18:08:07 +08:00
Zexi Li
68a31e0d14 Merge pull request #7410 from ioito/automated-cherry-pick-of-#7405-upstream-release-3.1
Automated cherry pick of #7405: fix: avoid account sync deadlock
2020-07-31 18:05:34 +08:00
Qu Xuan
be45e166cb fix: avoid lost backend params 2020-07-31 17:20:23 +08:00
Qu Xuan
0bc58b8fe3 fix: avoid account sync deadlock 2020-07-31 16:41:00 +08:00
Zexi Li
7d92493e3a Merge pull request #7362 from ioito/automated-cherry-pick-of-#7359-upstream-release-3.1
Automated cherry pick of #7359: fix: 修复vm绑定重复安全组
2020-07-28 20:56:11 +08:00
Qu Xuan
4663ecddf4 fix: 修复vm绑定重复安全组 2020-07-28 18:16:47 +08:00
Zexi Li
0bd0782268 Merge pull request #7341 from rainzm/automated-cherry-pick-of-#7338-upstream-release-3.1
Automated cherry pick of #7338: fix(region): Remove default secgroup for esxi guest
2020-07-27 19:49:28 +08:00
rainzm
c5b719b21f 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:54:47 +08:00
yunion-ci-robot
7b470196ef Merge pull request #7306 from wanyaoqi/automated-cherry-pick-of-#7302-upstream-release-3.1
Automated cherry pick of #7302: fix clone clean pending usage
2020-07-24 22:51:41 +08:00
wanyaoqi
f1113a9c23 fix clone clean pending usage 2020-07-23 18:39:22 +08:00
Zexi Li
b56e49de6d Merge pull request #7297 from wanyaoqi/automated-cherry-pick-of-#7294-upstream-release-3.1
Automated cherry pick of #7294: fix snapshot clean pending usage
2020-07-23 13:48:18 +08:00
wanyaoqi
3f270e8bd3 fix snapshot clean pending usage 2020-07-23 11:40:58 +08:00
Zexi Li
de893473d6 Merge pull request #7289 from tb365/automated-cherry-pick-of-#7286-upstream-release-3.1
Automated cherry pick of #7286: apigateway host imports data validate
2020-07-22 21:44:22 +08:00
tangbin
6809f62d95 format fix 2020-07-22 18:05:07 +08:00
tangbin
c345991bd4 fix empty else 2020-07-22 18:05:07 +08:00
tangbin
e5f95e0986 fix host import 2020-07-22 18:05:07 +08:00
tangbin
e8bd33751c fix huawei delete resource 2020-07-22 18:05:07 +08:00
tangbin
727801bff5 fix huawei elb disable healthcheck 2020-07-22 18:05:07 +08:00
tangbin
3e56e4acb8 lb sync project fix 2020-07-22 18:05:06 +08:00
tangbin
f79abe479a add more log 2020-07-22 17:51:27 +08:00
tangbin
ec8e58554a apigateway host imports data validate 2020-07-22 17:51:27 +08:00
Zexi Li
5a731d8176 Merge pull request #7284 from rainzm/automated-cherry-pick-of-#7281-upstream-release-3.1
Automated cherry pick of #7281: fix(esxi): Select correct unitNumber for ide control when creating disk
2020-07-22 13:52:33 +08:00
Rain Zheng
4515843a2c fix(esxi): Select correct unitNumber for ide control when creating disk 2020-07-21 20:49:48 +08:00
Zexi Li
8c1b1f80b6 Merge pull request #7261 from tb365/automated-cherry-pick-of-#7237-upstream-release-3.1
Automated cherry pick of #7237: huawei eip delete fix
2020-07-20 20:47:30 +08:00
tangbin
4b95ec7f0d huawei eip delete fix 2020-07-20 10:51:16 +08:00
Zexi Li
8ddf04e3dd Merge pull request #7219 from rainzm/automated-cherry-pick-of-#7216-upstream-release-3.1
Automated cherry pick of #7216: fix: prefetch image error when create guest with vmware template
2020-07-17 10:16:48 +08:00
rainzm
3b268ad6fb 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:47:40 +08:00
yunion-ci-robot
21e7ea198c Merge pull request #7207 from zexi/automated-cherry-pick-of-#7201-upstream-release-3.1
Automated cherry pick of #7201: webconsole: fix old session make new session closed
2020-07-16 20:21:20 +08:00
Zexi Li
c09676aa9f webconsole: fix old session make new session closed 2020-07-16 18:51:09 +08:00
Zexi Li
ee69f560ae Merge pull request #7180 from ioito/automated-cherry-pick-of-#7177-upstream-release-3.1
Automated cherry pick of #7177: fix: 避免华为云安全组规则删除失败
2020-07-16 10:16:41 +08:00
Qu Xuan
92e75e87c9 fix: 避免华为云安全组规则删除失败 2020-07-15 17:14:45 +08:00
Zexi Li
4b2869cf4e Merge pull request #7161 from yousong/automated-cherry-pick-of-#7158-upstream-release-3.1
Automated cherry pick of #7158: iproute2: address: make Exact idempotent
2020-07-15 10:34:45 +08:00
Yousong Zhou
249abee22d 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:42:49 +08:00
Zexi Li
27e99f8b51 Merge pull request #7150 from rainzm/automated-cherry-pick-of-#7147-upstream-release-3.1
Automated cherry pick of #7147: fix: mo.VirtualMachine's Config maybe nil
2020-07-14 11:34:52 +08:00
rainzm
5d1d963990 fix: mo.VirtualMachine's Config maybe nil 2020-07-13 23:30:04 +08:00
Zexi Li
9c27a7cafd Merge pull request #7128 from wanyaoqi/bugfix/wyq/cherry-pick-7125
Manual cherry pick of #7125: fix rbd set storage info
2020-07-10 20:16:07 +08:00
wanyaoqi
433aa54055 fix rbd set storage info 2020-07-10 14:56:15 +08:00
Zexi Li
cf8377ea72 Merge pull request #7109 from wanyaoqi/automated-cherry-pick-of-#7106-upstream-release-3.1
Automated cherry pick of #7106: fix set storage info bind mount
2020-07-09 21:19:44 +08:00
wanyaoqi
0a71acd86b fix set storage info bind mount 2020-07-09 14:56:37 +08:00
Zexi Li
780418219c Merge pull request #7064 from rainzm/automated-cherry-pick-of-#7061-upstream-release-3.1
Automated cherry pick of #7061: Update docker image onecloud-base and its references
2020-07-07 11:12:56 +08:00
rainzm
e5487fab4f Update docker image onecloud-base and its references 2020-07-06 21:06:20 +08:00
Zexi Li
546ec09848 Merge pull request #7039 from swordqiu/automated-cherry-pick-of-#7036-upstream-release-3.1
Automated cherry pick of #7036: fix: cloud account sync may block
2020-07-04 12:09:33 +08:00
Qiu Jian
1e49aa17b7 fix: cloud account sync may block 2020-07-04 10:25:41 +08:00
Zexi Li
bf3b06cd8c Merge pull request #7014 from wanyaoqi/automated-cherry-pick-of-#7006-upstream-release-3.1
Automated cherry pick of #7006: bind mount nfs storage path
2020-07-02 17:35:48 +08:00
wanyaoqi
289a6bcf4b bind mount nfs storage path 2020-07-02 17:34:59 +08:00
Zexi Li
46b80f79a3 Merge pull request #6993 from rainzm/automated-cherry-pick-of-#6990-upstream-release-3.1
Automated cherry pick of #6990: fix the bug introduced in #6643
2020-07-01 19:26:36 +08:00
rainzm
0438db6938 fix the bug introduced in #6643 2020-07-01 16:55:58 +08:00
Zexi Li
4d9b6e1599 Merge pull request #6978 from wanyaoqi/automated-cherry-pick-of-#6975-upstream-release-3.1
Automated cherry pick of #6975: fix deploy backup server order
2020-06-30 23:09:17 +08:00
wanyaoqi
2f4401a407 fix deploy backup server order 2020-06-30 22:04:30 +08:00
Zexi Li
e9855290e8 Merge pull request #6939 from swordqiu/automated-cherry-pick-of-#6936-upstream-release-3.1
Automated cherry pick of #6936: fix: sort quota list result by usage rate
2020-06-23 23:28:09 +08:00
Qiu Jian
228d45b7a1 fix: sort quota list result by usage rate 2020-06-23 22:24:42 +08:00
Zexi Li
f977e44885 Merge pull request #6924 from swordqiu/automated-cherry-pick-of-#6921-upstream-release-3.1
Automated cherry pick of #6921: fix: simplify forbidden user login message
2020-06-23 21:26:06 +08:00
Qiu Jian
ecfe897c2e fix: simplify forbidden user login message 2020-06-23 17:48:21 +08:00
yunion-ci-robot
7370f1ecf1 Merge pull request #6909 from wanyaoqi/automated-cherry-pick-of-#6906-upstream-release-3.1
Automated cherry pick of #6906: disable dhclient
2020-06-23 10:31:59 +08:00
wanyaoqi
bd0d22e7e4 disable dhclient 2020-06-22 21:31:33 +08:00
Zexi Li
997141525d Merge pull request #6896 from yousong/automated-cherry-pick-of-#6893-upstream-release-3.1
Automated cherry pick of #6893: cloudcommon: app: cosmetic change
2020-06-22 09:15:46 +08:00
Yousong Zhou
477d5845d5 cloudcommon: policy: fix interval and oneshot sync
Reduce CPU utilization caused by queued time.AfterFunc calls
2020-06-21 18:34:21 +08:00
Yousong Zhou
fb886c6f25 cloudcommon: app: cosmetic change 2020-06-21 18:34:21 +08:00
yunion-ci-robot
44a9f29c94 Merge pull request #6887 from swordqiu/automated-cherry-pick-of-#6885-upstream-release-3.1
Automated cherry pick of #6885: fix: wrong cloud provider status when sync disconnected cloud account
2020-06-19 09:49:08 +08:00
Qiu Jian
20473f6544 fix: wrong cloud provider status when sync disconnected cloud account 2020-06-19 01:22:58 +08:00
yunion-ci-robot
af19d59bc8 Merge pull request #6866 from yousong/automated-cherry-pick-of-#6859-upstream-release-3.1
Automated cherry pick of #6859: cloudaccounts: one sync task in queue per cloudaccount
2020-06-18 23:19:04 +08:00
Zexi Li
11a66c13c3 Merge pull request #6873 from ioito/automated-cherry-pick-of-#6871-upstream-release-3.1
Automated cherry pick of #6871: fix: 避免同步删除失败
2020-06-18 19:05:46 +08:00
Qu Xuan
ea4535cbbb fix: 避免同步删除失败 2020-06-18 17:21:39 +08:00
Yousong Zhou
2ab2c5b0dd cloudaccounts: one sync task in queue per cloudaccount 2020-06-18 17:12:33 +08:00
yunion-ci-robot
b1bd51d040 Merge pull request #6876 from tb365/automated-cherry-pick-of-#6875-upstream-release-3.1
Automated cherry pick of #6875: replace err with errors.cause
2020-06-18 15:16:03 +08:00
tangbin
e4c1d4181b replace err with errors.cause 2020-06-18 14:29:49 +08:00
Zexi Li
356fa8d02d Merge pull request #6863 from tb365/automated-cherry-pick-of-#6861-upstream-release-3.1
Automated cherry pick of #6861: shuzhou to suzhou
2020-06-17 18:50:55 +08:00
Zexi Li
dd32b0aacc Merge pull request #6842 from zexi/automated-cherry-pick-of-#6839-upstream-release-3.1
Automated cherry pick of #6839: scheduler: fix memory over committed
2020-06-17 18:49:40 +08:00
tangbin
4c00f92502 shuzhou to suzhou 2020-06-17 15:55:36 +08:00
Zexi Li
d4a714af2c Merge pull request #6856 from yousong/automated-cherry-pick-of-#6837-upstream-release-3.1
Automated cherry pick of #6837: appsrv: ring: release ring content on pop
2020-06-17 11:24:40 +08:00
Yousong Zhou
da702c8284 appsrv: rework TestRing 2020-06-17 10:53:42 +08:00
Yousong Zhou
649eac69ef appsrv: ring: release ring content on pop 2020-06-17 10:53:42 +08:00
Zexi Li
0cf01d2f0a Merge pull request #6851 from swordqiu/automated-cherry-pick-of-#6849-upstream-release-3.1
Automated cherry pick of #6849: fix: disable policy rule compaction
2020-06-17 10:29:07 +08:00
Qiu Jian
120ed1f695 fix: policy allow if one of the matching rules is allow 2020-06-16 23:11:35 +08:00
Qiu Jian
4acc7a580f fix: disable policy rule compaction 2020-06-16 23:11:34 +08:00
Zexi Li
facbe5433a Merge pull request #6846 from wanyaoqi/automated-cherry-pick-of-#6844-upstream-release-3.1
Automated cherry pick of #6844: fix cpu usage metrics
2020-06-16 21:00:51 +08:00
wanyaoqi
96088d3465 fix cpu usage metrics 2020-06-16 20:44:40 +08:00
Zexi Li
4b98425f0c Merge pull request #6826 from wanyaoqi/automated-cherry-pick-of-#6824-upstream-release-3.1
Automated cherry pick of #6824: fix windows install regedit record
2020-06-16 20:12:53 +08:00
Zexi Li
4ac3f8e4fa scheduler: fix memory over committed 2020-06-16 19:17:35 +08:00
wanyaoqi
d48b88ec83 fix windows install regedit record 2020-06-15 10:58:41 +08:00
Zexi Li
c0659c1453 Merge pull request #6819 from yousong/automated-cherry-pick-of-#6817-upstream-release-3.1
Automated cherry pick of #6817: guestnetworks: use math/rand instead of crypto/rand
2020-06-12 10:09:26 +08:00
Yousong Zhou
99598a4804 guestnetworks: reduce odds of collision seeded by epoch seconds 2020-06-11 21:22:52 +08:00
Yousong Zhou
651f2c3f9c guestnetworks: use math/rand instead of crypto/rand 2020-06-11 21:22:52 +08:00
Zexi Li
fa12b95e21 Merge pull request #6813 from ioito/automated-cherry-pick-of-#6810-upstream-release-3.1
Automated cherry pick of #6810: fix: 避免openstack磁盘和存储窜位
2020-06-11 17:52:22 +08:00
Zexi Li
93a659c81c Merge pull request #6805 from zexi/automated-cherry-pick-of-#6803-upstream-release-3.1
Automated cherry pick of #6803: webconsole: fix version and others handler not handle
2020-06-11 17:50:10 +08:00
Qu Xuan
9def31ddfe fix: 避免openstack磁盘和存储窜位 2020-06-11 14:14:19 +08:00
Zexi Li
f98104ad20 Merge pull request #6799 from wanyaoqi/automated-cherry-pick-of-#6797-upstream-release-3.1
Automated cherry pick of #6797: fix host list servers filter
2020-06-10 17:05:59 +08:00
Zexi Li
6b0be1317e webconsole: fix version and others handler not handle 2020-06-10 17:02:24 +08:00
wanyaoqi
5a9e9f66e4 fix host list servers filter 2020-06-10 14:08:26 +08:00
Zexi Li
b5d4885007 Merge pull request #6732 from ioito/automated-cherry-pick-of-#6663-upstream-release-3.1
Automated cherry pick of #6663: fix: 优化安全组同步逻辑
2020-06-10 11:28:55 +08:00
Zexi Li
58ba106c61 Merge pull request #6788 from rainzm/automated-cherry-pick-of-#6786-upstream-release-3.1
Automated cherry pick of #6786: fix: Hanle the error of vdisk.GetIStorage in syncCloudDisk
2020-06-10 11:28:06 +08:00
Zexi Li
fb406e91c4 Merge pull request #6781 from ioito/automated-cherry-pick-of-#6779-upstream-release-3.1
Automated cherry pick of #6779: fix: 更正华为云操作成功判断
2020-06-10 10:46:07 +08:00
Zexi Li
462ff5c2d8 Merge pull request #6784 from rainzm/automated-cherry-pick-of-#6782-upstream-release-3.1
Automated cherry pick of #6782: fix: Add '/version' handler for notify
2020-06-10 10:18:56 +08:00
Zexi Li
a1fbc8455b Merge pull request #6793 from swordqiu/automated-cherry-pick-of-#6791-upstream-release-3.1
Automated cherry pick of #6791: fix: policy-explain not working properly
2020-06-10 09:53:04 +08:00
Qiu Jian
50e28166ef fix: policy-explain not working properly 2020-06-09 22:29:44 +08:00
rainzm
92381b0213 fix: Hanle the error of vdisk.GetIStorage in syncCloudDisk 2020-06-09 19:50:30 +08:00
rainzm
65b1fbae34 fix: Add '/version' handler for notify 2020-06-09 18:55:34 +08:00
Qu Xuan
918265ea49 fix: 更正华为云操作成功判断 2020-06-09 18:21:25 +08:00
yunion-ci-robot
5591bbec4e Merge pull request #6771 from zexi/automated-cherry-pick-of-#6769-upstream-release-3.1
Automated cherry pick of #6769: region: retry set influxdb policy until completed
2020-06-08 21:11:09 +08:00
Zexi Li
8f0ac8e19b region: retry set influxdb policy until completed 2020-06-08 19:08:50 +08:00
Qu Xuan
307fb3a116 fix: 优化安全组同步逻辑 2020-06-08 14:12:57 +08:00
yunion-ci-robot
3bd3dda026 Merge pull request #6694 from ioito/automated-cherry-pick-of-#6692-upstream-release-3.1
Automated cherry pick of #6692: fix: 返回object默认acl
2020-06-06 10:59:46 +08:00
Qu Xuan
a396868d6a fix: 返回object默认acl 2020-06-05 11:00:56 +08:00
Zexi Li
794b2896f4 Merge pull request #6742 from swordqiu/automated-cherry-pick-of-#6740-upstream-release-3.1
Automated cherry pick of #6740: fix: xsky recode using endpoint as accesskey key
2020-06-04 21:41:06 +08:00
Zexi Li
2443cc9a3c Merge pull request #6738 from tb365/automated-cherry-pick-of-#6737-upstream-release-3.1
Automated cherry pick of #6737: ctyun sync host wire fix
2020-06-04 21:39:51 +08:00
Zexi Li
56ebaea85e Merge pull request #6746 from wanyaoqi/automated-cherry-pick-of-#6744-upstream-release-3.1
Automated cherry pick of #6744: bind mount local image path to container path
2020-06-04 21:24:19 +08:00
Zexi Li
37cefd0d64 Merge pull request #6749 from wanyaoqi/automated-cherry-pick-of-#6173-upstream-release-3.1
Automated cherry pick of #6173: support custom service url
2020-06-04 21:20:05 +08:00
wanyaoqi
8a2c03d683 support custom service url 2020-06-04 20:28:20 +08:00
wanyaoqi
ed136fb2f0 bind mount local image path to container path 2020-06-04 20:22:45 +08:00
Qiu Jian
3b3cbb94d6 fix: xsky recode using endpoint as accesskey key 2020-06-04 19:23:27 +08:00
tangbin
79614b5939 ctyun sync host wire fix 2020-06-04 18:53:00 +08:00
Zexi Li
6fce123623 Merge pull request #6724 from ioito/automated-cherry-pick-of-#6722-upstream-release-3.1
Automated cherry pick of #6722: fix: 添加region翻译
2020-06-04 10:28:27 +08:00
Qu Xuan
d9ddbb5bcf fix: 添加region翻译 2020-06-03 20:41:35 +08:00
Zexi Li
e871084a85 Merge pull request #6718 from tb365/automated-cherry-pick-of-#6696-upstream-release-3.1
Automated cherry pick of #6696: add-enterprise-info-update-climc
2020-06-03 17:26:18 +08:00
Zexi Li
170b08329d Merge pull request #6715 from wanyaoqi/automated-cherry-pick-of-#6713-upstream-release-3.1
Automated cherry pick of #6713: isolated device manager:
2020-06-03 17:25:28 +08:00
tangbin
a433306ba4 add-enterprise-info-update-climc 2020-06-03 16:26:14 +08:00
wanyaoqi
0737e5ed39 isolated device manager:
- fix find boot_vga got No such file or dirtory
2020-06-03 15:53:09 +08:00
yunion-ci-robot
b9c8dc01fb Merge pull request #6688 from ioito/automated-cherry-pick-of-#6686-upstream-release-3.1
Automated cherry pick of #6686: fix: 避免锁超时
2020-06-02 13:59:42 +08:00
Qu Xuan
748d547b88 fix: 避免锁超时 2020-06-02 11:15:15 +08:00
Zexi Li
59d979043e Merge pull request #6677 from ioito/automated-cherry-pick-of-#6675-upstream-release-3.1
Automated cherry pick of #6675: fix: add us-west4 for google region
2020-06-02 10:00:20 +08:00
Zexi Li
9f9e5eed10 Merge pull request #6672 from wanyaoqi/automated-cherry-pick-of-#6670-upstream-release-3.1
Automated cherry pick of #6670: get snapshots order by created at asc
2020-06-02 09:58:38 +08:00
Qu Xuan
e9638cc461 fix: add us-west4 for google region 2020-06-01 18:28:22 +08:00
wanyaoqi
8f15091db1 get snapshots order by created at asc 2020-06-01 15:10:25 +08:00
Zexi Li
3ee4ae370a Merge pull request #6660 from ioito/automated-cherry-pick-of-#6658-upstream-release-3.1
Automated cherry pick of #6658: fix: byte size fix
2020-05-29 19:14:42 +08:00
Qu Xuan
99eb111954 fix: byte size fix 2020-05-29 17:00:25 +08:00
Zexi Li
d968caaa47 Merge pull request #6655 from swordqiu/automated-cherry-pick-of-#6636-upstream-release-3.1
Automated cherry pick of #6636: fix: ignore match weights when searching matched policysets
2020-05-29 14:20:34 +08:00
Zexi Li
a5530fee10 Merge pull request #6652 from wanyaoqi/automated-cherry-pick-of-#6650-upstream-release-3.1
Automated cherry pick of #6650: fix migrate with multi local storage
2020-05-29 14:19:01 +08:00
Qiu Jian
87b4a151df fix: ignore match weights when searching matched policysets 2020-05-29 12:50:15 +08:00
wanyaoqi
1d463ed8c8 fix migrate with multi local storage 2020-05-29 11:54:19 +08:00
yunion-ci-robot
63638b15d1 Merge pull request #6645 from rainzm/automated-cherry-pick-of-#6643-upstream-release-3.1
Automated cherry pick of #6643: feat(notify): Support 'socpe:domain' when list contacts
2020-05-28 19:04:59 +08:00
yunion-ci-robot
5c4bf3e03c Merge pull request #6557 from zhaoxiangchun/automated-cherry-pick-of-#6544-upstream-release-3.1
Automated cherry pick of #6544: 类型是onecloud的notifier增加webconsole的alert
2020-05-28 19:02:00 +08:00
Zexi Li
b239ca7b15 Merge pull request #6639 from ioito/automated-cherry-pick-of-#6637-upstream-release-3.1
Automated cherry pick of #6637: fix: 避免因磁盘数量导致创建机器失败
2020-05-28 17:14:00 +08:00
rainzm
87ca98b362 feat(notify): Support 'socpe:domain' when list contacts
This is a temporary solution.
2020-05-28 15:28:55 +08:00
Qu Xuan
04eaf773fe fix: 避免因磁盘数量导致创建机器失败 2020-05-28 12:08:57 +08:00
Zexi Li
4aa2299b47 Merge pull request #6622 from ioito/automated-cherry-pick-of-#6619-upstream-release-3.1
Automated cherry pick of #6619: fix: 避免azure卸载磁盘失败
2020-05-27 17:52:14 +08:00
Qu Xuan
9c8337ae8f fix: 避免azure卸载磁盘失败 2020-05-27 15:56:40 +08:00
Zexi Li
a8e9c3f510 Merge pull request #6615 from yousong/bugfix/yousong-vpc-key-3.1
apis: WireDetails: fix wrong key for vpc name
2020-05-27 10:30:09 +08:00
Yousong Zhou
290a32b9de apis: WireDetails: fix wrong key for vpc name 2020-05-27 10:02:24 +08:00
Zexi Li
94fe13ddc5 Merge pull request #6600 from wanyaoqi/automated-cherry-pick-of-#6598-upstream-release-3.1
Automated cherry pick of #6598: fix remotefile fetch image propertites
2020-05-26 17:25:02 +08:00
Zexi Li
ad071de5a0 Merge pull request #6596 from ioito/automated-cherry-pick-of-#6594-upstream-release-3.1
Automated cherry pick of #6594: fix: bucket信息修正
2020-05-26 17:14:02 +08:00
wanyaoqi
b570dc9d82 fix remotefile fetch image propertites 2020-05-26 15:54:43 +08:00
Qu Xuan
aa9de0f84d fix: bucket信息修正 2020-05-26 15:10:25 +08:00
Zexi Li
9285208d1c Merge pull request #6584 from zexi/hotfix/k8s-repo-privilege-bk
fix k8s repo wrong privilege
2020-05-25 18:27:18 +08:00
Zexi Li
4112e7052d fix k8s repo wrong privilege 2020-05-25 16:58:06 +08:00
Zexi Li
f33aa39eed Merge pull request #6576 from zhaoxiangchun/automated-cherry-pick-of-#6573-upstream-release-3.1
Automated cherry pick of #6573: zstack宿主机监控中增加参数信息进行Unmarshal
2020-05-25 12:18:09 +08:00
zhaoxiangchun
cd2499c3b0 zstack宿主机监控中增加参数信息进行Unmarshal 2020-05-24 17:19:26 +08:00
Zexi Li
e2fa8d48e6 Merge pull request #6569 from swordqiu/automated-cherry-pick-of-#6567-upstream-release-3.1
Automated cherry pick of #6567: fix: default policy not effective
2020-05-22 22:48:31 +08:00
Zexi Li
a1750c6dd0 Merge pull request #6560 from ioito/automated-cherry-pick-of-#6558-upstream-release-3.1
Automated cherry pick of #6558: fix: 避免openstack以镜像做系统盘创建失败
2020-05-22 22:45:27 +08:00
Qiu Jian
5a93924ff2 fix: default policy not effective 2020-05-22 22:38:19 +08:00
Qu Xuan
0c32be0707 fix: 避免openstack以镜像做系统盘创建失败 2020-05-22 20:17:54 +08:00
zhaoxiangchun
62fe7d977d 类型是onecloud的notifier增加webconsole的alert 2020-05-22 20:04:49 +08:00
Zexi Li
fb4206d904 Merge pull request #6553 from swordqiu/automated-cherry-pick-of-#6551-upstream-release-3.1
Automated cherry pick of #6551: fix: empty matched policies list for roles
2020-05-22 19:32:24 +08:00
Qiu Jian
3afbb86fad fix: empty matched policies list for roles 2020-05-22 18:53:43 +08:00
Zexi Li
aeaa6939c7 Merge pull request #6542 from ioito/automated-cherry-pick-of-#6540-upstream-release-3.1
Automated cherry pick of #6540: fix: 避免因io问题导致同步镜像列表为空
2020-05-22 14:43:49 +08:00
Qu Xuan
950e7696bc fix: 避免因io问题导致同步镜像列表为空 2020-05-22 13:47:47 +08:00
Zexi Li
8bf5eb3321 Merge pull request #6538 from ioito/automated-cherry-pick-of-#6530-upstream-release-3.1
Automated cherry pick of #6530: fix: aliyun rds backup create fix
2020-05-22 12:36:48 +08:00
Qu Xuan
91e558e74a fix: aliyun rds backup create fix 2020-05-22 10:31:55 +08:00
Zexi Li
d196c943eb Merge pull request #6513 from ioito/automated-cherry-pick-of-#6511-upstream-release-3.1
Automated cherry pick of #6511: fix: 避免忽略本地allow any云上deny any安全组规则同步
2020-05-22 10:22:34 +08:00
Zexi Li
61e6a98328 Merge pull request #6522 from swordqiu/automated-cherry-pick-of-#6516-upstream-release-3.1
Automated cherry pick of #6516: fix: system privileges user cannot access system console
2020-05-22 10:15:22 +08:00
yunion-ci-robot
61e81748d7 Merge pull request #6507 from ioito/automated-cherry-pick-of-#6505-upstream-release-3.1
Automated cherry pick of #6505: fix: 上传镜像为转换列表之外时,subformat状态异常
2020-05-21 23:08:50 +08:00
Qiu Jian
51563912b0 fix: system privileges user cannot access system console 2020-05-21 18:44:37 +08:00
Qu Xuan
215f9c4d1d fix: 避免忽略本地allow any云上deny any安全组规则同步 2020-05-21 18:30:39 +08:00
Qu Xuan
a32021969a fix: 上传镜像为转换列表之外时,subformat状态异常 2020-05-21 17:41:55 +08:00
Zexi Li
18e98f598e Merge pull request #6501 from zhaoxiangchun/automated-cherry-pick-of-#6500-upstream-release-3.1
Automated cherry pick of #6500: 修复当prestate=alerting,newstate=alerting的情况无法触发notify的问题
2020-05-21 16:37:58 +08:00
Zexi Li
520af18f9e Merge pull request #6489 from rainzm/automated-cherry-pick-of-#6487-upstream-release-3.1
Automated cherry pick of #6487: Fix/esxi
2020-05-21 16:33:17 +08:00
zhaoxiangchun
28fab54660 修复当prestate=alerting,newstate=alerting的情况无法触发notify的问题 2020-05-21 13:57:14 +08:00
rainzm
4f9bbe0674 fix(esxi): Modify the disk size correctly when creating vm 2020-05-21 10:50:25 +08:00
rainzm
d3fb8a60d7 fix(esxi): Detach all disk first when deleting vm 2020-05-21 10:50:25 +08:00
rainzm
3276164c8b Kill processes in time & Add debug info 2020-05-21 10:50:25 +08:00
rainzm
d759c27bf6 fix(esxi): Remove 'Destory' operation that is unnecessary for VirtualDiskManager 2020-05-21 10:50:25 +08:00
rainzm
ce827235b3 fix(esxi): Separate detach disk and delete disk when rebuilding.
In previous versions, set
`removeSpec.FileOperation = types.VirtualDeviceConfigSpecFileOperationDestroy'
to delete disk indirectly.

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

Now, detach disk without deleteing backing file and then remove backing
2020-05-21 10:50:25 +08:00
Zexi Li
9534c153c3 Merge pull request #6493 from zexi/automated-cherry-pick-of-#6491-upstream-release-3.1
Automated cherry pick of #6491: keystone: fix db not sync
2020-05-20 17:32:24 +08:00
Zexi Li
e4eb798fda keystone: fix db not sync 2020-05-20 17:23:07 +08:00
Zexi Li
34cef736d3 Merge pull request #6482 from zexi/automated-cherry-pick-of-#6481-upstream-release-3.1
Automated cherry pick of #6481: region: fix get resource details panic
2020-05-20 14:00:12 +08:00
Zexi Li
a175ca421f region: fix get resource details panic 2020-05-20 13:30:32 +08:00
Zexi Li
03b13297e8 Merge pull request #6476 from yousong/automated-cherry-pick-of-#6474-upstream-release-3.1
Automated cherry pick of #6474: cloudcommon: rbac: fix typo
2020-05-20 12:53:21 +08:00
Zexi Li
1b3c442407 Merge pull request #6480 from tb365/automated-cherry-pick-of-#6463-upstream-release-3.1
Automated cherry pick of #6463: add fuzzy ip matching
2020-05-20 12:51:58 +08:00
tangbin
949c202692 add fuzzy ip matching 2020-05-20 12:02:29 +08:00
Zexi Li
47be971d66 Merge pull request #6455 from ioito/automated-cherry-pick-of-#6453-upstream-release-3.1
Automated cherry pick of #6453: fix: 优化azure image同步逻辑
2020-05-20 11:08:27 +08:00
Yousong Zhou
77a36234a4 networks: return HTTP 404 for sql.ErrNoRows 2020-05-20 11:06:34 +08:00
Yousong Zhou
2f89114413 wires: default to "default" vpc on creation
Wire creation request right now only makes sense in context of classic
network ("default" vpc)
2020-05-20 11:06:34 +08:00
Yousong Zhou
2322118457 networks: eliminate a variable 2020-05-20 11:05:50 +08:00
Yousong Zhou
fa5fbccf2b guestdrivers: managed: use const api.EIP_STATUS_ASSOCIATE 2020-05-20 11:05:50 +08:00
Yousong Zhou
c5cf45772c cloudprovider: fix typo 2020-05-20 11:05:50 +08:00
Yousong Zhou
6daa0a1d4f cloudcommon: rbac: fix typo 2020-05-20 11:05:50 +08:00
yunion-ci-robot
a304d30020 Merge pull request #6471 from tb365/automated-cherry-pick-of-#6463-upstream-release-3.1
Automated cherry pick of #6463: add fuzzy ip matching
2020-05-19 19:29:40 +08:00
tangbin
8aed26a110 add fuzzy ip matching 2020-05-19 19:24:55 +08:00
Zexi Li
6c78e3d349 Merge pull request #6460 from ioito/automated-cherry-pick-of-#6458-upstream-release-3.1
Automated cherry pick of #6458: fix: 修复zstack使用win镜像时userdata base64加密问题
2020-05-19 19:13:56 +08:00
Zexi Li
83a5574e5d Merge pull request #6465 from zexi/automated-cherry-pick-of-#6462-upstream-release-3.1
Automated cherry pick of #6462: region: fix server create params not include specified resource
2020-05-19 19:08:52 +08:00
Zexi Li
f05ed6ccb6 region: fix server create params not include specified resource 2020-05-19 17:38:46 +08:00
Qu Xuan
73ca4a9ee8 fix: 修复zstack使用win镜像时userdata base64加密问题 2020-05-19 16:47:29 +08:00
Qu Xuan
144bc806b8 fix: 优化azure image同步逻辑 2020-05-19 16:24:47 +08:00
Zexi Li
144ebc6e8b Merge pull request #6445 from swordqiu/automated-cherry-pick-of-#6443-upstream-release-3.1
Automated cherry pick of #6443: fix: anonymous user may list resources
2020-05-19 10:17:58 +08:00
Zexi Li
33fd165939 Merge pull request #6439 from zexi/automated-cherry-pick-of-#6436-upstream-release-3.1
Automated cherry pick of #6436: baremetal: fix ssh put empty content file not created
2020-05-19 10:16:12 +08:00
Qiu Jian
08971d413a fix: anonymous user may list resources 2020-05-19 01:24:16 +08:00
Zexi Li
c321c6c4b7 Merge pull request #6425 from ioito/automated-cherry-pick-of-#6423-upstream-release-3.1
Automated cherry pick of #6423: fix: 避免仅同步一个region时,其余region状态变为准备中
2020-05-18 21:49:19 +08:00
Zexi Li
45d627da21 Merge pull request #6430 from ioito/automated-cherry-pick-of-#6428-upstream-release-3.1
Automated cherry pick of #6428: fix: 避免设置自动释放后磁盘的expired_at失效
2020-05-18 21:47:59 +08:00
Zexi Li
24a6b94fc8 baremetal: fix ssh put empty content file not created 2020-05-18 21:46:04 +08:00
Qu Xuan
7fd2a886b4 fix: 避免设置自动释放后磁盘的expired_at失效 2020-05-18 20:08:29 +08:00
Qu Xuan
4a9030636b fix: 避免仅同步一个region时,其余region状态变为准备中 2020-05-18 19:38:00 +08:00
Zexi Li
15ba242294 Merge pull request #6413 from rainzm/release/3.1
update vendor for release/3.1
2020-05-17 14:18:12 +08:00
Zexi Li
12b8efa2a1 Merge pull request #6414 from zhaoxiangchun/automated-cherry-pick-of-#6410-upstream-release-3.1
Automated cherry pick of #6410: 修复无法获取vmware宿主机监控数据的问题
2020-05-17 14:17:01 +08:00
zhaoxiangchun
715c1ba936 修复无法获取vmware宿主机监控数据的问题 2020-05-16 21:23:00 +08:00
rainzm
a50e8a797e update vendor 2020-05-16 21:21:45 +08:00
yunion-ci-robot
a314b7a37b Merge pull request #6390 from zexi/automated-cherry-pick-of-#6388-upstream-release-3.1
Automated cherry pick of #6388: region: fix baremetal can't enable public baremetal type network
2020-05-16 18:05:03 +08:00
Zexi Li
f3838108cd Merge pull request #6397 from swordqiu/automated-cherry-pick-of-#6395-upstream-release-3.1
Automated cherry pick of #6395: fix: server-sync-fix-nics should return errors if vnics ip is not reachable on host
2020-05-16 17:44:50 +08:00
Zexi Li
756e1f5570 Merge pull request #6377 from rainzm/automated-cherry-pick-of-#6375-upstream-release-3.1
Automated cherry pick of #6375: Fix/esxi
2020-05-16 17:41:39 +08:00
Zexi Li
9425460800 region: fix baremetal can't enable public baremetal type network 2020-05-16 17:30:59 +08:00
Qiu Jian
bebdc5532c fix: server-sync-fix-nics should return errors if vnics ip is not reachable on host 2020-05-15 22:20:18 +08:00
rainzm
069805fa89 fix(esxi): Allow the creation of duplicate vcenter machines.
Create vm with name whose vlaue is localVM.Uuid and try to rename again.
2020-05-15 21:36:50 +08:00
rainzm
eae078398b fix(esxi): Add usb to support mouse in vnc viewer 2020-05-15 21:36:50 +08:00
rainzm
068a89b234 fix(esxi): Fix GetDriver and add driver log for vdisk.
In GetDriver, return 'name' directly if driverMap is empty.
2020-05-15 21:36:50 +08:00
rainzm
b27a0af647 fix(esxi): Set 'WindowsDefaultAdminUser' as true when deploy vm.
'WindowsDefaultAdminUser' means that the default admin account is
'Administrator' when deploy windows vm.
2020-05-15 21:36:50 +08:00
rainzm
7bc16cacad fix(region): Set default value if rootdisk's driver is empty. 2020-05-15 21:36:50 +08:00
rainzm
700e513595 fix(esxi): Disable automatically add host to the dvs 2020-05-15 21:36:50 +08:00
rainzm
9113050534 fix(esxi): Set 'IsInit' as true when rebuildroot
IsInit is true will cause cloudinit enable. When rebuilding root, if there is cloudinit service in the image, it will cover the initialization work we did on the rebuilding.
2020-05-15 21:36:50 +08:00
Zexi Li
89c80a43f8 Merge pull request #6384 from zexi/automated-cherry-pick-of-#6381-upstream-release-3.1
Automated cherry pick of #6381: scheduler: fix min counter get count not correct
2020-05-15 15:28:30 +08:00
Zexi Li
e2d86cc624 scheduler: fix min counter get count not correct 2020-05-15 15:09:40 +08:00
Zexi Li
99e30e2dc1 Merge pull request #6362 from ioito/automated-cherry-pick-of-#6346-upstream-release-3.1
Automated cherry pick of #6346: fix: 优化windows powershell userdata
2020-05-15 11:09:58 +08:00
Zexi Li
110555570c Merge pull request #6360 from ioito/automated-cherry-pick-of-#6352-upstream-release-3.1
Automated cherry pick of #6352: fix: 优化rds zone同步逻辑
2020-05-15 11:05:52 +08:00
Qu Xuan
7a80b316ac fix: 优化windows powershell userdata 2020-05-14 20:43:41 +08:00
Qu Xuan
1445a91007 fix: 优化rds zone同步逻辑 2020-05-14 20:26:55 +08:00
Zexi Li
d4a81bedf9 Merge pull request #6356 from zexi/automated-cherry-pick-of-#6353-upstream-release-3.1
Automated cherry pick of #6353: scheduler: filter disabled cloudprovider
2020-05-14 18:59:29 +08:00
Zexi Li
05313e1f9a Merge pull request #6340 from swordqiu/automated-cherry-pick-of-#6338-upstream-release-3.1
Automated cherry pick of #6338: fix: avoid using background context
2020-05-14 18:19:31 +08:00
Zexi Li
372646dd0d scheduler: filter disabled cloudprovider 2020-05-14 18:15:32 +08:00
Zexi Li
617adad306 Merge pull request #6349 from zexi/automated-cherry-pick-of-#6347-upstream-release-3.1
Automated cherry pick of #6347: scheduler: set schedtag default strategy if input empty
2020-05-14 17:49:23 +08:00
Zexi Li
8ad98ea029 scheduler: set schedtag default strategy if input empty 2020-05-14 17:26:28 +08:00
Qiu Jian
869d434ce1 fix: avoid using background context 2020-05-14 17:05:10 +08:00
yunion-ci-robot
1b5c347408 Merge pull request #6321 from wanyaoqi/automated-cherry-pick-of-#6319-upstream-release-3.1
Automated cherry pick of #6319: do not close worker chan
2020-05-13 20:18:02 +08:00
wanyaoqi
bccdbae49d do not close worker chan
don't close worker chan after put work, will cause dead loop
2020-05-13 18:58:45 +08:00
Zexi Li
63fe793a2f Merge pull request #6304 from yousong/automated-cherry-pick-of-#6302-upstream-release-3.1
Automated cherry pick of #6302: vpcagent: ignore possible external subnets
2020-05-13 12:45:38 +08:00
Zexi Li
e9e6ff2425 Merge pull request #6311 from ioito/automated-cherry-pick-of-#6306-upstream-release-3.1
Automated cherry pick of #6306: fix: openstack 安全组规则同步
2020-05-13 12:42:00 +08:00
Zexi Li
dcdcbcae11 Merge pull request #6294 from ioito/automated-cherry-pick-of-#6292-upstream-release-3.1
Automated cherry pick of #6292: fix: 优化openstack错误处理
2020-05-13 10:42:51 +08:00
Yousong Zhou
b1d2f2e2fc vpcagent: ignore possible external subnets 2020-05-12 18:06:47 +08:00
Qu Xuan
0473fe6524 fix: openstack 安全组规则同步 2020-05-12 17:57:46 +08:00
Qu Xuan
08bef5e63f fix: 优化openstack错误处理 2020-05-12 14:09:35 +08:00
Zexi Li
743b4d2561 Merge pull request #6289 from yousong/automated-cherry-pick-of-#6287-upstream-release-3.1
Automated cherry pick of #6287: region: lbagent: undeploy: make it idempotent
2020-05-12 11:50:34 +08:00
Zexi Li
66b937acc5 Merge pull request #6284 from yousong/automated-cherry-pick-of-#6282-upstream-release-3.1
Automated cherry pick of #6282: region: lbagents: fix deleting pending_deleted objects
2020-05-12 11:43:46 +08:00
Yousong Zhou
0781273c26 region: lbagent: undeploy: make it idempotent
Both the following three can result in the same error message "Could not
find the requested service yunion-xx: host"

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

Use of ansibleplaybookv2 is overkill and can break console expectation.
Just turn to shell module for now
2020-05-12 10:39:17 +08:00
Yousong Zhou
8a619edb7a region: lbagents: fix deleting pending_deleted objects
This was broken since the introduction of virtual object
2020-05-12 10:11:22 +08:00
Zexi Li
32429e54b7 Merge pull request #6272 from zexi/automated-cherry-pick-of-#6270-upstream-release-3.1
Automated cherry pick of #6270: scheduler: get region nil panic
2020-05-11 21:07:44 +08:00
Zexi Li
28b00fc130 Merge pull request #6260 from ioito/automated-cherry-pick-of-#6258-upstream-release-3.1
Automated cherry pick of #6258: fix: 避免aliyun磁盘计费类型多次转换
2020-05-11 18:17:09 +08:00
Zexi Li
b42df76abd scheduler: get region nil panic 2020-05-11 18:02:36 +08:00
Qu Xuan
15ee6e6920 fix: 避免aliyun磁盘计费类型多次转换 2020-05-11 14:06:25 +08:00
Zexi Li
9bb48de844 Merge pull request #6255 from swordqiu/automated-cherry-pick-of-#6252-upstream-release-3.1
Automated cherry pick of #6252: fix: panic when disk has no valid storage_id
2020-05-11 10:01:46 +08:00
Qiu Jian
e8f7ab6676 fix: panic when disk has no valid storage_id 2020-05-11 02:58:03 +08:00
Zexi Li
14542810a8 Merge pull request #6249 from wanyaoqi/automated-cherry-pick-of-#6247-upstream-release-3.1
Automated cherry pick of #6247: fix import from libvirt
2020-05-10 21:35:11 +08:00
Zexi Li
3175bdd0cc Merge pull request #6235 from tb365/automated-cherry-pick-of-#6232-upstream-release-3.1
Automated cherry pick of #6232: huawei network id fix
2020-05-10 21:33:44 +08:00
wanyaoqi
25003603aa fix import from libvirt 2020-05-10 20:44:13 +08:00
Zexi Li
74ea904e4c Merge pull request #6244 from yousong/automated-cherry-pick-of-#6242-upstream-release-3.1
Automated cherry pick of #6242: disks: reword error message on bad DiskConfig struct
2020-05-10 11:29:08 +08:00
Yousong Zhou
ae2926168c disks: reword error message on bad DiskConfig struct 2020-05-10 00:18:39 +08:00
tangbin
12335b8f62 huawei network id fix 2020-05-09 20:11:47 +08:00
Zexi Li
b118cbe143 Merge pull request #6223 from yousong/automated-cherry-pick-of-#6221-upstream-release-3.1
Automated cherry pick of #6221: cloudprovider: add methods for getting http client
2020-05-09 19:02:21 +08:00
Zexi Li
8b0437f988 Merge pull request #6215 from yousong/automated-cherry-pick-of-#6213-upstream-release-3.1
Automated cherry pick of #6213: vpcagent: ovn: explicitly include gateway route in classless routes
2020-05-09 18:57:20 +08:00
Zexi Li
0fdb86ecb1 Merge pull request #6227 from yousong/automated-cherry-pick-of-#6225-upstream-release-3.1
Automated cherry pick of #6225: apigateway: handlers: register cloudnet modules
2020-05-09 18:47:47 +08:00
Yousong Zhou
254bac3ffe apigateway: handlers: register cloudnet modules 2020-05-09 16:41:27 +08:00
Yousong Zhou
472721bc18 multicloud: loader: guard against changing proxyFunc of default client 2020-05-09 12:56:51 +08:00
Yousong Zhou
f62c00d342 multicloud: avoid changing transport of global default http client 2020-05-09 12:56:51 +08:00
Yousong Zhou
b62c930289 cloudprovider: add methods for getting http client
Prepare for following changes to avoid using and changing default
client settings
2020-05-09 12:56:51 +08:00
Yousong Zhou
ed583438b1 vpcagent: ovn: explicitly include gateway route in classless routes 2020-05-08 16:36:44 +08:00
Zexi Li
0dda6257fc Merge pull request #6188 from zhaoxiangchun/automated-cherry-pick-of-#6185-upstream-release-3.1
Automated cherry pick of #6185: 修复谷歌监控无法获取的问题
2020-05-07 17:21:33 +08:00
Zexi Li
9944fc1e27 Merge pull request #6191 from zhaoxiangchun/automated-cherry-pick-of-#5863-upstream-release-3.1
Automated cherry pick of #5863: 优化邮件格式
2020-05-07 17:20:46 +08:00
zhaoxiangchun
86524a8574 优化邮件格式
1.邮件主题中的报警级别和web页面进行对应
2.向onecloud发送邮件时,通过html/template进行格式化
2020-05-07 15:31:22 +08:00
zhaoxiangchun
822c972ce8 修复谷歌监控无法获取的问题
直接返回调用RestAPI的json格式数据
2020-05-07 11:28:07 +08:00
Zexi Li
23ec7d77c7 Merge pull request #6170 from yousong/automated-cherry-pick-of-#6168-upstream-release-3.1
Automated cherry pick of #6168: dnsrecords: note that DnsRecordManager is a IAdminSharableVirtualModelManager
2020-05-07 11:23:19 +08:00
Zexi Li
83a30f1c7c Merge pull request #6176 from swordqiu/automated-cherry-pick-of-#6174-upstream-release-3.1
Automated cherry pick of #6174: fix: fail to fetch real client ip from httprequest
2020-05-07 11:16:27 +08:00
Qiu Jian
ff287c632e fix: fail to fetch real client ip from httprequest 2020-05-06 22:27:32 +08:00
Yousong Zhou
e98516a94a dnsrecords: allow updating only description
This commit includes the following changes

 - Eliminate unused arguments from validateModelData()
 - Remove "records" member of input data unconditionally
 - Allow updates to not include records related parameters, to allow
   updating only "description" without emitting "Empty record" error
2020-05-06 18:42:53 +08:00
Yousong Zhou
8176d74976 dnsrecords: note that DnsRecordManager is a IAdminSharableVirtualModelManager 2020-05-06 18:42:53 +08:00
yunion-ci-robot
59419868a0 Merge pull request #6160 from zhaoxiangchun/automated-cherry-pick-of-#6158-upstream-release-3.1
Automated cherry pick of #6158: bugfix mem paginate
2020-05-06 15:44:45 +08:00
zhaoxiangchun
c733a582dd bugfix mem paginate
通过totoal和offset 与limit比较确定最后返回数据
2020-05-06 11:06:03 +08:00
Zexi Li
6fcba7d320 Merge pull request #6155 from ioito/automated-cherry-pick-of-#6153-upstream-release-3.1
Automated cherry pick of #6153: fix: secgroupcache权限问题修复
2020-04-30 20:14:06 +08:00
Qu Xuan
0cb9db8835 fix: secgroupcache权限问题修复 2020-04-30 15:43:30 +08:00
Zexi Li
7230a47ed3 Merge pull request #6139 from ioito/automated-cherry-pick-of-#6137-upstream-release-3.1
Automated cherry pick of #6137: fix: 云账号创建可以指定项目
2020-04-30 10:36:42 +08:00
Zexi Li
c6e8eb6d10 Merge pull request #6127 from ioito/automated-cherry-pick-of-#6123-upstream-release-3.1
Automated cherry pick of #6123: fix: usage-handler 不统计虚拟的vpc wire
2020-04-30 10:36:21 +08:00
Zexi Li
7b9b78fed3 Merge pull request #6129 from swordqiu/automated-cherry-pick-of-#6120-upstream-release-3.1
Automated cherry pick of #6120: fix: sysadmin can override policy violation check
2020-04-29 21:15:48 +08:00
Qu Xuan
7a0420dc1a fix: 云账号创建可以指定项目 2020-04-29 20:06:58 +08:00
Zexi Li
952879c40e Merge pull request #6132 from tb365/bugfix/tb-bugfix-0429
fix: FindAnonymousStructPoint needs input as a pointer to struct
2020-04-29 19:29:34 +08:00
Qiu Jian
2fb5c0b24e fix: FindAnonymousStructPoint needs input as a pointer to struct 2020-04-29 18:11:56 +08:00
Qiu Jian
899184eb4b fix: sysadmin can override policy violation check 2020-04-29 17:59:36 +08:00
Qu Xuan
93330a3c2a fix: usage-handler 不统计虚拟的vpc wire 2020-04-29 17:58:26 +08:00
Zexi Li
001519224c Merge pull request #6113 from swordqiu/automated-cherry-pick-of-#6111-upstream-release-3.1
Automated cherry pick of #6111: fix: prevent policy violation
2020-04-29 13:10:29 +08:00
Zexi Li
949979fca1 Merge pull request #6097 from ioito/automated-cherry-pick-of-#6095-upstream-release-3.1
Automated cherry pick of #6095: fix: 普通用户可获取rds账号密码
2020-04-29 13:08:13 +08:00
Qiu Jian
5d6abcc7df fix: prevent policy violation 2020-04-28 23:56:37 +08:00
yunion-ci-robot
498961324c Merge pull request #6105 from ioito/automated-cherry-pick-of-#6103-upstream-release-3.1
Automated cherry pick of #6103: fix: 修复openstack存储同步问题
2020-04-28 23:40:41 +08:00
Qu Xuan
916a05c9bf fix: 修复openstack存储同步问题 2020-04-28 14:48:00 +08:00
Qu Xuan
44b78f47d5 fix: 普通用户可获取rds账号密码 2020-04-28 10:42:11 +08:00
Zexi Li
203284a6f9 Merge pull request #6089 from yousong/bugfix/yousong-vpcagent-3.1
[3.1] vpcagent: models: allow guest to have multiple vpc nics
2020-04-27 21:01:21 +08:00
Zexi Li
14be39a37f Merge pull request #6084 from yousong/bugfix/yousong-proxysetting-3.1
[3.1] region: cloudaccounts: fix updating failure caused by proxysetting
2020-04-27 20:53:55 +08:00
Yousong Zhou
05afabb69c vpcagent: models: allow guest to have multiple vpc nics
(cherry picked from commit 09cc38f962)
2020-04-27 17:52:29 +08:00
Yousong Zhou
95290a1c0d region: cloudaccounts: fix updating failure caused by proxysetting 2020-04-27 17:32:04 +08:00
Zexi Li
08f240762b Merge pull request #6070 from ioito/automated-cherry-pick-of-#6068-upstream-release-3.1
Automated cherry pick of #6068: fix: gcp use project name for cloudprovider
2020-04-27 16:03:23 +08:00
Qu Xuan
953f235110 fix: gcp use project name for cloudprovider 2020-04-27 14:17:03 +08:00
Zexi Li
861f827101 Merge pull request #6064 from rainzm/automated-cherry-pick-of-#6062-upstream-release-3.1
Automated cherry pick of #6062: fix/notify: Add deadline for rpc client
2020-04-27 12:48:07 +08:00
Rain
7c20400bc6 fix/notify: Add deadline for rpc client 2020-04-27 10:44:24 +08:00
Zexi Li
070876e760 Merge pull request #6047 from tb365/automated-cherry-pick-of-#6042-upstream-release-3.1
Automated cherry pick of #6042: huawei elb cookie timeout fix
2020-04-26 21:06:27 +08:00
Zexi Li
35542cb381 Merge pull request #6043 from tb365/automated-cherry-pick-of-#6040-upstream-release-3.1
Automated cherry pick of #6040: ctyun subnet create bugfix
2020-04-26 20:31:24 +08:00
tangbin
d0b166364a aws elb health check type fix 2020-04-26 20:10:24 +08:00
tangbin
b20725656e huawei elb cookie timeout fix 2020-04-26 20:10:24 +08:00
tangbin
fa6991ce94 ctyun subnet create bugfix 2020-04-26 20:08:18 +08:00
yunion-ci-robot
fb39dbc772 Merge pull request #6011 from swordqiu/automated-cherry-pick-of-#6008-upstream-release-3.1
Automated cherry pick of #6008: fix: GetOnPremiseNetworkOfIP should return underlay networks
2020-04-26 19:49:32 +08:00
Zexi Li
85c21e6dbb Merge pull request #6030 from ioito/automated-cherry-pick-of-#6028-upstream-release-3.1
Automated cherry pick of #6028: fix: json unmarshal
2020-04-26 18:19:23 +08:00
Zexi Li
77f0ccf889 Merge pull request #6027 from swordqiu/automated-cherry-pick-of-#6006-upstream-release-3.1
Automated cherry pick of #6006: fix: resolve parameter name conflict in google cloud account create input
2020-04-26 16:36:22 +08:00
Qu Xuan
da3383d81a fix: json unmarshal 2020-04-26 15:52:13 +08:00
Qiu Jian
5fec0b66a5 fix: resolve parameter name conflict in google cloud account create input 2020-04-26 11:47:55 +08:00
yunion-ci-robot
20b6277c6a Merge pull request #6016 from zexi/automated-cherry-pick-of-#6014-upstream-release-3.1
Automated cherry pick of #6014: scheduler: fix network predicate get wrong free port
2020-04-26 00:31:30 +08:00
Zexi Li
3eedb00e11 scheduler: fix network predicate get wrong free port 2020-04-25 23:55:13 +08:00
Qiu Jian
d8251ce270 fix: GetOnPremiseNetworkOfIP should return underlay networks 2020-04-25 16:31:03 +08:00
Zexi Li
7d4a57cf33 Merge pull request #5992 from ioito/automated-cherry-pick-of-#5918-upstream-release-3.1
Automated cherry pick of #5918: fix: 修复华为云eneterprise-project-list异常问题
2020-04-24 18:18:13 +08:00
Zexi Li
562fbb2afe Merge pull request #5997 from yousong/automated-cherry-pick-of-#5995-upstream-release-3.1
Automated cherry pick of #5995: lblistener: fix updating lblistener without backend_group field
2020-04-24 18:17:22 +08:00
Yousong Zhou
51f0d8448d lblistener: fix updating lblistener without backend_group field
Fixes dd01610931 ("lblistener: allow setting http/https listener
backendgroup to empty")
2020-04-24 14:23:02 +08:00
Qu Xuan
9d479e6293 fix: 修复华为云eneterprise-project-list异常问题 2020-04-24 14:12:50 +08:00
Zexi Li
3955c45d63 Merge pull request #5990 from ioito/automated-cherry-pick-of-#5903-upstream-release-3.1
Automated cherry pick of #5903: fix: esxi disk project sync
2020-04-24 14:09:54 +08:00
Zexi Li
49737431a2 Merge pull request #5988 from ioito/automated-cherry-pick-of-#5881-upstream-release-3.1
Automated cherry pick of #5881: fix: 阿里云资源组同步
2020-04-24 14:09:34 +08:00
Qu Xuan
52c76cb49c fix: esxi disk project sync 2020-04-24 11:35:07 +08:00
Qu Xuan
c1198af38e VMware resource pool同步 2020-04-24 11:33:48 +08:00
Qu Xuan
be56970506 fix: 华为企业项目映射同步 2020-04-24 11:33:48 +08:00
Qu Xuan
c2d83b0007 fix: 阿里云资源组同步 2020-04-24 11:32:26 +08:00
Zexi Li
080c77685c Merge pull request #5977 from ioito/automated-cherry-pick-of-#5975-upstream-release-3.1
Automated cherry pick of #5975: fix: 添加cloudevent过滤参数
2020-04-24 01:36:28 +08:00
Zexi Li
18c63a1fdc Merge pull request #5981 from ioito/automated-cherry-pick-of-#5979-upstream-release-3.1
Automated cherry pick of #5979: fix: cloudevent使用代理优化
2020-04-24 01:35:31 +08:00
Qu Xuan
7478891d74 fix: 添加cloudevent过滤参数 2020-04-23 17:58:27 +08:00
Qu Xuan
e336583552 fix: cloudevent使用代理优化 2020-04-23 17:55:25 +08:00
yunion-ci-robot
c0f88cc35d Merge pull request #5939 from ioito/automated-cherry-pick-of-#5915-upstream-release-3.1
Automated cherry pick of #5915: fix: 自动创建项目
2020-04-23 13:40:53 +08:00
Zexi Li
f636bd4c15 Merge pull request #5969 from swordqiu/automated-cherry-pick-of-#5966-upstream-release-3.1
Automated cherry pick of #5966: supermicro redfish support
2020-04-23 09:54:53 +08:00
Qiu Jian
eb7f0d465d remove errors import 2020-04-23 09:32:07 +08:00
Qiu Jian
fa2e55ce14 supermicro redfish support 2020-04-23 09:31:24 +08:00
Zexi Li
6d2c73e1bc Merge pull request #5930 from yousong/automated-cherry-pick-of-#5928-upstream-release-3.1
Automated cherry pick of #5928: lbagent: fend off unexpected resources just in case
2020-04-23 00:07:15 +08:00
Zexi Li
ce542891d9 Merge pull request #5963 from swordqiu/automated-cherry-pick-of-#5961-upstream-release-3.1
Automated cherry pick of #5961: fix: clean pending usage caused by pre-validate-create-data
2020-04-23 00:03:15 +08:00
Zexi Li
8f02b26ae3 Merge pull request #5922 from ioito/automated-cherry-pick-of-#5919-upstream-release-3.1
Automated cherry pick of #5919: fix: 非私有云同步region name
2020-04-22 23:59:45 +08:00
Zexi Li
4a3d0bef39 Merge pull request #5932 from ioito/automated-cherry-pick-of-#5931-upstream-release-3.1
Automated cherry pick of #5931: fix: 转换非标准存储类型到lrs
2020-04-22 23:57:17 +08:00
Zexi Li
93c94454d5 Merge pull request #5948 from tb365/automated-cherry-pick-of-#5945-upstream-release-3.1
Automated cherry pick of #5945: huawei elb sync vpc
2020-04-22 23:55:51 +08:00
Zexi Li
fa7dd281e8 Merge pull request #5954 from zexi/automated-cherry-pick-of-#5951-upstream-release-3.1
Automated cherry pick of #5951: baremetal: ensure power up add retries
2020-04-22 23:52:40 +08:00
Qiu Jian
5f78b96dad fix: clean pending usage caused by pre-validate-create-data 2020-04-22 23:48:24 +08:00
yunion-ci-robot
29d428a6db Merge pull request #5941 from tb365/automated-cherry-pick-of-#5927-upstream-release-3.1
Automated cherry pick of #5927: remove aws invalid backendgroup
2020-04-22 23:05:06 +08:00
Zexi Li
d8f1cd5bf6 baremetal: ensure power up add retries 2020-04-22 22:16:44 +08:00
tangbin
ead643b844 huawei elb sync vpc 2020-04-22 20:30:43 +08:00
tangbin
f399796852 remove aws invalid backendgroup 2020-04-22 19:01:21 +08:00
Qu Xuan
be77084d0e fix: 自动创建项目 2020-04-22 18:56:56 +08:00
Qu Xuan
61c52e6cb5 fix: 转换非标准存储类型到lrs 2020-04-22 18:53:45 +08:00
Yousong Zhou
3a42c05133 lbagent: fend off unexpected resources just in case
As resource we do not know whether they are bad, but surely we know
they are not what we expect
2020-04-22 18:50:50 +08:00
Qu Xuan
5d2d5f2cb1 fix: 非私有云同步region name 2020-04-22 18:00:02 +08:00
Zexi Li
849756946b Merge pull request #5902 from ioito/automated-cherry-pick-of-#5900-upstream-release-3.1
Automated cherry pick of #5900: fix: 尽量避免因代理问题导致google request异常
2020-04-22 15:12:20 +08:00
Zexi Li
18ae833a5e Merge pull request #5908 from swordqiu/automated-cherry-pick-of-#5906-upstream-release-3.1
Automated cherry pick of #5906: fix: blacklist keystone reset admin password
2020-04-22 15:07:38 +08:00
Qiu Jian
bfb913105d fix: blacklist keystone reset admin password 2020-04-22 15:03:09 +08:00
Qu Xuan
d9e5df08db fix: 尽量避免因代理问题导致google request异常 2020-04-22 10:48:47 +08:00
Zexi Li
daeca7f7bf Merge pull request #5893 from swordqiu/automated-cherry-pick-of-#5890-upstream-release-3.1
Automated cherry pick of #5890: fix: policy details should carry updated_at and created_at fields
2020-04-22 10:39:21 +08:00
Zexi Li
bd117d6d1e Merge pull request #5898 from swordqiu/automated-cherry-pick-of-#5895-upstream-release-3.1
Automated cherry pick of #5895: fix: delete idp also delete users/groups in target domain
2020-04-22 10:34:08 +08:00
Zexi Li
383b73551a Merge pull request #5886 from ioito/automated-cherry-pick-of-#5884-upstream-release-3.1
Automated cherry pick of #5884: fix: 仅当变更domainId时才需要更新projectId
2020-04-22 10:32:39 +08:00
Qiu Jian
71351daa59 fix: delete idp also delete users/groups in target domain 2020-04-22 10:15:34 +08:00
Qiu Jian
a5b44df050 fix: policy details should carry updated_at and created_at fields 2020-04-21 22:43:17 +08:00
Qu Xuan
882c5ddc86 fix: 仅当变更domainId时才需要更新projectId 2020-04-21 21:14:39 +08:00
Zexi Li
37e6b25f4a Merge pull request #5858 from ioito/automated-cherry-pick-of-#5856-upstream-release-3.1
Automated cherry pick of #5856: fix: show sql connection error
2020-04-20 20:55:38 +08:00
Zexi Li
5a2d4737f3 Merge pull request #5868 from tb365/automated-cherry-pick-of-#5865-upstream-release-3.1
Automated cherry pick of #5865: lblis & lbbg & lbr & lbb create add fetch owner id
2020-04-20 20:51:23 +08:00
tangbin
f7b11621a7 lblis & lbbg & lbr & lbb create add fetch owner id 2020-04-20 19:31:09 +08:00
Qu Xuan
13bef96917 fix: show sql connection error 2020-04-20 16:50:15 +08:00
Zexi Li
cfafea78e7 Merge pull request #5851 from swordqiu/automated-cherry-pick-of-#5850-upstream-release-3.1
Automated cherry pick of #5850: fix: allow any character in project/domain name, giveup displayname
2020-04-18 16:27:49 +08:00
Qiu Jian
e94e63d6d4 fix: allow any character in project/domain name, giveup displayname 2020-04-18 16:00:17 +08:00
Zexi Li
b8b8174632 Merge pull request #5848 from swordqiu/automated-cherry-pick-of-#5845-upstream-release-3.1
Automated cherry pick of #5845: fix: cloudproviderregion sync ignore panic
2020-04-18 12:02:31 +08:00
Zexi Li
59ead8ac15 Merge pull request #5843 from tb365/automated-cherry-pick-of-#5840-upstream-release-3.1
Automated cherry pick of #5840: aws elb create bugfix
2020-04-18 12:00:12 +08:00
yunion-ci-robot
0750fad9b4 Merge pull request #5849 from swordqiu/hotfix/qj-proxy-settting-id-revisit-3.1
fix: proxysetting_id => proxysetting revisited on 3.1
2020-04-17 22:50:05 +08:00
Qiu Jian
09274e2574 fix: proxysetting_id => proxysetting revisited on 3.1 2020-04-17 22:20:43 +08:00
Qiu Jian
102361dc2a fix: cloudproviderregion sync ignore panic 2020-04-17 22:08:58 +08:00
TangBin
a4197e96b1 huawei oss client bugfix 2020-04-17 20:47:47 +08:00
TangBin
ac2015d6df huawei oss client fix & huawei client init fix 2020-04-17 20:47:47 +08:00
tangbin
7dd0fcf719 aws elb create bugfix 2020-04-17 20:47:47 +08:00
Zexi Li
aed78bbb72 Merge pull request #5821 from swordqiu/automated-cherry-pick-of-#5818-upstream-release-3.1
Automated cherry pick of #5818: fix: non-redfish baremetal might support jnlp console
2020-04-17 00:05:18 +08:00
Zexi Li
ed29d7b702 Merge pull request #5826 from ioito/automated-cherry-pick-of-#5825-upstream-release-3.1
Automated cherry pick of #5825: fix: 尽量避免secgroup重名问题
2020-04-17 00:02:53 +08:00
Zexi Li
2fb625c0f0 Merge pull request #5835 from zhaoxiangchun/automated-cherry-pick-of-#5831-upstream-release-3.1
Automated cherry pick of #5831: 修复azure获取不到监控数据的问题
2020-04-17 00:01:26 +08:00
Zexi Li
62726047e8 Merge pull request #5837 from swordqiu/automated-cherry-pick-of-#5836-upstream-release-3.1
Automated cherry pick of #5836: fix: cas auto create project fetch failure
2020-04-16 23:59:54 +08:00
yunion-ci-robot
1c8285bbd2 Merge pull request #5812 from yousong/automated-cherry-pick-of-#5811-upstream-release-3.1
Automated cherry pick of #5811: region: lbagents: default to using public type endpoint of influxdb
2020-04-16 23:24:05 +08:00
Qiu Jian
0885c45f34 fix: cas auto create project fetch failure 2020-04-16 22:33:20 +08:00
zhaoxiangchun
5e623616d0 修复azure获取不到监控数据的问题 2020-04-16 20:13:21 +08:00
Zexi Li
98dbf2e10b Merge pull request #5806 from ioito/automated-cherry-pick-of-#5805-upstream-release-3.1
Automated cherry pick of #5805: fix: 优化rds sku list查询速度
2020-04-16 18:01:40 +08:00
Zexi Li
aee280b5d7 Merge pull request #5822 from swordqiu/hotfix/qj-update-depecated-by-tag-3.1
update deprecated-by tag for release 3.1
2020-04-16 17:59:41 +08:00
Qu Xuan
7fb48f891d fix: 尽量避免secgroup重名问题 2020-04-16 16:40:44 +08:00
Qiu Jian
a19cdad2f4 change deprecated-by to yunion:deprecated-by 2020-04-16 00:42:20 +08:00
Qiu Jian
175283c94d fix: non-redfish baremetal might support jnlp console 2020-04-15 23:55:58 +08:00
Yousong Zhou
3245626bb7 region: buckets: use identity_apis.EndpointInterfacePublic 2020-04-15 18:03:30 +08:00
Qu Xuan
3a18169f39 fix: 优化rds sku list查询速度 2020-04-15 18:01:50 +08:00
Yousong Zhou
ba79c4c67b image: use identity_apis.EndpointInterfacePublic 2020-04-15 18:01:46 +08:00
Yousong Zhou
08cfb1ee71 region: lbagents: default to using public type endpoint of influxdb 2020-04-15 18:01:46 +08:00
Zexi Li
cc38f00731 Merge pull request #5801 from zexi/automated-cherry-pick-of-#5798-upstream-release-3.1
Automated cherry pick of #5798: climc: support k8s service v3.2
2020-04-15 10:38:02 +08:00
Zexi Li
ca563a3221 climc: support k8s service v3.2 2020-04-15 10:37:05 +08:00
Zexi Li
affd6fb567 Merge pull request #5795 from rainzm/automated-cherry-pick-of-#5794-upstream-release-3.1
Automated cherry pick of #5794: fix(region): Fix the snapshotpolicy info in DiskDetails
2020-04-14 22:41:43 +08:00
Zexi Li
4a3ae9da7f Merge pull request #5796 from swordqiu/feature/qj-cas-user-join-project-3.1
feature: cas user auto join designated project
2020-04-14 16:28:40 +08:00
Rain
d8d04512ba fix(region): Fix the snapshotpolicy info in DiskDetails 2020-04-14 15:41:17 +08:00
Qiu Jian
eac60b484b feature: cas user auto join designated project 2020-04-14 15:40:01 +08:00
Zexi Li
3e170f8a9b Merge pull request #5790 from yousong/automated-cherry-pick-of-#5789-upstream-release-3.1
Automated cherry pick of #5789: proxysetting: fix validating delete condition
2020-04-14 10:45:49 +08:00
Zexi Li
14f66686d9 Merge pull request #5786 from ioito/automated-cherry-pick-of-#5785-upstream-release-3.1
Automated cherry pick of #5785: fix: 避免aliyun access key不可用时返回NotFoundError错误
2020-04-14 10:44:58 +08:00
Yousong Zhou
a3b0b2193c proxysetting: fix validating delete condition 2020-04-13 20:12:53 +08:00
Qu Xuan
af24cbfaa3 fix: 避免aliyun access key不可用时返回NotFoundError错误 2020-04-13 18:49:04 +08:00
Zexi Li
8ef6b60a42 Merge pull request #5779 from swordqiu/automated-cherry-pick-of-#5756-upstream-release-3.1
Automated cherry pick of #5756: fix: 1. allow share proxysetting 2. claim proxsetting as domain resources
2020-04-13 15:45:16 +08:00
Qiu Jian
df00cdbd04 update vendor 2020-04-13 15:27:11 +08:00
Zexi Li
df37a12fc2 Merge pull request #5770 from wanyaoqi/automated-cherry-pick-of-#5769-upstream-release-3.1
Automated cherry pick of #5769: fix host init generate network config
2020-04-13 12:08:44 +08:00
Zexi Li
afc653bb48 Merge pull request #5763 from tb365/automated-cherry-pick-of-#5759-upstream-release-3.1
Automated cherry pick of #5759: aws elb bugfix
2020-04-13 11:27:46 +08:00
Qiu Jian
cae9564f29 update vendor 2020-04-13 11:00:58 +08:00
Qiu Jian
2b45e26243 fix: 1. allow share proxysetting 2. claim proxsetting as domain resources 2020-04-13 11:00:58 +08:00
tangbin
89f6f9985c aws elb bugfix 2020-04-13 10:29:17 +08:00
Zexi Li
daeb7bb144 Merge pull request #5783 from swordqiu/automated-cherry-pick-of-#5780-upstream-release-3.1
Automated cherry pick of #5780: fix: host jnlp request fail for idrac9
2020-04-13 09:49:21 +08:00
Qiu Jian
4fc343f577 fix: host jnlp request fail for idrac9 2020-04-13 00:13:20 +08:00
yunion-ci-robot
35e6f3992a Merge pull request #5775 from ioito/automated-cherry-pick-of-#5774-upstream-release-3.1
Automated cherry pick of #5774: fix: azure重装系统删除不必要的参数
2020-04-12 00:37:53 +08:00
Qu Xuan
b1f320bdd5 fix: azure重装系统删除不必要的参数 2020-04-11 15:10:58 +08:00
Zexi Li
e843eecbd1 Merge pull request #5753 from swordqiu/automated-cherry-pick-of-#5745-upstream-release-3.1
Automated cherry pick of #5745: feature: redfish support IDRAC9 baremetal
2020-04-11 13:12:18 +08:00
Zexi Li
597a9d38ca Merge pull request #5747 from yousong/automated-cherry-pick-of-#5746-upstream-release-3.1
Automated cherry pick of #5746: proxysetting: add class level test action
2020-04-11 13:07:19 +08:00
Zexi Li
03b1a0c0a1 Merge pull request #5766 from yousong/automated-cherry-pick-of-#5765-upstream-release-3.1
Automated cherry pick of #5765: region: lbagent: vrrp.advert_int must be the same inside cluster
2020-04-11 13:05:16 +08:00
Yousong Zhou
168248ef97 region: lbagent: vrrp.advert_int must be the same inside cluster 2020-04-10 15:55:15 +08:00
wanyaoqi
a965ecf107 fix host init generate network config 2020-04-10 15:49:39 +08:00
yunion-ci-robot
e46f6dc0e1 Merge pull request #5741 from yousong/automated-cherry-pick-of-#5740-upstream-release-3.1
Automated cherry pick of #5740: region: lbagents: fix returning error when glob has no match
2020-04-10 09:53:42 +08:00
Qiu Jian
0659981e24 feature: redfish support IDRAC9 baremetal 2020-04-09 22:51:09 +08:00
Yousong Zhou
58db9ddf0f proxysetting: add class level test action 2020-04-09 17:38:47 +08:00
Yousong Zhou
7e2a369fae region: lbagents: fix returning error when glob has no match 2020-04-09 11:08:03 +08:00
Zexi Li
d07d8f9652 Merge pull request #5730 from tb365/automated-cherry-pick-of-#5726-upstream-release-3.1
Automated cherry pick of #5726: huawei&qcloud&huawei elb bugfix
2020-04-08 21:54:00 +08:00
Zexi Li
367e92858f Merge pull request #5736 from swordqiu/automated-cherry-pick-of-#5733-upstream-release-3.1
Automated cherry pick of #5733: fix: idp log connected/disconnected event
2020-04-08 21:51:48 +08:00
Qiu Jian
251639353d fix: idp log connected/disconnected event 2020-04-08 21:27:04 +08:00
tangbin
e8ef3ab74e huawei&qcloud&huawei elb bugfix 2020-04-08 20:12:28 +08:00
Zexi Li
6e8a97b995 Merge pull request #5725 from yousong/automated-cherry-pick-of-#5724-upstream-release-3.1
Automated cherry pick of #5724: lbagents: deploy: deploy public type auth_url
2020-04-08 19:45:34 +08:00
Yousong Zhou
721b80e2fe climc: networks: remove stale dns related commands 2020-04-08 18:09:49 +08:00
Yousong Zhou
3d705eee3f climc: fix router-route-xx command description 2020-04-08 18:09:49 +08:00
Yousong Zhou
799b7eacb7 climc: add command proxysetting-test 2020-04-08 18:09:49 +08:00
Yousong Zhou
7f9bb72ce3 proxysetting: add test api 2020-04-08 18:09:48 +08:00
Yousong Zhou
860030929d apis: proxy: fix sanitizing empty proxy string 2020-04-08 18:09:48 +08:00
Yousong Zhou
1914e2b054 climc: proxysetting-update: fix update option 2020-04-08 18:09:48 +08:00
Yousong Zhou
fdfe3bb374 db_dispatcher: default action log for create & update 2020-04-08 18:09:48 +08:00
Yousong Zhou
b1c84895e5 lbagents: deploy: deploy public type auth_url 2020-04-08 18:09:48 +08:00
Zexi Li
e8ce6da148 Merge pull request #5717 from swordqiu/automated-cherry-pick-of-#5714-upstream-release-3.1
Automated cherry pick of #5714: fix: decouple getUserInfo at apigateway from capabilities call
2020-04-08 02:26:23 +08:00
Qiu Jian
b29d752647 fix: decouple getUserInfo at apigateway from capabilities call 2020-04-08 00:06:00 +08:00
Zexi Li
ddda51d272 Merge pull request #5699 from swordqiu/automated-cherry-pick-of-#5698-upstream-release-3.1
Automated cherry pick of #5698: fix: service config changes not effective
2020-04-07 10:38:30 +08:00
Zexi Li
1574970148 Merge pull request #5705 from wanyaoqi/automated-cherry-pick-of-#5704-upstream-release-3.1
Automated cherry pick of #5704: fix migrate cache cdrom
2020-04-07 10:37:20 +08:00
wanyaoqi
f96e632384 fix migrate cache cdrom 2020-04-06 23:17:15 +08:00
Qiu Jian
41bf5a1c17 fix: service config changes not effective 2020-04-06 16:09:00 +08:00
Zexi Li
1f645f550a Merge pull request #5693 from rainzm/automated-cherry-pick-of-#5691-upstream-release-3.1
Automated cherry pick of #5691: fix(esxi): Fix some question of CheckAndSetCacheImage.
2020-04-05 13:53:32 +08:00
Zexi Li
72bf32b8db Merge pull request #5697 from swordqiu/automated-cherry-pick-of-#5694-upstream-release-3.1
Automated cherry pick of #5694: fix: misc bugs in usage data
2020-04-05 13:52:32 +08:00
Qiu Jian
93e7780d1d fix: misc bugs in usage data 2020-04-05 08:06:42 +08:00
Rain
3ad7ac7e18 fix(esxi): Fix some question of CheckAndSetCacheImage.
1. If there is storagecachedimage in this host's storagecache, use is
instead of another host's one.
2. SrcStorage should be found from srcHost instead host.
2020-04-04 21:54:14 +08:00
Zexi Li
888c527fa9 Merge pull request #5687 from ioito/automated-cherry-pick-of-#5686-upstream-release-3.1
Automated cherry pick of #5686: fix: 修复重装系统时未能更换指定image问题
2020-04-03 19:43:23 +08:00
Zexi Li
f577998f60 Merge pull request #5672 from ioito/automated-cherry-pick-of-#5671-upstream-release-3.1
Automated cherry pick of #5671: fix: 华为云rds使用自身的存储类型
2020-04-03 19:41:39 +08:00
Zexi Li
57fe0a05af Merge pull request #5683 from ioito/automated-cherry-pick-of-#5682-upstream-release-3.1
Automated cherry pick of #5682: fix: typo
2020-04-03 11:35:53 +08:00
Qu Xuan
dcfe21a5ee fix: 修复重装系统时未能更换指定image问题 2020-04-03 11:35:29 +08:00
Qu Xuan
0c3fe7e440 fix: typo 2020-04-02 20:23:15 +08:00
yunion-ci-robot
1452c4d817 Merge pull request #5681 from yousong/bugfix/yousong-cloudaccount-ps-3.1
[3.1] cloudaccounts: update: make proxy_setting optional
2020-04-02 19:25:49 +08:00
Zexi Li
d9c7f08c74 Merge pull request #5677 from wanyaoqi/automated-cherry-pick-of-#5676-upstream-release-3.1
Automated cherry pick of #5676: host do not set hostname
2020-04-02 19:07:21 +08:00
yunion-ci-robot
f33b779c24 Merge pull request #5680 from ioito/automated-cherry-pick-of-#5679-upstream-release-3.1
Automated cherry pick of #5679: fix: typo
2020-04-02 18:54:51 +08:00
yunion-ci-robot
05405def86 Merge pull request #5668 from ioito/automated-cherry-pick-of-#5667-upstream-release-3.1
Automated cherry pick of #5667: fix: 修复更新qcloud sdk引出的不兼容问题
2020-04-02 18:51:50 +08:00
Yousong Zhou
644d1a0056 cloudaccounts: update: make proxy_setting optional 2020-04-02 18:41:10 +08:00
Qu Xuan
5b50b77c13 fix: typo 2020-04-02 18:26:40 +08:00
wanyaoqi
9a836d37b5 host do not set hostname 2020-04-02 18:11:40 +08:00
yunion-ci-robot
cc8ca3656d Merge pull request #5670 from zexi/automated-cherry-pick-of-#5669-upstream-release-3.1
Automated cherry pick of #5669: climc: k8s remove registrysecret create command
2020-04-02 18:09:49 +08:00
Qu Xuan
6a7e1ccaf4 fix: 华为云rds使用自身的存储类型 2020-04-02 17:29:42 +08:00
Zexi Li
2423107c23 climc: k8s remove registrysecret create command 2020-04-02 16:31:18 +08:00
Qu Xuan
f80a0c2a2e fix: 修复更新qcloud sdk引出的不兼容问题 2020-04-02 15:56:51 +08:00
Zexi Li
5c38e6935e Merge pull request #5639 from tb365/automated-cherry-pick-of-#5631-upstream-release-3.1
Automated cherry pick of #5631: elb bugfix
2020-04-02 12:47:42 +08:00
Zexi Li
908c7c2d81 Merge pull request #5664 from swordqiu/automated-cherry-pick-of-#5662-upstream-release-3.1
Automated cherry pick of #5662: fix: disk/nics usage should exclude those pending_deleted
2020-04-02 12:45:43 +08:00
Zexi Li
fd8ee54deb Merge pull request #5657 from yousong/automated-cherry-pick-of-#5652-upstream-release-3.1
Automated cherry pick of #5652: proxysetting: forbid deletion of DIRECT setting
2020-04-02 12:44:05 +08:00
Zexi Li
1b98d99905 Merge pull request #5660 from wanyaoqi/automated-cherry-pick-of-#5659-upstream-release-3.1
Automated cherry pick of #5659: host session use internal endpoint
2020-04-02 12:43:16 +08:00
Qiu Jian
f423eb9011 fix: disk/nics usage should exclude those pending_deleted 2020-04-02 01:53:14 +08:00
tangbin
0ee58ec243 elb bugfix 2020-04-01 20:30:48 +08:00
wanyaoqi
a3318a87c0 host session use internal endpoint 2020-04-01 20:00:59 +08:00
Zexi Li
40bc2e3ae1 Merge pull request #5656 from swordqiu/automated-cherry-pick-of-#5653-upstream-release-3.1
Automated cherry pick of #5653: fix: allow list cloudprovider by default
2020-04-01 18:14:00 +08:00
Yousong Zhou
ef7674af30 proxysetting: validate create/update data 2020-04-01 18:13:00 +08:00
Yousong Zhou
fa8e8e555e apis: proxy: add input validation 2020-04-01 18:13:00 +08:00
Zexi Li
2e167d8599 Merge pull request #5649 from swordqiu/automated-cherry-pick-of-#5648-upstream-release-3.1
Automated cherry pick of #5648: fix: cancel pending usage might not need to update usage
2020-04-01 18:11:08 +08:00
Yousong Zhou
19f4328ed1 cloudaccount: provide proxysetting details 2020-04-01 18:07:48 +08:00
Qiu Jian
62d009f2f8 fix: allow list cloudprovider by default 2020-04-01 17:48:12 +08:00
Yousong Zhou
2718d7bf4e proxysetting: forbid deletion of DIRECT setting 2020-04-01 17:16:13 +08:00
Qiu Jian
007566c4b5 fix: cancel pending usage might not need to update usage 2020-04-01 16:43:49 +08:00
Zexi Li
5bcc2a4298 Merge pull request #5647 from ioito/automated-cherry-pick-of-#5646-upstream-release-3.1
Automated cherry pick of #5646: 修复: 默认存在的bucket状态为ready
2020-04-01 16:41:30 +08:00
Qu Xuan
3913a71f5c 修复: 默认存在的bucket状态为ready 2020-04-01 15:18:58 +08:00
Zexi Li
f4fb2b55a2 Merge pull request #5645 from zexi/automated-cherry-pick-of-#5644-upstream-release-3.1
Automated cherry pick of #5644: monitor: add paused api
2020-04-01 13:45:43 +08:00
Zexi Li
071f919d1e monitor: add paused api 2020-04-01 13:42:59 +08:00
Zexi Li
59309efd8c Merge pull request #5638 from yousong/feature/yousong-multicloud-proxyfunc-3.1
Feature/yousong multicloud proxyfunc 3.1
2020-04-01 10:24:35 +08:00
Zexi Li
7a64637e14 Merge pull request #5641 from swordqiu/automated-cherry-pick-of-#5640-upstream-release-3.1
Automated cherry pick of #5640: fix: changes to request_work_count cause apigateway restart
2020-04-01 10:23:25 +08:00
Qiu Jian
f4baf1761a fix: changes to request_work_count cause apigateway restart 2020-04-01 10:19:33 +08:00
Yousong Zhou
f8dc741763 cloudcommon: proxysetting: make it domainized 2020-03-31 18:59:27 +08:00
Zexi Li
1739d4f805 Merge pull request #5633 from zexi/automated-cherry-pick-of-#5632-upstream-release-3.1
Automated cherry pick of #5632: monitor: support support extra params in alertnotification joint object
2020-03-31 18:36:10 +08:00
Zexi Li
c681805629 monitor: support support extra params in alertnotification joint object 2020-03-31 17:58:13 +08:00
Zexi Li
2f4e7d585e Merge pull request #5630 from zexi/automated-cherry-pick-of-#5629-upstream-release-3.1
Automated cherry pick of #5629: monitor: add alert config helper
2020-03-31 16:45:32 +08:00
Zexi Li
d3c3a201b8 monitor: add alert config helper 2020-03-31 16:43:04 +08:00
Zexi Li
9933db70a3 Merge pull request #5625 from wanyaoqi/automated-cherry-pick-of-#5624-upstream-release-3.1
Automated cherry pick of #5624: - add check disk is enable delete - vm enable detach network on running state - add menu on boot from iso - misc fix
2020-03-31 16:24:51 +08:00
yunion-ci-robot
624acc21f9 Merge pull request #5626 from swordqiu/automated-cherry-pick-of-#5623-upstream-release-3.1
Automated cherry pick of #5623: fix: worker may block by worker_chan
2020-03-31 10:03:44 +08:00
Qiu Jian
f361618f06 fix: worker may block by worker_chan 2020-03-31 09:51:33 +08:00
wanyaoqi
790f9fc1a3 vm online detach network 2020-03-30 21:30:44 +08:00
wanyaoqi
e86909c43a - add check disk is enable delete - vm enable detach network on running state - add menu on boot from iso - misc fix 2020-03-30 21:30:44 +08:00
Zexi Li
9085ee9775 Merge pull request #5620 from swordqiu/automated-cherry-pick-of-#5616-upstream-release-3.1
Automated cherry pick of #5616: fix: increase apigateway default worker count to 32
2020-03-30 19:22:44 +08:00
Qiu Jian
34c7a31106 fix: increase apigateway default worker count to 32 2020-03-30 19:08:11 +08:00
yunion-ci-robot
52bbe4d74e Merge pull request #5618 from zexi/automated-cherry-pick-of-#5617-upstream-release-3.1
Automated cherry pick of #5617: action: add region dns image
2020-03-30 15:10:44 +08:00
Zexi Li
2190de3e77 action: add region dns image 2020-03-30 15:05:55 +08:00
Zexi Li
d58e8f3b67 Merge pull request #5607 from yousong/automated-cherry-pick-of-#5606-upstream-release-3.1
Automated cherry pick of #5606: region: lbagent: move systemd service unit file to system dir
2020-03-28 10:29:33 +08:00
yunion-ci-robot
a431d7ca20 Merge pull request #5612 from swordqiu/automated-cherry-pick-of-#5608-upstream-release-3.1
Automated cherry pick of #5608: fix: allow list loadbalancer cluster by default
2020-03-28 09:47:41 +08:00
Qiu Jian
8fed2fc64b fix: allow list loadbalancer cluster by default 2020-03-28 09:05:28 +08:00
Yousong Zhou
68900b3fab region: lbagent: move systemd service unit file to system dir 2020-03-27 15:32:11 +08:00
Zexi Li
4ddb4e14a5 Merge pull request #5602 from ioito/automated-cherry-pick-of-#5601-upstream-release-3.1
Automated cherry pick of #5601: fix: 修正gcp不支持预付费资源
2020-03-26 20:33:08 +08:00
Qu Xuan
1c9a926247 fix: 修正gcp不支持预付费资源 2020-03-26 20:01:37 +08:00
Zexi Li
0ac45d9ff7 Merge pull request #5591 from yousong/feature/yousong-backport-proxyfunc
Feature/yousong backport proxyfunc
2020-03-26 10:41:11 +08:00
Yousong Zhou
45a4848808 climc: add cloud-account-update-google 2020-03-25 17:34:16 +08:00
Yousong Zhou
0fb6de4d80 cloudaccounts: fix checking update data 2020-03-25 17:34:16 +08:00
Yousong Zhou
1bcd3dcab6 mcclient: cloudaccounts: allow updating proxysetting 2020-03-25 17:34:16 +08:00
Yousong Zhou
291230694d mcclient: add proxysettings manager 2020-03-25 17:33:24 +08:00
Yousong Zhou
140ac46e67 cloudevent: use cloudprovider proxysetting 2020-03-25 17:33:24 +08:00
Yousong Zhou
0e5f5221f0 region: refer to proxySetting 2020-03-25 17:33:24 +08:00
Yousong Zhou
5813d64a7d cloudcommon: proxysetting: referrerMen 2020-03-25 17:33:24 +08:00
Yousong Zhou
6444825331 cloudevent: add proxy.ProxySettingManager 2020-03-25 17:33:24 +08:00
Yousong Zhou
adfad567f6 s3gateway: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
cf7c63be3f region: add cloudaccount.ProxySettingId 2020-03-25 17:33:24 +08:00
Yousong Zhou
1d78192a36 cloudprovider: add TestProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
462b832e1a objectstore: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
06fad05278 objectstore: use ObjectStoreClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
1695947221 esxi: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
4c40e3bf40 esxi: use ESXiClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
4f270a3ff0 openstack: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
6a7382f5be mcclient: add SetHttpTransportProxyFunc() 2020-03-25 17:33:24 +08:00
Yousong Zhou
a7cff31e3c openstack: use OpenstackClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
874699a1d7 zstack: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
c3c5b0b156 zstack: use ZstackClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
22bc479420 zstack: remove sessionID field 2020-03-25 17:33:24 +08:00
Yousong Zhou
64387f83d8 ucloud: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
b4438122f9 ucloud: use UcloudClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
11ee270911 qcloud: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
70b78835d3 qcloud: use QcloudClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
0faa2bfb9c vendor: update github.com/tencentcloud/tencentcloud-sdk-go 2020-03-25 17:33:24 +08:00
Yousong Zhou
991b3bb5cf huawei: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
608a18eed4 huawei: client: add SBaseManager.SetHttpClient() 2020-03-25 17:33:24 +08:00
Yousong Zhou
292ca54153 huawei: use HuaweiClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
a157596973 azure: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
23bc582407 azure: use AzureClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
cfe5b990f9 aws: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
58f6f37891 aws: use AwsClientConfig 2020-03-25 17:33:24 +08:00
Yousong Zhou
5ab5fbdf92 ctyun: use cpcfg.ProxyFunc 2020-03-25 17:33:24 +08:00
Yousong Zhou
374d15b701 ctyun: use CtyunClientConfig 2020-03-25 17:33:23 +08:00
Yousong Zhou
e57dcee3e4 google: use cpcfg.ProxyFunc 2020-03-25 17:33:23 +08:00
Yousong Zhou
01ca954399 google: use GoogleClientConfig 2020-03-25 17:33:23 +08:00
Yousong Zhou
7da2fa556c aliyun: use cpcfg.ProxyFunc 2020-03-25 17:17:29 +08:00
Yousong Zhou
4c50f40771 aliyun clientcfg 2020-03-25 17:17:29 +08:00
Yousong Zhou
85a9d51e58 httputils: add SetClientProxyFunc(client, proxyFunc) 2020-03-25 17:17:29 +08:00
Yousong Zhou
8009857c8a cloudprovider: use ProviderConfig 2020-03-25 17:16:35 +08:00
Yousong Zhou
e2826b1338 cloudcommon: add ProxySetting 2020-03-25 17:15:47 +08:00
Zexi Li
7e88a79a8d Merge pull request #5582 from yousong/automated-cherry-pick-of-#5581-upstream-release-3.1
Automated cherry pick of #5581: webconsole: typo fix accessable -> accessible
2020-03-23 21:14:18 +08:00
Yousong Zhou
51f0ff4d9c httperrors: fix passing "params" argument 2020-03-23 16:41:13 +08:00
Yousong Zhou
bd922dfe14 webconsole: typo fix accessable -> accessible 2020-03-23 16:41:13 +08:00
Zexi Li
096ce97503 Merge pull request #5578 from zexi/automated-cherry-pick-of-#5577-upstream-release-3.1
Automated cherry pick of #5577: climc: k8s storageclass support
2020-03-23 10:53:03 +08:00
Zexi Li
336b8fa6f9 Merge pull request #5570 from yousong/automated-cherry-pick-of-#5569-upstream-release-3.1
Automated cherry pick of #5569: build: cache-aware docker-xxx-build
2020-03-23 10:52:32 +08:00
Zexi Li
499be25fc0 climc: k8s storageclass support 2020-03-23 10:52:07 +08:00
Zexi Li
4ec48d5a66 Merge pull request #5568 from tb365/automated-cherry-pick-of-#5567-upstream-release-3.1
Automated cherry pick of #5567: ctyun bugfix
2020-03-20 19:39:58 +08:00
Zexi Li
b7861f5341 Merge pull request #5572 from wanyaoqi/automated-cherry-pick-of-#5571-upstream-release-3.1
Automated cherry pick of #5571: guest add metadata cpu mode
2020-03-20 19:39:27 +08:00
wanyaoqi
c2a82bd9cd guest add metadata cpu mode
- live migrate if guest cpu mode is qemu, do not check host cpu mode
- disk name generation replace '_' to '-'
2020-03-20 15:10:47 +08:00
Yousong Zhou
ee8b23bdc7 scripts: remove host_find_libraries.sh
Not needed after we switch to using native alpine image
2020-03-20 14:44:51 +08:00
Yousong Zhou
1b3979fb97 build: cache-aware docker-xxx-build 2020-03-20 14:44:51 +08:00
tangbin
26ac56c1a6 ctyun bugfix 2020-03-20 10:30:48 +08:00
Zexi Li
1833456c45 Merge pull request #5556 from rainzm/automated-cherry-pick-of-#5555-upstream-release-3.1
Automated cherry pick of #5555: feat(notify): Compatibility and repair
2020-03-19 10:05:59 +08:00
yunion-ci-robot
50dc428692 Merge pull request #5491 from ioito/automated-cherry-pick-of-#5490-upstream-release-3.1
Automated cherry pick of #5490: fix: class action 统一使用keywords包裹
2020-03-19 08:48:20 +08:00
Rain
d403d6d62f feat(notify): Compatibility and repair 2020-03-18 20:54:18 +08:00
Zexi Li
8fca2c7c8f Merge pull request #5546 from swordqiu/automated-cherry-pick-of-#5545-upstream-release-3.1
Automated cherry pick of #5545: fix: policy fetcher not retry after initial failure
2020-03-18 10:53:12 +08:00
Qu Xuan
5dac5a465b fix: class action 统一使用keywords包裹 2020-03-17 18:44:10 +08:00
Qiu Jian
f3c9ad15da fix: policy fetcher not retry after initial failure 2020-03-17 18:30:29 +08:00
Zexi Li
12040bd5aa Merge pull request #5544 from ioito/automated-cherry-pick-of-#5543-upstream-release-3.1
Automated cherry pick of #5543: fix: 避免dbinstance_sku.get 异常
2020-03-17 17:20:08 +08:00
Qu Xuan
6367d20757 fix: 避免dbinstance_sku.get 异常 2020-03-17 17:04:13 +08:00
Zexi Li
4dbbb2b1b5 Merge pull request #5542 from zexi/automated-cherry-pick-of-#5541-upstream-release-3.1
Automated cherry pick of #5541: monitor: fix meteralert update status
2020-03-17 14:59:32 +08:00
Zexi Li
7a756c5766 monitor: fix meteralert update status 2020-03-17 15:00:45 +08:00
Zexi Li
ce7212a798 Merge pull request #5507 from swordqiu/automated-cherry-pick-of-#5506-upstream-release-3.1
Automated cherry pick of #5506: fix: recode cloudprovider usable filter
2020-03-17 11:39:47 +08:00
yunion-ci-robot
e0c6ea920d Merge pull request #5530 from ioito/automated-cherry-pick-of-#5529-upstream-release-3.1
Automated cherry pick of #5529: fix: 避免重装系统失败后imageId依然发生改变
2020-03-17 08:22:14 +08:00
yunion-ci-robot
892b769d3a Merge pull request #5537 from ioito/automated-cherry-pick-of-#5536-upstream-release-3.1
Automated cherry pick of #5536: fix: 修复谷歌云 cloud-provider-clirc 显示错误问题
2020-03-17 08:13:14 +08:00
Qu Xuan
0f31a7d479 fix: 修复谷歌云 cloud-provider-clirc 显示错误问题 2020-03-16 20:09:43 +08:00
yunion-ci-robot
cafc8dedc7 Merge pull request #5524 from ioito/automated-cherry-pick-of-#5452-upstream-release-3.1
Automated cherry pick of #5452: fix: 优化rds sku同步逻辑
2020-03-16 15:25:14 +08:00
Zexi Li
5f168a76af Merge pull request #5518 from swordqiu/automated-cherry-pick-of-#5517-upstream-release-3.1
Automated cherry pick of #5517: fix: storage details missing capacity fields since 3.1
2020-03-16 13:00:59 +08:00
Zexi Li
985b56353b Merge pull request #5500 from zhaoxiangchun/automated-cherry-pick-of-#5496-upstream-release-3.1
Automated cherry pick of #5496: vmware 宿主机监控信息获取
2020-03-16 12:57:33 +08:00
Qu Xuan
0570476c5c fix: 避免重装系统失败后imageId依然发生改变 2020-03-16 11:29:44 +08:00
Qu Xuan
2d641b4e30 fix: 优化rds sku同步逻辑 2020-03-16 10:33:38 +08:00
yunion-ci-robot
3bc58d2c8e Merge pull request #5520 from ioito/automated-cherry-pick-of-#5519-upstream-release-3.1
Automated cherry pick of #5519: fix: 避免未传递prority参数导致校验未通过
2020-03-16 09:09:13 +08:00
Qu Xuan
4b472cfd30 fix: 避免未传递prority参数导致校验未通过 2020-03-15 13:12:44 +08:00
Qiu Jian
04e79b5140 fix: storage details missing capacity fields since 3.1 2020-03-14 22:02:29 +08:00
yunion-ci-robot
7435c8bc29 Merge pull request #5515 from zexi/automated-cherry-pick-of-#5511-upstream-release-3.1
Automated cherry pick of #5511: scheduler: fix disk allocated not balanced
2020-03-14 17:50:05 +08:00
Zexi Li
8031105ea2 scheduler: fix disk allocated not balanced 2020-03-14 16:51:45 +08:00
Qiu Jian
d7fd2b7d8c fix: recode cloudprovider usable filter 2020-03-14 09:04:32 +08:00
Zexi Li
2f50aae082 Merge pull request #5502 from zexi/automated-cherry-pick-of-#5501-upstream-release-3.1
Automated cherry pick of #5501: auth: check isAuthed if nil
2020-03-13 19:18:18 +08:00
Zexi Li
4ec8b1f523 auth: check isAuthed if nil 2020-03-13 19:19:11 +08:00
zhaoxiangchun
2c97fdaf46 vmware 宿主机监控信息获取 2020-03-13 17:23:35 +08:00
yunion-ci-robot
ed06f6ed84 Merge pull request #5475 from rainzm/automated-cherry-pick-of-#5454-upstream-release-3.1
Automated cherry pick of #5454: fix(glance): Structured subimage info and add 'created_at' field
2020-03-13 15:44:02 +08:00
yunion-ci-robot
6e29509da4 Merge pull request #5486 from wanyaoqi/automated-cherry-pick-of-#5484-upstream-release-3.1
Automated cherry pick of #5484: download handler set no timeout
2020-03-13 14:33:02 +08:00
wanyaoqi
9a3df26dc1 download handler set no timeout 2020-03-13 11:40:18 +08:00
Zexi Li
9b335e2afa Merge pull request #5485 from rainzm/automated-cherry-pick-of-#5479-upstream-release-3.1
Automated cherry pick of #5479: fix(scheduler): Candidater's CloudProvider maybe nil
2020-03-13 11:28:05 +08:00
Rain
8ebb409ef3 fix(scheduler): Candidater's CloudProvider maybe nil
Candidater(Host) in Provider Onecloud doesn't have CloudProvider.
2020-03-13 11:26:42 +08:00
Zexi Li
61757b8e8a Merge pull request #5481 from rainzm/automated-cherry-pick-of-#5480-upstream-release-3.1
Automated cherry pick of #5480: fix(esxi): VlanID '1' is default value
2020-03-13 11:11:18 +08:00
Zexi Li
67b8fa74f3 Merge pull request #5474 from zhaoxiangchun/automated-cherry-pick-of-#5472-upstream-release-3.1
Automated cherry pick of #5472: 修复meteralartbug
2020-03-13 00:44:21 +08:00
Rain
bc72a0c172 fix(esxi): VlanID '1' is default value 2020-03-12 20:58:36 +08:00
yunion-ci-robot
49d73df622 Merge pull request #5469 from zexi/automated-cherry-pick-of-#5458-upstream-release-3.1
Automated cherry pick of #5458: region: baremetal convert host join as k8s node
2020-03-12 20:51:15 +08:00
Rain
a9c1a9c5a4 fix(glance): Structured subimage info and add 'created_at' field 2020-03-12 19:27:10 +08:00
yunion-ci-robot
653eaf019e Merge pull request #5471 from wanyaoqi/automated-cherry-pick-of-#5470-upstream-release-3.1
Automated cherry pick of #5470: region misc fix
2020-03-12 17:34:15 +08:00
zhaoxiangchun
df443d9593 修复meteralartbug
1.设置消费日提醒时,提示名称重复。
2.查询信息时MeterAlertDetails的一些字段没有回显。
2020-03-12 17:29:27 +08:00
wanyaoqi
51216bdc80 region misc fix 2020-03-12 16:49:22 +08:00
Zexi Li
3c7917425b region: baremetal convert host join as k8s node 2020-03-12 16:32:20 +08:00
Zexi Li
0dd7604d6a Merge pull request #5462 from bistuzx/automated-cherry-pick-of-#5459-upstream-release-3.1
Automated cherry pick of #5459: add bucket connection test
2020-03-12 16:20:31 +08:00
张旭
eb72141e52 change climc bucket options import 2020-03-12 12:27:08 +08:00
张旭
235aba14f4 add bucket connection test 2020-03-12 12:27:08 +08:00
Zexi Li
e81dc6c36d Merge pull request #5466 from rainzm/feat/vendor_3.1
feat: Update Vendor for release/3.1
2020-03-12 12:07:26 +08:00
Rain
5edd07e805 feat: Update Vendor for release/3.1 2020-03-12 11:53:22 +08:00
yunion-ci-robot
7139672f63 Merge pull request #5446 from rainzm/automated-cherry-pick-of-#5444-upstream-release-3.1
Automated cherry pick of #5444: fix(esxi): UnitNumber 7 is unavailable for scsi controller
2020-03-12 02:51:02 +08:00
yunion-ci-robot
926cabd695 Merge pull request #5441 from rainzm/automated-cherry-pick-of-#5439-upstream-release-3.1
Automated cherry pick of #5439: fix(esxi): Fix bugs when using network with vlanID
2020-03-12 02:46:02 +08:00
yunion-ci-robot
e28cb2edcc Merge pull request #5456 from wanyaoqi/automated-cherry-pick-of-#5455-upstream-release-3.1
Automated cherry pick of #5455: fix structure host storage output: storagecache_id
2020-03-12 02:45:01 +08:00
wanyaoqi
bf9c9251f9 fix structure host storage output: storagecache_id 2020-03-11 18:09:02 +08:00
Rain
6b6c965299 fix(esxi): UnitNumber 7 is unavailable for scsi controller
By default, the virtual SCSI controller is assigned to virtual device node (z:7),
so that device node is unavailable for hard disks or other devices.
https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.vm_admin.doc/GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362.html
2020-03-11 15:19:16 +08:00
Rain
bdb9929628 fix(esxi): Fix bugs when using network with vlanID 2020-03-11 11:03:15 +08:00
1939 changed files with 247698 additions and 177143 deletions

View File

@@ -39,7 +39,7 @@ jobs:
make cmd/cloudevent cmd/devtool
make cmd/*cli
make cmd/esxi-agent
make docker-alpine-build F='-j4 cmd/host cmd/vpcagent'
make docker-alpine-build F='-j4 cmd/host cmd/vpcagent cmd/region-dns'
- name: Image baremetal-agent
uses: elgohr/Publish-Docker-Github-Action@master
@@ -220,3 +220,13 @@ jobs:
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.devtool
- name: Image region DNS
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/region-dns
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.region-dns

View File

@@ -211,6 +211,7 @@ docker-centos-build:
--name onecloud-ci-build \
--rm \
--volume $(CURDIR):/root/onecloud \
--volume $(CURDIR)/_output/_cache:/root/.cache \
registry.cn-beijing.aliyuncs.com/yunionio/centos-build:$(DOCKER_BUILD_IMAGE_VERSION) \
/bin/bash -c "$$dockerCentOSBuildCmd"
chown -R $$(id -u):$$(id -g) _output
@@ -241,6 +242,7 @@ docker-alpine-build:
--name onecloud-docker-alpine-build \
-v $(CURDIR):/root/go/src/yunion.io/x/onecloud \
-v $(CURDIR)/_output/alpine-build:/root/go/src/yunion.io/x/onecloud/_output \
-v $(CURDIR)/_output/alpine-build/_cache:/root/.cache \
registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-1 \
/bin/sh -c "$$dockerAlpineBuildCmd"
ls -lh _output/alpine-build/bin

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/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,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
FROM alpine:3.11.3
ADD ./_output/bin/region-dns /opt/yunion/bin/region-dns
RUN mkdir -p /opt/yunion/bin
ADD ./_output/alpine-build/bin/region-dns /opt/yunion/bin/region-dns

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

@@ -84,7 +84,11 @@ func newClient(options *BaseOptions) (*aliyun.SRegion, error) {
return nil, fmt.Errorf("Missing secret")
}
cli, err := aliyun.NewAliyunClient("", "", options.AccessKey, options.Secret, options.Debug)
cli, err := aliyun.NewAliyunClient(
aliyun.NewAliyunClientConfig(
options.AccessKey, options.Secret,
).Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -85,7 +85,13 @@ func newClient(options *BaseOptions) (*aws.SRegion, error) {
return nil, fmt.Errorf("Missing secret")
}
cli, err := aws.NewAwsClient("", "", options.AccessUrl, options.AccessKey, options.Secret, options.Debug)
cli, err := aws.NewAwsClient(
aws.NewAwsClientConfig(
options.AccessUrl,
options.AccessKey,
options.Secret,
).Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -100,11 +100,17 @@ func newClient(options *BaseOptions) (*azure.SRegion, error) {
return nil, fmt.Errorf("Missing Cloud Environment")
}
cli, err := azure.NewAzureClient("", "", options.CloudEnv,
options.DirectoryID,
options.ApplicationID, options.ApplicationKey,
options.SubscriptionID,
options.Debug)
cli, err := azure.NewAzureClient(
azure.NewAzureClientConfig(
options.CloudEnv,
options.DirectoryID,
options.ApplicationID,
options.ApplicationKey,
).
SubscriptionId(options.SubscriptionID).
Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -0,0 +1,46 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package shell
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type BucketOptionsVerifyOptions struct {
options.BaseListOptions
CloudaccountId string `help:"cloudaccount Id" required:"true"`
BillingReportBucket string `help:"S3 bucket that stores account billing report"`
BillingFilePrefix string `help:"prefix of billing file name"`
BillingBucketAccount string `help:"Id of cloudaccount that can access billing bucket"`
UsageReportBucket string `help:"S3 bucket that stores account usage report"`
UsageFilePrefix string `help:"prefix of usage file name"`
UsageBucketAccount string `help:"Id of cloudaccount that can access usage bucket"`
}
R(&BucketOptionsVerifyOptions{}, "bucket-options-verify", "billing bucket connection test",
func(s *mcclient.ClientSession, args *BucketOptionsVerifyOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.BucketOptions.PerformAction(s, args.CloudaccountId, "verify", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -26,6 +26,28 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func parseGcpCredential(filename string) (jsonutils.JSONObject, error) {
data, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
authParams, err := jsonutils.Parse(data)
if err != nil {
return nil, err
}
ret := jsonutils.NewDict()
for _, k := range []string{
"client_email",
"project_id",
"private_key_id",
"private_key",
} {
v, _ := authParams.Get(k)
ret.Add(v, fmt.Sprintf("gcp_%s", k))
}
return ret, nil
}
func init() {
type CloudaccountListOptions struct {
@@ -138,11 +160,7 @@ func init() {
R(&options.SGoogleCloudAccountCreateOptions{}, "cloud-account-create-google", "Create a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountCreateOptions) error {
params := jsonutils.Marshal(args)
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("Google"), "provider")
data, err := ioutil.ReadFile(args.GoogleJsonFile)
if err != nil {
return err
}
authParams, err := jsonutils.Parse(data)
authParams, err := parseGcpCredential(args.GoogleJsonFile)
if err != nil {
return err
}
@@ -381,6 +399,19 @@ func init() {
return nil
})
R(&options.SGoogleCloudAccountUpdateOptions{}, "cloud-account-update-google", "update a google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
if params.Size() == 0 {
return InvalidUpdateError()
}
result, err := modules.Cloudaccounts.Update(s, args.ID, params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SAWSCloudAccountUpdateOptions{}, "cloud-account-update-aws", "update an AWS cloud account", func(s *mcclient.ClientSession, args *options.SAWSCloudAccountUpdateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
@@ -422,7 +453,7 @@ func init() {
return nil
})
R(&options.SOpenStackCloudAccountUpdateOptions{}, "cloud-account-update-openstack", "update an AWS cloud account", func(s *mcclient.ClientSession, args *options.SOpenStackCloudAccountUpdateOptions) error {
R(&options.SOpenStackCloudAccountUpdateOptions{}, "cloud-account-update-openstack", "update an OpenStack cloud account", func(s *mcclient.ClientSession, args *options.SOpenStackCloudAccountUpdateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
if params.Size() == 0 {
return InvalidUpdateError()
@@ -675,11 +706,7 @@ func init() {
})
R(&options.SGoogleCloudAccountUpdateCredentialOptions{}, "cloud-account-update-credential-google", "Update credential of a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateCredentialOptions) error {
data, err := ioutil.ReadFile(args.GoogleJsonFile)
if err != nil {
return err
}
params, err := jsonutils.Parse(data)
params, err := parseGcpCredential(args.GoogleJsonFile)
if err != nil {
return err
}

View File

@@ -22,7 +22,7 @@ import (
)
func init() {
R(&options.RouteCreateOptions{}, "router-route-create", "Create router", func(s *mcclient.ClientSession, opts *options.RouteCreateOptions) error {
R(&options.RouteCreateOptions{}, "router-route-create", "Create router route", func(s *mcclient.ClientSession, opts *options.RouteCreateOptions) error {
params, err := base_options.StructToParams(opts)
if err != nil {
return err
@@ -34,7 +34,7 @@ func init() {
printObject(router)
return nil
})
R(&options.RouteGetOptions{}, "router-route-show", "Show router", func(s *mcclient.ClientSession, opts *options.RouteGetOptions) error {
R(&options.RouteGetOptions{}, "router-route-show", "Show router route", func(s *mcclient.ClientSession, opts *options.RouteGetOptions) error {
router, err := modules.Routes.Get(s, opts.ID, nil)
if err != nil {
return err
@@ -42,7 +42,7 @@ func init() {
printObject(router)
return nil
})
R(&options.RouteListOptions{}, "router-route-list", "List routers", func(s *mcclient.ClientSession, opts *options.RouteListOptions) error {
R(&options.RouteListOptions{}, "router-route-list", "List router routes", func(s *mcclient.ClientSession, opts *options.RouteListOptions) error {
params, err := base_options.ListStructToParams(opts)
if err != nil {
return err
@@ -54,7 +54,7 @@ func init() {
printList(result, modules.Routes.GetColumns(s))
return nil
})
R(&options.RouteUpdateOptions{}, "router-route-update", "Update router", func(s *mcclient.ClientSession, opts *options.RouteUpdateOptions) error {
R(&options.RouteUpdateOptions{}, "router-route-update", "Update router route", func(s *mcclient.ClientSession, opts *options.RouteUpdateOptions) error {
params, err := base_options.StructToParams(opts)
router, err := modules.Routes.Update(s, opts.ID, params)
if err != nil {
@@ -63,7 +63,7 @@ func init() {
printObject(router)
return nil
})
R(&options.RouteDeleteOptions{}, "router-route-delete", "Delete router", func(s *mcclient.ClientSession, opts *options.RouteDeleteOptions) error {
R(&options.RouteDeleteOptions{}, "router-route-delete", "Delete router route", func(s *mcclient.ClientSession, opts *options.RouteDeleteOptions) error {
router, err := modules.Routes.Delete(s, opts.ID, nil)
if err != nil {
return err

View File

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

View File

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

View File

@@ -205,4 +205,70 @@ func initKubeCluster() {
printObject(ret)
return nil
})
R(&o.IdentOptions{}, cmdN("components-status"), "Get cluster component status", func(s *mcclient.ClientSession, args *o.IdentOptions) error {
ret, err := k8s.KubeClusters.GetSpecific(s, args.ID, "components-status", nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.ClusterComponentTypeOptions{}, cmdN("component-setting"), "Get cluster component setting", func(s *mcclient.ClientSession, args *o.ClusterComponentTypeOptions) error {
q := jsonutils.NewDict()
q.Add(jsonutils.NewString(args.TYPE), "type")
ret, err := k8s.KubeClusters.GetSpecific(s, args.ID, "component-setting", q)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.ClusterEnableComponentCephCSIOpt{}, cmdN("component-enable-ceph-csi"), "Enable cluster component", func(s *mcclient.ClientSession, args *o.ClusterEnableComponentCephCSIOpt) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "enable-component", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.ClusterDisableComponent{}, cmdN("component-disable"), "Enable cluster component", func(s *mcclient.ClientSession, args *o.ClusterDisableComponent) error {
params := args.Params()
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "disable-component", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.ClusterDisableComponent{}, cmdN("component-delete"), "Delete cluster component", func(s *mcclient.ClientSession, args *o.ClusterDisableComponent) error {
params := args.Params()
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "delete-component", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&o.ClusterUpdateComponentCephCSIOpt{}, cmdN("component-update-ceph-csi"), "Update cluster component", func(s *mcclient.ClientSession, args *o.ClusterUpdateComponentCephCSIOpt) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.KubeClusters.PerformAction(s, args.ID, "update-component", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -0,0 +1,9 @@
package k8s
import (
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
)
func initEvent() {
initK8sNamespaceResource("event", k8s.Events)
}

View File

@@ -16,6 +16,11 @@ package k8s
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"github.com/ghodss/yaml"
"yunion.io/x/jsonutils"
@@ -57,7 +62,7 @@ func init() {
initPVC()
initJob()
initCronJob()
initEvent()
initRbac()
initApp()
@@ -217,6 +222,71 @@ func NewK8sNsResourceGetCmd(cmdN CmdNameFactory, manager modulebase.Manager) *Cm
)
}
func NewK8sNsResourceGetRawCmd(cmdN CmdNameFactory, manager k8s.IClusterResourceManager) *Cmd {
return NewCommand(
&o.NamespaceResourceGetOptions{},
cmdN.Do("show-raw"),
fmt.Sprintf("Show k8s %s raw data", cmdN.Kind),
func(s *mcclient.ClientSession, args *o.NamespaceResourceGetOptions) error {
ret, err := manager.GetRaw(s, args.NAME, args.Params())
if err != nil {
return err
}
printObjectYAML(ret)
return nil
},
)
}
func NewK8sResourceEditRawCmd(cmdN CmdNameFactory, manager k8s.IClusterResourceManager) *Cmd {
return NewCommand(
&o.NamespaceResourceGetOptions{},
cmdN.Do("edit-raw"),
fmt.Sprintf("Edit and update k8s %s raw data", cmdN.Kind),
func(s *mcclient.ClientSession, args *o.NamespaceResourceGetOptions) error {
rawData, err := manager.GetRaw(s, args.NAME, args.Params())
if err != nil {
return err
}
yamlBytes := rawData.YAMLString()
tempfile, err := ioutil.TempFile("", fmt.Sprintf("k8s-%s-%s*.yaml", cmdN.Kind, args.NAME))
if err != nil {
return err
}
defer os.Remove(tempfile.Name())
if _, err := tempfile.Write([]byte(yamlBytes)); err != nil {
return err
}
if err := tempfile.Close(); err != nil {
return err
}
cmd := exec.Command("vim", tempfile.Name())
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
return err
}
content, err := ioutil.ReadFile(tempfile.Name())
if err != nil {
return err
}
jsonBytes, err := yaml.YAMLToJSON(content)
if err != nil {
return err
}
body, err := jsonutils.Parse(jsonBytes)
if err != nil {
return err
}
if _, err := manager.UpdateRaw(s, args.NAME, args.Params(), body.(*jsonutils.JSONDict)); err != nil {
return err
}
return nil
},
)
}
func NewK8sResourceDeleteCmd(cmdN CmdNameFactory, manager modulebase.Manager) *Cmd {
return NewCommand(
&o.ResourceDeleteOptions{},
@@ -244,11 +314,13 @@ func NewK8sNsResourceDeleteCmd(cmdN CmdNameFactory, manager modulebase.Manager)
return deleteCmd
}
func initK8sNamespaceResource(kind string, manager modulebase.Manager) *ShellCommands {
func initK8sNamespaceResource(kind string, manager k8s.IClusterResourceManager) *ShellCommands {
cmdN := NewCmdNameFactory(kind)
return NewShellCommands(cmdN.Do).AddR(
NewK8sNsResourceListCmd(cmdN, manager),
NewK8sNsResourceGetCmd(cmdN, manager),
NewK8sNsResourceDeleteCmd(cmdN, manager),
NewK8sNsResourceGetRawCmd(cmdN, manager),
NewK8sResourceEditRawCmd(cmdN, manager),
)
}

View File

@@ -40,22 +40,40 @@ func initSecret() {
})
secretCmd.AddR(listCmd)
registryCmd := initK8sNamespaceResource("registrysecret", k8s.RegistrySecrets)
createCmd := NewCommand(
registryCmd := NewCmdNameFactory("secret-registry")
registryCreateCmd := NewCommand(
&o.RegistrySecretCreateOptions{},
registryCmd.CommandNameFactory("create"),
"Create docker registry secret resource",
registryCmd.Do("create"),
"Create docker registry secret secret",
func(s *mcclient.ClientSession, args *o.RegistrySecretCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.RegistrySecrets.Create(s, params)
ret, err := k8s.Secrets.Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
})
registryCmd.AddR(createCmd)
cephCSICmd := NewCmdNameFactory("secret-ceph-csi")
cephCSICreateCmd := NewCommand(
&o.CephCSISecretCreateOptions{},
cephCSICmd.Do("create"),
"Create ceph csi user secret",
func(s *mcclient.ClientSession, args *o.CephCSISecretCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.Secrets.Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
})
secretCmd.AddR(cephCSICreateCmd, registryCreateCmd)
}

View File

@@ -15,9 +15,70 @@
package k8s
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
o "yunion.io/x/onecloud/pkg/mcclient/options/k8s"
)
func initStorageClass() {
initK8sClusterResource("storageclass", k8s.Storageclass)
cmdN := NewCmdNameFactory("storageclass")
scCmd := initK8sClusterResource("storageclass", k8s.Storageclass)
setDefaultCmd := NewCommand(
&o.ClusterResourceBaseOptions{},
cmdN.Do("set-default"),
"Set storageclass as default",
func(s *mcclient.ClientSession, args *o.ClusterResourceBaseOptions) error {
ret, err := k8s.Storageclass.PerformAction(s, args.NAME, "set-default", args.Params())
if err != nil {
return err
}
printObject(ret)
return nil
},
)
scCmd.AddR(setDefaultCmd)
addStorageClassCephCSI(scCmd)
}
func addStorageClassCephCSI(cmd *ShellCommands) {
rbdN := NewCmdNameFactory("storageclass-ceph-csi-rbd")
rbdCreateCmd := NewCommand(
&o.StorageClassCephCSIRBDCreateOptions{},
rbdN.Do("create"),
"Create ceph csi rbd",
func(s *mcclient.ClientSession, args *o.StorageClassCephCSIRBDCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.Storageclass.Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
},
)
testConnCmd := NewCommand(
&o.StorageClassCephCSIRBDTestOptions{},
rbdN.Do("connection-test"),
"Test storageclass connection",
func(s *mcclient.ClientSession, args *o.StorageClassCephCSIRBDTestOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := k8s.Storageclass.PerformClassAction(s, "connection-test", params)
if err != nil {
return err
}
printObject(ret)
return nil
},
)
cmd.AddR(rbdCreateCmd, testConnCmd)
}

View File

@@ -15,6 +15,9 @@
package monitor
import (
"fmt"
monitorapi "yunion.io/x/onecloud/pkg/apis/monitor"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
@@ -36,6 +39,20 @@ func init() {
return nil
})
R(&options.AlertCreateOptions{}, aN("create"), "Create alert rule",
func(s *mcclient.ClientSession, args *options.AlertCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Alerts.DoCreate(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.AlertShowOptions{}, aN("show"), "Show details of a alert rule",
func(s *mcclient.ClientSession, args *options.AlertShowOptions) error {
ret, err := monitor.Alerts.Get(s, args.ID, nil)
@@ -66,4 +83,34 @@ func init() {
printBatchResults(ret, monitor.Alerts.GetColumns(s))
return nil
})
R(&options.AlertTestRunOptions{}, aN("test-run"), "Test run alert",
func(s *mcclient.ClientSession, args *options.AlertTestRunOptions) error {
data := new(monitorapi.AlertTestRunInput)
if args.Debug {
data.IsDebug = true
}
ret, err := monitor.Alerts.DoTestRun(s, args.ID, data)
if err != nil {
return err
}
fmt.Println(ret.JSON(ret).YAMLString())
return nil
})
R(&options.AlertPauseOptions{}, aN("pause"), "Pause or unpause alert",
func(s *mcclient.ClientSession, args *options.AlertPauseOptions) error {
data := new(monitorapi.AlertPauseInput)
if args.UnPause {
data.Paused = false
} else {
data.Paused = true
}
ret, err := monitor.Alerts.PerformAction(s, args.ID, "pause", data.JSON(data))
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -0,0 +1,60 @@
package monitor
import (
monitorapi "yunion.io/x/onecloud/pkg/apis/monitor"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
initAlertNotification()
}
func initAlertNotification() {
aN := cmdN("alert-notification")
R(&options.AlertNotificationListOptions{}, aN("list"), "List alert notification pairs",
func(s *mcclient.ClientSession, args *options.AlertNotificationListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
var result *modulebase.ListResult
if len(args.Alert) > 0 {
result, err = monitor.Alertnotification.ListDescendent(s, args.Alert, params)
} else if len(args.Notification) > 0 {
result, err = monitor.Alertnotification.ListDescendent2(s, args.Notification, params)
} else {
result, err = monitor.Alertnotification.List(s, params)
}
if err != nil {
return err
}
printList(result, monitor.Alertnotification.GetColumns(s))
return nil
})
R(&options.AlertNotificationAttachOptions{}, aN("attach"), "Attach a notification to a alert",
func(s *mcclient.ClientSession, args *options.AlertNotificationAttachOptions) error {
input := &monitorapi.AlertnotificationCreateInput{
UsedBy: args.UsedBy,
}
ret, err := monitor.Alertnotification.Attach(s, args.ALERT, args.NOTIFICATION, input.JSON(input))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.AlertNotificationAttachOptions{}, aN("detach"), "Detach a notification to a alert",
func(s *mcclient.ClientSession, args *options.AlertNotificationAttachOptions) error {
ret, err := monitor.Alertnotification.Detach(s, args.ALERT, args.NOTIFICATION, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -346,77 +346,6 @@ func init() {
return nil
})
type NetworkAddDnsUpdateTargetOptions struct {
ID string `help:"Network ID or name"`
DNS string `help:"DNS server address" metavar:"DNS_SERVER"`
KEY string `help:"DNS update key name" metavar:"DNS_UPDATE_KEY"`
SECRET string `help:"DNS update key secret" metavar:"DNS_UPDATE_SECRET"`
}
R(&NetworkAddDnsUpdateTargetOptions{}, "network-add-dns-update-target", "Add a dns update target to a network", func(s *mcclient.ClientSession, args *NetworkAddDnsUpdateTargetOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.DNS), "server")
params.Add(jsonutils.NewString(args.KEY), "key")
params.Add(jsonutils.NewString(args.SECRET), "secret")
result, err := modules.Networks.PerformAction(s, args.ID, "add-dns-update-target", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type NetworkRemoveDnsUpdateTargetOptions struct {
ID string `help:"Network ID or name"`
DNS string `help:"DNS server address" metavar:"DNS_SERVER"`
KEY string `help:"DNS update key name" metavar:"DNS_UPDATE_KEY"`
}
R(&NetworkRemoveDnsUpdateTargetOptions{}, "network-remove-dns-update-target", "Remove a dns update target from a network", func(s *mcclient.ClientSession, args *NetworkRemoveDnsUpdateTargetOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.DNS), "server")
params.Add(jsonutils.NewString(args.KEY), "key")
result, err := modules.Networks.PerformAction(s, args.ID, "remove-dns-update-target", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type NetworkSetDnsUpdateKeyOptions struct {
ID string `help:"ID of virtual network to update"`
KEY string `help:"Key name of secret" metavar:"KEYNAME"`
SECRET string `help:"Key secret"`
SERVER string `help:"Alternate DNS update server"`
}
R(&NetworkSetDnsUpdateKeyOptions{}, "network-set-dns-update-key", "Set DNS update key info for a virtual network", func(s *mcclient.ClientSession, args *NetworkSetDnsUpdateKeyOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.KEY), "dns_update_key_name")
params.Add(jsonutils.NewString(args.SECRET), "dns_update_key_secret")
params.Add(jsonutils.NewString(args.SERVER), "dns_update_server")
result, err := modules.Networks.PerformAction(s, args.ID, "metadata", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type NetworkRemoveDnsUpdateKeyOptions struct {
ID string `help:"ID of virtual network"`
}
R(&NetworkRemoveDnsUpdateKeyOptions{}, "network-remove-dns-update-key", "Set DNS update key info for a virtual network", func(s *mcclient.ClientSession, args *NetworkRemoveDnsUpdateKeyOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.JSONNull, "dns_update_key_name")
params.Add(jsonutils.JSONNull, "dns_update_key_secret")
params.Add(jsonutils.JSONNull, "dns_update_server")
result, err := modules.Networks.PerformAction(s, args.ID, "metadata", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type NetworkAddressOptions struct {
NETWORK string `help:"id or name of network to query"`
}

View File

@@ -41,7 +41,7 @@ func init() {
NotificationCreateOptions
}
R(&NotificationCreateSingleOptions{}, "notify", "Send a notification to someones", func(s *mcclient.ClientSession,
R(&NotificationCreateSingleOptions{}, "notify", "Send a notification to someone", func(s *mcclient.ClientSession,
args *NotificationCreateSingleOptions) error {
msg := notify.SNotifyMessage{}

View File

@@ -134,7 +134,7 @@ func init() {
return nil
}
R(&PolicyPatchOptions{}, "policy-patch", "Patch policy", updateFunc)
R(&PolicyPatchOptions{}, "policy-update", "Patch policy", updateFunc)
R(&PolicyPatchOptions{}, "policy-update", "Update policy", updateFunc)
type PolicyPerformOptions struct {
ID string `help:"ID of policy to update"`
@@ -285,12 +285,30 @@ func init() {
if err != nil {
log.Fatalf("Set log level %q: %v", "debug", err)
}
if args.Debug {
rbacutils.ShowMatchRuleDebug = true
}
auth.InitFromClientSession(s)
policy.EnableGlobalRbac(15*time.Second, 15*time.Second, false)
if args.Debug {
consts.EnableRbacDebug()
}
findPolicy := false
for !findPolicy {
all := policy.PolicyManager.AllPolicies()
for _, allP := range all {
if len(allP) > 0 {
findPolicy = true
break
}
}
if findPolicy {
break
}
time.Sleep(time.Second)
}
req := jsonutils.NewDict()
for i := 0; i < len(args.Request); i += 1 {
parts := strings.Split(args.Request[i], ":")
@@ -356,6 +374,7 @@ func init() {
Context: mcclient.SAuthContext{
Ip: args.Ip,
},
Token: "faketoken",
}
} else {
token = s.GetToken()
@@ -367,6 +386,10 @@ func init() {
}
printObject(result)
for _, r := range args.Role {
fmt.Println("role", r, "matched policies:", policy.PolicyManager.RoleMatchPolicies(r))
}
fmt.Println("userCred:", token)
for _, scope := range []rbacutils.TRbacScope{
rbacutils.ScopeSystem,
@@ -375,7 +398,7 @@ func init() {
rbacutils.ScopeUser,
rbacutils.ScopeNone,
} {
m := policy.PolicyManager.MatchedPolicies(scope, token)
m := policy.PolicyManager.MatchedPolicyNames(scope, token)
fmt.Println("matched", scope, "policies:", m)
}

View File

@@ -0,0 +1,81 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package shell
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
R(&options.ProxySettingCreateOptions{}, "proxysetting-create", "Create proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingCreateOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
proxysetting, err := modules.ProxySettings.Create(s, params)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingGetOptions{}, "proxysetting-show", "Show proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingGetOptions) error {
proxysetting, err := modules.ProxySettings.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingListOptions{}, "proxysetting-list", "List proxysettings", func(s *mcclient.ClientSession, opts *options.ProxySettingListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.ProxySettings.List(s, params)
if err != nil {
return err
}
printList(result, modules.ProxySettings.GetColumns(s))
return nil
})
R(&options.ProxySettingUpdateOptions{}, "proxysetting-update", "Update proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingUpdateOptions) error {
params, err := options.StructToParams(opts)
proxysetting, err := modules.ProxySettings.Update(s, opts.ID, params)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingDeleteOptions{}, "proxysetting-delete", "Delete proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingDeleteOptions) error {
proxysetting, err := modules.ProxySettings.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingTestOptions{}, "proxysetting-test", "Test proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingTestOptions) error {
proxysetting, err := modules.ProxySettings.PerformAction(s, opts.ID, "test", nil)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
}

View File

@@ -179,6 +179,19 @@ func init() {
},
)
R(&options.ServerCreateOptions{}, "server-check-create-data", "Check create server data", func(s *mcclient.ClientSession, opts *options.ServerCreateOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
server, err := modules.Servers.PerformClassAction(s, "check-create-data", params.JSON(params))
if err != nil {
return err
}
printObject(server)
return nil
})
R(&options.ServerCreateOptions{}, "server-create", "Create a server", func(s *mcclient.ClientSession, opts *options.ServerCreateOptions) error {
params, err := opts.Params()
if err != nil {
@@ -975,6 +988,7 @@ func init() {
config.Hosts[i].HostIp = yamlConfig.Hosts[i].HostIp
config.Hosts[i].XmlFilePath = yamlConfig.Hosts[i].XmlFilePath
config.Hosts[i].Servers = make([]compute.SLibvirtServerConfig, len(yamlConfig.Hosts[i].Servers))
config.Hosts[i].MonitorPath = yamlConfig.Hosts[i].MonitorPath
for j := 0; j < len(yamlConfig.Hosts[i].Servers); j++ {
config.Hosts[i].Servers[j].MacIp = make(map[string]string)
mac := yamlConfig.Hosts[i].Servers[j].Mac
@@ -997,11 +1011,11 @@ func init() {
if err != nil {
return err
}
for i := 0; i < len(params); i++ {
val := jsonutils.NewDict()
val.Set(modules.Servers.KeywordPlural, params[i])
params[i] = val
}
//for i := 0; i < len(params); i++ {
// val := jsonutils.NewDict()
// val.Set(modules.Servers.KeywordPlural, params[i])
// params[i] = val
//}
results := modules.Servers.BatchPerformClassAction(s, "import-from-libvirt", params)
printBatchResults(results, modules.Servers.GetColumns(s))

View File

@@ -84,8 +84,11 @@ func newClient(options *BaseOptions) (*ctyun.SRegion, error) {
return nil, fmt.Errorf("Missing secret")
}
cli, err := ctyun.NewSCtyunClient("", "", "",
options.AccessKey, options.Secret, options.Debug)
cli, err := ctyun.NewSCtyunClient(
ctyun.NewSCtyunClientConfig(
options.AccessKey, options.Secret,
).Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -88,7 +88,14 @@ func newClient(options *BaseOptions) (*esxi.SESXiClient, error) {
return nil, fmt.Errorf("Missing password")
}
return esxi.NewESXiClient2("", "", options.Host, options.Port, options.Account, options.Password, false)
return esxi.NewESXiClient2(
esxi.NewESXiClientConfig(
options.Host,
options.Port,
options.Account,
options.Password,
),
)
}
func main() {

View File

@@ -94,7 +94,14 @@ func newClient(options *BaseOptions) (*google.SRegion, error) {
return nil, fmt.Errorf("Missing ProjectID")
}
cli, err := google.NewGoogleClient("", "", options.ProjectID, options.ClientEmail, options.PrivateKeyID, options.PrivateKey, options.Debug)
cli, err := google.NewGoogleClient(
google.NewGoogleClientConfig(
options.ProjectID,
options.ClientEmail,
options.PrivateKeyID,
options.PrivateKey,
).Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -86,9 +86,14 @@ func newClient(options *BaseOptions) (*huawei.SRegion, error) {
return nil, fmt.Errorf("Missing secret")
}
cli, err := huawei.NewHuaweiClient("", "", options.CloudEnv,
options.AccessKey, options.Secret, options.ProjectId,
options.Debug)
cli, err := huawei.NewHuaweiClient(
huawei.NewHuaweiClientConfig(
options.CloudEnv,
options.AccessKey,
options.Secret,
options.ProjectId,
).Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -93,7 +93,18 @@ func newClient(options *BaseOptions) (*openstack.SRegion, error) {
return nil, fmt.Errorf("Missing Password")
}
cli, err := openstack.NewOpenStackClient("", "", options.AuthURL, options.Username, options.Password, options.Project, options.EndpointType, options.DomainName, options.ProjectDomain, options.Debug)
cli, err := openstack.NewOpenStackClient(
openstack.NewOpenstackClientConfig(
options.AuthURL,
options.Username,
options.Password,
options.Project,
options.ProjectDomain,
).
EndpointType(options.EndpointType).
DomainName(options.DomainName).
Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -85,11 +85,12 @@ func newClient(options *BaseOptions) (*qcloud.SRegion, error) {
return nil, fmt.Errorf("Missing SecretID")
}
if cli, err := qcloud.NewQcloudClient("", "",
options.SecretID,
options.SecretKey,
options.AppID,
options.Debug); err != nil {
if cli, err := qcloud.NewQcloudClient(
qcloud.NewQcloudClientConfig(
options.SecretID,
options.SecretKey,
).AppId(options.AppID).Debug(options.Debug),
); err != nil {
return nil, err
} else if region := cli.GetRegion(options.RegionId); region == nil {
return nil, fmt.Errorf("No such region %s", options.RegionId)

View File

@@ -94,11 +94,23 @@ func newClient(options *BaseOptions) (cloudprovider.ICloudRegion, error) {
}
if options.Backend == api.CLOUD_PROVIDER_CEPH {
return ceph.NewCephRados("", "", options.AccessUrl, options.AccessKey, options.Secret, options.Debug)
return ceph.NewCephRados(
objectstore.NewObjectStoreClientConfig(
options.AccessUrl, options.AccessKey, options.Secret,
).Debug(options.Debug),
)
} else if options.Backend == api.CLOUD_PROVIDER_XSKY {
return xsky.NewXskyClient("", "", options.AccessUrl, options.AccessKey, options.Secret, options.Debug)
return xsky.NewXskyClient(
objectstore.NewObjectStoreClientConfig(
options.AccessUrl, options.AccessKey, options.Secret,
).Debug(options.Debug),
)
}
return objectstore.NewObjectStoreClient("", "", options.AccessUrl, options.AccessKey, options.Secret, options.Debug)
return objectstore.NewObjectStoreClient(
objectstore.NewObjectStoreClientConfig(
options.AccessUrl, options.AccessKey, options.Secret,
).Debug(options.Debug),
)
}
func main() {

View File

@@ -86,11 +86,12 @@ func newClient(options *BaseOptions) (*ucloud.SRegion, error) {
return nil, fmt.Errorf("Missing secret")
}
cli, err := ucloud.NewUcloudClient("", "",
options.AccessKey,
options.Secret,
options.ProjectId,
options.Debug)
cli, err := ucloud.NewUcloudClient(
ucloud.NewUcloudClientConfig(
options.AccessKey,
options.Secret,
).ProjectId(options.ProjectId).Debug(options.Debug),
)
if err != nil {
return nil, err
}

View File

@@ -89,7 +89,13 @@ func newClient(options *BaseOptions) (*zstack.SRegion, error) {
return nil, fmt.Errorf("Missing Password")
}
cli, err := zstack.NewZStackClient("", "", options.AuthURL, options.Username, options.Password, options.Debug)
cli, err := zstack.NewZStackClient(
zstack.NewZstackClientConfig(
options.AuthURL,
options.Username,
options.Password,
).Debug(options.Debug),
)
if err != nil {
return nil, err
}

89
go.mod
View File

@@ -3,10 +3,10 @@ module yunion.io/x/onecloud
go 1.12
require (
cloud.google.com/go v0.38.0
github.com/360EntSecGroup-Skylar/excelize v1.4.0
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible
github.com/Azure/go-autorest v10.15.5+incompatible
github.com/Azure/go-autorest/autorest v0.9.3
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2
github.com/DataDog/dd-trace-go v0.6.1 // indirect
github.com/DataDog/zstd v1.3.4 // indirect
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3
@@ -29,23 +29,18 @@ require (
github.com/c-bata/go-prompt v0.2.1
github.com/ceph/go-ceph v0.0.0-20181217221554-e32f9f0f2e94
github.com/coredns/coredns v1.3.0
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/denisenkom/go-mssqldb v0.0.0-20190806190131-db2462fef53b // indirect
github.com/dimchansky/utfbom v1.1.0 // indirect
github.com/dnaeon/go-vcr v1.0.1 // indirect
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11 // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
github.com/farsightsec/golang-framestream v0.0.0-20181102145529-8a0cb8ba8710 // indirect
github.com/fatih/color v1.7.0
github.com/fernet/fernet-go v0.0.0-20180830025343-9eac43b88a5e
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/ghodss/yaml v1.0.0
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect
github.com/gin-gonic/gin v1.3.0
github.com/gin-gonic/gin v1.5.0
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 // indirect
github.com/go-logfmt/logfmt v0.4.0 // indirect
github.com/go-ole/go-ole v1.2.2 // indirect
@@ -58,14 +53,12 @@ require (
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/golang/protobuf v1.3.2
github.com/google/gopacket v1.1.17
github.com/google/uuid v1.1.0 // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb // indirect
github.com/googollee/go-socket.io v0.0.0-20181214084611-0ad7206c347a
github.com/gorilla/mux v1.6.2
github.com/gorilla/mux v1.7.0
github.com/gorilla/websocket v1.4.0
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead
github.com/huandu/xstrings v1.2.0 // indirect
@@ -74,7 +67,7 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.0.1 // indirect
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c
github.com/kr/pty v1.1.3
github.com/kr/pty v1.1.5
github.com/lib/pq v1.2.0 // indirect
github.com/libvirt/libvirt-go-xml v5.2.0+incompatible
github.com/mattn/go-runewidth v0.0.4 // indirect
@@ -84,7 +77,7 @@ require (
github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7
github.com/mdlayher/raw v0.0.0-20190606144222-a54781e5f38f
github.com/mholt/caddy v0.10.11
github.com/miekg/dns v1.1.1
github.com/miekg/dns v1.1.4
github.com/minio/minio-go v6.0.14+incompatible
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/moul/http2curl v1.0.0
@@ -92,61 +85,81 @@ require (
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
github.com/opentracing/opentracing-go v1.0.2 // indirect
github.com/openzipkin/zipkin-go-opentracing v0.3.4 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pierrec/lz4 v2.0.5+incompatible
github.com/pkg/errors v0.8.1
github.com/pkg/term v0.0.0-20181116001808-27bbf2edb814 // indirect
github.com/pquerna/otp v1.2.0
github.com/satori/go.uuid v1.2.0 // indirect
github.com/serialx/hashring v0.0.0-20180504054112-49a4782e9908
github.com/shirou/gopsutil v2.18.10+incompatible
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9
github.com/smartystreets/goconvey v1.6.4
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.4.0
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181108132626-805d01dd0e2e
github.com/tencentcloud/tencentcloud-sdk-go v3.0.135+incompatible
github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20191108095731-8ca4b370cde4
github.com/tinylib/msgp v1.1.0 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c
github.com/ugorji/go v0.0.0-20161130061742-9c7f9b7a2bc3 // indirect
github.com/vishvananda/netlink v1.0.0
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible
github.com/vmware/govmomi v0.19.0
github.com/vmware/govmomi v0.20.1
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738
go.uber.org/atomic v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
golang.org/x/net v0.0.0-20191007182048-72f939374954
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20191008105621-543471e840be
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987
google.golang.org/api v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
google.golang.org/grpc v1.23.1
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.44.0 // indirect
gopkg.in/ldap.v3 v3.0.3
gopkg.in/yaml.v2 v2.2.2
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76
k8s.io/apimachinery v0.0.0-20181215012845-4d029f033399
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.17.3
k8s.io/apimachinery v0.17.3
k8s.io/client-go v9.0.0+incompatible
k8s.io/klog v0.1.0 // indirect
k8s.io/kubernetes v1.12.3
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-20200113074440-9297fd00ba07
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070
yunion.io/x/jsonutils v0.0.0-20200415132054-2bf8a5e94501
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
yunion.io/x/pkg v0.0.0-20200516092703-0a53bc9270aa
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20200221103553-6a98f7f8ab92
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
yunion.io/x/sqlchemy v0.0.0-20200312002602-1177cd8fbc57
yunion.io/x/structarg v0.0.0-20200423163001-168d0687be7e
)
replace github.com/ceph/go-ceph v0.0.0-20181217221554-e32f9f0f2e94 => github.com/yunionio/go-ceph v0.0.0-20190912101231-6f05a06b3859
replace (
github.com/ceph/go-ceph v0.0.0-20181217221554-e32f9f0f2e94 => github.com/yunionio/go-ceph v0.0.0-20190912101231-6f05a06b3859
k8s.io/api => k8s.io/api v0.0.0-20190918155943-95b840bb6a1f
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
k8s.io/apiserver => k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20190918162238-f783a3654da8
k8s.io/client-go => k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90
k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20190918163234-a9c1f33e9fb9
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.0.0-20190918163108-da9fdfce26bb
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269
k8s.io/component-base => k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090
k8s.io/cri-api => k8s.io/cri-api v0.0.0-20190828162817-608eb1dad4ac
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.0.0-20190918163402-db86a8c7bb21
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190918161219-8c8f079fddc3
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.0.0-20190918162944-7a93a0ddadd8
k8s.io/kube-proxy => k8s.io/kube-proxy v0.0.0-20190918162534-de037b596c1e
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.0.0-20190918162820-3b5c1246eb18
k8s.io/kubectl => k8s.io/kubectl v0.0.0-20190918164019-21692a0861df
k8s.io/kubelet => k8s.io/kubelet v0.0.0-20190918162654-250a1838aa2c
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.0.0-20190918163543-cfa506e53441
k8s.io/metrics => k8s.io/metrics v0.0.0-20190918162108-227c654b2546
k8s.io/node-api => k8s.io/node-api v0.0.0-20190918163711-2299658ad911
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.0.0-20190918161442-d4c9c65c82af
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.0.0-20190918162410-e45c26d066f2
k8s.io/sample-controller => k8s.io/sample-controller v0.0.0-20190918161628-92eb3cb7496c
)

507
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,7 @@ import (
"yunion.io/x/onecloud/pkg/apigateway/constants"
"yunion.io/x/onecloud/pkg/apigateway/options"
policytool "yunion.io/x/onecloud/pkg/apigateway/policy"
"yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/appctx"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
@@ -360,7 +361,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
@@ -569,6 +570,7 @@ func (this *projectRoles) add(roleId, roleName string) {
func (this *projectRoles) getToken(scope rbacutils.TRbacScope, user, userId, domain, domainId string, ip string) mcclient.TokenCredential {
return &mcclient.SSimpleToken{
Token: "faketoken",
Domain: domain,
DomainId: domainId,
User: user,
@@ -608,12 +610,12 @@ func (this *projectRoles) json(user, userId, domain, domainId string, ip string)
}
obj.Add(roles, "roles")
for _, scope := range []rbacutils.TRbacScope{
rbacutils.ScopeSystem,
rbacutils.ScopeDomain,
rbacutils.ScopeProject,
rbacutils.ScopeDomain,
rbacutils.ScopeSystem,
} {
token := this.getToken(scope, user, userId, domain, domainId, ip)
matches := policy.PolicyManager.MatchedPolicies(scope, token)
matches := policy.PolicyManager.MatchedPolicyNames(scope, token)
obj.Add(jsonutils.NewStringArray(matches), fmt.Sprintf("%s_policies", scope))
if len(matches) > 0 {
obj.Add(jsonutils.JSONTrue, fmt.Sprintf("%s_capable", scope))
@@ -646,8 +648,11 @@ func getUserAuthCookie(ctx context.Context, s *mcclient.ClientSession, token mcc
}
func getLBAgentInfo(s *mcclient.ClientSession, token mcclient.TokenCredential) (*jsonutils.JSONDict, error) {
lbagents, err := modules.LoadbalancerAgents.List(s, nil)
params := jsonutils.NewDict()
params.Add(jsonutils.NewString("hb_last_seen.isnotempty()"), "filter.0")
params.Add(jsonutils.NewInt(1), "limit")
params.Add(jsonutils.JSONFalse, "details")
lbagents, err := modules.LoadbalancerAgents.List(s, params)
if err != nil {
return nil, errors.Wrapf(err, "user %s get lbagent", token.GetUserName())
}
@@ -665,6 +670,7 @@ func getLBAgentInfo(s *mcclient.ClientSession, token mcclient.TokenCredential) (
}
func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.TokenCredential, req *http.Request) (*jsonutils.JSONDict, error) {
log.Infof("getUserInfo modules.UsersV3.Get")
usr, err := modules.UsersV3.Get(s, token.GetUserId(), nil)
if err != nil {
log.Errorf("modules.UsersV3.Get fail %s", err)
@@ -693,6 +699,7 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
data.Add(jsonutils.NewString(token.GetProjectDomain()), "projectDomain")
data.Add(jsonutils.NewString(token.GetProjectDomainId()), "projectDomainId")
log.Infof("getUserInfo modules.RoleAssignments.List")
query := jsonutils.NewDict()
query.Add(jsonutils.JSONNull, "effective")
query.Add(jsonutils.JSONNull, "include_names")
@@ -735,7 +742,7 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
rbacutils.ScopeDomain,
rbacutils.ScopeProject,
} {
p := policy.PolicyManager.MatchedPolicies(scope, token)
p := policy.PolicyManager.MatchedPolicyNames(scope, token)
data.Add(jsonutils.NewStringArray(p), fmt.Sprintf("%s_policies", scope))
if scope == rbacutils.ScopeSystem {
data.Add(jsonutils.NewStringArray(p), "admin_policies")
@@ -772,6 +779,7 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
log.Errorf("fail to find services????: %#v %s", adminToken, curReg)
}
log.Infof("getUserInfo getLBAgentInfo")
lb, err := getLBAgentInfo(s, adminToken)
if err != nil {
log.Errorf("getLBAgentInfo fail %s", err)
@@ -788,13 +796,23 @@ func getUserInfo(ctx context.Context, s *mcclient.ClientSession, token mcclient.
}
}
log.Infof("getUserInfo modules.Hosts.Get")
s2 := auth.GetSession(ctx, token, FetchRegion(req), "v2")
cap, err := modules.Capabilities.List(s2, nil)
params := jsonutils.NewDict()
params.Add(jsonutils.NewString("host_type"), "field")
params.Add(jsonutils.NewString("system"), "scope")
params.Add(jsonutils.JSONTrue, "usable")
params.Add(jsonutils.JSONTrue, "show_emulated")
cap, err := modules.Hosts.Get(s2, "distinct-field", params)
if err != nil {
log.Errorf("modules.Capabilities.List fail %s", err)
log.Errorf("modules.Servers.Get distinct-field fail %s", err)
} else {
hypervisors, _ := cap.Data[0].Get("hypervisors")
data.Add(hypervisors, "hypervisors")
hostTypes, _ := jsonutils.GetStringArray(cap, "host_type")
hypervisors := make([]string, len(hostTypes))
for i, hostType := range hostTypes {
hypervisors[i] = compute.HOSTTYPE_HYPERVISOR[hostType]
}
data.Add(jsonutils.NewStringArray(hypervisors), "hypervisors")
}
data.Add(menus, "menus")

View File

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

View File

@@ -28,6 +28,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 +38,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 (
@@ -171,19 +173,23 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
}
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 +205,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")
}

View File

@@ -606,28 +606,45 @@ func (f *ResourceHandlers) patchJointHandler(ctx context.Context, w http.Respons
}
}
// batch update Joint
// * batch update Joint
// * put specific
// /<resname>/<resid>/<resname2>
// /<resname>/<resid>/<spec>
func (f *ResourceHandlers) batchUpdateJointHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
req := newRequest(ctx, w, r).WithMod1().WithMod2()
req := newRequest(ctx, w, r).WithMod1()
if err := req.Error(); err != nil {
httperrors.GeneralServerError(w, err)
return
}
session := req.Session()
module := req.Mod1()
module2 := req.Mod2()
body := req.Body()
query := req.Query()
idlist := fetchIdList(query, w)
if idlist == nil {
if idlist, _ := query.GetArray("id"); len(idlist) == 0 {
// do put specific
spec := req.ResName2()
obj, e := module.PutSpecific(session, req.ResID(), spec, query, body)
if e != nil {
httperrors.GeneralServerError(w, e)
} else {
appsrv.SendJSON(w, obj)
}
return
}
req = req.WithMod2()
if err := req.Error(); err != nil {
httperrors.GeneralServerError(w, err)
return
}
module2 := req.Mod2()
jmod, e := modulebase.GetJointModule2(session, module, module2)
if e != nil { // update joint
httperrors.GeneralServerError(w, e)
return
}
idlist := fetchIdList(query, w)
ret := jmod.BatchUpdate(session, req.ResID(), idlist, query, body)
w.WriteHeader(207)
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(ret))

View File

@@ -29,7 +29,7 @@ type GatewayOptions struct {
SqlitePath string `help:"sqlite db path" default:"/etc/yunion/data/yunionapi.db"`
common_options.CommonOptions
common_options.CommonOptions `"request_worker_count->default":"32"`
}
var (
@@ -40,9 +40,10 @@ func OnOptionsChange(oldO, newO interface{}) bool {
oldOpts := oldO.(*GatewayOptions)
newOpts := newO.(*GatewayOptions)
changed := false
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
return true
changed = true
}
return false
return changed
}

View File

@@ -0,0 +1 @@
package proxy // import "yunion.io/x/onecloud/pkg/apis/cloudcommon/proxy"

View File

@@ -0,0 +1,55 @@
package proxy
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
const (
ProxySettingId_DIRECT = "DIRECT"
)
type ProxySettingCreateInput struct {
apis.StandaloneResourceCreateInput
ProxySetting
}
type ProxySettingUpdateInput struct {
// 资源名称
Name string `json:"name"`
// 资源描述
Description string `json:"description"`
ProxySetting
}
// String implements ISerializable interface
func (ps *SProxySetting) String() string {
return jsonutils.Marshal(ps).String()
}
// IsZero implements ISerializable interface
func (ps *SProxySetting) IsZero() bool {
if ps.HTTPProxy == "" &&
ps.HTTPSProxy == "" &&
ps.NoProxy == "" {
return true
}
return false
}
type ProxySettingResourceInput struct {
// 代理配置
ProxySetting string `json:"proxy_setting"`
// swagger:ignore
// Deprecated
ProxySettingId string `json:"proxy_setting_id" "yunion:deprecated-by":"proxy_setting"`
}
type ProxySettingTestInput struct {
HttpProxy string
HttpsProxy string
}

View File

@@ -0,0 +1,111 @@
package proxy
import (
"fmt"
"net"
"net/url"
"strings"
"yunion.io/x/pkg/errors"
)
type ProxySetting struct {
HttpProxy string
HttpsProxy string
NoProxy string
}
func (v *ProxySetting) Sanitize() error {
v.HttpProxy = strings.TrimSpace(v.HttpProxy)
if u, err := parseProxy(v.HttpProxy); err != nil {
return errors.Wrap(err, "invalid https_proxy url")
} else if u != nil {
v.HttpProxy = u.String()
}
v.HttpsProxy = strings.TrimSpace(v.HttpsProxy)
if u, err := parseProxy(v.HttpsProxy); err != nil {
return errors.Wrap(err, "invalid http_proxy url")
} else if u != nil {
v.HttpsProxy = u.String()
}
if noProxy, err := parseNoProxy(v.NoProxy); err == nil {
v.NoProxy = strings.Join(noProxy, ",")
} else {
return errors.Wrap(err, "invalid no_proxy")
}
return nil
}
func parseProxy(proxy string) (*url.URL, error) {
if proxy == "" {
return nil, nil
}
proxyURL, err := url.Parse(proxy)
if err != nil ||
(proxyURL.Scheme != "http" &&
proxyURL.Scheme != "https" &&
proxyURL.Scheme != "socks5") {
// proxy was bogus. Try prepending "http://" to it and
// see if that parses correctly. If not, we fall
// through and complain about the original one.
if proxyURL, err := url.Parse("http://" + proxy); err == nil {
return proxyURL, nil
}
}
if err != nil {
return nil, errors.Wrapf(err, "invalid proxy address %q", proxy)
}
return proxyURL, nil
}
func parseNoProxy(noProxy string) ([]string, error) {
var r []string
for _, p := range strings.Split(noProxy, ",") {
p = strings.ToLower(strings.TrimSpace(p))
if len(p) == 0 {
continue
}
if p == "*" {
r = append(r, p)
// let it go
//return r, nil
}
// IPv4/CIDR, IPv6/CIDR
if _, _, err := net.ParseCIDR(p); err == nil {
r = append(r, p)
continue
}
// IPv4:port, [IPv6]:port
phost, _, err := net.SplitHostPort(p)
if err == nil {
if len(phost) == 0 {
// There is no host part, likely the entry is malformed; ignore.
return nil, fmt.Errorf("host part must not be empty: %s", p)
}
if phost[0] == '[' && phost[len(phost)-1] == ']' {
phost = phost[1 : len(phost)-1]
}
} else {
phost = p
}
// IPv4, IPv6
if pip := net.ParseIP(phost); pip != nil {
r = append(r, p)
continue
}
if len(phost) == 0 {
// There is no host part, likely the entry is malformed; ignore.
continue
}
r = append(r, p)
}
return r, nil
}

View File

@@ -1,5 +1,3 @@
// Copyright 2018, OpenCensus Authors
//
// 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
@@ -12,21 +10,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build go1.11
// Code generated by model-api-gen. DO NOT EDIT.
package trace
package proxy
import (
"context"
t "runtime/trace"
"yunion.io/x/onecloud/pkg/apis"
)
func startExecutionTracerTask(ctx context.Context, name string) (context.Context, func()) {
if !t.IsEnabled() {
// Avoid additional overhead if
// runtime/trace is not enabled.
return ctx, func() {}
}
nctx, task := t.NewTask(ctx, name)
return nctx, task.End
// SProxySetting is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db/proxy.SProxySetting.
type SProxySetting struct {
apis.SStandaloneResourceBase
HTTPProxy string `json:"http_proxy"`
HTTPSProxy string `json:"https_proxy"`
NoProxy string `json:"no_proxy"`
}

View File

@@ -18,13 +18,59 @@ import (
"time"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/apis/compute"
)
type CloudeventListInput struct {
apis.VirtualResourceListInput
apis.ModelBaseListInput
compute.ManagedResourceListInput
// 列出指定云平台的资源,支持的云平台如下
//
// | Provider | 开始支持版本 | 平台 |
// |-----------|------------|-------------------------------------|
// | OneCloud | 0.0 | OneCloud内置私有云包括KVM和裸金属管理 |
// | VMware | 1.2 | VMware vCenter |
// | OpenStack | 2.6 | OpenStack M版本以上私有云 |
// | ZStack | 2.10 | ZStack私有云 |
// | Aliyun | 2.0 | 阿里云 |
// | Aws | 2.3 | Amazon AWS |
// | Azure | 2.2 | Microsoft Azure |
// | Google | 2.13 | Google Cloud Platform |
// | Qcloud | 2.3 | 腾讯云 |
// | Huawei | 2.5 | 华为公有云 |
// | Ucloud | 2.7 | UCLOUD |
// | Ctyun | 2.13 | 天翼云 |
// | S3 | 2.11 | 通用s3对象存储 |
// | Ceph | 2.11 | Ceph对象存储 |
// | Xsky | 2.11 | XSKY启明星辰Ceph对象存储 |
//
// enum: OneCloud,VMware,Aliyun,Qcloud,Azure,Aws,Huawei,OpenStack,Ucloud,ZStack,Google,Ctyun,S3,Ceph,Xsky"
Providers []string `json:"providers"`
// swagger:ignore
// Deprecated
Provider []string `json:"provider" "yunion:deprecated-by":"providers"`
// 列出指定云平台品牌的资源一般来说brand和provider相同除了以上支持的provider之外还支持以下band
//
// | Brand | Provider | 说明 |
// |----------|----------|------------|
// | DStack | ZStack | 滴滴云私有云 |
//
Brands []string `json:"brands"`
// swagger:ignore
// Deprecated
Brand []string `json:"brand" "yunion:deprecated-by":"brands"`
// 服务类型
Service []string `json:"service"`
// 订阅
Manager []string `json:"manager"`
// 账号
Account []string `json:"account"`
// 操作类型
Action []string `json:"action"`
// 操作日志起始时间
Since time.Time `json:"since"`

View File

@@ -285,7 +285,7 @@ type ServerConfigs struct {
// swagger:ignore
// Deprecated
// alias for InstanceType
Sku string `json:"sku" deprecated-by:"instance_type"`
Sku string `json:"sku" "yunion:deprecated-by":"instance_type"`
// 虚拟机高可用(创建备机)
// default: false
@@ -357,12 +357,13 @@ type ServerCreateInput struct {
// required: false
UserData string `json:"user_data"`
// Deprecated
// swagger:ignore
Keypair string `json:"keypair" deprecated-by:"keypair_id"`
KeypairId string `json:"keypair_id" "yunion:deprecated-by":"keypair"`
// 秘钥对Id
// required: false
KeypairId string `json:"keypair_id"`
Keypair string `json:"keypair"`
// 密码
// 要求: 密码长度 >= 20, 至少包含一个数字一个小写字母一个大小字母及特殊字符~`!@#$%^&*()-_=+[]{}|:';\",./<>?中的一个

View File

@@ -19,6 +19,7 @@ import (
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apis"
proxyapi "yunion.io/x/onecloud/pkg/apis/cloudcommon/proxy"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/httperrors"
)
@@ -79,6 +80,8 @@ type CloudaccountCreateInput struct {
// 额外信息,例如账单的access key
Options *jsonutils.JSONObject `json:"options"`
proxyapi.ProxySettingResourceInput
cloudprovider.SCloudaccount
cloudprovider.SCloudaccountCredential
}
@@ -177,4 +180,6 @@ type CloudaccountDetail struct {
// 存储缓存数量
// example: 10
StoragecacheCount int `json:"storagecache_count,allowempty"`
ProxySetting proxyapi.SProxySetting `json:"proxy_setting"`
}

View File

@@ -18,6 +18,7 @@ import (
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apis"
proxyapi "yunion.io/x/onecloud/pkg/apis/cloudcommon/proxy"
"yunion.io/x/onecloud/pkg/cloudprovider"
)
@@ -96,6 +97,8 @@ type CloudproviderDetails struct {
apis.StandaloneResourceDetails
SCloudprovider
ProxySetting proxyapi.SProxySetting `json:"proxy_setting"`
// 云账号名称
// example: google-account
Cloudaccount string `json:"cloudaccount"`
@@ -144,30 +147,30 @@ type ManagedResourceListInput struct {
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
Manager string `json:"manager" deprecated-by:"cloudprovider"`
Manager string `json:"manager" "yunion:deprecated-by":"cloudprovider"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
ManagerId string `json:"manager_id" deprecated-by:"cloudprovider"`
ManagerId string `json:"manager_id" "yunion:deprecated-by":"cloudprovider"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
CloudproviderId string `json:"cloudprovider_id" deprecated-by:"cloudprovider"`
CloudproviderId string `json:"cloudprovider_id" "yunion:deprecated-by":"cloudprovider"`
// 列出关联指定云账号(ID或Name)的资源
Cloudaccount string `json:"cloudaccount"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
CloudaccountId string `json:"cloudaccount_id" deprecated-by:"cloudaccount"`
CloudaccountId string `json:"cloudaccount_id" "yunion:deprecated-by":"cloudaccount"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
Account string `json:"account" deprecated-by:"cloudaccount"`
Account string `json:"account" "yunion:deprecated-by":"cloudaccount"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
AccountId string `json:"account_id" deprecated-by:"cloudaccount"`
AccountId string `json:"account_id" "yunion:deprecated-by":"cloudaccount"`
// 列出指定云平台的资源,支持的云平台如下
//
@@ -193,7 +196,7 @@ type ManagedResourceListInput struct {
Providers []string `json:"providers"`
// swagger:ignore
// Deprecated
Provider []string `json:"provider" deprecated-by:"providers"`
Provider []string `json:"provider" "yunion:deprecated-by":"providers"`
// 列出指定云平台品牌的资源一般来说brand和provider相同除了以上支持的provider之外还支持以下band
//
@@ -204,7 +207,7 @@ type ManagedResourceListInput struct {
Brands []string `json:"brands"`
// swagger:ignore
// Deprecated
Brand []string `json:"brand" deprecated-by:"brands"`
Brand []string `json:"brand" "yunion:deprecated-by":"brands"`
// 列出指定云环境的资源,支持云环境如下:
//

View File

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

View File

@@ -212,7 +212,7 @@ type DbinstanceFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by dbinstance_id
DbinstanceId string `json:"dbinstance_id" deprecated-by:"dbinstance"`
DbinstanceId string `json:"dbinstance_id" "yunion:deprecated-by":"dbinstance"`
}
type DBInstanceDetails struct {

View File

@@ -108,10 +108,10 @@ const (
ALIYUN_DBINSTANCE_STORAGE_TYPE_CLOUD_SSD = "cloud_ssd" //SSD云盘
//华为云存储类型
HUAWEI_DBINSTANCE_STORAGE_TYPE_SSD = "SSD" //超高IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_SAS = "SAS" //高IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_SATA = "SATA" //普通IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGH = "ULTRAHIGH" //超高IO云硬盘
HUAWEI_DBINSTANCE_STORAGE_TYPE_ULTRAHIGHPRO = "ULTRAHIGHPRO"
HUAWEI_DBINSTANCE_STORAGE_TYPE_COMMON = "COMMON"
HUAWEI_DBINSTANCE_STORAGE_TYPE_HIGH = "HIGH"
)
var (

View File

@@ -1,4 +1,4 @@
// Copyright 2018, OpenCensus Authors
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,11 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Package internal provides trace internals.
package internal
package compute
// IDGenerator allows custom generators for TraceId and SpanId.
type IDGenerator interface {
NewTraceID() [16]byte
NewSpanID() [8]byte
import "yunion.io/x/onecloud/pkg/apis"
type DBInstanceSkuDetails struct {
apis.StandaloneResourceDetails
CloudregionInfo
}

View File

@@ -89,7 +89,7 @@ type SnapshotPolicyFilterListInput struct {
// swagger:ignore
// Deprecated
// filter disk by snapshotpolicy_id
SnapshotpolicyId string `json:"snapshotpolicy_id" deprecated-by:"snapshotpolicy"`
SnapshotpolicyId string `json:"snapshotpolicy_id" "yunion:deprecated-by":"snapshotpolicy"`
}
type DiskListInput struct {
@@ -109,7 +109,7 @@ type DiskListInput struct {
// swagger:ignore
// Deprecated
// filter by disk type
Type string `json:"type" deprecated-by:"disk_type"`
Type string `json:"type" "yunion:deprecated-by":"disk_type"`
// 过滤指定disk_type的磁盘列表可能的值为sys, data, swap. volume
//
// | disk_type值 | 说明 |
@@ -128,7 +128,7 @@ type DiskFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by disk_id
DiskId string `json:"disk_id" deprecated-by:"disk"`
DiskId string `json:"disk_id" "yunion:deprecated-by":"disk"`
}
type SimpleGuest struct {
@@ -138,8 +138,10 @@ type SimpleGuest struct {
}
type SimpleSnapshotPolicy struct {
RepeatWeekdays []int `json:"repeat_weekdays"`
TimePoints []int `json:"time_points"`
Id string `json:"id"`
Name string `json:"name"`
RepeatWeekdays []int `json:"repeat_weekdays"`
TimePoints []int `json:"time_points"`
}
type DiskDetails struct {

View File

@@ -43,10 +43,6 @@ const (
EIP_CHARGE_TYPE_BY_TRAFFIC = "traffic"
EIP_CHARGE_TYPE_BY_BANDWIDTH = "bandwidth"
EIP_CHARGE_TYPE_DEFAULT = EIP_CHARGE_TYPE_BY_TRAFFIC
// EIP associate resource type
EIP_ASSOCIATE_TYPE_VM = "server"
EIP_ASSOCIATE_TYPE_ELB = "elb"
)
var (

View File

@@ -27,15 +27,15 @@ type RegionalFilterListInput struct {
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
CloudregionId string `json:"cloudregion_id" deprecated-by:"cloudregion"`
CloudregionId string `json:"cloudregion_id" "yunion:deprecated-by":"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
Region string `json:"region" deprecated-by:"cloudregion"`
Region string `json:"region" "yunion:deprecated-by":"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
RegionId string `json:"region_id" deprecated-by:"cloudregion"`
RegionId string `json:"region_id" "yunion:deprecated-by":"cloudregion"`
}
type ZonalFilterListInput struct {
@@ -46,7 +46,7 @@ type ZonalFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by zone_id
ZoneId string `json:"zone_id" deprecated-by:"zone"`
ZoneId string `json:"zone_id" "yunion:deprecated-by":"zone"`
// 过滤处于多个指定可用区内的资源
Zones []string `json:"zones"`
}
@@ -67,7 +67,7 @@ type HostFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by host_id
HostId string `json:"host_id" deprecated-by:"host"`
HostId string `json:"host_id" "yunion:deprecated-by":"host"`
}
type CloudregionListInput struct {

View File

@@ -150,6 +150,11 @@ const (
HYPERVISOR_DEFAULT = HYPERVISOR_KVM
)
const (
CPU_MODE_QEMU = "qemu"
CPU_MODE_HOST = "host"
)
var VM_RUNNING_STATUS = []string{VM_START_START, VM_STARTING, VM_RUNNING, VM_BLOCK_STREAM, VM_BLOCK_STREAM_FAIL}
var VM_CREATING_STATUS = []string{VM_CREATE_NETWORK, VM_CREATE_DISK, VM_START_DEPLOY, VM_DEPLOYING}

View File

@@ -28,15 +28,15 @@ type ServerFilterListInput struct {
// swagger:ignore
// Deprecated
// Filter by guest Id
ServerId string `json:"server_id" deprecated-by:"server"`
ServerId string `json:"server_id" "yunion:deprecated-by":"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
Guest string `json:"guest" deprecated-by:"server"`
Guest string `json:"guest" "yunion:deprecated-by":"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
GuestId string `json:"guest_id" deprecated-by:"server"`
GuestId string `json:"guest_id" "yunion:deprecated-by":"server"`
}
type ServerListInput struct {

View File

@@ -124,3 +124,10 @@ type HostDetails struct {
// 标签
Metadata map[string]string `json:"metadata"`
}
type HostRegisterMetadata struct {
apis.Meta
OnKubernetes bool `json:"on_kubernetes"`
Hostname string `json:"hostname"`
}

View File

@@ -51,7 +51,7 @@ type HoststorageDetails struct {
// 镜像缓存路径
ImagecachePath string `json:"imagecache_path"`
// 存储缓存Id
StoragecacheId string `json:"storagecached_id"`
StoragecacheId string `json:"storagecache_id"`
GuestDiskCount int `json:"guest_disk_count,allowempty"`
}

View File

@@ -41,5 +41,5 @@ type GroupFilterListInput struct {
// swagger:ignore
// deprecated: true
// Filter by instance group Id
GroupId string `json:"group_id" deprecated-by:"group"`
GroupId string `json:"group_id" "yunion:deprecated-by":"group"`
}

View File

@@ -29,6 +29,10 @@ type SimpleSnapshot struct {
CloudregionId string `json:"cloudregion_id"`
// 快照大小
Size int `json:"size"`
// 快照状态
Status string `json:"status"`
// 存储类型
StorageType string `json:"storage_type"`
}
type InstnaceSnapshotDetails struct {

View File

@@ -24,7 +24,7 @@ type VpcFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by vpc Id
VpcId string `json:"vpc_id" deprecated-by:"vpc"`
VpcId string `json:"vpc_id" "yunion:deprecated-by":"vpc"`
}
type WireFilterListInput struct {
@@ -35,7 +35,7 @@ type WireFilterListInput struct {
// swagger:ignore
// Deprecated
// fitler by wire id
WireId string `json:"wire_id" deprecated-by:"wire"`
WireId string `json:"wire_id" "yunion:deprecated-by":"wire"`
}
type NetworkFilterListInput struct {
@@ -46,7 +46,7 @@ type NetworkFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by networkId
NetworkId string `json:"network_id" deprecated-by:"network"`
NetworkId string `json:"network_id" "yunion:deprecated-by":"network"`
}
type NetworkListInput struct {
@@ -60,9 +60,13 @@ type NetworkListInput struct {
WireFilterListInput
// description: search ip address in network.
// description: Exact matching ip address in network.
// example: 10.168.222.1
Ip string `json:"ip"`
// description: Fuzzy matching ip address in network.
// example: 10.168.222.1
IpMatch string `json:"ip_match"`
}
type NetworkCreateInput struct {

View File

@@ -45,7 +45,7 @@ type SchedtagFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by schedtag_id
SchedtagId string `json:"schedtag_id" deprecated-by:"schedtag"`
SchedtagId string `json:"schedtag_id" "yunion:deprecated-by":"schedtag"`
}
type SchedtagListInput struct {
@@ -56,7 +56,7 @@ type SchedtagListInput struct {
// swagger:ignore
// Deprecated
// filter by type, alias for resource_type
Type string `json:"type" deprecated-by:"resource_type"`
Type string `json:"type" "yunion:deprecated-by":"resource_type"`
}
type SchedtagDetails struct {

View File

@@ -162,7 +162,7 @@ type SecgroupFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by secgroup_id
SecgroupId string `json:"secgroup_id" deprecated-by:"secgroup"`
SecgroupId string `json:"secgroup_id" "yunion:deprecated-by":"secgroup"`
}
type SecgroupDetails struct {

View File

@@ -112,22 +112,27 @@ type StorageCreateInput struct {
NfsSharedDir string `json:"nfs_shared_dir"`
}
type StorageDetails struct {
apis.StandaloneResourceDetails
SStorage
type SStorageCapacityInfo struct {
// 容量大小, 单位Mb
Capacity int64 `json:"capacity"`
// 已使用容量大小
Used int64 `json:"used"`
UsedCapacity int64 `json:"used_capacity"`
// 浪费容量大小(异常磁盘大小总和)
Wasted int64 `json:"wasted"`
WasteCapacity int64 `json:"waste_capacity"`
// 虚拟容量大小
VCapacity int64 `json:"vcapacity"`
VirtualCapacity int64 `json:"virtual_capacity"`
// 超分率
CommitRate float64 `json:"commit_rate"`
// 可使用容量
FreeCapacity int64 `json:"free_capacity"`
}
type StorageDetails struct {
apis.StandaloneResourceDetails
SStorageCapacityInfo
SStorage
CloudproviderInfo
Schedtags []SchedtagShortDescDetails `json:"schedtags"`

View File

@@ -144,7 +144,7 @@ type StorageFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by storage_id
StorageId string `json:"storage_id" deprecated-by:"storage"`
StorageId string `json:"storage_id" "yunion:deprecated-by":"storage"`
}
type StorageShareFilterListInput struct {

View File

@@ -53,7 +53,7 @@ type WireDetails struct {
// example: 1
Networks int `json:"networks"`
// VPC名称
Vpc string `json:"vpc'`
Vpc string `json:"vpc"`
// VPC外部Id
VpcExtId string `json:"vpc_ext_id"`

View File

@@ -46,7 +46,7 @@ type ZoneDetails struct {
// 可用区底下启用的宿主机数量
// example: 2
HostsEnabled int `json:"host_enabled"`
HostsEnabled int `json:"hosts_enabled"`
// 可用区底下的裸金属服务器数量
// example: 1

View File

@@ -195,6 +195,8 @@ type SCloudaccount struct {
IsPublic bool `json:"is_public"`
// add share_mode field to indicate the share range of this account
ShareMode string `json:"share_mode"`
// 默认值proxyapi.ProxySettingId_DIRECT
ProxySettingId string `json:"proxy_setting_id"`
}
// SCloudprovider is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudprovider.
@@ -215,6 +217,7 @@ type SCloudprovider struct {
type SCloudproviderCapability struct {
apis.SResourceBase
CloudproviderId string `json:"cloudprovider_id"`
CloudregionId string `json:"cloudregion_id"`
Capability string `json:"capability"`
}

View File

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

View File

@@ -14,8 +14,20 @@
package identity
import "yunion.io/x/pkg/tristate"
type SCASIdpConfigOptions struct {
// https://cas.example.org/cas/
CASServerURL string `json:"cas_server_url"`
Service string `json:"service"`
CasProjectAttribute string `json:"cas_project_attribute"`
AutoCreateCasProject tristate.TriState `json:"auto_create_cas_project"`
DefaultCasProjectId string `json:"default_cas_project_id"`
CasRoleAttribute string `json:"cas_role_attribute"`
DefaultCasRoleId string `json:"default_cas_role_id"`
}

View File

@@ -93,3 +93,19 @@ var (
IdpTemplateOpenLDAPSingleDomain: IdentityDriverLDAP,
}
)
type PerformConfigInput struct {
// 更新配置的方式
// example: update
//
// | action | 含义 |
// |---------|-----------------------------------------------|
// | update | 增量更新配置 |
// | remove | 删除指定配置 |
// | replace | 全量替换配置如果action为空则默认为replace |
//
Action string `json:"action"`
// 配置信息
Config TConfigs `json:"config"`
}

View File

@@ -144,6 +144,10 @@ var (
"etcd_cacert",
"etcd_cert",
"etcd_key",
"bootstrap_admin_user_password",
"reset_admin_user_password",
"fernet_key_repository",
},
}
)

View File

@@ -29,3 +29,28 @@ type IdentityProviderDetails struct {
ProjectCount int `json:"project_count,allowempty"`
GroupCount int `json:"group_count,allowempty"`
}
type IdentityProviderCreateInput struct {
apis.EnabledStatusStandaloneResourceCreateInput
// 后端驱动名称
Driver string `json:"driver"`
// 模板名称
Template string `json:"template"`
// 默认导入用户和组的域
TargetDomain string `json:"target_domain"`
// swagger:ignore
// Deprecated
TargetDomainId string `json:"target_domain_id" "yunion:deprecated-by":"target_domain"`
// 新建域的时候是否自动新建第一个项目
AutoCreateProject *bool `json:"auto_create_project"`
// 自动同步间隔,单位:秒
SyncIntervalSeconds *int `json:"sync_interval_seconds"`
// 配置信息
Config TConfigs `json:"config"`
}

View File

@@ -48,15 +48,15 @@ type ProjectFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by project_id
ProjectId string `json:"project_id" deprecated-by:"project"`
ProjectId string `json:"project_id" "yunion:deprecated-by":"project"`
// swagger:ignore
// Deprecated
// filter by tenant
Tenant string `json:"tenant" deprecated-by:"project"`
Tenant string `json:"tenant" "yunion:deprecated-by":"project"`
// swagger:ignore
// Deprecated
// filter by tenant_id
TenantId string `json:"tenant_id" deprecated-by:"project"`
TenantId string `json:"tenant_id" "yunion:deprecated-by":"project"`
}
type UserFilterListInput struct {
@@ -65,7 +65,7 @@ type UserFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by user_id
UserId string `json:"user_id" deprecated-by:"user"`
UserId string `json:"user_id" "yunion:deprecated-by":"user"`
}
type GroupFilterListInput struct {
@@ -74,7 +74,7 @@ type GroupFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by group_id
GroupId string `json:"group_id" deprecated-by:"group"`
GroupId string `json:"group_id" "yunion:deprecated-by":"group"`
}
type RoleFilterListInput struct {
@@ -83,7 +83,7 @@ type RoleFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by role_id
RoleId string `json:"role_id" deprecated-by:"role"`
RoleId string `json:"role_id" "yunion:deprecated-by":"role"`
}
type ServiceFilterListInput struct {
@@ -92,7 +92,7 @@ type ServiceFilterListInput struct {
// swagger:ignore
// Deprecated
// filter by service_id
ServiceId string `json:"service_id" deprecated-by:"service"`
ServiceId string `json:"service_id" "yunion:deprecated-by":"service"`
}
type RoleListInput struct {

View File

@@ -15,6 +15,8 @@
package image
import (
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
@@ -27,13 +29,23 @@ type GuestImageDetails struct {
ImageIds jsonutils.JSONObject `json:"image_ids"`
//Status string `json:"status"`
Size int64 `json:"size"`
MinRamMb int32 `json:"min_ram_mb"`
DiskFormat string `json:"disk_format"`
RootImage jsonutils.JSONObject `json:"root_image"`
DataImages jsonutils.JSONObject `json:"data_images"`
Size int64 `json:"size"`
MinRamMb int32 `json:"min_ram_mb"`
DiskFormat string `json:"disk_format"`
RootImage SubImageInfo `json:"root_image"`
DataImages []SubImageInfo `json:"data_images"`
Properties *jsonutils.JSONDict `json:"properties"`
DisableDelete bool `json:"disable_delete"`
}
type SubImageInfo struct {
ID string `json:"id"`
Name string `json:"name"`
MinDiskMB int32 `json:"min_disk_mb"`
DiskFormat string `json:"disk_format"`
Size int64 `json:"size"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
}

View File

@@ -28,11 +28,11 @@ type DomainizedResourceListInput struct {
// swagger:ignore
// Deprecated
// Project domain Id filter, alias for project_domain
ProjectDomainId string `json:"project_domain_id" deprecated-by:"project_domain"`
ProjectDomainId string `json:"project_domain_id" "yunion:deprecated-by":"project_domain"`
// swagger:ignore
// Deprecated
// Domain Id filter, alias for project_domain
DomainId string `json:"domain_id" deprecated-by:"project_domain"`
DomainId string `json:"domain_id" "yunion:deprecated-by":"project_domain"`
}
type DomainizedResourceCreateInput struct {
@@ -53,15 +53,15 @@ type ProjectizedResourceListInput struct {
// swagger:ignore
// Deprecated
// Filter by project_id, alias for project
ProjectId string `json:"project_id" deprecated-by:"project"`
ProjectId string `json:"project_id" "yunion:deprecated-by":"project"`
// swagger:ignore
// Deprecated
// Filter by tenant ID or Name, alias for project
Tenant string `json:"tenant" deprecated-by:"project"`
Tenant string `json:"tenant" "yunion:deprecated-by":"project"`
// swagger:ignore
// Deprecated
// Filter by tenant_id, alias for project
TenantId string `json:"tenant_id" deprecated-by:"project"`
TenantId string `json:"tenant_id" "yunion:deprecated-by":"project"`
}
type ProjectizedResourceCreateInput struct {
@@ -82,7 +82,7 @@ type UserResourceListInput struct {
// swagger:ignore
// Deprecated
// Filter by userId
UserId string `json:"user_id" deprecated-by:"user"`
UserId string `json:"user_id" "yunion:deprecated-by":"user"`
}
func (input UserResourceListInput) UserStr() string {

View File

@@ -15,6 +15,8 @@
package monitor
import (
"time"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/pkg/apis"
@@ -103,12 +105,18 @@ type AlertCreateInput struct {
Name string `json:"name"`
// 报警执行频率
Frequency int64 `json:"frequency"`
// 报警持续时间
For int64 `json:"for"`
// 报警设置
Settings AlertSetting `json:"settings"`
// 启用报警
Enabled *bool `json:"enabled"`
// 报警级别
Level string `json:"level"`
// 没有收到监控指标时将当前报警状态设置为对应的状态
NoDataState string `json:"no_data_state"`
// 报警执行错误将当前报警状态设置为对应的状态
ExecutionErrorState string `json:"execution_error_state"`
}
type AlertUpdateInput struct {
@@ -124,6 +132,10 @@ type AlertUpdateInput struct {
Enabled *bool `json:"enabled"`
// 报警级别
Level *string `json:"level"`
// 没有收到监控指标时将当前报警状态设置为对应的状态
NoDataState string `json:"no_data_state"`
// 报警执行错误将当前报警状态设置为对应的状态
ExecutionErrorState string `json:"execution_error_state"`
}
type AlertListInput struct {
@@ -135,3 +147,41 @@ type AlertListInput struct {
// 以报警是否启用/禁用过滤列表
Enabled *bool `json:"enabled"`
}
type AlertTestRunInput struct {
apis.Meta
IsDebug bool `json:"is_debug"`
}
// ResultLogEntry represents log data for the alert evaluation.
type ResultLogEntry struct {
Message string `json:"message"`
Data interface{} `json:"data"`
}
// EvalMatch represents the series violating the threshold.
type EvalMatch struct {
Condition string `json:"condition"`
Value *float64 `json:"value"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
}
type AlertTestRunOutput struct {
apis.Meta
Firing bool `json:"firing"`
EvalMatches []*EvalMatch `json:"eval_matches"`
Logs []*ResultLogEntry `json:"logs"`
Error error `json:"error"`
ConditionEvals string `json:"condition_evals"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
type AlertPauseInput struct {
apis.Meta
Paused bool `json:"paused"`
}

View File

@@ -0,0 +1,31 @@
package monitor
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
type AlertJointResourceBaseDetails struct {
SAlertJointsBase
Alert string `json:"alert"`
}
type AlertnotificationDetails struct {
AlertJointResourceBaseDetails
Notification string `json:"notification"`
}
type AlertJointCreateInput struct {
apis.Meta
AlertId string `json:"alert_id"`
}
type AlertnotificationCreateInput struct {
AlertJointCreateInput
NotificationId string `json:"notification_id"`
UsedBy string `json:"used_by"`
Params jsonutils.JSONObject `json:"params"`
}

View File

@@ -70,4 +70,5 @@ type MeterAlertUpdateInput struct {
ProjectId *string `json:"project_id"`
// 通知方式, 比如: email, mobile
Channel *string `json:"channel"`
Status *string `json:"status"`
}

View File

@@ -171,6 +171,7 @@ type AlertV1Details struct {
Measurement string `json:"measurement"`
Field string `json:"field"`
NotifierId string `json:"notifier_id"`
Status string `json:"status"`
}
type NodeAlertDetails struct {

View File

@@ -32,11 +32,3 @@ type NotificationTemplateConfig struct {
Level string `json:"level"`
IsRecovery bool `json:"is_recovery"`
}
// EvalMatch represents the series violating the threshold.
type EvalMatch struct {
Condition string `json:"condition"`
Value *float64 `json:"value"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
}

View File

@@ -0,0 +1,77 @@
// 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.
// Code generated by model-api-gen. DO NOT EDIT.
package monitor
import (
time "time"
"yunion.io/x/onecloud/pkg/apis"
)
// SAlert is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlert.
type SAlert struct {
apis.SVirtualResourceBase
Frequency int64 `json:"frequency"`
Settings interface{} `json:"settings"`
Level string `json:"level"`
Message string `json:"message"`
UsedBy string `json:"used_by"`
// Silenced bool
ExecutionError string `json:"execution_error"`
For int64 `json:"for"`
EvalData interface{} `json:"eval_data"`
State string `json:"state"`
NoDataState string `json:"no_data_state"`
ExecutionErrorState string `json:"execution_error_state"`
LastStateChange time.Time `json:"last_state_change"`
StateChanges int `json:"state_changes"`
}
// SAlertJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertJointsBase.
type SAlertJointsBase struct {
apis.SVirtualJointResourceBase
AlertId string `json:"alert_id"`
}
// SAlertnotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertnotification.
type SAlertnotification struct {
SAlertJointsBase
NotificationId string `json:"notification_id"`
State string `json:"state"`
Index byte `json:"index"`
UsedBy string `json:"used_by"`
}
// SDataSource is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SDataSource.
type SDataSource struct {
apis.SStandaloneResourceBase
Type string `json:"type"`
Url string `json:"url"`
User string `json:"user"`
Password string `json:"password"`
Database string `json:"database"`
IsDefault *bool `json:"is_default,omitempty"`
}
// SNotification is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SNotification.
type SNotification struct {
apis.SVirtualResourceBase
Type string `json:"type"`
IsDefault bool `json:"is_default"`
SendReminder bool `json:"send_reminder"`
DisableResolveMessage bool `json:"disable_resolve_message"`
Frequency int64 `json:"frequency"`
Settings interface{} `json:"settings"`
}

View File

@@ -19,7 +19,7 @@ import "yunion.io/x/onecloud/pkg/apis"
type ContactDetails struct {
apis.ModelBaseDetails
Id string `json:"id"`
UID string `json:"uid"`
Name string `json:"name"`
Details string `json:"details"`
}

View File

@@ -77,6 +77,7 @@ type ScheduleInput struct {
LiveMigrate bool `json:"live_migrate"`
CpuDesc string `json:"cpu_desc"`
CpuMicrocode string `json:"cpu_microcode"`
CpuMode string `json:"cpu_mode"`
PendingUsages []jsonutils.JSONObject
}
@@ -93,6 +94,17 @@ type CandidateDisk struct {
StorageIds []string `json:"storage_ids"`
}
type CandidateDiskV2 struct {
Index int `json:"index"`
Storages []*CandidateStorage `json:"storages"`
}
type CandidateStorage struct {
Id string
Name string
FreeCapacity int64
}
type CandidateNet struct {
Index int `json:"index"`
NetworkIds []string `json:"network_ids"`

View File

@@ -268,7 +268,7 @@ func (app *Application) defaultHandle(w http.ResponseWriter, r *http.Request, ri
hand, ok := handler.(*SHandlerInfo)
if ok {
fw := newResponseWriterChannel(w)
worker := make(chan *SWorker)
currentWorker := make(chan *SWorker, 1) // make it a buffered channel
to := hand.FetchProcessTimeout(r)
if to == 0 {
to = app.processTimeout
@@ -320,13 +320,13 @@ func (app *Application) defaultHandle(w http.ResponseWriter, r *http.Request, ri
} // otherwise, the task has been timeout
fw.closeChannels()
},
worker,
currentWorker,
func(err error) {
httperrors.InternalServerError(&fw, "Internal server error: %s", err)
fw.closeChannels()
},
)
runErr := fw.wait(ctx, worker)
runErr := fw.wait(ctx, currentWorker)
if runErr != nil {
switch runErr.(type) {
case *httputils.JSONClientError:

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