Compare commits

...

435 Commits

Author SHA1 Message Date
wanyaoqi
334fee5006 fix(region): reset guest quorum child index on guest shutdown (#25136) 2026-07-14 00:10:20 +08:00
wanyaoqi
960528ae22 fix(region): snapshot validate add check guest is quorum master guest (#25054) 2026-06-24 10:30:46 +08:00
wanyaoqi
c9494e0aaf fix(host): check cluster is valid before do qemuimg convert (#24925) 2026-06-02 20:00:54 +08:00
Jian Qiu
0e78b8a53d fix: undo pr 24532 (#24637)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2026-04-08 16:25:09 +08:00
Jian Qiu
7de2696457 fix: lbagent genHaproxyConfig possible nil pointer panic (#24532)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2026-03-25 10:32:13 +08:00
wanyaoqi
86d4079205 fix(host): dd zero to lv wife partitions on lvremove (#24523) 2026-03-23 19:01:33 +08:00
wanyaoqi
e65439b5a0 fix(scheduler): correct mem_free = (mem_total - mem_reserved) * mem_cmtbound (#23979) 2025-12-29 11:18:05 +08:00
Jian Qiu
2ea865df3d fix: splitable not function due to empty datefield (#23912)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2025-12-09 13:34:05 +08:00
wanyaoqi
cd3d699c46 fix(region): disk take snapshot check backing snapshot is merged (#23834) 2025-11-26 00:59:32 +08:00
Jian Qiu
5ff875cfa5 fix: validate policy role delete condition (#23811)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2025-11-21 12:03:33 +08:00
Jian Qiu
ffd35fb870 fix: default cloud region init error (#23473)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2025-10-03 06:35:08 +08:00
wanyaoqi
c934445ac8 fix(host): check min_free_kbytes size is enough (#23285) 2025-09-12 22:55:32 +08:00
wanyaoqi
ecaedce272 fix(region): try recover image cache on guest migrate (#23189) 2025-08-28 10:04:35 +08:00
wanyaoqi
c4ac131176 fix(scheduler): add session usage timeout options (#23146) 2025-08-21 18:11:20 +08:00
wanyaoqi
5ecdd7e404 fix(host): lvm guest reload disk before delete snapshot (#23056) 2025-08-08 20:56:57 +08:00
wanyaoqi
b0ad2ddd19 fix(host): generate ceph conf dup monHosts (#23023) 2025-08-06 18:31:19 +08:00
Jian Qiu
636e287145 fix: always update hostname for rhel-like os (#23020)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2025-08-06 01:07:06 +08:00
wanyaoqi
c7e032e96f fix(host,glance): only target qcow2 set cluster size on image convert (#22977) 2025-07-30 00:42:48 +08:00
wanyaoqi
3db68b9c5c fix(host): set qemuimg convert cluster_size 64k on compat image (#22968) 2025-07-29 00:04:38 +08:00
Zexi Li
cb7ee805c8 fix(scheduler): netinterface cache is not informed (#22904) 2025-07-15 20:00:14 +08:00
wanyaoqi
56ecdaf1d2 fix(region): do not set guest to resuce status on guest running (#22866) 2025-07-10 22:10:57 +08:00
wanyaoqi
3955a6ca98 fix(host): add check mem dev is null on guest setup (#22850) 2025-07-09 14:15:46 +08:00
wanyaoqi
9fc987e7ac fix(host): qemuimg convert add cluster_size (#22794) 2025-07-03 05:28:00 +08:00
屈轩
454d18be9b fix(region): vendor update (#22752) 2025-06-20 18:12:52 +08:00
屈轩
af6f84c887 fix(region): lb listener rule associate backend group (#22747) 2025-06-20 17:27:29 +08:00
wanyaoqi
3299b8d758 fix(region,host): add auto merge snapshots options, preallocation options (#22711) 2025-06-13 15:19:29 +08:00
wanyaoqi
7f72f23fab fix(host): qemu extra params format (#22611) 2025-05-27 13:34:26 +08:00
wanyaoqi
5d342b8a9c fix(region): guestdisk list add auto reset column (#22348) 2025-03-26 15:07:38 +08:00
wanyaoqi
4b7bd6a6aa fix(host): virtio nic add fdb record on has sriov nic (#22286) 2025-03-18 15:10:52 +08:00
Zexi Li
2b7f5fcb77 Merge pull request #22262 from zexi/automated-cherry-pick-of-#22259-upstream-release-3.10
Automated cherry pick of #22259: fix(webconsole,monitor): pprof handlers of gorilla mux
2025-03-11 12:27:52 +08:00
Zexi Li
9ed8ac48b9 fix(webconsole,monitor): pprof handlers of gorilla mux 2025-03-11 12:00:55 +08:00
wanyaoqi
929fbdd897 feat(glance,region,host): auto cache glance images to ceph storages (#22247) 2025-03-08 11:04:01 +08:00
wanyaoqi
09bb2ba976 fix(host): change storage clone disk add encrypt info (#22228) 2025-03-08 08:59:05 +08:00
Jian Qiu
a9df7ce31f Automated cherry pick of #22209: fix: disk copy to storage inherit classmeta (#22216)
* fix: disk copy to storage inherit classmeta

* fix: inheritFromTo parameter not match

---------

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2025-03-03 10:04:02 +08:00
wanyaoqi
c3183c4401 fix(host): shared lvm activte with auto activation option (#22192) 2025-02-27 16:05:49 +08:00
wanyaoqi
711786736f feat(region,host): add guest disk auto reset on shutdown support (#22197) 2025-02-27 16:03:07 +08:00
Jian Qiu
3e5e510605 fix: remove default values from cmtbound columns (#22158)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2025-02-24 17:32:21 +08:00
Jian Qiu
d1a50169b7 fix: disable server TLS 1.0, 1.x and 1.2 SHA1 (#22169)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2025-02-24 17:30:24 +08:00
Zexi Li
c151761076 fix(scheduler): 尽早发现子网ip不足引起的调度失败 (#22133) 2025-02-19 17:03:28 +08:00
Zexi Li
a7c05d1a14 optimized(scheduler): reduce scheduling time (#22032) 2025-02-05 10:25:40 +08:00
屈轩
11e479757d fix(region): avoid panic (#22050) 2025-02-05 09:56:17 +08:00
wanyaoqi
485d636c1d fix(region,host): slvm snapshot delete and instance snapshot purge (#22020) 2025-01-26 19:37:44 +08:00
wanyaoqi
4dba5726b6 fix(region): remove delete expired snapshot after auto snapshots (#22002) 2025-01-26 19:36:52 +08:00
Zexi Li
9d58922492 fix(glance): query vmware account brand (#22019) 2025-01-24 11:51:39 +08:00
Zexi Li
5067703dd3 fix(host): skip detect device that is not GPU class (#21986) 2025-01-18 06:14:58 +08:00
屈轩
94fbb84cd6 fix(region): loadbalancer listener create input (#21939) 2025-01-08 18:31:32 +08:00
wanyaoqi
f5f857e1f4 fix(region): record snapshot last attched host on delete disk (#21924) 2025-01-07 20:42:50 +08:00
屈轩
3bf0765018 fix(region): fetch lb backend owner (#21932) 2025-01-07 09:40:17 +08:00
wanyaoqi
32c8b2b03e Automated cherry pick of #21875: Automated cherry pick of #21804: [WIP] fix: add more action log (#21879)
* fix: add more action log

* fix(region): add set cmt bound action
2024-12-29 23:10:03 +08:00
屈轩
87c66d2a68 fix(region): skip record conflict error (#21898) 2024-12-26 09:46:41 +08:00
屈轩
75e57a903a fix(region): qcloud rds cpu option (#21893) 2024-12-25 10:55:34 +08:00
wanyaoqi
99a0bcff31 fix(host): delete snapshot from storagehandler misc fix (#21882) 2024-12-23 20:43:21 +08:00
屈轩
b0d387e685 fix(cloudmon): sync cloudproviders (#21734) 2024-12-04 09:42:49 +08:00
屈轩
5ac581e750 fix(apigateway): add service settings info (#21722) 2024-12-04 09:41:32 +08:00
Zexi Li
cde63b6b0d fix(monitor): clone alert dashboard (#21729) 2024-12-03 10:06:20 +08:00
屈轩
47ad66df21 fix(region): vendor update for qcloud net sync (#21716) 2024-11-29 16:13:46 +08:00
Zexi Li
e1779242b5 fix(monitor): add METRIC_UNIT_PPS (#21715) 2024-11-29 14:20:21 +08:00
Zexi Li
f9d304a639 Automated cherry pick of #21692: fix: complete monitor metrics (#21698)
* fix: complete monitor metrics

* fix(monitor): remove container related metrics

---------

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-11-26 14:45:56 +08:00
Zexi Li
d61e94e5f0 fix(monitor): inject ResType (#21624) 2024-11-19 13:59:51 +08:00
屈轩
e6fdd807c9 fix(region): add actual capacity used usage (#21575) 2024-11-12 11:35:17 +08:00
Zexi Li
426c4882b0 fix(monitor): alert notification details (#21577) 2024-11-12 11:28:04 +08:00
Zexi Li
718e036aba fix(monitor): add metric content for email template (#21570) 2024-11-11 16:09:54 +08:00
Jian Qiu
941bec7c39 fix: telegraf kakfa ordered configuration (#21551)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-11-07 09:49:59 +08:00
Zexi Li
b658742969 feat(region,climc): server-set-root-disk-matcher (#21544) 2024-11-06 18:53:02 +08:00
Zexi Li
1d248b054c fix(monitor): 修复报警恢复时包含其他资源的问题 (#21543) 2024-11-06 18:52:38 +08:00
屈轩
458ce7e4e0 fix(region): vendor update (#21501) 2024-11-04 14:54:46 +08:00
Zexi Li
790caabb8b fix(region): not set PrimaryZone when no dns_domain configured (#21511) 2024-11-04 12:39:52 +08:00
Jian Qiu
b7b874a747 feature: kafka telegraf output options (#21496)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-10-30 12:33:01 +08:00
wanyaoqi
957d69b1e2 fix(region,host): ceph add enable messenger v2 options (#21446) 2024-10-25 10:16:30 +08:00
Zexi Li
be5a09a67b fix(scheduler): avoid_same_host 策略分数过高导致调度分配不均 (#21412) 2024-10-16 10:22:57 +08:00
wanyaoqi
05645aaadc fix(region): check disk is deleted on delete snapshot (#21371) 2024-10-09 21:49:27 +08:00
wanyaoqi
4a9a768360 fix: fix slice init length (#21351)
Co-authored-by: cui fliter <imcusg@gmail.com>
2024-10-07 20:09:07 +08:00
wanyaoqi
8319a8f402 Automated cherry pick of #20996: fix(region,host): lvm snapshot delete and create from backup (#21312)
* fix(region,host): lvm snapshot delete and create from backup

* fix(host): slvm delete snapshot and save images

* fix(host): add option boot vga pci addr

* fix(host): slvm active exclusive mode on convert snapshot
2024-09-27 00:37:09 +08:00
Jian Qiu
d839581c8d fix: prevent access from anonymous user (#21244)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-09-14 19:37:01 +08:00
Zexi Li
35d11d2f8b feat(monitor): filter monitor_resource_alert by ip (#21218) 2024-09-12 11:00:59 +08:00
Zexi Li
f6ccb188e7 fix(moniotr): filter dirty resource alerts (#21215) 2024-09-12 10:04:59 +08:00
Zexi Li
383c1c71fc fix(climc): monitor-alert-test-run prints result error (#21213) 2024-09-11 20:04:49 +08:00
Zexi Li
c7b709ce82 optimized(monitor): keep 2 precision of reduced value (#21209) 2024-09-11 16:37:38 +08:00
wanyaoqi
d28ec77c04 fix(host): rbd save image use /opt/cloud temp dir (#21153) 2024-09-04 10:43:23 +08:00
Jian Qiu
7860619585 fix: telegraf config file format error (#21147)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-09-03 11:03:20 +08:00
Zexi Li
a89a474bed fix(climc): host-ssh is not working (#21114) 2024-08-27 16:25:41 +08:00
Zexi Li
0e0f31d55a fix(monitor): only show MEAN and SUM aggregators (#21101) 2024-08-26 17:40:15 +08:00
wanyaoqi
bfe7b47317 fix(host): nbd worker count add options (#21097) 2024-08-26 17:30:14 +08:00
屈轩
5dda4971be fix(region): dns record update with enabled params (#21083) 2024-08-23 10:20:48 +08:00
Jian Qiu
c586ce431b fix: filter islated devices capability info by zone (#21036)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-08-15 09:37:58 +08:00
Zexi Li
6c9a728e6b fix(baremetal): ignore 0.0.0.0 ipmi address when probing (#21006) 2024-08-13 17:43:26 +08:00
屈轩
b1298e1175 fix(region): custom total count (#21001) 2024-08-12 15:48:15 +08:00
屈轩
074cd00323 fix(region): show status info with list api (#20989) 2024-08-12 09:17:14 +08:00
wanyaoqi
e91c7d3b74 fix(host-deployer): add cpu mem hotplug udev rules (#20976) 2024-08-07 19:00:56 +08:00
wanyaoqi
a733ef75ca fix(host): too much qga ping logs (#20958) 2024-08-05 14:47:44 +08:00
Zexi Li
acd4e95ff1 feat(monitor): add inodes_used_percent metric (#20940) 2024-08-01 16:18:45 +08:00
Zexi Li
a046a3b12d fix(monitor): no alert_details in nodata monitor_resource_alert (#20933) 2024-07-31 13:47:05 +08:00
Zexi Li
a00e268b6b feat(monitor): multiple alerts of resource (#20926) 2024-07-30 16:16:12 +08:00
Zexi Li
59502b785c fix(mointor): multiple duplicated message (#20917) 2024-07-29 21:03:26 +08:00
Jian Qiu
0f16659b23 fix: opsadmin deny host perform login-info (#20906)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-07-29 13:21:06 +08:00
Zexi Li
83e8bb7344 feat(webconsole): add secret_level property inside query data (#20887) 2024-07-24 17:41:41 +08:00
Zexi Li
726251391e fix: webconsole display information control (#20884)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-07-24 17:38:49 +08:00
wanyaoqi
098a26160b Automated cherry pick of #20857: Manual cherrypick of #20852 to release/3.9 (#20858)
* fix(host): lvm disk create from backup

* fix(host): resolve confilct lvm create from backup
2024-07-22 15:12:37 +08:00
Zexi Li
b73b93c2b4 feat(host): add interface meta tags of netio metrics (#20782) 2024-07-12 10:18:42 +08:00
Zexi Li
9e05db4846 fix(baremetal): some tasks don't implement IServerBaseDeployTask interface (#20772) 2024-07-10 16:15:11 +08:00
屈轩
73111caf58 fix(region): optimized guest list speed (#20761) 2024-07-10 16:12:51 +08:00
wanyaoqi
329390f07a fix(host): disk reset with encryption (#20763) 2024-07-10 16:11:30 +08:00
Zexi Li
cf21ef26e0 fix(scheduler,baremetal): match RAID and PCIE storages in range (#20768)
The index of PCIE storages is not reindex when range is provided.
2024-07-09 11:12:01 +08:00
wanyaoqi
a0b56c038a fix(region,host): lvm snapshot reset and backup (#20717)
- fix lvm disk reset request hosts wrong, should reset on guest hosts
- add lvm disk snapshot failed handle
- support lvm disk backup
- lvm disk snapshot add encrypt support
2024-07-05 13:49:45 +08:00
Jian Qiu
7a34293068 feature: support baremetal profile (#20690)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-06-30 22:23:30 +08:00
wanyaoqi
0d2e7c3157 fix(region): login account allow startwith capital letter (#20672) 2024-06-27 20:50:43 +08:00
wanyaoqi
0c632a36fd fix(host): delete snapshot on guest deleted (#20643) 2024-06-26 21:19:17 +08:00
屈轩
0acb44d73b fix(region): snapshot policy update (#20655) 2024-06-26 18:09:31 +08:00
gouqi11
b61df821fa fix(region): fix snapshotpolicy create action (#20652)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-06-26 16:03:38 +08:00
wanyaoqi
a8e18cec36 Automated cherry pick of #20594: Fix/deploy reset password support loginaccount (#20597)
* fix(host): lvm resize add encrypt support

* fix(region): deploy reset password add loginaccount
2024-06-25 10:57:30 +08:00
Zexi Li
8e2ea908c5 fix(monitor): add difference tags for each series (#20621) 2024-06-22 22:06:23 +08:00
Zexi Li
fbaa21c67c fix(logger): add rejected action i18n translation (#20601) 2024-06-20 15:01:06 +08:00
Zexi Li
6b4a524704 feat(monitor): add reducer of AlertRecordRule (#20590) 2024-06-20 09:49:12 +08:00
Zexi Li
98e3d7fde9 feat(log): add i18n consts for itsm service (#20577) 2024-06-19 15:35:24 +08:00
Jian Qiu
469736380c fix: add predefined log policy (#20572)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-06-19 09:34:09 +08:00
wanyaoqi
78123575cc fix(region): insert iso sync guest status (#20543) 2024-06-16 22:59:54 +08:00
Jian Qiu
7da17468e1 fix: enable image cache cleanup by default (#20533)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-06-14 18:14:09 +08:00
gouqi11
7d55ca585a fix(notify): add mobile verify (#20522)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-06-13 18:59:50 +08:00
gouqi11
7a1b98b6f1 fix(notify): fix mobile validate (#20512)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-06-11 14:18:15 +08:00
wanyaoqi
911317dd01 fix(host): parse qga command and args (#20508) 2024-06-07 15:04:23 +08:00
wanyaoqi
d0a800208a fix(host-deployer): extend volume before extend filesystem (#20503) 2024-06-06 13:34:46 +08:00
Jian Qiu
7e4b352fb8 fix: disk backup details missing components (#20498)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-06-06 13:33:07 +08:00
Zexi Li
6b9ef0c926 feat(region,baremetal,climc): support baremetal root disk matcher (#20470) 2024-06-05 00:16:47 +08:00
屈轩
8646181751 fix(baremetal-agent): avoid dead lock (#20478) 2024-06-04 18:05:01 +08:00
wanyaoqi
b195999e17 fix(host-deployer): split guest dns by comma (#20451) 2024-06-03 19:15:52 +08:00
Zexi Li
69efb3a7b2 feat(monitor): remove precision of float when using max or min function (#20432) 2024-06-01 20:41:14 +08:00
wanyaoqi
ca7149dd7f fix(region): storagecacheresource panic on FetchCustomizeColumns (#20428) 2024-05-31 17:54:00 +08:00
gouqi11
e9871f4e9d fix(notify): message add medium tag (#20422)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-05-31 10:39:25 +08:00
Jian Qiu
4f55172d6a fix: haproxy check parammeters with default value (#20418)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-05-31 10:20:35 +08:00
wanyaoqi
065138b504 fix(region,host): slvm default deactivate on hosts (#20380) 2024-05-30 15:03:36 +08:00
gouqi11
a84da849a6 fix(notify): change receiver owner (#20400)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-05-30 11:47:12 +08:00
Zexi Li
ed67fcc159 feat(climc): feature config (#20397) 2024-05-30 10:48:39 +08:00
Zexi Li
c8c5bf9e84 fix(host): wrap disk probed error (#20387) 2024-05-29 17:44:20 +08:00
Zexi Li
2dfc84fbdf fix(monitor): detach alert (#20376) 2024-05-28 10:00:39 +08:00
Zexi Li
97ecac0230 fix(monitor): multiple monitor resource alert (#20368) 2024-05-27 15:45:14 +08:00
wanyaoqi
baef6e919c fix(host): resize lvm disk (#20316) 2024-05-20 10:49:35 +08:00
Jian Qiu
65e12adada fix: vpc network no resulve.conf (#20305)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-05-16 17:08:25 +08:00
Jian Qiu
a5e4e5aa65 fix: hostbackupstorage climc subcmds (#20287)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-05-15 18:03:30 +08:00
wanyaoqi
5c3d901547 fix(region,host): slvm misc fix (#20272) 2024-05-15 10:45:42 +08:00
wanyaoqi
73f86fc44a fix(region): return origin error on fetch joint item failed (#20249) 2024-05-13 17:51:14 +08:00
Jian Qiu
e18ee04afb fix: ceph stats backward compatible with ceph 12.x (#20222)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-05-10 14:55:20 +08:00
Jian Qiu
8c61d0090b fix: storagecachedimages details speedup (#20231)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-05-10 14:53:43 +08:00
Jian Qiu
27943ed5e5 fix: cachedimage sync tenant_id (#20238)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-05-10 14:52:51 +08:00
屈轩
6259f71228 fix(region): zstack shared block storage (#20227) 2024-05-09 14:25:59 +08:00
Jian Qiu
3188808dec Automated cherry pick of #20209: feature: automatically clean obsolete images from host iamge cache (#20223)
* feature: automatically clean obsolete images from host iamge cache

* minor fixes

---------

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-05-09 12:11:09 +08:00
wanyaoqi
9f74455d88 fix(host): ignore disk not found on disk delete handler (#20176) 2024-04-30 07:14:45 +08:00
Zexi Li
3a05432746 fix(monitor): multiple metrics query of alert (#20170) 2024-04-28 19:06:00 +08:00
Zexi Li
b9c26518a5 feat(monitor): support multiple metrics alert (#20159) 2024-04-28 11:36:04 +08:00
wanyaoqi
08cad45aea Automated cherry pick of #20152: Fix/host misc fix 0425 (#20153)
* fix(host): dirty guest dir move to recycle dir

* fix(host-deployer): fix deployer guest ssh port range, use localhost

* fix(host): try bind vfio dirver use addr
2024-04-28 11:18:44 +08:00
Zexi Li
467c755036 fix(monitor): alert panic (#20149) 2024-04-26 12:19:17 +08:00
Zexi Li
0d0680b0ea fix(monitor): filter alerts by monitor_resource_id (#20136) 2024-04-25 17:06:59 +08:00
Zexi Li
c893c71e8a fix(monitor): query monitor_resource_alert by monitor_resource_id is not working (#20132) 2024-04-25 15:49:05 +08:00
Jian Qiu
d4016f744f fix: guest stop revisit (#20094)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-04-22 14:51:48 +08:00
wanyaoqi
c19d970b33 fix(regin,host): delete snapshots after stream complete (#20086) 2024-04-19 18:27:47 +08:00
Jian Qiu
61637e7000 fix: backup storage access containd by hosts (#20064)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-04-19 07:21:03 +08:00
屈轩
8af82884bc fix(region): avoid skip zone purge (#20067) 2024-04-18 15:39:29 +08:00
屈轩
b2cfdd4166 fix(region): vendor update for code generate (#20060) 2024-04-18 13:22:56 +08:00
Zexi Li
0f6b24a88b Merge pull request #20016 from wanyaoqi/automated-cherry-pick-of-#20013-upstream-release-3.10
Automated cherry pick of #20013: fix(region,host): custom device model add auto detect option
2024-04-17 10:28:09 +08:00
Zexi Li
e4df4f2605 Merge pull request #19993 from wanyaoqi/fix/host-sriov-bond
fix(host): sriov bond
2024-04-17 10:26:22 +08:00
wanyaoqi
27d7b39f8a fix(region,host): custom device model add auto detect option
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2024-04-16 19:55:06 +08:00
Zexi Li
6a887329a1 Merge pull request #20000 from swordqiu/automated-cherry-pick-of-#19996-upstream-release-3.10
Automated cherry pick of #19996: fix: disk post create not inherit upper class
2024-04-16 18:20:57 +08:00
Zexi Li
4dfcc5f7ac Merge pull request #20028 from wanyaoqi/automated-cherry-pick-of-#20025-upstream-release-3.10
Automated cherry pick of #20025: fix(host): fix gpu device vendor check strategy
2024-04-16 18:19:48 +08:00
Zexi Li
edb7dc288f Merge pull request #20009 from swordqiu/automated-cherry-pick-of-#20006-upstream-release-3.10
Automated cherry pick of #20006: fix: fail to create encrypted nfs disk
2024-04-16 16:00:54 +08:00
wanyaoqi
6a9a551169 fix(host): fix gpu device vendor check strategy
Check gpu device vendor id on class code is DISPLAY.

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2024-04-16 15:57:40 +08:00
Qiu Jian
4762650665 fix: fail to create encrypted nfs disk 2024-04-16 00:19:01 +08:00
Qiu Jian
1d4e6511eb fix: disk post create not inherit upper class 2024-04-15 21:47:44 +08:00
屈轩
fe50664353 fix(image): set image upload download timeout 4 hour (#19979) 2024-04-15 10:14:01 +08:00
wanyaoqi
0fe7bbec46 fix(host): init from existing guest load cpuset 2024-04-12 19:21:20 +08:00
wanyaoqi
ec863b29aa fix(host): detect sriov bond nics 2024-04-12 17:33:38 +08:00
Jian Qiu
e920b6bcdf fix: netplan empty bond address @ release/3.10 (#19951)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-04-11 18:11:52 +08:00
屈轩
52aac7072f fix(region): vendor update (#19949) 2024-04-11 15:06:59 +08:00
屈轩
9727232aab fix(region): avoid purge zone (#19939) 2024-04-11 14:01:57 +08:00
Zexi Li
906635d954 Merge pull request #19928 from swordqiu/hotfix/qj-disable-disk-serial-for-esxi-3.10
fix: disable disk serial for esxi vm on release/3.10
2024-04-11 11:35:00 +08:00
Qiu Jian
12c3369a56 fix: disable disk serial for esxi vm on release/3.10 2024-04-11 01:16:07 +08:00
屈轩
d7bd82d534 fix(region): avoid purge regions (#19925) 2024-04-10 17:06:18 +08:00
wanyaoqi
fedc88762b Automated cherry pick of #19844: feat: lvm snapshots (#19893)
* fix(region,host): remove snapshot fake delete state

* feat(region,host): lvm snapshot support
2024-04-08 02:56:04 +08:00
Jian Qiu
d493013428 fix: fail to detect lv by megacli64 and storecli (#19882)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-04-08 00:27:13 +08:00
屈轩
f960354c76 fix(region): prepare regions by prefix (#19874) 2024-04-03 10:15:19 +08:00
屈轩
aee1d8be2a fix(region): total count rds by zone id (#19868) 2024-04-02 20:33:01 +08:00
屈轩
9fa7b7ffd2 fix(region): vendor update for region sync (#19865) 2024-04-02 20:22:29 +08:00
gouqi11
37eb481e3e fix(notify): clean notificationGroup after send (#19860)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-04-02 18:40:20 +08:00
Zexi Li
6402b79c65 Merge pull request #19852 from swordqiu/automated-cherry-pick-of-#19850-upstream-release-3.10
Automated cherry pick of #19850: fix: idp list query filter by sso_domain
2024-04-02 10:36:12 +08:00
Qiu Jian
a43fe54154 fix: idp list query filter by sso_domain 2024-04-02 01:30:51 +08:00
屈轩
0a11bdf8fb fix(region): billing resource check (#19842) 2024-04-01 10:06:23 +08:00
Zexi Li
96526ad6a0 Merge pull request #19832 from wanyaoqi/automated-cherry-pick-of-#19830-upstream-release-3.10
Automated cherry pick of #19830: fix(host-deployer): deploy guest arm kernel path fix
2024-03-29 16:15:19 +08:00
wanyaoqi
9220554156 fix(host-deployer): deploy guest arm kernel path fix 2024-03-29 16:13:24 +08:00
屈轩
bb071ea46d fix(region): vendor update (#19828) 2024-03-29 10:38:05 +08:00
屈轩
48506a293b fix(region): cloudpods region sync (#19822) 2024-03-28 15:33:46 +08:00
Zexi Li
f1a163702d Merge pull request #19811 from wanyaoqi/automated-cherry-pick-of-#19803-upstream-release-3.10
Automated cherry pick of #19803: fix(host): delete lvm disk active first
2024-03-27 20:23:34 +08:00
屈轩
5044c06e59 fix(region): avoid panic (#19817) 2024-03-27 15:05:22 +08:00
wanyaoqi
7ca2f7b3ce fix(host): resize slvm disk 2024-03-26 22:56:39 +08:00
wanyaoqi
78c7cb32ad fix(host): delete lvm disk active first 2024-03-26 22:56:39 +08:00
Jian Qiu
876eda36ea fix: create lb listener rules fail due to domain not found (#19787)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-03-26 09:49:45 +08:00
wanyaoqi
01bd3b3c56 fix(ansibleserver): update file repo (#19774) 2024-03-26 09:48:37 +08:00
Jian Qiu
5772b2a3fa fix: server skus ignore seting SetModelManager (#19779)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-03-26 09:47:31 +08:00
屈轩
94fd886cda fix(vpcagent): signal killed (#19763) 2024-03-22 09:37:39 +08:00
屈轩
3a5b215731 fix(vpcagent): prevent the security group deletion rule from taking effect (#19760) 2024-03-21 20:39:23 +08:00
屈轩
36f873ef4b fix(notify): simplify receiver api (#19766) 2024-03-21 20:07:45 +08:00
Zexi Li
78daf104b0 Merge pull request #19732 from wanyaoqi/automated-cherry-pick-of-#19730-upstream-release-3.10
Automated cherry pick of #19730: fix(region,host): lvm storage misc fix
2024-03-21 19:53:41 +08:00
屈轩
ee02051ce0 fix(region): skip set lost name when purge deleted vm (#19754) 2024-03-20 18:20:13 +08:00
屈轩
66bd2a10f9 fix(region): support create vmware vm with desc (#19741) 2024-03-18 09:47:22 +08:00
wanyaoqi
f8df78755c fix(region,host): lvm storage misc fix
- add some lvm storage create check
- fix slvm storage image cache not correct

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2024-03-14 22:16:02 +08:00
屈轩
1b237ce01c fix(esxi-agent): create vmware vm with suitable version (#19727) 2024-03-14 15:54:31 +08:00
Zexi Li
5d010d9097 Merge pull request #19713 from wanyaoqi/automated-cherry-pick-of-#19711-upstream-release-3.10
Automated cherry pick of #19711: fix(host): gpu probe check vendor is amd or nvidia
2024-03-13 20:06:24 +08:00
Zexi Li
5c3b8805f1 Merge pull request #19716 from swordqiu/automated-cherry-pick-of-#19714-upstream-release-3.10
Automated cherry pick of #19714: fix: tag filter with no value revisit
2024-03-13 20:05:11 +08:00
屈轩
4fab709e03 fix(region): filter disks by guest status (#19722) 2024-03-13 19:10:58 +08:00
屈轩
0fb3bcccf4 fix(region): avoid panic when network is nil (#19719) 2024-03-13 11:58:54 +08:00
Qiu Jian
df3be7a101 fix: tag filter with no value revisit 2024-03-12 22:06:34 +08:00
wanyaoqi
96d67a6833 fix(host): gpu probe check vendor is amd or nvidia 2024-03-12 21:38:08 +08:00
屈轩
154433943c fix(region): avoid duplicate vm name (#19707) 2024-03-12 15:50:17 +08:00
Jian Qiu
a4567fb721 fix: host-deploy options struct consistent with host options (#19696)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-03-12 13:35:55 +08:00
Zexi Li
8436e27831 Merge pull request #19690 from swordqiu/automated-cherry-pick-of-#19688-upstream-release-3.10
Automated cherry pick of #19688: fix: make authManager a singleton
2024-03-12 10:49:35 +08:00
屈轩
24c2c0846e fix(region): avoid update network dns panic (#19699) 2024-03-11 10:57:53 +08:00
Qiu Jian
771304a2f4 fix: make authManager a singleton 2024-03-10 10:09:39 +08:00
Jian Qiu
5969e2b20c fix: webconsole command log empty opstime (#19684)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-03-10 07:24:47 +08:00
Jian Qiu
c9ce8f9930 fix: vpcagent always do full sync, disable incremental sync (#19630)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-03-10 07:23:38 +08:00
wanyaoqi
f0e3fcf3a2 fix(host): qga set network flush ipv4 address (#19673) 2024-03-10 07:22:40 +08:00
屈轩
6e93cf13fe fix(region): vendor update for qcloud nat sync (#19678) 2024-03-08 18:13:48 +08:00
Zexi Li
509f838827 Merge pull request #19666 from swordqiu/hotfix/qj-always-add-static-routes
fix: always add static routes for default nic
2024-03-07 10:04:33 +08:00
Qiu Jian
a81f05cedc fix: always add static routes for default nic 2024-03-06 19:35:05 +08:00
屈轩
bf22a4fa22 fix(region): vendor update for sync azure network cidr (#19663) 2024-03-06 18:08:27 +08:00
Jian Qiu
a2cd574870 fix: donot use insertOrUpdate for create joint resources (#19652)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-03-06 02:24:06 +08:00
wanyaoqi
61103acb4a fix(host-deployer): support deploy encrypted disk (#19641) 2024-03-06 02:23:15 +08:00
wanyaoqi
76a5e1c6da fix(host): backup guest dirty shutdown (#19622)
backup guest dirty shutdown master request sync status,
slave request dirty start.
2024-03-06 02:21:57 +08:00
wanyaoqi
229544d14e feat(region,host): support shared driver by lvmlockd (#19617) 2024-03-06 02:20:31 +08:00
屈轩
dabb647d94 fix(region): dissociate eip when vm deleted (#19648) 2024-03-05 18:35:56 +08:00
屈轩
1fbadd5bcb fix(region): sync account project (#19645) 2024-03-05 17:18:25 +08:00
屈轩
0633063fc0 fix(region): compatible with v3.9 vm cdrom (#19638) 2024-03-05 15:57:00 +08:00
Zexi Li
b1fe1f6ff0 Merge pull request #19633 from swordqiu/automated-cherry-pick-of-#19631-upstream-release-3.10
Automated cherry pick of #19631: fix: tokenCache newInformer fail
2024-03-05 10:29:57 +08:00
Qiu Jian
20937a79e3 fix: tokenCache newInformer fail 2024-03-05 00:30:40 +08:00
屈轩
15d8af61d6 fix(region): vendor update for azure associate type (#19626) 2024-03-04 20:09:22 +08:00
gouqi11
06f54776de fix(influxdb): support set timeout (#19601)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-03-03 10:48:00 +08:00
屈轩
7c1eee7f9f fix(region): raw query with delete-all options (#19605) 2024-03-01 19:36:40 +08:00
屈轩
9bdc4617e5 fix(cloudmon): collect metric with project tags (#19599) 2024-03-01 16:46:22 +08:00
屈轩
4fcdf8476f fix(region): avoid sync huawei lb backend panic (#19591) 2024-03-01 10:41:37 +08:00
屈轩
2a04dea345 fix(region): ctyun api page size must le 50 (#19586) 2024-02-29 18:20:45 +08:00
屈轩
c06c3b4a1b fix(region): skip sync apsara expired time (#19581) 2024-02-29 16:08:19 +08:00
屈轩
40e44b1828 fix(keystone): domain-list with delete-all options (#19578) 2024-02-29 16:06:20 +08:00
屈轩
74eba501d4 fix(notify): add capability for notify config (#19572) 2024-02-29 14:36:36 +08:00
wanyaoqi
abc4558b24 Automated cherry pick of #19547: Fix/create from iso set os distro (#19549)
* fix(region): iso guest copy image props to metadata

* fix(region): always run host ping detect task
2024-02-28 14:16:49 +08:00
Jian Qiu
cf5208c9c5 fix: backport cephutils to 3.10/3.9 (#19545)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-28 14:02:59 +08:00
wanyaoqi
1e88f4cd24 Automated cherry pick of #19558: Fix/guest image live migrate (#19560)
* fix(host): slvm storage active on init

* fix(region): guest live migrate cache all of guestimage caches
2024-02-28 11:32:14 +08:00
Zexi Li
8f1f82e05c Merge pull request #19561 from zexi/sched-queue-key
fix(scheduler): unsued key
2024-02-28 10:59:53 +08:00
Zexi Li
0051cc6aae fix(scheduler): unsued key 2024-02-28 10:24:46 +08:00
wanyaoqi
bb25345eaf fix(host): load guest desc hpet and video1 dev (#19532) 2024-02-24 07:51:44 +08:00
Jian Qiu
309af994d8 fix: support OpenCloudOS, OpenKylin, Alma, UOSDesktop (#19529)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-24 07:50:14 +08:00
gouqi11
220a908707 fix(util): fix excelutils set emptu cell (#19526)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-02-22 19:55:34 +08:00
屈轩
26dbb92fda fix(region): vendor update for qcloud nat status (#19514) 2024-02-20 16:01:48 +08:00
wanyaoqi
112f4ebfc3 fix(host): script start guest donot force restart on monitor timeout (#19502) 2024-02-19 20:52:20 +08:00
wanyaoqi
0bb4fb9944 feat(region,host): guest numa allocate (#19400) 2024-02-18 19:35:05 +08:00
屈轩
e9a29645eb fix(region): vendor update for openstack https support (#19495) 2024-02-18 10:22:47 +08:00
Jian Qiu
3253857e94 fix: invalid token request too frequent (#19490)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-17 19:00:22 +08:00
Jian Qiu
0ba359589a fix: sync error (#19414)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-10 16:32:56 +08:00
wanyaoqi
051025e944 fix(host-deployer): elfherader fd leak (#19473) 2024-02-08 14:11:00 +08:00
屈轩
8462776b4d fix(region): add read only filter for account and provider (#19470) 2024-02-07 15:33:08 +08:00
wanyaoqi
c0efb08381 fix(host-deployer): xfs unlock panic (#19456) 2024-02-06 00:31:45 +08:00
屈轩
79a5e8063c fix(region): qcloud disks delete when vm deleted (#19454) 2024-02-05 17:54:55 +08:00
屈轩
90265c3191 fix(region): cloudpods deploy api (#19448) 2024-02-05 11:23:49 +08:00
Jian Qiu
95d93f80de Automated cherry pick of #19440: fix: tenant cache sync deleted projects (#19442)
* fix: tenant cache sync deleted projects

* remove user sync

---------

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-05 08:45:31 +08:00
屈轩
8e836e5baf fix(region): avoid filesystem sync error (#19437) 2024-02-04 15:20:53 +08:00
gouqi11
319ac1b782 fix(scheduledtask): fix deletedResource task (#19429)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-02-04 10:42:58 +08:00
Zexi Li
fa1c6de647 Merge pull request #19421 from wanyaoqi/fix/host-memobj-miss-size
fix(host): init from guest mem obj miss size
2024-02-02 16:53:31 +08:00
wanyaoqi
fe7412761a fix(host): init from guest mem obj miss size 2024-02-02 16:41:25 +08:00
Jian Qiu
5d895393d2 fix: sync unknown guest status when host ping (#19383)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-01 10:57:32 +08:00
屈轩
e0d967b85d fix(common): auto disable 3des cipher suites (#19393) 2024-02-01 10:57:13 +08:00
Zexi Li
a75e24d2f2 Merge pull request #19365 from swordqiu/automated-cherry-pick-of-#19363-upstream-release-3.10
Automated cherry pick of #19363: fix: validate policy violation when assign users for oidc IDP
2024-01-28 21:58:58 +08:00
Qiu Jian
9fcde5f2cc fix: validate policy violation when assign users for oidc IDP 2024-01-27 18:17:48 +08:00
Zexi Li
2c0e7fd689 fix(apigateway): ignore empty rows when registering baremetal host (#19353) 2024-01-27 18:16:23 +08:00
wanyaoqi
e15d5332ba fix(host-deployer): escape back quote (#19358) 2024-01-27 08:10:40 +08:00
Zexi Li
d2b21b9374 Merge pull request #19348 from wanyaoqi/automated-cherry-pick-of-#19347-upstream-release-3.10
Automated cherry pick of #19347: fix(host-deployer): check sshclient is nil on disconnect
2024-01-26 16:04:13 +08:00
wanyaoqi
5f4e8d2d3d fix(host-deployer): check sshclient is nil on disconnect 2024-01-26 12:10:29 +08:00
Zexi Li
f1448fda84 Merge pull request #19345 from zexi/fix-pkg-version
fix(vendor): fixed yunion.io/x/pkg version to v1.10.0
2024-01-25 20:26:09 +08:00
Zexi Li
f9631dceba fix(vendor): fixed yunion.io/x/pkg version to v1.10.0 2024-01-25 20:16:08 +08:00
Zexi Li
c8f025f9c1 Merge pull request #19342 from zexi/sched-projects
optimized(scheduler): remove fillResidentTenants function loading data from db
2024-01-25 17:10:44 +08:00
Zexi Li
6da2cbcb2b optimized(scheduler): remove fillResidentTenants function loading data from db 2024-01-25 16:52:10 +08:00
Zexi Li
2615b0282a Merge pull request #19334 from zexi/bm-h3c
fix(baremetal): hardcode h3c ipmi lan channel to 1
2024-01-25 15:49:29 +08:00
Zexi Li
de266f79b9 fix(baremetal): hardcode h3c ipmi lan channel to 1 2024-01-25 11:52:06 +08:00
Zexi Li
8f3eb73ffd Merge pull request #19314 from zexi/upgrade-telegraf-raid-plugin
fix(build): use telegraf-raid-plugin:release-1.6.5
2024-01-22 16:59:12 +08:00
Zexi Li
3accf7f3ae fix(build): use telegraf-raid-plugin:release-1.6.5 2024-01-22 16:48:14 +08:00
屈轩
95f577c4c1 fix(region): eip sync with project (#19303) 2024-01-19 14:04:22 +08:00
gouqi11
dc916a3282 fix(region): add public_cloud_provider list (#19288)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-01-18 10:48:59 +08:00
Jian Qiu
fbb82f84c7 fix: try resolve tenant by project id first (#19278)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-17 00:28:41 +08:00
Jian Qiu
877bd56198 fix: automatically refresh invalid admin token (#19274)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-17 00:28:08 +08:00
屈轩
648c5eb21c fix(region): vendor update for pve vm sync (#19267) 2024-01-16 15:34:52 +08:00
屈轩
b155224e3a fix(region): esxi vm create with tags (#19264) 2024-01-16 14:25:58 +08:00
屈轩
6f0372f8e8 fix(region): avoid duplicate cachedimage insert (#19256) 2024-01-15 18:30:49 +08:00
wanyaoqi
331b87df8b fix(host-deployer): add growpart resize partitions (#19246) 2024-01-15 12:14:03 +08:00
wanyaoqi
0b496af99b fix(host-deployer): add cmdline vsyscall=emulate on ramfs guest (#19222)
deploy fs on older system like centos 6, need emulate vsyscall.
otherwise will get error like:
    Code: Unable to access opcode bytes at 0xffffffffff6003d6.
2024-01-11 05:44:17 +08:00
Jian Qiu
61d5207105 fix: verbose api helper params (#19221)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-11 05:43:45 +08:00
Jian Qiu
7c9a8e80a7 fix: verbose api helper params (#19219)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-11 05:43:35 +08:00
wanyaoqi
f4a0da91a6 feat(region,host): shared lvm storage (#19177) 2024-01-10 23:25:35 +08:00
Zexi Li
24d75f3736 Merge pull request #19197 from wanyaoqi/automated-cherry-pick-of-#19196-upstream-release-3.10
Automated cherry pick of #19196: fix(host): host-agent register skip upload vf nics
2024-01-10 10:28:32 +08:00
Zexi Li
873518d98a Merge pull request #19215 from wanyaoqi/fix/host-deployer-guest-mem-size
fix(host-deployer): deploy params has special char
2024-01-10 10:27:05 +08:00
wanyaoqi
323a9890f8 fix(host-deployer): deploy params has special char 2024-01-09 23:01:20 +08:00
屈轩
c1202e6b4c fix(region): skip sync used ip addr (#19209) 2024-01-09 17:50:36 +08:00
屈轩
86209f23a1 fix(region): image project tags (#19212) 2024-01-09 17:50:02 +08:00
屈轩
4a68beb063 fix(region): skip clear secgroup when delete vm (#19201) 2024-01-09 16:59:20 +08:00
wanyaoqi
e03f259dd6 fix(host): host-agent register skip upload vf nics 2024-01-08 23:13:32 +08:00
屈轩
5649535c8d fix(region): support aliyun essd entry (#19186) 2024-01-08 11:18:11 +08:00
wanyaoqi
ca75c9804a fix(host): host register set isinit false on hostId not null (#19153)
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2024-01-02 14:00:55 +08:00
Jian Qiu
3c63350d7c fix: qmp free port test (#19150)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-02 14:00:12 +08:00
wanyaoqi
15816b90f5 fix(region): ovs offload interface get ifname from isolated devices tlb (#19145)
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2023-12-31 12:30:05 +08:00
Jian Qiu
93372985e3 fix: network update params backport 3.10 (#19144)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-31 11:59:09 +08:00
Jian Qiu
7467605d48 fix: deploy user ssh keypair for user account only (#19135)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-30 16:56:49 +08:00
Zexi Li
de0061a848 Merge pull request #19131 from swordqiu/automated-cherry-pick-of-#19129-upstream-release-3.10
Automated cherry pick of #19129: fix: avoid megacli hang on adpallinfo
2023-12-29 16:37:16 +08:00
Qiu Jian
de0230dc1d fix: avoid megacli hang on adpallinfo 2023-12-28 22:16:59 +08:00
gouqi11
e9d111f073 fix(monitor): fix alertRecord manager (#19119)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-12-27 17:30:54 +08:00
Jian Qiu
f6c23817a6 fix: backport network avaialble addresses (#19112)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-26 20:43:37 +08:00
wanyaoqi
8e6d5a16e3 fix(region,host-deployer): qga os distribution format (#19107)
host-deployer fix xfs mount error

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2023-12-26 20:15:10 +08:00
Jian Qiu
5babce8322 fix: delete server will purge instance backups (#19104)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-26 15:44:50 +08:00
wanyaoqi
0e43e81dfc feat(region,host): guest sync os info (#19098) 2023-12-26 12:49:17 +08:00
Zexi Li
08e594819d Merge pull request #19088 from zexi/cp-18190
fix(hostman): try to deploy telegraf via systemd
2023-12-23 11:46:13 +08:00
Zexi Li
948dd7f779 fix(hostman): try to deploy telegraf via systemd
cherry pick https://github.com/yunionio/cloudpods/pull/18190
2023-12-22 19:42:11 +08:00
屈轩
f7ea547bc7 fix(region): change storage_size from int to int64 (#19087) 2023-12-22 18:36:21 +08:00
Zexi Li
a780425627 Merge pull request #19082 from wanyaoqi/fix/host-deployer-init-qemu-driver
fix(host-deployer): check executor is enabled on init qemu driver
2023-12-22 17:31:52 +08:00
wanyaoqi
5a20a7baa8 fix(host-deployer): check executor is enabled on init qemu driver 2023-12-22 16:30:02 +08:00
屈轩
5339c8363b fix(region): optimized disk list (#19078) 2023-12-22 14:49:42 +08:00
Zexi Li
6a34dd7216 feat(baremetal-agent): support using tftp to download kernel and initrd (#19056) 2023-12-21 00:50:39 +08:00
屈轩
3b0324bc1f fix(region): vendor update for volcengine network and aws dnsrecords sync (#19063) 2023-12-20 11:35:16 +08:00
Zexi Li
0202907b2e Merge pull request #19048 from zhasm/automated-cherry-pick-of-#19046-upstream-release-3.10
Automated cherry pick of #19046: fix(docker): update dockerfile for ansible-base
2023-12-19 13:17:10 +08:00
Zhang Dongliang
13152e9595 fix(docker): update dockerfile for ansible-base 2023-12-19 13:08:52 +08:00
Zexi Li
c800e3ed13 Merge pull request #19033 from swordqiu/hotfix/qj-disable-pvpanic-dev
fix: disable pvpanic dev
2023-12-18 17:26:41 +08:00
Zexi Li
06bcfe340f Merge pull request #19031 from wanyaoqi/fix/host-deployer-config
fix(host-deployer): pass config files to deploy vm
2023-12-18 17:25:05 +08:00
Zexi Li
4efa4a6724 Merge pull request #19037 from wanyaoqi/fix/usb-device-id
fix(host): usb device hotplug
2023-12-18 17:23:02 +08:00
wanyaoqi
703ddee2ed fix(host-deployer): pass config files to deploy vm 2023-12-18 16:41:22 +08:00
Qiu Jian
cefd594d5f fix: disable pvpanic dev 2023-12-18 16:33:57 +08:00
wanyaoqi
33ec145d2a fix(host): hot add usb device 2023-12-18 15:26:56 +08:00
wanyaoqi
bef55edf9e fix(host): usb host device add device_id 2023-12-18 13:33:17 +08:00
gouqi11
e8879cc7f6 feat(region): add ip_addr for rds.GetShortDesc (#19023)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-12-16 16:38:10 +08:00
Zexi Li
9ee9bb5274 Merge pull request #19007 from zexi/sched-cloudprovider-sync
fix(scheduler): reload cloudprovider's hosts when syncing finished
2023-12-16 10:06:02 +08:00
Zexi Li
fff4824984 fix(scheduler): reload cloudprovider's hosts when syncing finished 2023-12-15 20:17:06 +08:00
Zexi Li
60d6f3da06 fix(cloudcommon): service config informer doesn't start watching (#19003) 2023-12-15 14:58:29 +08:00
Zexi Li
8784bebbde Merge pull request #18999 from wanyaoqi/fix/host-deployer-yunionos
fix(host-deployer): udpate yunionos, reduce yunionos memsize
2023-12-15 11:50:07 +08:00
wanyaoqi
d177d68359 fix(host-deployer): udpate yunionos, reduce yunionos memsize 2023-12-15 11:39:16 +08:00
屈轩
2a64576b87 fix(region): avoid duplicate rule name for gcp (#18991) 2023-12-14 11:23:42 +08:00
wanyaoqi
97826501d5 feat(region,host): clvm support (#18949) 2023-12-14 09:41:33 +08:00
Zexi Li
ce403d1503 Merge pull request #18984 from zexi/automated-cherry-pick-of-#18981-upstream-release-3.10
Automated cherry pick of #18981: fix(monitor): fetch measurements from victoriametrics
2023-12-13 19:47:33 +08:00
Zexi Li
43cfc6e87a fix(monitor): fetch measurements from victoriametrics 2023-12-13 19:07:27 +08:00
Zexi Li
7f856291c9 Merge pull request #18983 from zexi/automated-cherry-pick-of-#18908-upstream-release-3.10
Automated cherry pick of #18908: fix(monitor): map interval to step
2023-12-13 19:06:14 +08:00
Zexi Li
6a3fc188b5 fix(monitor): map interval to step 2023-12-13 19:04:36 +08:00
Zexi Li
90f73232f6 Merge pull request #18975 from zexi/monitor-mem-mig
fix(monitor): consider whether the target host is in source host of mem balancer
2023-12-13 13:38:07 +08:00
Zexi Li
d0fe863aae fix(monitor): consider whether the target host is in source host of mem balancer 2023-12-13 12:50:36 +08:00
Zexi Li
177148af92 Merge pull request #18971 from ioito/automated-cherry-pick-of-#18969-upstream-release-3.10
Automated cherry pick of #18969: fix(region): vendor update for gcp rebuild-root sys disk size and password login
2023-12-12 18:21:23 +08:00
ioito
0e81616ba3 fix(region): vendor update for gcp rebuild-root sys disk size and password login 2023-12-12 17:25:06 +08:00
Zexi Li
3c8f464e55 Merge pull request #18965 from wanyaoqi/fix/host-deployer-run-guest-on-host
fix(host-deployer): run guest on host and ignore no config file
2023-12-12 15:18:52 +08:00
wanyaoqi
ab9a6e523e fix(host-deployer): run guest on host and ignore no config file
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2023-12-12 14:52:51 +08:00
Zexi Li
439a2dc978 Merge pull request #18953 from swordqiu/automated-cherry-pick-of-#18951-upstream-release-3.10
Automated cherry pick of #18951: fix: ignore vm virtual ip changes
2023-12-12 09:34:36 +08:00
Qiu Jian
9374824060 fix: ignore vm virtual ip changes 2023-12-10 13:28:49 +08:00
Jian Qiu
1365fc6011 fix: host add a local config file (#18934)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-08 21:26:52 +08:00
屈轩
00004fb627 fix(region): support volc balance and gcp api retry (#18948) 2023-12-08 17:56:46 +08:00
Zexi Li
fe35f15395 Merge pull request #18940 from zexi/automated-cherry-pick-of-#18939-upstream-release-3.10
Automated cherry pick of #18939: fix(monitor): not add scope to query resource from region service
2023-12-08 12:41:58 +08:00
Zexi Li
0cd4376ef4 fix(monitor): not add scope to query resource from region service 2023-12-08 12:29:50 +08:00
Zexi Li
575bdd4b34 Merge pull request #18929 from swordqiu/automated-cherry-pick-of-#18927-upstream-release-3.10
Automated cherry pick of #18927: fix: no default fallback dns server
2023-12-08 10:47:19 +08:00
Zexi Li
dbe610dd99 Merge pull request #18931 from zexi/automated-cherry-pick-of-#18926-upstream-release-3.10
Automated cherry pick of #18926: feat(monitor): make simple-query API adapting victoriametrics and add monitor-unifiedmonitor-query command
2023-12-08 10:46:32 +08:00
Zexi Li
987a7fb476 feat(climc): add monitor-unifiedmonitor-query command 2023-12-08 10:06:08 +08:00
Zexi Li
eff7457860 fix(monitor): make simple-query API adapt to victoriametrics 2023-12-08 10:06:07 +08:00
Qiu Jian
35462d4b15 fix: no default fallback dns server 2023-12-08 01:18:10 +08:00
Zexi Li
6309663621 Merge pull request #18924 from ioito/automated-cherry-pick-of-#18922-upstream-release-3.10
Automated cherry pick of #18922: fix(region): cloudpods uefi and generate name
2023-12-07 16:41:15 +08:00
Zexi Li
a210ed0d26 Merge pull request #18916 from wanyaoqi/fix/host-deployer
Fix/host deployer
2023-12-07 16:40:05 +08:00
ioito
a4379cc29c fix(region): cloudpods uefi and generate name 2023-12-07 16:15:44 +08:00
wanyaoqi
ea9ce74767 fix(host-deployer): disconnect fix and concurrence control 2023-12-07 16:03:30 +08:00
wanyaoqi
91ca77a8a1 fix:(host-deployer): arm guest add gic version 2023-12-06 12:16:54 +08:00
Zexi Li
336b8548ab Merge pull request #18902 from zexi/specify-sqlchemy-version
fix(util): fixed yunion.io/x/sqlchemy version
2023-12-06 10:50:46 +08:00
Zexi Li
8200da5b2d fix(util): fixed yunion.io/x/sqlchemy version 2023-12-06 10:27:29 +08:00
Zexi Li
0b6805d68e Merge pull request #18899 from zexi/automated-cherry-pick-of-#18897-upstream-release-3.10
Automated cherry pick of #18897: fix(monitor): update vendor to support victoriametrics topk func
2023-12-05 18:23:39 +08:00
Zexi Li
f3894e3bf8 fix(monitor): update vendor to support victoriametrics topk func 2023-12-05 18:03:07 +08:00
Jian Qiu
83034ad10c fix: add index for token_cache_tbl to accelerate invalid token query (#18891)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-05 12:22:53 +08:00
wanyaoqi
faef1cd360 fix(host-deployer): qemu deployer without kvm support (#18876) 2023-12-05 07:07:58 +08:00
Zexi Li
09d0edc0b1 Merge pull request #18869 from ioito/automated-cherry-pick-of-#18867-upstream-release-3.10
Automated cherry pick of #18867: fix(region): vendor update
2023-12-04 15:26:09 +08:00
ioito
99dbaddb28 fix(region): vendor update 2023-12-04 15:00:39 +08:00
Zexi Li
567d1653d0 Merge pull request #18863 from wanyaoqi/fix/deploy-driver-options
fix(host-deployer,host): mv deploy driver option to common options
2023-12-04 14:35:12 +08:00
屈轩
48d62f88d3 fix(region): vendor update (#18862) 2023-12-04 14:26:22 +08:00
wanyaoqi
7969a10eaa fix(host-deployer,host): mv deploy driver option to common options 2023-12-04 14:13:46 +08:00
Zexi Li
a5fbdde0d6 Merge pull request #18856 from wanyaoqi/fix/qemu-deploy
Fix/qemu deploy
2023-12-04 10:35:37 +08:00
wanyaoqi
5ce9b93ceb fix(host-deployer): update base image and fix return errors 2023-12-04 01:40:24 +08:00
wanyaoqi
4ea36162fe feat(host-deployer): use qemu-kvm as default deploy dirver 2023-12-04 01:37:01 +08:00
boironic@gmail.com
b67d8fa8f3 feat(region): add guest rescue api && download initrd from baremetal tftp server && add baremetal agent ip finder & update pic address & support ip kernel config. 2023-12-04 01:37:01 +08:00
Zexi Li
f796b9567a fix(baremetal): disable probe access mac by redfish driver (#18844) 2023-12-03 15:17:43 +08:00
屈轩
03344ff697 fix(region): vendor update (#18850) 2023-12-01 17:03:25 +08:00
Zexi Li
6da80c333e Merge pull request #18848 from zexi/automated-cherry-pick-of-#18843-upstream-release-3.10
Automated cherry pick of #18843: feat(ci): use github action to check PR
2023-12-01 14:59:43 +08:00
Zexi Li
dca1c97972 feat(ci): use github action to check PR 2023-12-01 14:58:55 +08:00
wanyaoqi
47c94d2e21 fix(host): guest switch to backup (#18832) 2023-11-30 17:14:43 +08:00
Jian Qiu
2eff999f16 Revert "Feat/deploy guest (#18821)" (#18833)
This reverts commit 103f1cde8d.
2023-11-30 17:03:24 +08:00
wanyaoqi
103f1cde8d Feat/deploy guest (#18821)
* feat(region): add guest rescue api && download initrd from baremetal tftp server && add baremetal agent ip finder & update pic address & support ip kernel config.

* feat(host-deployer): use qemu-kvm as default deploy dirver

---------

Co-authored-by: boironic@gmail.com <boironic@gmail.com>
2023-11-30 16:49:53 +08:00
屈轩
58ac69e8ab fix(region): skip sync meta if no public cloud register (#18829) 2023-11-30 13:33:07 +08:00
Jian Qiu
71755ff812 fix: generalized metadata getter (#18809)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-29 09:04:31 +08:00
Zexi Li
9839864808 Merge pull request #18802 from swordqiu/automated-cherry-pick-of-#18800-upstream-release-3.10
Automated cherry pick of #18800: fix: customized show content of get-property
2023-11-28 10:09:52 +08:00
Qiu Jian
f8082b2f5b fix: customized show content of get-property 2023-11-28 09:14:57 +08:00
Zexi Li
4a15393d39 Merge pull request #18791 from wanyaoqi/fix/alloc-ovn-mapped-ip-addr-on-host-post-create
fix(region): alloc ovn_mapped_ip_addr on host post create
2023-11-27 19:07:20 +08:00
Zexi Li
5a26d1bb70 Merge pull request #18789 from swordqiu/automated-cherry-pick-of-#18787-upstream-release-3.10
Automated cherry pick of #18787: fix: cloud account update aliyun billing scope
2023-11-27 19:06:56 +08:00
wanyaoqi
d1333c61b6 fix(region): alloc ovn_mapped_ip_addr on host post create 2023-11-27 17:12:35 +08:00
Qiu Jian
014af79b79 fix: cloud account update aliyun billing scope 2023-11-27 01:26:28 +08:00
屈轩
a79cfcf9f9 fix(region): trim metadata key (#18781) 2023-11-24 22:17:36 +08:00
屈轩
60c960ed16 fix(region): vm filter by os dist (#18779) 2023-11-24 20:06:08 +08:00
屈轩
3c32a19364 fix(region): distinct os dist field (#18769) 2023-11-24 11:51:59 +08:00
Jian Qiu
892e5daf3b fix: hot add mem check for esxi vm (#18764)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-23 12:20:31 +08:00
Zexi Li
1dca2ff06d Merge pull request #18761 from swordqiu/automated-cherry-pick-of-#18757-upstream-release-3.10
Automated cherry pick of #18757: fix: hot add mem check for esxi vm
2023-11-23 10:15:40 +08:00
Qiu Jian
fc3403c82f fix: hot add mem check for esxi vm 2023-11-23 10:03:41 +08:00
Zexi Li
46223df7f0 Merge pull request #18748 from zexi/automated-cherry-pick-of-#18746-upstream-release-3.10
Automated cherry pick of #18746: fix(monitor): query multiple fileds from victoria-metrics
2023-11-21 18:08:03 +08:00
Zexi Li
ed3d4a13dc fix(monitor): query multiple fileds from victoria-metrics 2023-11-21 17:46:10 +08:00
屈轩
cd3d7aa248 fix(region): vendor update for aliyun tags (#18729) 2023-11-17 16:30:29 +08:00
gouqi11
a6ce80f4ae fix(notify): fix webhook brand (#18725)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-17 15:37:25 +08:00
Zexi Li
756a30dc6e Merge pull request #18718 from zexi/climc-completion
fix(climc): bash completion is not working
2023-11-17 12:33:22 +08:00
Zexi Li
281716df7a fix(climc): bash completion is not working 2023-11-17 11:42:59 +08:00
屈轩
e4a9734643 fix(region): vendor update (#18716) 2023-11-17 11:34:33 +08:00
屈轩
9e9c9dd2a2 fix(region): vendor update (#18713) 2023-11-17 10:15:03 +08:00
gouqi11
bce2d0a81f fix(region): fix db_dispatcher duplicate notify (#18700)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-15 17:02:51 +08:00
Jian Qiu
1f9e8729ec fix: update lb cluster with patch params (#18697)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:57:15 +08:00
Jian Qiu
c909d86eab fix: windows GPU vm should set hypervisor=off (#18692)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:56:56 +08:00
Jian Qiu
6b60b28fa6 fix: make host dhcp lease options global (#18684)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:55:40 +08:00
Jian Qiu
9d150a81b9 fix: host set nil metadata (#18689)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:54:46 +08:00
Zexi Li
b06051d6ca feat(region,climc): add set-os-info api (#18677) 2023-11-14 22:59:37 +08:00
Zexi Li
abeffed6f1 Merge pull request #18669 from wanyaoqi/fix/sriov-nic-change-bw
fix(host): sync sriov nic bw on change config
2023-11-14 20:25:18 +08:00
Zexi Li
ea9daa7246 fix(host): setup routes from start to end (#18672) 2023-11-14 17:55:50 +08:00
wanyaoqi
b58bc3e8cd fix(host): sync sriov nic bw on change config 2023-11-14 16:20:26 +08:00
Zexi Li
0082c1d6f2 Merge pull request #18665 from wanyaoqi/fix/instance_snapshot_fill_os_arch
fix(regin): instance snapshot create guest fill os arch
2023-11-14 14:47:29 +08:00
Zexi Li
0242872a28 Merge pull request #18668 from ioito/automated-cherry-pick-of-#18661-upstream-release-3.10
Automated cherry pick of #18661: fix(region): order by os dist
2023-11-14 14:45:03 +08:00
ioito
01aef4908b fix(region): order by os dist 2023-11-14 14:34:26 +08:00
wanyaoqi
eb4f7988f1 fix(regin): instance snapshot create guest fill os arch 2023-11-14 10:54:51 +08:00
Zexi Li
d862223feb fix(host): catch init error (#18655) 2023-11-13 21:03:12 +08:00
Zexi Li
8b89af2645 Merge pull request #18659 from zexi/automated-cherry-pick-of-#18634-upstream-release-3.10
Automated cherry pick of #18634: chore: unnecessary use of fmt.Sprintf d
2023-11-13 20:45:01 +08:00
guoguangwu
88e13652e7 chore: unnecessary use of fmt.Sprintf d
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-11-13 20:43:21 +08:00
Zexi Li
081401967a Merge pull request #18649 from swordqiu/automated-cherry-pick-of-#18644-upstream-release-3.10
Automated cherry pick of #18644: fix: extend gpu pci class codes
2023-11-13 19:19:54 +08:00
Qiu Jian
7efd8804c4 fix: extend gpu pci class codes 2023-11-13 17:47:34 +08:00
Zexi Li
e873c9c110 Merge pull request #18639 from wanyaoqi/fix/sriov-nic
fix(region,host): sriov nic hotplug and metrics fix
2023-11-13 17:02:20 +08:00
Zexi Li
2d5d96f035 Merge pull request #18636 from wanyaoqi/fix/change-config-set-traffic-limits
fix(region): change config check traffic limit params
2023-11-13 11:38:36 +08:00
wanyaoqi
450e73b3cf fix(region): change config check traffic limit params 2023-11-13 10:59:46 +08:00
wanyaoqi
6d926f2f28 fix(region,host): sriov nic hotplug and metrics fix 2023-11-13 00:33:34 +08:00
Zexi Li
d6bd2a60a9 Merge pull request #18545 from zexi/mig-victoria-metrics
feat(monitor,region,host,cloudmon): support VictoriaMetrics as TSDB backend
2023-11-10 16:05:41 +08:00
Zexi Li
518bd88463 feat(monitor,region,host,cloudmon): support VictoriaMetrics as TSDB backend 2023-11-10 15:32:49 +08:00
屈轩
0a6796c325 fix(region): vendor update (#18624) 2023-11-10 11:59:12 +08:00
Zexi Li
fcc80ec7b6 Merge pull request #18615 from ioito/automated-cherry-pick-of-#18613-upstream-release-3.10
Automated cherry pick of #18613: fix(region): pve cdrom with host info
2023-11-09 12:18:28 +08:00
ioito
c5225d2faa fix(region): pve cdrom with host info 2023-11-09 12:05:18 +08:00
屈轩
b9cec7e12b fix(region): avoid panic when sync aliyun redis (#18609) 2023-11-08 20:56:38 +08:00
屈轩
cfe9a91d83 fix(webconsole): pve vnc support (#18605) 2023-11-08 19:35:15 +08:00
865 changed files with 45110 additions and 7922 deletions

38
.github/workflows/ci-pr-build-test.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Building and test for PR
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Install check tools
shell: bash
run: |
set -o xtrace
git clone --branch yun --depth 4 https://github.com/yousong/tools && cd tools
go build ./cmd/goimports && sudo cp goimports /usr/bin/ && cd .. && rm -rf tools
git clone --depth 4 https://github.com/yousong/y18n && cd y18n
go build . && sudo cp y18n /usr/bin && cd .. && rm -rf y18n
- name: Test and build
shell: bash
run: |
set -o xtrace
export GO111MODULE=on
make -j3 check
make test
targets="$(find cmd -mindepth 1 -maxdepth 1 -type d | grep -v cmd/host-image)"
echo $targets | tr ' ' '\n'
make $targets
ls -lh _output/bin

View File

@@ -287,7 +287,9 @@ GOPROXY ?= direct
mod:
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get -d yunion.io/x/cloudmux@$(RELEASE_BRANCH)
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get -d $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p' | grep -v '/cloudmux$$'))
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get -d yunion.io/x/sqlchemy@v1.1.2
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get -d yunion.io/x/pkg@v1.10.1
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get -d $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p' | egrep -v '/cloudmux$$|/sqlchemy$$|/pkg$$'))
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go mod tidy
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go mod vendor -v
@@ -349,7 +351,7 @@ image:
.PHONY: image
image-telegraf-raid-plugin:
VERSION=release-1.6.4 ARCH=all make image telegraf-raid-plugin
VERSION=release-1.6.5 ARCH=all make image telegraf-raid-plugin
%:
@:

View File

@@ -1,8 +1,13 @@
export PATH=/opt/yunion/bin:$PATH
if [ -f /etc/profile.d/bash_completion.sh ]; then
source /etc/profile.d/bash_completion.sh
fi
test -f /etc/yunion/rcadmin && source /etc/yunion/rcadmin
source <(climc --completion bash)
source <(kubectl completion bash)
echo "Welcome to Cloud Shell :-) You may execute climc and other command tools in this shell."
echo "Please exec 'climc' to get started"

View File

@@ -1,7 +1,7 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/ansibleserver-base:v1.1.1
# install playbook and telegraf install pkg
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.4.0 /opt/yunion/playbook /opt/yunion/playbook
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.4.0 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/playbook /opt/yunion/playbook
COPY --from=registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.5.2 /opt/yunion/ansible-install-pkg /opt/yunion/ansible-install-pkg
ADD ./_output/alpine-build/bin/ansibleserver /opt/yunion/bin/ansibleserver

View File

@@ -9,12 +9,20 @@ RUN sed -i 's!https://dl-cdn.alpinelinux.org/!https://mirrors.ustc.edu.cn/!g' /e
# openssh-client, for ansible ssh connection
# git, ca-certificates, for fetching ansible roles
RUN set -x \
&& apk update \
&& apk add openssh-client \
&& apk add sshpass \
&& apk add ansible \
&& apk add py3-pip \
&& apk add tzdata git ca-certificates \
&& rm -rf /var/cache/apk/*
&& apk update \
&& apk add openssh-client \
&& apk add sshpass \
&& apk add py3-pip \
&& apk add tzdata git ca-certificates
RUN pip3 install pywinrm
RUN apk add --no-cache openssh openssl curl rsync pv mariadb-client
RUN apk add --no-cache --virtual .build-dependencies \
libffi-dev openssl-dev python3-dev build-base py-setuptools rust cargo mariadb-dev
# ansible should be installed
# after setuptools and wheel
RUN pip3 install -U pip setuptools wheel \
&& pip3 install paramiko mysqlclient pywinrm \
&& pip3 install 'ansible<=9.0.0' \
&& apk del --no-network .build-dependencies \
&& rm -rf /root/.cache /root/.cargo /var/cache/apk/*

View File

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

View File

@@ -1,7 +1,7 @@
#FROM --platform=linux/amd64 registry.cn-beijing.aliyuncs.com/yunionio/centos-build:1.1-4 as build
#RUN yum install -y https://iso.yunion.cn/vm-images/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
#RUN yum install -y http://192.168.23.50:8083/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
FROM registry.cn-beijing.aliyuncs.com/yunionio/yunionos:v0.1.8-20230812.0 as yunionos
FROM registry.cn-beijing.aliyuncs.com/yunionio/yunionos:v3.10.8-20231215.0 as yunionos
FROM centos:8 as grub-stage

View File

@@ -1,3 +1,5 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/file-repo:v0.4.0 as file-repo
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.2
MAINTAINER "Rain Zheng <zhengyu@yunion.com>"
@@ -11,12 +13,13 @@ RUN set -x \
# install default playbook and install pkg
Run mkdir -p /opt/yunion/ansible-install-pkg
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf-0.x86_64.rpm -P /opt/yunion/ansible-install-pkg
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf-0.aarch64.rpm -P /opt/yunion/ansible-install-pkg
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf_1.19.2-yn~be742cbf-0_arm64.deb -P /opt/yunion/ansible-install-pkg
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf_1.19.2-yn~be742cbf-0_amd64.deb -P /opt/yunion/ansible-install-pkg
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf_windows_amd64.zip -P /opt/yunion/ansible-install-pkg
Run wget https://yunioniso.oss-cn-beijing.aliyuncs.com/rpms/telegraf/telegraf-1.19.2-yn~be742cbf_windows_i386.zip -P /opt/yunion/ansible-install-pkg
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf-0.x86_64.rpm /opt/yunion/ansible-install-pkg
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf-0.aarch64.rpm /opt/yunion/ansible-install-pkg
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf_1.19.2-yn~be742cbf-0_arm64.deb /opt/yunion/ansible-install-pkg
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf_1.19.2-yn~be742cbf-0_amd64.deb /opt/yunion/ansible-install-pkg
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf_windows_amd64.zip /opt/yunion/ansible-install-pkg
COPY --from=file-repo /opt/yunion/ansible-install-pkg/telegraf-1.19.2-yn~be742cbf_windows_i386.zip /opt/yunion/ansible-install-pkg
Run mkdir -p /opt/yunion/playbook
Run mkdir /opt/yunion/playbook/monitor-agent

View File

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

View File

@@ -15,7 +15,7 @@ onecloud-base:
onecloud-base-3-15-4:
$(DOCKER_BUILDX)/onecloud-base:$(ONECLOUD_BASE_VERSION_3-15-4) -f ./Dockerfile.onecloud-base-3-15-4 .
ANSIBLESERVER_BASE = v1.1.1
ANSIBLESERVER_BASE = v1.1.2
ansibleserver-base:
$(DOCKER_BUILDX)/ansibleserver-base:$(ANSIBLESERVER_BASE) -f ./Dockerfile.ansibleserver-base .
@@ -30,7 +30,7 @@ WEBCONSOLE_BASE_VERSION = 20230731.2
webconsole-base:
$(DOCKER_BUILDX)/webconsole-base:$(WEBCONSOLE_BASE_VERSION) -f ./Dockerfile.webconsole-base .
BAREMETAL_BASE_VERSION = v0.3.9-20230812.0
BAREMETAL_BASE_VERSION = v0.3.9-20231219.1
baremetal-base:
$(DOCKER_BUILDX)/baremetal-base:$(BAREMETAL_BASE_VERSION) -f ./Dockerfile.baremetal-base .
@@ -44,7 +44,7 @@ GLANCE_BASE_VERSION = v0.0.1
glance-base:
$(DOCKER_BUILDX)/glance-base:$(GLANCE_BASE_VERSION) -f ./Dockerfile.glance-base .
FILE_REPO_VERSION = v0.3.3
FILE_REPO_VERSION = v0.5.2
file-repo:
$(DOCKER_BUILDX)/file-repo:$(FILE_REPO_VERSION) -f ./Dockerfile.file-repo .

View File

@@ -3,7 +3,7 @@
触发时间: {{.start_time}}
报警级别: {{.level}}
触发条件: {{.description | unescaped}}
资源数量:{{len .matches}}
报警数量:{{len .matches}}
资源名称:{{.resource_name}}
详情地址: {{.web_url}}

View File

@@ -108,6 +108,7 @@
<td>名称</td>
<td>IP</td>
<td>平台</td>
<td>指标</td>
<td>触发值</td>
</tr>
</thead>
@@ -124,7 +125,8 @@
<td>
{{ index .tags "brand" }}
</td>
<td>{{$Matche.value_str}}</td>
<td>{{ $Matche.metric }}</td>
<td>{{ $Matche.value_str }}</td>
</tr>
{{end}}
</tbody>

View File

@@ -3,7 +3,7 @@ AlertName: {{.name}}
Time: {{.start_time}}
Level: {{.level}}
TriggerCondition: {{.description | unescaped}}
ResourceCount: {{len .matches}}
AlertCount: {{len .matches}}
ResourceName: {{.resource_name}}
WebUrl: {{.web_url}}

View File

@@ -108,6 +108,7 @@
<td>Name</td>
<td>IP</td>
<td>Brand</td>
<td>Metric</td>
<td>Trigger value</td>
</tr>
</thead>
@@ -124,7 +125,8 @@
<td>
{{ index .tags "brand" }}
</td>
<td>{{$Matche.value_str}}</td>
<td>{{ $Matche.metric }}</td>
<td>{{ $Matche.value_str }}</td>
</tr>
{{end}}
</tbody>

View File

@@ -49,4 +49,10 @@ func init() {
ibCmd.Create(&compute.InstanceBackupManagerCreateFromPackageOptions{})
ibCmd.Perform("syncstatus", &compute.DiskBackupSyncstatusOptions{})
ibCmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
hbsCmd := shell.NewJointCmd(&modules.HostBackupstorages)
hbsCmd.List(&compute.HostBackupStorageListOptions{})
hbsCmd.Show(&compute.HostBackupStorageJoinOptions{})
hbsCmd.Attach(&compute.HostBackupStorageJoinOptions{})
hbsCmd.Detach(&compute.HostBackupStorageJoinOptions{})
}

View File

@@ -0,0 +1,50 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/util/printutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
baremetalmodules "yunion.io/x/onecloud/pkg/mcclient/modules/compute/baremetal"
baremetaloptions "yunion.io/x/onecloud/pkg/mcclient/options/compute/baremetal"
)
func init() {
cmd := shell.NewResourceCmd(&baremetalmodules.BaremetalProfiles)
cmd.List(new(baremetaloptions.BaremetalProfileListOptions))
cmd.Show(new(baremetaloptions.BaremetalProfileIdOptions))
cmd.Delete(new(baremetaloptions.BaremetalProfileIdOptions))
type BaremetalProfileMatchOpts struct {
OEMNAME string
MODEL string
}
R(&BaremetalProfileMatchOpts{}, "baremetal-profile-match", "find match baremetal profile by oemname and model", func(s *mcclient.ClientSession, args *BaremetalProfileMatchOpts) error {
specs, err := baremetalmodules.BaremetalProfiles.GetMatchProfiles(s, args.OEMNAME, args.MODEL)
if err != nil {
return errors.Wrap(err, "GetMatchProfiles")
}
listResults := printutils.ListResult{}
for _, spec := range specs {
listResults.Data = append(listResults.Data, jsonutils.Marshal(spec))
}
printList(&listResults, nil)
return nil
})
}

View File

@@ -174,6 +174,7 @@ func init() {
AutoSnapshot string `help:"enable/disable auto snapshot of disk" choices:"enable|disable"`
DiskType string `help:"Disk type" choices:"data|volume"`
IsSsd *bool `help:"mark disk as ssd" negative:"no-is-ssd"`
AutoReset *bool `help:"Enable auto reset disk after geust shutdown"`
}
R(&DiskUpdateOptions{}, "disk-update", "Update property of a virtual disk", func(s *mcclient.ClientSession, args *DiskUpdateOptions) error {
params := jsonutils.NewDict()
@@ -207,6 +208,10 @@ func init() {
params.Add(jsonutils.JSONFalse, "is_ssd")
}
}
if args.AutoReset != nil {
params.Add(jsonutils.NewBool(*args.AutoReset), "auto_reset")
}
if params.Size() == 0 {
return InvalidUpdateError()
}

View File

@@ -54,6 +54,7 @@ func init() {
cmd.Perform("probe-isolated-devices", &options.BaseIdOptions{})
cmd.Perform("class-metadata", &options.ResourceMetadataOptions{})
cmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
cmd.Perform("set-commit-bound", &compute.HostSetCommitBoundOptions{})
cmd.BatchPerform("enable", &options.BaseIdsOptions{})
cmd.BatchPerform("disable", &options.BaseIdsOptions{})
@@ -173,17 +174,16 @@ func init() {
})
type HostUpdateOptions struct {
ID string `help:"ID or Name of Host"`
Name string `help:"New name of the host"`
Desc string `help:"New Description of the host"`
CpuCommitBound float64 `help:"CPU overcommit upper bound at this host"`
MemoryCommitBound float64 `help:"Memory overcommit upper bound at this host"`
MemoryReserved string `help:"Memory reserved"`
CpuReserved int64 `help:"CPU reserved"`
HostType string `help:"Change host type, CAUTION!!!!" choices:"hypervisor|kubelet|esxi|baremetal"`
ID string `help:"ID or Name of Host"`
Name string `help:"New name of the host"`
Desc string `help:"New Description of the host"`
MemoryReserved string `help:"Memory reserved"`
CpuReserved int64 `help:"CPU reserved"`
HostType string `help:"Change host type, CAUTION!!!!" choices:"hypervisor|kubelet|esxi|baremetal"`
// AccessIp string `help:"Change access ip, CAUTION!!!!"`
AccessMac string `help:"Change baremetal access MAC, CAUTION!!!!"`
Uuid string `help:"Change baremetal UUID, CAUTION!!!!"`
AccessMac string `help:"Change baremetal access MAC, CAUTION!!!!"`
Uuid string `help:"Change baremetal UUID, CAUTION!!!!"`
EnableNumaAllocate string `help:"Host enable numa allocate" choices:"True|False"`
IpmiUsername string `help:"IPMI user"`
IpmiPassword string `help:"IPMI password"`
@@ -201,12 +201,6 @@ func init() {
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
if args.CpuCommitBound > 0.0 {
params.Add(jsonutils.NewFloat64(args.CpuCommitBound), "cpu_cmtbound")
}
if args.MemoryCommitBound > 0.0 {
params.Add(jsonutils.NewFloat64(args.MemoryCommitBound), "mem_cmtbound")
}
if len(args.MemoryReserved) > 0 {
params.Add(jsonutils.NewString(args.MemoryReserved), "mem_reserved")
}
@@ -234,6 +228,13 @@ func init() {
if len(args.Sn) > 0 {
params.Add(jsonutils.NewString(args.Sn), "sn")
}
if len(args.EnableNumaAllocate) > 0 {
enableNumaAllocate := false
if args.EnableNumaAllocate == "True" {
enableNumaAllocate = true
}
params.Add(jsonutils.NewBool(enableNumaAllocate), "enable_numa_allocate")
}
if params.Size() == 0 {
return fmt.Errorf("Not data to update")
}
@@ -593,7 +594,7 @@ func init() {
i, e := modules.Hosts.PerformAction(s, args.ID, "login-info", nil)
privateKey := ""
if e != nil {
if httputils.ErrorCode(e) == 404 || e.Error() == "ciphertext too short" {
if httputils.ErrorCode(e) == 404 || strings.Contains(e.Error(), "ciphertext too short") {
var err error
privateKey, err = modules.Sshkeypairs.FetchPrivateKeyBySession(context.Background(), s)
if err != nil {

View File

@@ -59,6 +59,17 @@ func init() {
printBatchResults(ret, modules.InstanceSnapshots.GetColumns(s))
return nil
})
type InstanceSnapshotPurgeOptions struct {
ID string `help:"Delete snapshot id"`
}
R(&InstanceSnapshotPurgeOptions{}, "instance-snapshot-purge", "Purge snapshots", func(s *mcclient.ClientSession, args *InstanceSnapshotPurgeOptions) error {
result, err := modules.InstanceSnapshots.PerformAction(s, args.ID, "purge", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type InstanceSnapshotShowOptions struct {
ID string `help:"ID or Name of snapshot"`

View File

@@ -15,8 +15,13 @@
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/util/printutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
baseoptions "yunion.io/x/onecloud/pkg/mcclient/options"
options "yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
@@ -26,4 +31,68 @@ func init() {
cmd.Create(new(options.IsolatedDeviceModelCreateOptions))
cmd.Update(new(options.IsolatedDeviceModelUpdateOptions))
cmd.Delete(new(options.IsolatedDeviceIdsOptions))
type HostIsolatedDeviceModelListOptions struct {
baseoptions.BaseListOptions
Host string `help:"ID or Name of Host"`
IsolatedDeviceModel string `help:"ID or Name of Isolated device model"`
}
R(&HostIsolatedDeviceModelListOptions{}, "host-isolated-device-model-list",
"List host Isolated device model pairs", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
var result *printutils.ListResult
var err error
if len(args.Host) > 0 {
result, err = modules.HostIsolatedDeviceModels.ListDescendent(s, args.Host, params)
} else if len(args.IsolatedDeviceModel) > 0 {
result, err = modules.HostIsolatedDeviceModels.ListDescendent2(s, args.IsolatedDeviceModel, params)
} else {
result, err = modules.HostIsolatedDeviceModels.List(s, params)
}
if err != nil {
return err
}
printList(result, modules.HostIsolatedDeviceModels.GetColumns(s))
return nil
})
type HostIsolatedDeviceModelDetailOptions struct {
HOST string `help:"ID or Name of Host"`
IsolatedDeviceModel string `help:"ID or Name of Isolated device model"`
}
R(&HostIsolatedDeviceModelDetailOptions{}, "host-isolated-device-model-show", "Show host isolated-device-model details", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelDetailOptions) error {
result, err := modules.HostIsolatedDeviceModels.Get(s, args.HOST, args.IsolatedDeviceModel, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&HostIsolatedDeviceModelDetailOptions{}, "host-isolated-device-model-detach", "Detach a isolated-device-model from a host", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelDetailOptions) error {
result, err := modules.HostIsolatedDeviceModels.Detach(s, args.HOST, args.IsolatedDeviceModel, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&HostIsolatedDeviceModelDetailOptions{}, "host-isolated-device-model-attach", "Attach a isolated-device-model to a host", func(s *mcclient.ClientSession, args *HostIsolatedDeviceModelDetailOptions) error {
params := jsonutils.NewDict()
result, err := modules.HostIsolatedDeviceModels.Attach(s, args.HOST, args.IsolatedDeviceModel, params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -43,6 +43,7 @@ func init() {
cmd.Get("change-owner-candidate-domains", &compute_options.NetworkIdOptions{})
cmd.Perform("set-class-metadata", &options.ResourceMetadataOptions{})
cmd.Perform("switch-wire", &compute_options.NetworkSwitchWireOptions{})
cmd.Get("available-addresses", &compute_options.NetworkIdOptions{})
type NetworkShareOptions struct {
ID string `help:"ID or Name of the zone to show"`

View File

@@ -122,7 +122,12 @@ func init() {
cmd.Perform("reset-nic-traffic-limit", &options.ServerNicTrafficLimitOptions{})
cmd.Perform("set-nic-traffic-limit", &options.ServerNicTrafficLimitOptions{})
cmd.Perform("add-sub-ips", &options.ServerAddSubIpsOptions{})
cmd.BatchPerform("set-os-info", &options.ServerSetOSInfoOptions{})
cmd.BatchPerform("start-rescue", &options.ServerStartOptions{})
cmd.BatchPerform("stop-rescue", &options.ServerStartOptions{})
cmd.BatchPerform("sync-os-info", &options.ServerIdsOptions{})
cmd.BatchPerform("set-root-disk-matcher", &options.ServerSetRootDiskMatcher{})
cmd.Perform("disable-auto-merge-snapshot", &options.ServerDisableAutoMergeSnapshot{})
cmd.Get("vnc", new(options.ServerVncOptions))
cmd.Get("desc", new(options.ServerIdOptions))
cmd.Get("status", new(options.ServerIdOptions))

View File

@@ -102,7 +102,7 @@ func init() {
oldKeys = string(output)
}
pubKeys := &deployapi.SSHKeys{AdminPublicKey: pubKey}
newKeys := fsdriver.MergeAuthorizedKeys(oldKeys, pubKeys)
newKeys := fsdriver.MergeAuthorizedKeys(oldKeys, pubKeys, true)
if output, err := procutils.NewCommand(
"sh", "-c", fmt.Sprintf("echo '%s' > %s", newKeys, authFile)).Output(); err != nil {
return errors.Wrapf(err, "write public keys: %s", output)

View File

@@ -45,6 +45,7 @@ func init() {
cmd.Perform("force-detach-host", &compute.StorageForceDetachHost{})
cmd.Perform("public", &options.BasePublicOptions{})
cmd.Perform("private", &options.BaseIdOptions{})
cmd.Perform("set-commit-bound", &compute.StorageSetCommitBoundOptions{})
type StorageCephRunOptions struct {
ID string `help:"ID or name of ceph storage"`
@@ -58,9 +59,10 @@ func init() {
info := struct {
StorageType string `json:"storage_type"`
StorageConf struct {
Key string `json:"key"`
MonHost string `json:"mon_host"`
Pool string `json:"pool"`
Key string `json:"key"`
MonHost string `json:"mon_host"`
Pool string `json:"pool"`
EnableMessengerV2 bool `json:"enable_messenger_v2"`
}
}{}
err = result.Unmarshal(&info)
@@ -74,6 +76,7 @@ func init() {
info.StorageConf.MonHost,
info.StorageConf.Key,
info.StorageConf.Pool,
info.StorageConf.EnableMessengerV2,
)
if err != nil {
return errors.Wrap(err, "cephutils.NewClient")

View File

@@ -32,6 +32,11 @@ import (
func init() {
handleResult := func(s *mcclient.ClientSession, opt o.WebConsoleOptions, obj jsonutils.JSONObject) error {
if obj.Contains("access_url") {
accessUrl, _ := obj.GetString("access_url")
fmt.Println("AccessURL:", accessUrl)
return nil
}
if opt.WebconsoleUrl == "" {
resp, err := identity.ServicesV3.GetSpecific(s, "common", "config", nil)
if err != nil {

View File

@@ -229,7 +229,7 @@ type IPropertyOpt interface {
Property() string
}
func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
func (cmd ResourceCmd) GetPropertyWithShowFunc(args IPropertyOpt, showFunc func(jsonutils.JSONObject) error) {
man := cmd.manager
callback := func(s *mcclient.ClientSession, args IPropertyOpt) error {
params, err := args.Params()
@@ -240,6 +240,17 @@ func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
if err != nil {
return err
}
err = showFunc(ret)
if err != nil {
return err
}
return nil
}
cmd.RunWithDesc(args.Property(), fmt.Sprintf("Get property of a %s", man.GetKeyword()), args, callback)
}
func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
cmd.GetPropertyWithShowFunc(args, func(ret jsonutils.JSONObject) error {
if _, ok := ret.(*jsonutils.JSONArray); ok {
data, _ := ret.GetArray()
PrintList(&printutils.ListResult{
@@ -249,8 +260,7 @@ func (cmd ResourceCmd) GetProperty(args IPropertyOpt) {
PrintObject(ret)
}
return nil
}
cmd.RunWithDesc(args.Property(), fmt.Sprintf("Get property of a %s", man.GetKeyword()), args, callback)
})
}
func (cmd ResourceCmd) Show(args IShowOpt) {
@@ -657,15 +667,15 @@ func (cmd JointCmd) List(args IJointListOpt) {
cmd.RunWithDesc("list", fmt.Sprintf("list %s %s pairs", man.MasterManager().KeyString(), man.SlaveManager().KeyString()), args, callback)
}
type IJointShowOpt interface {
type IJointOpt interface {
IOpt
GetMasterId() string
GetSlaveId() string
}
func (cmd JointCmd) Show(args IJointShowOpt) {
func (cmd JointCmd) Show(args IJointOpt) {
man := cmd.manager.(modulebase.JointManager)
callback := func(s *mcclient.ClientSession, args IJointShowOpt) error {
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
params, err := args.Params()
if err != nil {
return err
@@ -679,3 +689,54 @@ func (cmd JointCmd) Show(args IJointShowOpt) {
}
cmd.Run("show", args, callback)
}
func (cmd JointCmd) Attach(args IJointOpt) {
man := cmd.manager.(modulebase.JointManager)
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := man.Attach(s, args.GetMasterId(), args.GetSlaveId(), params)
if err != nil {
return err
}
PrintObject(result)
return nil
}
cmd.Run("attach", args, callback)
}
func (cmd JointCmd) Detach(args IJointOpt) {
man := cmd.manager.(modulebase.JointManager)
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := man.Detach(s, args.GetMasterId(), args.GetSlaveId(), params)
if err != nil {
return err
}
PrintObject(result)
return nil
}
cmd.Run("detach", args, callback)
}
func (cmd JointCmd) Update(args IJointOpt) {
man := cmd.manager.(modulebase.JointManager)
callback := func(s *mcclient.ClientSession, args IJointOpt) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := man.Update(s, args.GetMasterId(), args.GetSlaveId(), nil, params)
if err != nil {
return err
}
PrintObject(result)
return nil
}
cmd.Run("update", args, callback)
}

View File

@@ -19,12 +19,45 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/utils"
"yunion.io/x/pkg/util/sets"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
)
type GlobalSettingsValue struct {
SetupKeys []string `json:"setupKeys"`
SetupKeysVersion string `json:"setupKeysVersion"`
SetupOneStackInitialized bool `json:"setupOneStackInitialized"`
ProductVersion string `json:"productVersion"`
UserDefinedKeys map[string]bool `json:"userDefinedKeys"`
}
func NewGlobalSettingsValue(setupKeys []string, setupOneStack bool) *GlobalSettingsValue {
settings := &GlobalSettingsValue{
SetupOneStackInitialized: setupOneStack,
UserDefinedKeys: make(map[string]bool),
}
for _, key := range setupKeys {
settings.Switch(key, true)
}
return settings
}
func (g *GlobalSettingsValue) Switch(featureKey string, on bool) {
if g.UserDefinedKeys == nil {
g.UserDefinedKeys = map[string]bool{}
}
g.UserDefinedKeys[featureKey] = on
ss := sets.NewString(g.SetupKeys...)
if on {
ss.Insert(featureKey)
} else {
ss.Delete(featureKey)
}
g.SetupKeys = ss.List()
}
func init() {
var features = []string{
"onestack",
@@ -93,10 +126,7 @@ func init() {
input := map[string]interface{}{
"name": GlobalSettings,
"service_id": YunionAgent,
"value": map[string]interface{}{
"setupKeys": []string{name},
"setupOneStackInitialized": true,
},
"value": NewGlobalSettingsValue([]string{name}, true),
}
params := jsonutils.Marshal(input)
if _, err := yunionconf.Parameters.Create(s, params); err != nil {
@@ -118,33 +148,20 @@ func init() {
if err != nil {
return errors.Wrap(err, "get value")
}
setupKeys := []string{}
if value.Contains("setupKeys") {
if err := value.Unmarshal(&setupKeys, "setupKeys"); err != nil {
return errors.Wrap(err, "unmarshal setupKeys")
}
curConf := new(GlobalSettingsValue)
if err := value.Unmarshal(curConf); err != nil {
return errors.Wrapf(err, "unmarshal to GlobalSettingsValue: %s", value)
}
if !enable {
if utils.IsInStringArray(name, setupKeys) {
newKeys := []string{}
for _, key := range setupKeys {
if key != name {
newKeys = append(newKeys, key)
}
}
setupKeys = newKeys
}
} else if enable {
if !utils.IsInStringArray(name, setupKeys) {
setupKeys = append(setupKeys, name)
}
curConf.Switch(name, false)
} else {
curConf.Switch(name, true)
}
value.(*jsonutils.JSONDict).Set("setupKeys", jsonutils.Marshal(setupKeys))
id, err := ss.GetString("id")
if err != nil {
return errors.Errorf("get id from %s", ss)
}
ss.(*jsonutils.JSONDict).Set("value", value)
ss.(*jsonutils.JSONDict).Set("value", jsonutils.Marshal(curConf))
obj, err := yunionconf.Parameters.Update(s, id, ss)
if err != nil {
return errors.Wrapf(err, "update %s(%s)", GlobalSettings, id)

View File

@@ -96,6 +96,7 @@ func init() {
apis.SERVICE_TYPE_OFFLINE_CLOUDMETA,
apis.SERVICE_TYPE_CLOUDMETA,
apis.SERVICE_TYPE_INFLUXDB,
apis.SERVICE_TYPE_VICTORIA_METRICS,
apis.SERVICE_TYPE_ETCD,
"torrent-tracker",
}) {

View File

@@ -15,7 +15,6 @@
package monitor
import (
"encoding/json"
"fmt"
"yunion.io/x/pkg/errors"
@@ -46,11 +45,7 @@ func init() {
if err != nil {
return errors.Wrap(err, "DoTestRun")
}
jsonBytes, err := json.MarshalIndent(ret, "", " ")
if err != nil {
return errors.Wrap(err, "MarshalIndent")
}
fmt.Printf("%s\n", jsonBytes)
fmt.Printf("%s\n", ret.PrettyString())
return nil
})
}

View File

@@ -36,9 +36,7 @@ func initAlertNotification() {
return err
}
var result *printutils.ListResult
if len(args.Alert) > 0 {
result, err = monitor.Alertnotification.ListDescendent(s, args.Alert, params)
} else if len(args.Notification) > 0 {
if len(args.Notification) > 0 {
result, err = monitor.Alertnotification.ListDescendent2(s, args.Notification, params)
} else {
result, err = monitor.Alertnotification.List(s, params)

View File

@@ -15,10 +15,136 @@
package monitor
import (
"yunion.io/x/jsonutils"
monitorapi "yunion.io/x/onecloud/pkg/apis/monitor"
"yunion.io/x/onecloud/pkg/mcclient"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
type CommonAlertTerm struct {
Database string
Measurement string
Operator string // and / or
Field []string
FieldFunc string
Reduce string
Comparator string
Threshold float64
Filters []monitorapi.MetricQueryTag
FieldOpt string
Name string
ConditionType string
From string
Interval string
GroupBy string
Level string
}
func newCommonAlertQuery(tem *CommonAlertTerm) *monitorapi.CommonAlertQuery {
mq := monitorapi.MetricQuery{
Alias: "",
Tz: "",
Database: tem.Database,
Measurement: tem.Measurement,
Tags: make([]monitorapi.MetricQueryTag, 0),
GroupBy: make([]monitorapi.MetricQueryPart, 0),
Selects: nil,
Interval: "",
Policy: "",
ResultFormat: "",
}
for _, field := range tem.Field {
sel := monitorapi.MetricQueryPart{
Type: "field",
Params: []string{field},
}
selectPart := []monitorapi.MetricQueryPart{sel}
if len(tem.FieldFunc) != 0 {
selectPart = append(selectPart, monitorapi.MetricQueryPart{
Type: tem.FieldFunc,
Params: []string{},
})
} else {
selectPart = append(selectPart, monitorapi.MetricQueryPart{
Type: "mean",
Params: []string{},
})
}
mq.Selects = append(mq.Selects, selectPart)
}
if len(tem.Filters) != 0 {
for _, filter := range tem.Filters {
mq.Tags = append(mq.Tags, filter)
}
}
alertQ := new(monitorapi.AlertQuery)
alertQ.Model = mq
alertQ.From = "60m"
commonAlert := monitorapi.CommonAlertQuery{
AlertQuery: alertQ,
Reduce: tem.Reduce,
Comparator: tem.Comparator,
Threshold: tem.Threshold,
Operator: tem.Operator,
}
if tem.FieldOpt != "" {
commonAlert.FieldOpt = monitorapi.CommonAlertFieldOpt_Division
}
if len(tem.ConditionType) != 0 {
commonAlert.ConditionType = tem.ConditionType
}
if len(tem.GroupBy) != 0 {
commonAlert.Model.GroupBy = append(commonAlert.Model.GroupBy, monitorapi.MetricQueryPart{
Type: "field",
Params: []string{tem.GroupBy},
})
}
return &commonAlert
}
var (
cpuTem = &CommonAlertTerm{
Operator: "or",
Database: "telegraf",
Measurement: "vm_cpu",
Field: []string{"usage_active"},
Comparator: ">=",
Reduce: "avg",
Threshold: 50,
Name: "lzx-test.cpu.usage_active",
Filters: []monitorapi.MetricQueryTag{
{
Key: "id",
Operator: "=",
Value: "a0eee5dd-3cfe-4ab1-8c79-aee1a8cf4dab",
},
},
}
memTem = &CommonAlertTerm{
Operator: "or",
Database: "telegraf",
Measurement: "vm_mem",
Field: []string{"used_percent"},
Comparator: ">=",
Reduce: "avg",
Threshold: 3,
Name: "lzx-test.mem.avaiable",
Filters: []monitorapi.MetricQueryTag{
{
Key: "id",
Operator: "=",
Value: "a0eee5dd-3cfe-4ab1-8c79-aee1a8cf4dab",
},
},
}
)
func init() {
cmd := NewResourceCmd(modules.CommonAlerts)
cmd.Create(new(options.CommonAlertCreateOptions))
@@ -28,4 +154,34 @@ func init() {
cmd.Perform("disable", &options.CommonAlertShowOptions{})
cmd.BatchDelete(new(options.CommonAlertDeleteOptions))
cmd.Perform("config", &options.CommonAlertUpdateOptions{})
type TestOpt struct {
NAME string
RobotIds []string
Users []string
}
R(&TestOpt{}, "monitor-commonalert-create-mul-test", "create test monitor common alert", func(s *mcclient.ClientSession, opt *TestOpt) error {
cpuQ := newCommonAlertQuery(cpuTem)
memQ := newCommonAlertQuery(memTem)
input := monitorapi.CommonAlertCreateInput{
CommonMetricInputQuery: monitorapi.CommonMetricInputQuery{
MetricQuery: []*monitorapi.CommonAlertQuery{
cpuQ,
memQ,
},
},
AlertCreateInput: monitorapi.AlertCreateInput{
Name: opt.NAME,
},
CommonAlertCreateBaseInput: monitorapi.CommonAlertCreateBaseInput{
Recipients: opt.Users,
RobotIds: opt.RobotIds,
Channel: []string{"webconsole"},
AlertType: monitorapi.CommonAlertNomalAlertType,
Scope: "system",
},
}
_, err := modules.CommonAlerts.Create(s, jsonutils.Marshal(input))
return err
})
}

View File

@@ -15,7 +15,10 @@
package monitor
import (
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
@@ -24,5 +27,18 @@ func init() {
cmd := shell.NewResourceCmd(monitor.UnifiedMonitorManager).SetPrefix("monitor")
cmd.Show(&options.SimpleQueryOptions{})
cmd.GetProperty(&options.MeasurementsQueryOptions{})
cmd.GetProperty(&options.DatabasesQueryOptions{})
// cmd.GetProperty(&options.DatabasesQueryOptions{})
R(new(options.MetricQueryOptions), "monitor-unifiedmonitor-query", "Perform metrics query", func(s *mcclient.ClientSession, opts *options.MetricQueryOptions) error {
input, err := opts.GetQueryInput()
if err != nil {
return err
}
resp, err := monitor.UnifiedMonitorManager.PerformQuery(s, input)
if err != nil {
return errors.Wrap(err, "PerformQuery")
}
printObject(resp)
return nil
})
}

View File

@@ -27,4 +27,5 @@ func init() {
cmd.Update(new(options.ConfigUpdateOptions))
cmd.Show(new(options.ConfigOptions))
cmd.Delete(new(options.ConfigOptions))
cmd.GetProperty(new(options.ConfigCapabilityOptions))
}

View File

@@ -44,6 +44,14 @@ const (
// Failed, Offline, Degraded, Rebuilding, Out of Sync (OSY)
func main() {
logLevel := "debug"
logVerboseLevel := 5
log.SetVerboseLevel(int32(logVerboseLevel))
err := log.SetLogLevelByString(log.Logger(), logLevel)
if err != nil {
log.Fatalf("Set log level %q: %v", logLevel, err)
}
// creates the in-cluster config
config, err := rest.InClusterConfig()
if err != nil {

26
go.mod
View File

@@ -26,13 +26,15 @@ require (
github.com/golang-plus/uuid v1.0.0
github.com/golang/mock v1.4.4
github.com/google/gopacket v1.1.17
github.com/google/uuid v1.3.0
github.com/google/uuid v1.6.0
github.com/googollee/go-socket.io v0.0.0-20181214084611-0ad7206c347a
github.com/gorilla/mux v1.7.0
github.com/gorilla/websocket v1.4.1
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead
github.com/hugozhu/godingtalk v1.0.6
github.com/influxdata/influxql v1.1.0
github.com/influxdata/promql/v2 v2.12.0
github.com/jaypipes/ghw v0.11.0
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c
github.com/lestrrat-go/jwx v1.0.2
@@ -54,16 +56,18 @@ require (
github.com/sevlyar/go-daemon v0.1.5
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/shirou/gopsutil/v3 v3.22.10
github.com/sirupsen/logrus v1.9.0
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9
github.com/smartystreets/goconvey v1.7.2
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.9.0
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e
github.com/tjfoc/gmsm v1.4.1
github.com/tredoe/osutil/v2 v2.0.0-rc.16
github.com/tredoe/osutil v1.5.0
github.com/vishvananda/netlink v1.1.0
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74
github.com/vmihailenco/msgpack v4.0.4+incompatible
github.com/xuri/excelize/v2 v2.7.1
github.com/zexi/influxql-to-metricsql v0.0.6
go.etcd.io/etcd/api/v3 v3.5.0
go.etcd.io/etcd/client/v3 v3.5.0
golang.org/x/crypto v0.8.0
@@ -85,14 +89,14 @@ require (
k8s.io/client-go v0.19.3
k8s.io/cluster-bootstrap v0.19.3
moul.io/http2curl/v2 v2.3.0
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101105715-47037258f09b
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250620092954-45cec7e835fd
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
yunion.io/x/jsonutils v1.0.1-0.20240930100528-1671a2d0d22f
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142
yunion.io/x/pkg v1.10.1
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926
yunion.io/x/sqlchemy v1.1.2
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
)
@@ -136,6 +140,7 @@ require (
github.com/boltdb/bolt v1.3.1 // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
@@ -225,11 +230,10 @@ require (
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.413 // indirect
github.com/tencentyun/cos-go-sdk-v5 v0.7.24 // indirect
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e // indirect
@@ -249,7 +253,7 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/tools v0.6.0 // indirect

51
go.sum
View File

@@ -87,6 +87,8 @@ github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuN
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3 h1:gImoAO1xAcC1oDlYmD/X7dggsodGf2DFJOVE5m0ssms=
github.com/Microsoft/azure-vhd-utils v0.0.0-20181115010904-44cbada2ece3/go.mod h1:u0H9gMieFLxkUy8RS0X8VbFWyPs2815qQAaitRbj6x0=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
@@ -178,6 +180,8 @@ github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2w
github.com/c-bata/go-prompt v0.2.4 h1:7pKUJ3CUgzdu1HJeWhNRkpVyY/NnlJhM/7d6YgHNOao=
github.com/c-bata/go-prompt v0.2.4/go.mod h1:PqlttLXp0E7bZcoDW+dmzyKqFbmQTFoNzGSuW/AQRmo=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -383,8 +387,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
@@ -426,6 +430,10 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/influxdata/influxql v1.1.0 h1:sPsaumLFRPMwR5QtD3Up54HXpNND8Eu7G1vQFmi3quQ=
github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo=
github.com/influxdata/promql/v2 v2.12.0 h1:kXn3p0D7zPw16rOtfDR+wo6aaiH8tSMfhPwONTxrlEc=
github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8=
github.com/ipandtcp/godingtalk v0.0.0-20180410032244-ca3d6ac197fb/go.mod h1:3umLciE1jBnh2LgrL15R2zbEe+HVPRZXnlSjjb/dYiw=
github.com/jaypipes/ghw v0.11.0 h1:i0pKvAM7eZk0KvLm9vzpcpDKTRnfR6AQ5pFkPVnYJXU=
github.com/jaypipes/ghw v0.11.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g=
@@ -608,6 +616,7 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4=
@@ -660,7 +669,6 @@ github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd/go.mod h1:XUKj4gbqj2QvJk/OdLWzyZ3FYli0f+MdpngyryX0gcw=
@@ -674,8 +682,9 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
@@ -684,8 +693,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/syncthing/syncthing v0.14.48-rc.4/go.mod h1:nw3siZwHPA6M8iSfjDCWQ402eqvEIasMQOE8nFOxy7M=
github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8=
github.com/tatsushid/go-fastping v0.0.0-20160109021039-d7bb493dee3e h1:nt2877sKfojlHCTOBXbpWjBkuWKritFaGIfgQwbQUls=
@@ -705,8 +715,8 @@ github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03O
github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o=
github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
github.com/tredoe/osutil/v2 v2.0.0-rc.16 h1:5A2SKvyB2c3lhPYUIHyFtu6jbaXlaA3Hu5gWIam8Pik=
github.com/tredoe/osutil/v2 v2.0.0-rc.16/go.mod h1:uLRVx/3pb7Y4RQhG8cQFbPE9ha5r81e6MXpBsxbTAYc=
github.com/tredoe/osutil v1.5.0 h1:UGVxbbHRoZi8xXVmbNZ2vgG6XoJ15ndE4LniiQ3rJKg=
github.com/tredoe/osutil v1.5.0/go.mod h1:TEzphzUUunysbdDRfdOgqkg10POQbnfIPV50ynqOfIg=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
@@ -739,6 +749,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/zexi/influxql-to-metricsql v0.0.6 h1:E16T4oqgjIJtSNVvhGGHnw+pmY3yGz2iRsmmmSVuOpY=
github.com/zexi/influxql-to-metricsql v0.0.6/go.mod h1:PyRRM+3Zrzzig6J4okYLeSv+/d+5GaL5ccBaUKQABNs=
go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw=
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
go.etcd.io/etcd/client/pkg/v3 v3.5.0 h1:2aQv6F436YnN7I4VbI8PPYrBhu+SmrTaADcf8Mi/6PU=
@@ -809,8 +821,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1184,26 +1197,28 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101105715-47037258f09b h1:t/iEm/UPjHrH43Qog2OBJmbYOFSXXgm5q4GXNBAuouI=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101105715-47037258f09b/go.mod h1:2sgCN7nRPQL3woLfdgqLDd92vwAHqtlz3KKiHxC5BAw=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241225022334-4e2172537c5f h1:aiuvYhva6wqHtF6SqSx2veZKIrTXQQDWng6/MkwZB/c=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241225022334-4e2172537c5f/go.mod h1:FTcqfExw4fKA/2uBsZy0FXZ6gojGisguUt65586FES4=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250620092954-45cec7e835fd h1:AOi+PskYKrV/KKCyzgz/ogL72V6uyLyLcuu7qj5QOFE=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250620092954-45cec7e835fd/go.mod h1:FTcqfExw4fKA/2uBsZy0FXZ6gojGisguUt65586FES4=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19 h1:mZh6vuo7oOiOtE5HF4667+XBNnn7uYpmGN5eIgCVMLk=
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
yunion.io/x/jsonutils v1.0.1-0.20240930100528-1671a2d0d22f h1:N7V0uLqX9mED1HEPeIKcYpkWglnHL5hyn4ENX+VBeqM=
yunion.io/x/jsonutils v1.0.1-0.20240930100528-1671a2d0d22f/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361 h1:c5LyNdhbvBe/92pXs9jgXOU/S+RgYh/DHe538LpT/Mo=
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 h1:inY5o3LDa/zgsIZuPN0HmpzKIsu/lLgsBmMttuDPGj4=
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 h1:Hu/4ERvoWaN6aiFs4h4/yvVBMeVzb3eDaYTxkVx9Kdo=
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142 h1:L6LqxfP08eWUx+A6yQdrL6VB3KILU1TbQllPtKZq7PM=
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
yunion.io/x/pkg v1.10.1 h1:X2U0LU5zKFGGG/XjZ6keX/7wvY0HdxxfbydduXIpsiY=
yunion.io/x/pkg v1.10.1/go.mod h1:39A2WEJLqD83do7yP5GL1ZT5w4N6x601PtxR+jlOwa8=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926 h1:FJ+2J0MwmxUcuN/8ukWHdK2XIoV3GGCotTCgi0w4L+w=
yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
yunion.io/x/sqlchemy v1.1.2 h1:h44E1ZO3bwiObXZsnCNSTRgXc9xSV86CWINUMs0qDVE=
yunion.io/x/sqlchemy v1.1.2/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=

View File

@@ -108,6 +108,8 @@ func (h *MiscHandler) Bind(app *appsrv.Application) {
// syslog webservice handlers
app.AddHandler(POST, prefix+"syslog/token", handleSyslogWebServiceToken)
app.AddHandler(POST, prefix+"syslog/message", handleSyslogWebServiceMessage)
// service settings
app.AddHandler(GET, prefix+"service_settings", h.getServiceSettings)
}
func UploadHandlerInfo(method, prefix string, handler func(context.Context, http.ResponseWriter, *http.Request)) *appsrv.SHandlerInfo {
@@ -250,7 +252,12 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
ips := []string{}
hosts := bytes.Buffer{}
for _, row := range rows[1:] {
for idx, row := range rows[1:] {
rowStr := strings.Join(row, "")
if len(rowStr) == 0 {
log.Warningf("empty row: %d, skipping it", idx+1)
continue
}
var e *httputils.JSONClientError
if i1 >= 0 && len(row[i1]) > 0 {
i1Ip := fmt.Sprintf("%d-%s", i1, row[i1])

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 handler
import (
"context"
"net/http"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modules/identity"
)
var settingNames = map[string][]string{
"identity": []string{"no_action_logout_seconds"},
"yunionapi": []string{"enable_organization"},
"image": []string{"enable_pending_delete"},
"compute_v2": []string{"enable_pending_delete"},
"meter": []string{"cost_conversion_available", "enable_prediction", "share_resource_type"},
"common": []string{"api_server", "enable_quota_check", "enable_watermark", "enable_cloud_shell"},
}
func (mh *MiscHandler) getServiceSettings(ctx context.Context, w http.ResponseWriter, req *http.Request) {
s := auth.GetAdminSession(ctx, FetchRegion(req))
types := []string{}
for typ := range settingNames {
types = append(types, typ)
}
params := map[string]interface{}{
"limit": 20,
"scope": "system",
"type": types,
}
resp, err := identity.ServicesV3.List(s, jsonutils.Marshal(params))
if err != nil {
e := httperrors.NewInternalServerError(err.Error())
httperrors.JsonClientError(ctx, w, e)
return
}
services := []struct {
Id string
Type string
}{}
err = jsonutils.Update(&services, resp.Data)
if err != nil {
e := httperrors.NewInternalServerError(err.Error())
httperrors.JsonClientError(ctx, w, e)
return
}
result := map[string]map[string]interface{}{}
for _, service := range services {
result[service.Type] = map[string]interface{}{}
data, err := identity.ServicesV3.GetSpecific(s, service.Id, "config", nil)
if err != nil {
e := httperrors.NewInternalServerError(err.Error())
httperrors.JsonClientError(ctx, w, e)
return
}
names, _ := settingNames[service.Type]
for _, name := range names {
v, _ := data.Get("config", "default", name)
result[service.Type][name] = v
}
}
appsrv.SendJSON(w, jsonutils.Marshal(result))
}

View File

@@ -17,7 +17,6 @@ package apihelper
import (
"context"
"fmt"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
@@ -40,10 +39,6 @@ func (o GetDBModelsOptions) GetModelSet() IModelSet {
return o.modelOptions.ModelSet
}
func (o GetDBModelsOptions) GetMinUpdatedAt() time.Time {
return o.modelOptions.MinUpdatedAt
}
func (o GetDBModelsOptions) IncludeDetails() bool {
return o.modelOptions.IncludeDetails
}

View File

@@ -90,11 +90,11 @@ func SyncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (
}
func syncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (IModelSets, error) {
mss := mssOld.ModelSetList()
// mss := mssOld.ModelSetList()
mssNews := mssOld.NewEmpty()
for i, msNew := range mssNews.ModelSetList() {
for _, msNew := range mssNews.ModelSetList() {
var (
minUpdatedAt = ModelSetMaxUpdatedAt(mss[i])
// minUpdatedAt = ModelSetMaxUpdatedAt(mss[i])
includeEmulated = false
)
if optProvider, ok := msNew.(IModelSetEmulatedIncluder); ok {
@@ -103,7 +103,7 @@ func syncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (
err := GetModels(&GetModelsOptions{
ClientSession: s,
ModelManager: msNew.ModelManager(),
MinUpdatedAt: minUpdatedAt,
// MinUpdatedAt: minUpdatedAt,
ModelSet: msNew,
BatchListSize: opt.ListBatchSize,
@@ -119,11 +119,9 @@ func syncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (
}
func SyncDBModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (r ModelSetsUpdateResult, err error) {
mss := mssOld.ModelSetList()
mssNews := mssOld.NewEmpty()
for i, msNew := range mssNews.ModelSetList() {
for _, msNew := range mssNews.ModelSetList() {
var (
minUpdatedAt = ModelSetMaxUpdatedAt(mss[i])
includeEmulated = false
)
if optProvider, ok := msNew.(IModelSetEmulatedIncluder); ok {
@@ -133,7 +131,6 @@ func SyncDBModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options)
opts := &GetModelsOptions{
ClientSession: s,
ModelManager: msNew.ModelManager(),
MinUpdatedAt: minUpdatedAt,
ModelSet: msNew,
BatchListSize: opt.ListBatchSize,

View File

@@ -23,7 +23,6 @@ import (
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/util/printutils"
"yunion.io/x/pkg/util/timeutils"
"yunion.io/x/onecloud/pkg/cloudcommon/db"
mcclient "yunion.io/x/onecloud/pkg/mcclient"
@@ -41,7 +40,6 @@ type GetModelsOptions struct {
ModelSet IModelSet
BatchListSize int
MinUpdatedAt time.Time
IncludeDetails bool
IncludeEmulated bool
InCludeOtherCloudEnv bool
@@ -51,56 +49,12 @@ func GetModels(opts *GetModelsOptions) error {
man := opts.ModelManager
manKeyPlural := man.KeyString()
minUpdatedAt := opts.MinUpdatedAt
minUpdatedAtFilter := func(time time.Time) string {
// TODO add GE
tstr := timeutils.MysqlTime(time)
return fmt.Sprintf("updated_at.ge('%s')", tstr)
}
setNextListParams := func(params *jsonutils.JSONDict, lastUpdatedAt time.Time, lastResult *printutils.ListResult) (time.Time, error) {
minUpdatedAt := PseudoZeroTime
setNextListParams := func(params *jsonutils.JSONDict, lastResult *printutils.ListResult) error {
// NOTE: the updated_at field has second-level resolution.
// If they all have the same date...
var max time.Time
nmax := 0
n := len(lastResult.Data)
// find out the max updated_at date in the result set, and how
// many in the set has this date
for i := n - 1; i >= 0; i-- {
j := lastResult.Data[i]
updatedAt, err := j.GetTime("updated_at")
if err != nil {
log.Warningf("%s: updated_at field: %s, %s",
manKeyPlural, err, j.String())
continue
}
if max.IsZero() {
max = updatedAt
}
if max.Equal(updatedAt) {
nmax += 1
}
}
// error if we do not have valid date
if max.IsZero() {
return time.Time{}, fmt.Errorf("%s: cannot find next updated_at after '%q'",
manKeyPlural, lastUpdatedAt)
}
var newTime time.Time
var newOffset int
// if not all updated_at date are the same, then we can
// continue to the next age.
if nmax < n || (!max.Equal(lastUpdatedAt) && !max.Equal(PseudoZeroTime)) {
newTime = max
newOffset = nmax
} else {
newTime = lastUpdatedAt
newOffset = lastResult.Offset + n
}
params.Set("filter.0", jsonutils.NewString(minUpdatedAtFilter(newTime)))
params.Set("offset", jsonutils.NewInt(int64(newOffset)))
return newTime, nil
params.Set("offset", jsonutils.NewInt(int64(lastResult.Offset+len(lastResult.Data))))
return nil
}
listOptions := options.BaseListOptions{
@@ -109,13 +63,11 @@ func GetModels(opts *GetModelsOptions) error {
Scope: "system",
Details: options.Bool(opts.IncludeDetails),
ShowEmulated: options.Bool(opts.IncludeEmulated),
Filter: []string{
minUpdatedAtFilter(minUpdatedAt), // order matters, filter.0
},
OrderBy: []string{"updated_at"},
Order: "asc",
Limit: options.Int(opts.BatchListSize),
Offset: options.Int(0),
Filter: []string{},
OrderBy: []string{"updated_at", "created_at", "id"},
Order: "asc",
Limit: options.Int(opts.BatchListSize),
Offset: options.Int(0),
}
if !opts.InCludeOtherCloudEnv {
listOptions.Filter = append(listOptions.Filter,
@@ -150,6 +102,7 @@ func GetModels(opts *GetModelsOptions) error {
entriesJson := []jsonutils.JSONObject{}
for {
var err error
log.Debugf("fetch %s with params %s", manKeyPlural, jsonutils.Marshal(params))
listResult, err := opts.ModelManager.List(opts.ClientSession, params)
if err != nil {
log.Errorf("%s: list failed with updated_at.gt('%s'): %s", manKeyPlural, minUpdatedAt, err)
@@ -159,7 +112,7 @@ func GetModels(opts *GetModelsOptions) error {
if listResult.Offset+len(listResult.Data) >= listResult.Total {
break
}
minUpdatedAt, err = setNextListParams(params, minUpdatedAt, listResult)
err = setNextListParams(params, listResult)
if err != nil {
return fmt.Errorf("%s: %s", manKeyPlural, err)
}
@@ -183,8 +136,7 @@ func InitializeModelSetFromJSON(set IModelSet, entriesJson []jsonutils.JSONObjec
manKeyPlural := set.ModelManager().KeyString()
for _, entryJson := range entriesJson {
m := set.NewModel()
var err error
err = entryJson.Unmarshal(m)
err := entryJson.Unmarshal(m)
if err != nil {
return fmt.Errorf("%s: unmarshal: %v: %s", manKeyPlural, err, entryJson.String())
}
@@ -284,5 +236,12 @@ func ModelSetApplyUpdates(aSet, bSet IModelSet) *ModelSetUpdateResult {
r.Changed = true
}
}
for _, kRv := range aSetRv.MapKeys() {
bMRv := bSetRv.MapIndex(kRv)
if !bMRv.IsValid() { // alread deleted
aSetRv.SetMapIndex(kRv, reflect.Value{})
r.Changed = true
}
}
return r
}

View File

@@ -1,5 +1,6 @@
// Copyright 2019 Yunion
//
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// 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,4 +13,28 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package cloudprovider // import "yunion.io/x/onecloud/pkg/apis/cloudprovider"
// Code generated by swagger-gen. DO NOT EDIT.
// Cloudprovider API
//
// Schemes: https, http
// BasePath: /
// Version: 1.0
// Host: "127.0.0.1:8889"
// Contact: Zexi Li<lizexi@yunion.cn>
// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
//
// SecurityDefinitions:
// keystone:
// name: X-Auth-Token
// type: apiKey
// in: header
//
// swagger:meta
package cloudprovider

View File

@@ -14,7 +14,22 @@
package cloudprovider
import "yunion.io/x/cloudmux/pkg/cloudprovider"
// CacheKeyRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.CacheKeyRule.
type CacheKeyRule struct {
RulePaths []string `json:"rule_paths"`
RuleType string `json:"rule_type"`
FullUrlCache bool `json:"full_url_cache"`
IgnoreCase bool `json:"ignore_case"`
QueryString CacheKeyRuleQueryString `json:"query_string"`
RuleTag string `json:"rule_tag"`
}
// CacheKeyRuleQueryString is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.CacheKeyRuleQueryString.
type CacheKeyRuleQueryString struct {
Enabled bool `json:"enabled"`
Action string `json:"action"`
Value string `json:"value"`
}
// DefaultAction is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.DefaultAction.
type DefaultAction struct {
@@ -30,6 +45,115 @@ type DefaultAction struct {
ResponseHeaders map[string]string `json:"response_headers"`
}
// ElasticSearchAccessInfo is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.ElasticSearchAccessInfo.
type ElasticSearchAccessInfo struct {
Domain string `json:"domain"`
PrivateDomain string `json:"private_domain"`
Vip string `json:"vip"`
Port int `json:"port"`
PrivatePort int `json:"private_port"`
KibanaUrl string `json:"kibana_url"`
KibanaPrivateUrl string `json:"kibana_private_url"`
}
// RefererRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.RefererRule.
type RefererRule struct {
// 规则类型:
// all所有文件生效
// file指定文件后缀生效
// directory指定路径生效
// path指定绝对路径生效
RuleType string `json:"rule_type"`
RulePaths []string `json:"rule_paths"`
RefererType string `json:"referer_type"`
Referers []string `json:"referers"`
AllowEmpty *bool `json:"allow_empty"`
}
// RuleCacheConfig is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.RuleCacheConfig.
type RuleCacheConfig struct {
Cache *struct {
Enabled bool
CacheTime int
CompareMaxAge bool
IgnoreCacheControl bool
IgnoreSetCookie bool
} `json:"cache"`
NoCache *struct {
Enabled bool
Revalidate bool
} `json:"no_cache"`
FollowOrigin *struct {
Enabled bool
HeuristicCache struct {
Enabled bool
CacheConfig struct {
HeuristicCacheTimeSwitch bool
HeuristicCacheTime int
}
}
} `json:"follow_origin"`
}
// SCDNCache is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNCache.
type SCDNCache struct {
RuleCache []SCacheRuleCache `json:"rule_cache"`
}
// SCDNCacheKeys is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNCacheKeys.
type SCDNCacheKeys struct {
// 开启关闭忽略参数
Enabled *bool `json:"enabled"`
// 是否忽略大小
IgnoreCase *bool `json:"ignore_case"`
// 分路径缓存键配置
KeyRules []CacheKeyRule `json:"key_rules"`
}
// SCDNForceRedirect is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNForceRedirect.
type SCDNForceRedirect struct {
// 访问强制跳转配置开关
Enabled *bool `json:"enabled"`
// 访问强制跳转类型
// enmu: http, https
RedirectType string `json:"redirect_type"`
}
// SCDNHttps is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNHttps.
type SCDNHttps struct {
// https 配置开关
Enabled *bool `json:"enabled"`
// http2 配置开关
Http2 *bool `json:"http2"`
}
// SCDNMaxAge is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNMaxAge.
type SCDNMaxAge struct {
Enabled *bool `json:"enabled"`
MaxAgeRules []SMaxAgeRule `json:"max_age_rules"`
}
// SCDNRangeOriginPull is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNRangeOriginPull.
type SCDNRangeOriginPull struct {
Enabled *bool `json:"enabled"`
RangeOriginPullRules []SRangeOriginPullRule `json:"range_origin_pull_rules"`
}
// SCDNReferer is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNReferer.
type SCDNReferer struct {
// 是否开启防盗链
Enabled *bool `json:"enabled"`
RefererRules []RefererRule `json:"referer_rules"`
}
// SCacheRuleCache is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCacheRuleCache.
type SCacheRuleCache struct {
RulePaths []string `json:"rule_paths"`
RuleType string `json:"rule_type"`
Priority int `json:"priority"`
CacheConfig *RuleCacheConfig `json:"cache_config"`
}
// SCdnDomain is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnDomain.
type SCdnDomain struct {
// cdn加速域名
@@ -48,14 +172,22 @@ type SCdnDomain struct {
// SCdnOrigin is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnOrigin.
type SCdnOrigin struct {
Type string `json:"type"`
Origin string `json:"origin"`
// 源站类型
// domain: 域名类型, cos对象存储源站, ipIP 列表作为源站
// enmu: domain, cos, ip
// required: true
Type string `json:"type"`
// 源站地址
Origin string `json:"origin"`
// 回主源站时 Host 头部
ServerName string `json:"server_name"`
Protocol string `json:"protocol"`
Path string `json:"path"`
Port int `json:"port"`
Enabled string `json:"enabled"`
Priority int `json:"priority"`
// 回源协议
// enmu: http, follow, https
Protocol string `json:"protocol"`
Path string `json:"path"`
Port int `json:"port"`
Enabled string `json:"enabled"`
Priority int `json:"priority"`
}
// SCdnOrigins is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnOrigins.
@@ -85,10 +217,28 @@ type SGeographicInfo struct {
CountryCode string `json:"country_code"`
}
// SMaxAgeRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SMaxAgeRule.
type SMaxAgeRule struct {
MaxAgeType string `json:"max_age_type"`
MaxAgeContents []string `json:"max_age_contents"`
MaxAgeTime int `json:"max_age_time"`
FollowOrigin bool `json:"follow_origin"`
}
// SRangeOriginPullRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SRangeOriginPullRule.
type SRangeOriginPullRule struct {
Enabled bool `json:"enabled"`
RuleType string `json:"rule_type"`
RulePaths []string `json:"rule_paths"`
}
// SSubAccount is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SSubAccount.
type SSubAccount struct {
Id string `json:"id"`
// 若Account不为空可不传
Name string `json:"name"`
// 描述信息
Desc string `json:"desc"`
// 输入必填,若为空,需要指定子账号名称
Account string `json:"account"`
HealthStatus string `json:"health_status"`
@@ -144,9 +294,11 @@ type ServerVncOutput struct {
HostId string `json:"host_id"`
Zone string `json:"zone"`
// kvm host ip
Host string `json:"host"`
Protocol string `json:"protocol"`
Port int64 `json:"port"`
Host string `json:"host"`
Protocol string `json:"protocol"`
Port int64 `json:"port"`
// volcengine
Region string `json:"region"`
Url string `json:"url"`
InstanceId string `json:"instance_id"`
InstanceName string `json:"instance_name"`
@@ -163,7 +315,7 @@ type ServerVncOutput struct {
// SubAccounts is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SubAccounts.
type SubAccounts struct {
// 若输出则是全量子账号列表,若输入,代表允许同步的子账号
Accounts []cloudprovider.SSubAccount `json:"accounts"`
Accounts []SSubAccount `json:"accounts"`
// 若输出是云账号查询到的区域列表,若输入,代表允许同步的区域
Cloudregions []struct {
Id string

View File

@@ -0,0 +1,18 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// 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 swagger-gen. DO NOT EDIT.
package cloudprovider

View File

@@ -135,6 +135,10 @@ type DiskConfig struct {
// requried: false
Fs string `json:"fs"`
// 关机后自动重置磁盘
// required: false
AutoReset bool `json:"auto_reset"`
// 磁盘存储格式
// enum: qcow2, raw, docker, iso, vmdk, vmdkflatver1, vmdkflatver2, vmdkflat, vmdksparse, vmdksparsever1, vmdksparsever2, vmdksepsparse vhd
// requried: false
@@ -256,6 +260,21 @@ type BaremetalDiskConfig struct {
Direct *bool `json:"direct,omitempty"`
}
type RootDiskMatcherSizeMBRange struct {
Start int64 `json:"start"`
End int64 `json:"end"`
}
const (
BAREMETAL_SERVER_METATA_ROOT_DISK_MATCHER = "baremetal_root_disk_matcher"
)
type BaremetalRootDiskMatcher struct {
Device string `json:"device"`
SizeMB int64 `json:"size_mb"`
SizeMBRange *RootDiskMatcherSizeMBRange `json:"size_mb_range"`
}
type ServerConfigs struct {
// 调度使用指定的云账号
PreferManager string `json:"prefer_manager_id"`
@@ -348,6 +367,9 @@ type ServerConfigs struct {
// 裸金属磁盘配置列表
BaremetalDiskConfigs []*BaremetalDiskConfig `json:"baremetal_disk_configs"`
// 裸金属系统盘匹配器
BaremetalRootDiskMatcher *BaremetalRootDiskMatcher `json:"baremetal_root_disk_matcher"`
// 主机组列表, 参数可以是主机组名称或ID,建议使用ID
InstanceGroupIds []string `json:"groups"`

View File

@@ -80,6 +80,11 @@ type BackupStorageDetails struct {
type BackupStorageListInput struct {
apis.EnabledStatusInfrasResourceBaseListInput
// filter by server_id
ServerId string `json:"server_id"`
// filter by disk_id
DiskId string `json:"disk_id"`
}
type DiskBackupListInput struct {
@@ -109,6 +114,8 @@ type DiskBackupDetails struct {
BackupStorageName string `json:"backup_storage_name"`
// description: 是否是子备份
IsSubBackup bool `json:"is_sub_backup"`
SDiskBackup
}
type DiskBackupCreateInput struct {

View File

@@ -0,0 +1,47 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
type BackupstorageResourceInput struct {
// 备份存储ID或Name
BackupstorageId string `json:"backupstorage_id"`
// swagger:ignore
// Deprecated
// filter by backupstorage_id
Backupstorage string `json:"backupstorage" yunion-deprecated-by:"backupstorage_id"`
}
type BackupstorageFilterListInputBase struct {
BackupstorageResourceInput
// 以备份存储名称排序
// pattern:asc|desc
OrderByBackupstorage string `json:"order_by_backupstorage"`
}
type BackupstorageResourceInfo struct {
// 备份存储名称
Backupstorage string `json:"backupstorage"`
// 备份存储类型
BackupstorageType string `json:"backupstorage_type"`
// 备份存储状态
BackupstorageStatus string `json:"backupstorage_status"`
}
type BackupstorageFilterListInput struct {
BackupstorageFilterListInputBase
}

View File

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

View File

@@ -0,0 +1,165 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package baremetal
import (
"strings"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/cloudcommon/types"
)
const (
DefaultBaremetalProfileId = "default"
)
type BaremetalProfileListInput struct {
apis.StandaloneAnonResourceListInput
OemName []string `json:"oem_name"`
Model []string `json:"model"`
}
func (input *BaremetalProfileListInput) Normalize() {
for i := range input.OemName {
input.OemName[i] = strings.TrimSpace(input.OemName[i])
}
for i := range input.Model {
input.Model[i] = strings.TrimSpace(input.Model[i])
}
}
type BaremetalProfileCreateInput struct {
apis.StandaloneAnonResourceCreateInput
OemName string
Model string
LanChannel uint8
RootId int
RootName string
StrongPass bool
}
type BaremetalProfileUpdateInput struct {
apis.StandaloneAnonResourceBaseUpdateInput
LanChannel uint8
RootId *int
RootName string
StrongPass *bool
}
type BaremetalProfileDetails struct {
SBaremetalProfile
}
func (detail BaremetalProfileDetails) ToSpec() BaremetalProfileSpec {
channels := make([]uint8, 0)
if detail.LanChannel > 0 {
channels = append(channels, detail.LanChannel)
}
if detail.LanChannel2 > 0 {
channels = append(channels, detail.LanChannel2)
}
if detail.LanChannel3 > 0 {
channels = append(channels, detail.LanChannel3)
}
return BaremetalProfileSpec{
OemName: detail.OemName,
Model: detail.Model,
LanChannels: channels,
RootName: detail.RootName,
RootId: detail.RootId,
StrongPass: detail.StrongPass,
}
}
type BaremetalProfileSpec struct {
OemName string
Model string
LanChannels []uint8
RootName string
RootId int
StrongPass bool
}
type BaremetalProfileSpecs []BaremetalProfileSpec
func (a BaremetalProfileSpecs) Len() int { return len(a) }
func (a BaremetalProfileSpecs) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a BaremetalProfileSpecs) Less(i, j int) bool {
if a[i].OemName != a[j].OemName {
return a[i].OemName < a[j].OemName
}
if a[i].Model != a[j].Model {
return a[i].Model < a[j].Model
}
return false
}
var PredefinedProfiles = []BaremetalProfileSpec{
{
OemName: "",
LanChannels: []uint8{1, 2, 8},
RootName: "root",
RootId: 2,
},
{
OemName: types.OEM_NAME_INSPUR,
LanChannels: []uint8{8, 1},
RootName: "admin",
RootId: 2,
},
{
OemName: types.OEM_NAME_LENOVO,
LanChannels: []uint8{1, 8},
RootName: "root",
RootId: 2,
},
{
OemName: types.OEM_NAME_HP,
LanChannels: []uint8{1, 2},
RootName: "root",
RootId: 1,
},
{
OemName: types.OEM_NAME_HUAWEI,
LanChannels: []uint8{1},
RootName: "root",
RootId: 2,
StrongPass: true,
},
{
OemName: types.OEM_NAME_FOXCONN,
LanChannels: []uint8{1},
RootName: "root",
RootId: 2,
StrongPass: true,
},
{
OemName: types.OEM_NAME_QEMU,
LanChannels: []uint8{8, 1},
RootName: "root",
RootId: 2,
StrongPass: true,
},
{
OemName: types.OEM_NAME_H3C,
LanChannels: []uint8{1},
RootName: "root",
RootId: 2,
StrongPass: true,
},
}

View File

@@ -0,0 +1,36 @@
// 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 baremetal
import (
"yunion.io/x/onecloud/pkg/apis"
)
// SBaremetalProfile is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models/baremetal.SBaremetalProfile.
type SBaremetalProfile struct {
apis.SStandaloneAnonResourceBase
// 品牌名称English)
OemName string `json:"oem_name"`
Model string `json:"model"`
LanChannel byte `json:"lan_channel"`
LanChannel2 byte `json:"lan_channel2"`
LanChannel3 byte `json:"lan_channel3"`
// BMC Root账号名称默认为 root
RootName string `json:"root_name"`
// BMC Root账号ID默认为 2
RootId int `json:"root_id"`
// 是否要求强密码
StrongPass bool `json:"strong_pass"`
}

View File

@@ -80,7 +80,7 @@ func (self BucketDetails) GetMetricTags() map[string]string {
"tenant_id": self.ProjectId,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}
func (self BucketDetails) GetMetricPairs() map[string]string {

View File

@@ -137,6 +137,7 @@ type CloudaccountResourceInfo struct {
AccountStatus string `json:"account_status,omitempty"`
// 云账号监控状态
AccountHealthStatus string `json:"account_health_status,omitempty"`
AccountReadOnly bool `json:"account_read_only,omitempty"`
}
type CloudaccountCreateInput struct {
@@ -259,6 +260,8 @@ type CloudaccountListInput struct {
// 账号健康状态
HealthStatus []string `json:"health_status"`
ReadOnly *bool `json:"read_only"`
// 共享模式
ShareMode []string `json:"share_mode"`
@@ -370,7 +373,7 @@ func (self CloudaccountDetail) GetMetricTags() map[string]string {
"project_domain": self.ProjectDomain,
"currency": self.Currency,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}
func (self CloudaccountDetail) GetMetricPairs() map[string]string {

View File

@@ -115,6 +115,18 @@ var (
CLOUD_PROVIDER_INCLOUD_SPHERE, CLOUD_PROVIDER_PROXMOX, CLOUD_PROVIDER_REMOTEFILE,
CLOUD_PROVIDER_H3C,
}
PUBLIC_CLOUD_PROVIDERS = []string{
CLOUD_PROVIDER_ALIYUN,
CLOUD_PROVIDER_AWS,
CLOUD_PROVIDER_AZURE,
CLOUD_PROVIDER_CTYUN,
CLOUD_PROVIDER_ECLOUD,
CLOUD_PROVIDER_HUAWEI,
CLOUD_PROVIDER_QCLOUD,
CLOUD_PROVIDER_UCLOUD,
CLOUD_PROVIDER_GOOGLE,
CLOUD_PROVIDER_JDCLOUD,
}
CLOUD_PROVIDERS = []string{
CLOUD_PROVIDER_ONECLOUD,

View File

@@ -255,6 +255,8 @@ type CloudproviderListInput struct {
SyncableBaseResourceListInput
ReadOnly *bool `json:"read_only"`
// 账号健康状态
HealthStatus []string `json:"health_status"`

View File

@@ -345,7 +345,8 @@ func (self DBInstanceDetails) GetMetricTags() map[string]string {
if len(self.IpAddrs) > 0 {
ret["rds_ip"] = strings.ReplaceAll(self.IpAddrs, ",", "|")
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}
func (self DBInstanceDetails) GetMetricPairs() map[string]string {

View File

@@ -160,6 +160,9 @@ type DiskListInput struct {
// swagger:ignore
// Deprecated
Snapshot string `json:"snapshot" yunion-deprecated-by:"snapshot_id"`
// 根据虚拟机状态过滤
GuestStatus string `json:"guest_status"`
}
type DiskResourceInput struct {
@@ -230,11 +233,6 @@ type DiskDetails struct {
// 自动快照策略
Snapshotpolicies []SimpleSnapshotPolicy `json:"snapshotpolicies"`
// 手动快照数量
ManualSnapshotCount int `json:"manual_snapshot_count"`
// 最多可创建手动快照数量
MaxManualSnapshotCount int `json:"max_manual_snapshot_count"`
}
type DiskResourceInfoBase struct {
@@ -259,6 +257,8 @@ type DiskUpdateInput struct {
// 磁盘类型
DiskType string `json:"disk_type"`
// 关机自动重置
AutoReset *bool `json:"auto_reset"`
}
type DiskSaveInput struct {

View File

@@ -66,7 +66,10 @@ const (
DISK_EXIST = "exist"
)
const DISK_META_EXISTING_PATH = "disk_existing_path"
const (
DISK_META_EXISTING_PATH = "disk_existing_path"
DISK_META_LAST_ATTACHED_HOST = "__disk_last_attached_host"
)
const (
DISK_DRIVER_VIRTIO = "virtio"

View File

@@ -1,46 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import "yunion.io/x/onecloud/pkg/apis"
const (
DNS_ZONE_CACHE_STATUS_DELETING = "deleting"
DNS_ZONE_CACHE_STATUS_DELETE_FAILED = "delete_failed"
DNS_ZONE_CACHE_STATUS_CREATING = "creating"
DNS_ZONE_CACHE_STATUS_CREATE_FAILED = "create_failed"
DNS_ZONE_CACHE_STATUS_AVAILABLE = "available"
DNS_ZONE_CACHE_STATUS_UNKNOWN = "unknown"
)
type DnsZoneCacheCreateInput struct {
}
type DnsZoneCacheDetails struct {
apis.StatusStandaloneResourceDetails
SDnsZoneCache
Account string
Brand string
Provider string
}
type DnsZoneCacheListInput struct {
apis.StatusStandaloneResourceListInput
DnsZoneFilterListBase
CloudaccountId string `json:"cloudaccount_id"`
}

View File

@@ -57,7 +57,7 @@ func (self ElasticcacheDetails) GetMetricTags() map[string]string {
"project_domain": self.ProjectDomain,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}
func (self ElasticcacheDetails) GetMetricPairs() map[string]string {

View File

@@ -113,7 +113,7 @@ func (self ElasticipDetails) GetMetricTags() map[string]string {
"ip_addr": self.IpAddr,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}
type ElasticipSyncstatusInput struct {

View File

@@ -45,6 +45,12 @@ const (
VM_DETACH_DISK = "detach_disk"
VM_UNSYNC = "unsync"
VM_START_RESCUE = "start_rescue"
VM_RESCUING = "rescuing"
VM_STOP_RESCUE = "stop_rescue"
VM_START_RESCUE_FAILED = "start_rescue_failed"
VM_STOP_RESCUE_FAILED = "stop_rescue_failed"
VM_BACKUP_STARTING = "backup_starting"
VM_BACKUP_STOPING = "backup_stopping"
VM_BACKUP_CREATING = "backup_creating"
@@ -166,6 +172,7 @@ const (
VM_QGA_SET_PASSWORD = "qga_set_password"
VM_QGA_COMMAND_EXECUTING = "qga_command_executing"
VM_QGA_EXEC_COMMAND_FAILED = "qga_exec_command_failed"
VM_QGA_SYNC_OS_INFO = "qga_sync_os_info"
VM_QGA_SET_NETWORK = "qga_set_network"
VM_QGA_SET_NETWORK_FAILED = "qga_set_network_failed"
@@ -384,18 +391,23 @@ const (
VM_AZURE_DEFAULT_LOGIN_USER = compute.VM_AZURE_DEFAULT_LOGIN_USER
VM_ZSTACK_DEFAULT_LOGIN_USER = compute.VM_ZSTACK_DEFAULT_LOGIN_USER
VM_METADATA_APP_TAGS = "app_tags"
VM_METADATA_CREATE_PARAMS = "create_params"
VM_METADATA_LOGIN_ACCOUNT = "login_account"
VM_METADATA_LOGIN_KEY = "login_key"
VM_METADATA_LAST_LOGIN_KEY = "last_login_key"
VM_METADATA_LOGIN_KEY_TIMESTAMP = "login_key_timestamp"
VM_METADATA_OS_ARCH = "os_arch"
VM_METADATA_OS_DISTRO = "os_distribution"
VM_METADATA_OS_NAME = "os_name"
VM_METADATA_OS_VERSION = "os_version"
VM_METADATA_CGROUP_CPUSET = "cgroup_cpuset"
VM_METADATA_ENABLE_MEMCLEAN = "enable_memclean"
VM_METADATA_APP_TAGS = "app_tags"
VM_METADATA_CREATE_PARAMS = "create_params"
VM_METADATA_LOGIN_ACCOUNT = "login_account"
VM_METADATA_LOGIN_KEY = "login_key"
VM_METADATA_LAST_LOGIN_KEY = "last_login_key"
VM_METADATA_LOGIN_KEY_TIMESTAMP = "login_key_timestamp"
VM_METADATA_OS_ARCH = "os_arch"
VM_METADATA_OS_DISTRO = "os_distribution"
VM_METADATA_OS_NAME = "os_name"
VM_METADATA_OS_VERSION = "os_version"
VM_METADATA_CGROUP_CPUSET = "cgroup_cpuset"
VM_METADATA_ENABLE_MEMCLEAN = "enable_memclean"
VM_METADATA_HOTPLUG_CPU_MEM = "hotplug_cpu_mem"
VM_METADATA_HOT_REMOVE_NIC = "hot_remove_nic"
VM_METADATA_START_VMEM_MB = "start_vmem_mb"
VM_METADATA_START_VCPU_COUNT = "start_vcpu_count"
VM_METADATA_DISABLE_AUTO_MERGE_SNAPSHOT = "disable_auto_merge_snapshot"
)
func Hypervisors2HostTypes(hypervisors []string) []string {

View File

@@ -34,6 +34,8 @@ type GuestDiskDetails struct {
// 磁盘类型
// example: data
DiskType string `json:"disk_type"`
// 关机自动重置
AutoReset bool `json:"auto_reset"`
// 介质类型
// example: ssd
MediumType string `json:"medium_type"`
@@ -90,6 +92,7 @@ type GuestdiskJsonDesc struct {
Dev string `json:"dev"`
IsSSD bool `json:"is_ssd"`
NumQueues uint8 `json:"num_queues"`
AutoReset bool `json:"auto_reset"`
// esxi
ImageInfo struct {

View File

@@ -0,0 +1,28 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
// Rescue constants are used for rescue mode
const (
GUEST_RESCUE_RELATIVE_PATH = "rescue" // serverxxx/rescue
GUEST_RESCUE_INITRAMFS = "initramfs"
GUEST_RESCUE_KERNEL = "kernel"
GUEST_RESCUE_INITRAMFS_ARM64 = "initramfs_aarch64"
GUEST_RESCUE_KERNEL_ARM64 = "kernel_aarch64"
GUEST_RESCUE_SYS_DISK_NAME = "sys_img"
GUEST_RESCUE_SYS_DISK_SIZE = 500 // MB
)

View File

@@ -109,6 +109,8 @@ type GuestnetworkBaseDesc struct {
} `json:"vpc"`
Networkaddresses jsonutils.JSONObject `json:"networkaddresses"`
VirtualIps []string `json:"virtual_ips"`
}
type GuestnetworkJsonDesc struct {
@@ -118,10 +120,9 @@ type GuestnetworkJsonDesc struct {
NumQueues int `json:"num_queues"`
Vectors *int `json:"vectors"`
VirtualIps []string `json:"virtual_ips"`
ExternalId string `json:"external_id"`
TeamWith string `json:"team_with"`
Manual *bool `json:"manual"`
ExternalId string `json:"external_id"`
TeamWith string `json:"team_with"`
Manual *bool `json:"manual"`
UpscriptPath string `json:"upscript_path"`
DownscriptPath string `json:"downscript_path"`
@@ -136,4 +137,6 @@ type GuestnetworkJsonDesc struct {
type SNicTrafficRecord struct {
RxTraffic int64
TxTraffic int64
HasBeenSetDown bool
}

View File

@@ -16,7 +16,6 @@ package compute
import (
"fmt"
"strings"
"time"
"yunion.io/x/jsonutils"
@@ -24,7 +23,6 @@ import (
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/apis/billing"
"yunion.io/x/onecloud/pkg/apis/cloudcommon/db"
imageapi "yunion.io/x/onecloud/pkg/apis/image"
"yunion.io/x/onecloud/pkg/httperrors"
)
@@ -75,6 +73,8 @@ type ServerListInput struct {
// 列出操作系统为指定值的主机
// enum: linux,windows,vmware
OsType []string `json:"os_type"`
// 操作系统发行版
OsDist []string `json:"os_dist"`
// 对列表结果按照磁盘大小进行排序
// enum: asc,desc
@@ -124,6 +124,9 @@ type ServerListInput struct {
InstanceType []string `json:"instance_type"`
// 根据镜像发行版排序
OrderByOsDist string `json:"order_by_os_dist"`
// 是否调度到宿主机上
WithHost *bool `json:"with_host"`
}
@@ -187,18 +190,11 @@ type ServerDetails struct {
// 系统管理员可见的安全组规则
AdminSecurityRules string `json:"admin_security_rules"`
// list
AttachTime time.Time `json:"attach_time"`
// common
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
// 备份主机所在宿主机名称
BackupHostName string `json:"backup_host_name"`
// 备份主机所在宿主机状态
BackupHostStatus string `json:"backup_host_status"`
// 主备机同步状态
BackupGuestSyncStatus string `json:"backup_guest_sync_status"`
// 主备机信息
BackupInfo
// 是否可以回收
CanRecycle bool `json:"can_recycle"`
@@ -268,6 +264,15 @@ type ServerDetails struct {
MonitorUrl string `json:"monitor_url"`
}
type BackupInfo struct {
// 备份主机所在宿主机名称
BackupHostName string `json:"backup_host_name"`
// 备份主机所在宿主机状态
BackupHostStatus string `json:"backup_host_status"`
// 主备机同步状态
BackupGuestSyncStatus string `json:"backup_guest_sync_status"`
}
type Floppy struct {
Ordinal int `json:"ordinal"`
Detail string `json:"detail"`
@@ -279,6 +284,22 @@ type Cdrom struct {
BootIndex int8 `json:"boot_index"`
}
type IMetricResource interface {
GetMetricTags() map[string]string
}
func AppendMetricTags(ret map[string]string, res ...IMetricResource) map[string]string {
if ret == nil {
ret = map[string]string{}
}
for _, r := range res {
for k, v := range r.GetMetricTags() {
ret[k] = v
}
}
return ret
}
func (self ServerDetails) GetMetricTags() map[string]string {
ret := map[string]string{
"id": self.Id,
@@ -307,15 +328,8 @@ func (self ServerDetails) GetMetricTags() map[string]string {
"account_id": self.AccountId,
"external_id": self.ExternalId,
}
for k, v := range self.Metadata {
if strings.HasPrefix(k, db.USER_TAG_PREFIX) {
if strings.Contains(k, "login_key") || strings.Contains(v, "=") {
continue
}
ret[k] = v
}
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}
func (self ServerDetails) GetMetricPairs() map[string]string {
@@ -340,6 +354,7 @@ type GuestDiskInfo struct {
Driver string `json:"driver"`
CacheMode string `json:"cache_mode"`
AioMode string `json:"aio_mode"`
AutoReset bool `json:"auto_reset"`
MediumType string `json:"medium_type"`
StorageType string `json:"storage_type"`
Iops int `json:"iops"`
@@ -593,6 +608,9 @@ type ServerStopInput struct {
// 是否强制关机
IsForce bool `json:"is_force"`
// 关机等待时间如果是强制关机则等待时间为0如果不设置默认为30秒
TimeoutSecs int `json:"timeout_secs"`
// 是否关机停止计费, 若平台不支持停止计费,此参数无作用
// 目前仅阿里云,腾讯云此参数生效
StopCharging bool `json:"stop_charging"`
@@ -716,6 +734,8 @@ type ServerDeployInputBase struct {
ResetPassword bool `json:"reset_password"`
// 重置指定密码
Password string `json:"password"`
// swagger: ignore
LoginAccount string `json:"login_account"`
// swagger: ignore
Restart bool `json:"restart"`
@@ -865,6 +885,8 @@ type GuestJsonDesc struct {
EncryptKeyId string `json:"encrypt_key_id,omitempty"`
IsDaemon bool `json:"is_daemon"`
LightMode bool `json:"light_mode"`
}
type ServerSetBootIndexInput struct {
@@ -912,6 +934,13 @@ type ServerChangeDiskStorageInternalInput struct {
CloneDiskCount int `json:"disk_count"`
}
type ServerCopyDiskToStorageInput struct {
KeepOriginDisk bool `json:"keep_origin_disk"`
GuestRunning bool `json:"guest_running"`
CompletedDiskCount int `json:"completed_disk_count"`
CloneDiskCount int `json:"disk_count"`
}
type ServerSetExtraOptionInput struct {
Key string `json:"key"`
Value string `json:"value"`
@@ -1115,3 +1144,13 @@ type GuestPerformStartInput struct {
// 仅适用于KVM虚拟机
QemuVersion string `json:"qemu_version"`
}
type ServerSetOSInfoInput struct {
// OS type, e.g.: Linux, Windows
Type string `json:"type" help:"OS type, e.g.: Linux, Windows"`
// OS distribution, e.g.: CentOS, Ubuntu, Windows Server 2016 Datacenter
Distribution string `json:"distribution" help:"OS distribution, e.g.: CentOS, Ubuntu, Windows Server 2016 Datacenter"`
// OS version, e.g: 7.9, 22.04, 6.3
Version string `json:"version" help:"OS version, e.g.: 7.9, 22.04, 6.3"`
Arch string `json:"arch" help:"OS arch, e.g.: x86_64, aarch64"`
}

View File

@@ -69,6 +69,7 @@ type HostListInput struct {
StorageFilterListInput
UsableResourceListInput
BackupstorageFilterListInput
// filter by ResourceType
ResourceType string `json:"resource_type"`
@@ -253,7 +254,8 @@ func (self HostDetails) GetMetricTags() map[string]string {
"account_id": self.AccountId,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo)
}
func (self HostDetails) GetMetricPairs() map[string]string {
@@ -284,6 +286,11 @@ type HostResourceInfo struct {
// 宿主机状态
HostStatus string `json:"host_status"`
HostResourceType string `json:"host_resource_type"`
// 宿主机计费类型
HostBillingType string `json:"host_billing_type"`
// 宿主机服务状态`
HostServiceStatus string `json:"host_service_status"`
@@ -396,7 +403,7 @@ type HostIpmiAttributes struct {
// presence
IpmiPresent *bool `json:"ipmi_present"`
// lan channel
IpmiLanChannel *int `json:"ipmi_lan_channel"`
IpmiLanChannel *uint8 `json:"ipmi_lan_channel"`
// verified
IpmiVerified *bool `json:"ipmi_verified"`
// Redfish API support
@@ -497,6 +504,8 @@ type HostUpdateInput struct {
// 主机启动模式, 可能值位PXE和ISO
BootMode string `json:"boot_mode"`
EnableNumaAllocate *bool `json:"enable_numa_allocate"`
}
type HostOfflineInput struct {
@@ -555,3 +564,8 @@ type HostLoginInfoOutput struct {
type HostPerformStartInput struct {
}
type HostSetCommitBoundInput struct {
CpuCmtbound *float32
MemCmtbound *float32
}

View File

@@ -15,29 +15,33 @@
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
type DnsTrafficPolicyCreateInput struct {
apis.EnabledStatusInfrasResourceBaseCreateInput
type HostBackupstorageDetails struct {
HostJointResourceDetails
Provider string `json:"provider"`
PolicyType string `json:"policy_type"`
PolicyValue string `json:"policy_value"`
// 额外参数
Options *jsonutils.JSONDict `json:"options"`
SHostBackupstorage
// 存储名称
Backupstorage string `json:"backupstorage"`
// 存储大小
CapacityMb int64 `json:"capacity_mb"`
// 存储类型
// example: local
StorageType string `json:"storage_type"`
// 是否启用
Enabled bool `json:"enabled"`
}
type DnsTrafficPolicyDetails struct {
apis.EnabledStatusInfrasResourceBaseDetails
SDnsTrafficPolicy
type HostBackupstorageListInput struct {
HostJointsListInput
BackupstorageFilterListInput
}
type DnsTrafficPolicyListInput struct {
apis.EnabledStatusInfrasResourceBaseListInput
Provider []string `json:"provider"`
PolicyType string `json:"policy_type"`
type HostBackupstorageCreateInput struct {
apis.JoinResourceBaseCreateInput
BackupstorageId string `json:"backupstorage_id"`
HostId string `json:"host_id"`
}

View File

@@ -27,7 +27,8 @@ type HostJointResourceDetailsBase struct {
type HostJointResourceDetails struct {
apis.JointResourceBaseDetails
HostJointResourceDetailsBase
// HostJointResourceDetailsBase
HostResourceInfo
}
type HostJointsListInput struct {

View File

@@ -115,6 +115,7 @@ type IsolatedDeviceJsonDesc struct {
DiskIndex int8 `json:"disk_index"`
NvmeSizeMB int `json:"nvme_size_mb"`
MdevId string `json:"mdev_id"`
NumaNode int8 `json:"numa_node"`
}
type IsolatedDeviceModelCreateInput struct {
@@ -177,4 +178,23 @@ type IsolatedDeviceModelListInput struct {
// 支持热插拔 HotPluggable
HotPluggable bool `json:"hot_pluggable"`
// 宿主机 Id
HostId string `json:"host_id"`
}
type HostIsolatedDeviceModelDetails struct {
SHostJointsBase
HostJointResourceDetails
// 宿主机Id
HostId string `json:"host_id"`
// 存储Id
IsolatedDeviceModelId string `json:"isolated_device_model_id"`
Model string
VendorId string
DeviceId string
DevType string
HotPluggable bool
DisableAutoDetect bool
}

View File

@@ -28,8 +28,6 @@ const (
AMD_VENDOR_ID = "1002"
)
const MEAT_PROBED_HOST_COUNT = "probed_host_count"
var VALID_GPU_TYPES = []string{GPU_HPC_TYPE, GPU_VGA_TYPE}
var VALID_ATTACH_TYPES = []string{GPU_HPC_TYPE, GPU_VGA_TYPE, USB_TYPE, SRIOV_VGPU_TYPE, LEGACY_VGPU_TYPE}

View File

@@ -67,7 +67,8 @@ func (self KubeClusterDetails) GetMetricTags() map[string]string {
"account_id": self.AccountId,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo)
}
func (self KubeClusterDetails) GetMetricPairs() map[string]string {

View File

@@ -246,5 +246,5 @@ func (self LoadbalancerDetails) GetMetricTags() map[string]string {
"tenant_id": self.ProjectId,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}

View File

@@ -144,7 +144,7 @@ type LoadbalancerListenerCreateInput struct {
HealthCheck string `json:"health_check"`
// enum: tcp, udp, http
HealthCheckType string `json:"health_check_type"`
HealthCheckDomain string `json:"string"`
HealthCheckDomain string `json:"health_check_domain"`
HealthCheckPath string `json:"health_check_path"`
// default: http_2xx,http_3xx
HealthCheckHttpCode string `json:"health_check_http_code"`

View File

@@ -73,7 +73,8 @@ func (self ModelartsPoolDetails) GetMetricTags() map[string]string {
"account": self.Account,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
}
type ModelartsPoolListInput struct {

View File

@@ -394,17 +394,17 @@ type NetworkUpdateInput struct {
// 接收IP地址
GuestIpEnd string `json:"guest_ip_end"`
// 掩码
GuestIpMask *int8 `json:"guest_ip_mask"`
GuestIpMask int8 `json:"guest_ip_mask"`
// 网关地址
GuestGateway string `json:"guest_gateway"`
GuestGateway *string `json:"guest_gateway"`
// DNS
GuestDns string `json:"guest_dns"`
GuestDns *string `json:"guest_dns"`
// allow multiple dhcp, seperated by ","
GuestDhcp string `json:"guest_dhcp"`
GuestDhcp *string `json:"guest_dhcp"`
// NTP
GuestNtp string `json:"guest_ntp"`
GuestNtp *string `json:"guest_ntp"`
GuestDomain string `json:"guest_domain"`
GuestDomain *string `json:"guest_domain"`
VlanId *int `json:"vlan_id"`
@@ -425,6 +425,14 @@ type GetNetworkAddressesOutput struct {
Addresses []SNetworkUsedAddress `json:"addresses"`
}
type GetNetworkAvailableAddressesInput struct {
}
type GetNetworkAvailableAddressesOutput struct {
// IP子网地址记录
Addresses []string `json:"addresses"`
}
type NetworkSetBgpTypeInput struct {
apis.Meta

View File

@@ -20,10 +20,6 @@ import (
"yunion.io/x/cloudmux/pkg/apis/compute"
)
const (
DefaultDNSServers = "223.5.5.5,223.6.6.6"
)
const (
// # DEFAULT_BANDWIDTH = options.default_bandwidth
MAX_BANDWIDTH = 100000

View File

@@ -71,6 +71,12 @@ type StorageCreateInput struct {
// example: 192.168.222.3,192.168.222.4,192.168.222.99
RbdMonHost string `json:"rbd_mon_host"`
// enable ceph messenger v2
EnableMessengerV2 *bool `json:"enable_messenger_v2"`
// rbd storage auto cache glance images
AutoCacheImages *bool `json:"auto_cache_images"`
// swagger:ignore
MonHost string
@@ -104,6 +110,13 @@ type StorageCreateInput struct {
// 网络文件系统共享目录, storage_type 为 nfs 时, 此参数必传
// example: /nfs_root/
NfsSharedDir string `json:"nfs_shared_dir"`
// CLVM VG Name
CLVMVgName string
// SLVM VG Name
SLVMVgName string
MasterHost string
Lvmlockd bool
}
type RbdTimeoutInput struct {
@@ -177,7 +190,7 @@ func (self StorageDetails) GetMetricTags() map[string]string {
"project_domain": self.ProjectDomain,
"external_id": self.ExternalId,
}
return ret
return AppendMetricTags(ret, self.MetadataResourceInfo)
}
func (self StorageDetails) GetMetricPairs() map[string]string {
@@ -224,10 +237,32 @@ type StorageUpdateInput struct {
// example: AQDigB9dtnDAKhAAxS6X4zi4BPR/lIle4nf4Dw==
RbdKey string `json:"rbd_key"`
// enable ceph messenger v2
EnableMessengerV2 *bool `json:"enable_messenger_v2"`
// rbd storage auto cache glance images
AutoCacheImages *bool `json:"auto_cache_images"`
RbdTimeoutInput
// swagger:ignore
StorageConf *jsonutils.JSONDict
UpdateStorageConf bool
MasterHost string
}
type RbdStorageConf struct {
RadosMonOpTimeout int `json:"rados_mon_op_timeout"`
RadosOsdOpTimeout int `json:"rados_osd_op_timeout"`
ClientMountTimeout int `json:"client_mount_timeout"`
MonHost string `json:"mon_host"`
Pool string `json:"pool"`
Key string `json:"key"`
EnableMessengerV2 bool `json:"enable_messenger_v2"`
AutoCacheImages bool `json:"auto_cache_images"`
}
type StorageSetCmtBoundInput struct {
Cmtbound *float32
}

View File

@@ -34,6 +34,8 @@ const (
STORAGE_NVME_PT = "nvme_pt" // nvme passthrough
STORAGE_NVME = "nvme" // nvme sriov
STORAGE_LVM = "lvm"
STORAGE_CLVM = "clvm" // clustered lvm
STORAGE_SLVM = "slvm" // shared lvm
STORAGE_PUBLIC_CLOUD = compute.STORAGE_PUBLIC_CLOUD
STORAGE_CLOUD_EFFICIENCY = compute.STORAGE_CLOUD_EFFICIENCY
@@ -43,6 +45,7 @@ const (
STORAGE_CLOUD_ESSD_PL2 = compute.STORAGE_CLOUD_ESSD_PL2 // 单盘最高随机读写IOPS 10万
STORAGE_CLOUD_ESSD_PL3 = compute.STORAGE_CLOUD_ESSD_PL3 // 单盘最高随机读写IOPS 100万
STORAGE_CLOUD_AUTO = compute.STORAGE_CLOUD_AUTO // ESSD AutoPL
STORAGE_CLOUD_ESSD_ENTRY = "cloud_essd_entry" // ESSD Entry云盘
STORAGE_EPHEMERAL_SSD = compute.STORAGE_EPHEMERAL_SSD // 单块本地SSD盘, 容量最大不能超过800 GiB
STORAGE_LOCAL_HDD_PRO = compute.STORAGE_LOCAL_HDD_PRO // 实例规格族d1ne和d1搭载的SATA HDD本地盘
STORAGE_LOCAL_SSD_PRO = compute.STORAGE_LOCAL_SSD_PRO // 实例规格族i2、i2g、i1、ga1和gn5等搭载的NVMe
@@ -93,6 +96,7 @@ const (
// Zstack storage type
STORAGE_ZSTACK_LOCAL_STORAGE = compute.STORAGE_ZSTACK_LOCAL_STORAGE
STORAGE_ZSTACK_CEPH = compute.STORAGE_ZSTACK_CEPH
STORAGE_ZSTACK_SHARED_BLOCK = compute.STORAGE_ZSTACK_SHARED_BLOCK
// Google storage type
STORAGE_GOOGLE_LOCAL_SSD = compute.STORAGE_GOOGLE_LOCAL_SSD //本地SSD暂存盘 (最多8个)
@@ -161,19 +165,20 @@ var (
STORAGE_HUAWEI_SSD, STORAGE_HUAWEI_SAS, STORAGE_HUAWEI_SATA,
STORAGE_OPENSTACK_ISCSI, STORAGE_UCLOUD_CLOUD_NORMAL, STORAGE_UCLOUD_CLOUD_SSD,
STORAGE_UCLOUD_LOCAL_NORMAL, STORAGE_UCLOUD_LOCAL_SSD, STORAGE_UCLOUD_EXCLUSIVE_LOCAL_DISK,
STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_ZSTACK_CEPH, STORAGE_GPFS, STORAGE_CIFS,
STORAGE_NVME_PT, STORAGE_NVME, STORAGE_LVM,
STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_ZSTACK_CEPH, STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_GPFS, STORAGE_CIFS,
STORAGE_NVME_PT, STORAGE_NVME, STORAGE_LVM, STORAGE_CLVM, STORAGE_SLVM,
}
HOST_STORAGE_LOCAL_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_OPENSTACK_NOVA}
STORAGE_LIMITED_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_NAS, STORAGE_RBD, STORAGE_NFS, STORAGE_GPFS, STORAGE_VSAN, STORAGE_CIFS}
STORAGE_LIMITED_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_NAS, STORAGE_RBD,
STORAGE_NFS, STORAGE_GPFS, STORAGE_VSAN, STORAGE_CIFS, STORAGE_CLVM, STORAGE_SLVM}
SHARED_FILE_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS}
FIEL_STORAGE = []string{STORAGE_LOCAL, STORAGE_NFS, STORAGE_GPFS}
FIEL_STORAGE = []string{STORAGE_LOCAL, STORAGE_NFS, STORAGE_GPFS, STORAGE_LVM, STORAGE_CLVM, STORAGE_SLVM}
// 目前来说只支持这些
SHARED_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS, STORAGE_RBD}
// supported shared storage types
SHARED_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS, STORAGE_RBD, STORAGE_CLVM, STORAGE_SLVM}
)
func IsDiskTypeMatch(t1, t2 string) bool {
@@ -253,4 +258,7 @@ type StorageListInput struct {
// filter storages of baremetal host
IsBaremetal *bool `json:"is_baremetal"`
// filter by storage type
StorageType string `json:"storage_type"`
}

View File

@@ -98,6 +98,26 @@ type StoragecacheResourceInfo struct {
// 存储缓存名称
Storagecache string `json:"storagecache"`
// 关联存储名称
Storages []string `json:"storages"`
// 关联存储信息
StorageInfo []StorageInfo `json:"storage_info"`
}
type StorageInfo struct {
Id string `json:"id"`
Name string `json:"name"`
StorageType string `json:"storage_type"`
MediumType string `json:"medium_type"`
ZoneId string `json:"zone_id"`
Zone string `json:"zone"`
}
type StoragecacheFilterListInputBase struct {

View File

@@ -15,12 +15,12 @@
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
type StoragecachedimageDetails struct {
SStoragecachedimage
apis.JointResourceBaseDetails
StoragecacheResourceInfo
@@ -29,15 +29,20 @@ type StoragecachedimageDetails struct {
Cachedimage string `json:"cachedimage"`
// 存储列表
Storages []string `json:"storages"`
// Storages []string `json:"storages"`
// 通过一致性哈希获取的一个宿主机详情
Host *jsonutils.JSONDict `json:"host"`
// Host *jsonutils.JSONDict `json:"host"`
// 镜像名称
Image string `json:"image"`
// 镜像大小
Size int64 `json:"size"`
// 引用次数
Reference int `json:"reference"`
// Disk引用次数
DiskReference int `json:"disk_reference"`
// Cdrom引用次数
CdromReference int `json:"cdrom_reference"`
}
type StoragecachedimageListInput struct {

View File

@@ -17,10 +17,10 @@ package compute
import (
time "time"
cloudprovider "yunion.io/x/cloudmux/pkg/cloudprovider"
jsonutils "yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/apis/cloudprovider"
)
// SAccessGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SAccessGroup.
@@ -329,6 +329,9 @@ type SCloudprovider struct {
CloudaccountId string `json:"cloudaccount_id"`
// 云账号的平台信息
Provider string `json:"provider"`
// 云上同步资源是否在本地被更改过配置, local: 更改过, cloud: 未更改过
// example: local
ProjectSrc string `json:"project_src"`
SProjectMappingResourceBase
}
@@ -352,9 +355,9 @@ type SCloudproviderQuota struct {
QuotaRange string `json:"quota_range"`
// 已使用的配额
// -1代表未从云平台拿到已使用配额信息
UsedCount int `json:"used_count"`
UsedCount int64 `json:"used_count"`
// 最大配额限制
MaxCount int `json:"max_count"`
MaxCount int64 `json:"max_count"`
// 配额类型
QuotaType string `json:"quota_type"`
}
@@ -388,7 +391,6 @@ type SCloudproviderschedtag struct {
type SCloudregion struct {
apis.SEnabledStatusStandaloneResourceBase
SI18nResourceBase
SManagedResourceBase
apis.SExternalizedResourceBase
cloudprovider.SGeographicInfo
// 云环境
@@ -664,48 +666,29 @@ type SDiskResourceBase struct {
DiskId string `json:"disk_id"`
}
// SDnsRecordis an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsRecord.
// SDnsRecord is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsRecord.
type SDnsRecord struct {
apis.SEnabledStatusStandaloneResourceBase
apis.SExternalizedResourceBase
SDnsZoneResourceBase
DnsType string `json:"dns_type"`
DnsValue string `json:"dns_value"`
TTL int64 `json:"ttl"`
MxPriority int64 `json:"mx_priority"`
}
// SDnsRecordSetTrafficPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsRecordSetTrafficPolicy.
type SDnsRecordSetTrafficPolicy struct {
apis.SJointResourceBase
DnsRecordsetId string `json:"dns_recordset_id"`
DnsTrafficPolicyId string `json:"dns_traffic_policy_id"`
}
// SDnsTrafficPolicy is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsTrafficPolicy.
type SDnsTrafficPolicy struct {
apis.SEnabledStatusInfrasResourceBase
Provider string `json:"provider"`
PolicyType string `json:"policy_type"`
PolicyValue string `json:"policy_value"`
Options *jsonutils.JSONDict `json:"options"`
// 解析线路类型
PolicyType string `json:"policy_type"`
// 解析线路
PolicyValue string `json:"policy_value"`
}
// SDnsZone is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsZone.
type SDnsZone struct {
apis.SEnabledStatusInfrasResourceBase
IsDirty bool `json:"is_dirty"`
ZoneType string `json:"zone_type"`
Options *jsonutils.JSONDict `json:"options"`
}
// SDnsZoneCache is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsZoneCache.
type SDnsZoneCache struct {
apis.SStatusStandaloneResourceBase
apis.SSharableVirtualResourceBase
apis.SEnabledResourceBase
apis.SExternalizedResourceBase
SDnsZoneResourceBase
// 归属云账号ID
CloudaccountId string `json:"cloudaccount_id"`
ProductType string `json:"product_type"`
SManagedResourceBase
ZoneType string `json:"zone_type"`
ProductType string `json:"product_type"`
}
// SDnsZoneResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsZoneResourceBase.
@@ -988,6 +971,9 @@ type SExternalProject struct {
apis.SVirtualResourceBase
apis.SExternalizedResourceBase
SManagedResourceBase
// 优先级,同一个本地项目映射多个云上项目,优先级高的优先选择
// 数值越高,优先级越大
Priority int `json:"priority"`
ExternalDomainId string `json:"external_domain_id"`
// 归属云账号ID
CloudaccountId string `json:"cloudaccount_id"`
@@ -1133,6 +1119,8 @@ type SGuest struct {
QgaStatus string `json:"qga_status"`
// power_states limit in [on, off, unknown]
PowerStates string `json:"power_states"`
// Used for guest rescue
RescueMode bool `json:"rescue_mode"`
}
// SGuestJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SGuestJointsBase.
@@ -1206,6 +1194,12 @@ type SGuestnetwork struct {
NumQueues int `json:"num_queues"`
// 带宽限制单位mbps
BwLimit int `json:"bw_limit"`
// 下行流量限制,单位 bytes
RxTrafficLimit int64 `json:"rx_traffic_limit"`
RxTrafficUsed int64 `json:"rx_traffic_used"`
// 上行流量限制,单位 bytes
TxTrafficLimit int64 `json:"tx_traffic_limit"`
TxTrafficUsed int64 `json:"tx_traffic_used"`
// 网卡序号
Index byte `json:"index"`
// 是否为虚拟接口无IP
@@ -1273,9 +1267,10 @@ type SHost struct {
// 内存超分比
MemCmtbound float32 `json:"mem_cmtbound"`
// 页大小
PageSizeKB int `json:"page_size_kb"`
PageSizeKB int `json:"page_size_kb"`
EnableNumaAllocate bool `json:"enable_numa_allocate"`
// 存储大小,单位Mb
StorageSize int `json:"storage_size"`
StorageSize int64 `json:"storage_size"`
// 存储类型
StorageType string `json:"storage_type"`
// 存储驱动类型
@@ -1316,6 +1311,24 @@ type SHost struct {
UefiInfo jsonutils.JSONObject `json:"uefi_info"`
}
// SHostBackupstorage is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostBackupstorage.
type SHostBackupstorage struct {
SHostJointsBase
// 宿主机Id
HostId string `json:"host_id"`
// 存储Id
BackupstorageId string `json:"backupstorage_id"`
}
// SHostIsolatedDeviceModel is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostIsolatedDeviceModel.
type SHostIsolatedDeviceModel struct {
SHostJointsBase
// 宿主机Id
HostId string `json:"host_id"`
// 设备类型Id
IsolatedDeviceModelId string `json:"isolated_device_model_id"`
}
// SHostJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostJointsBase.
type SHostJointsBase struct {
apis.SJointResourceBase
@@ -1516,7 +1529,25 @@ type SIsolatedDevice struct {
// guest disk index
DiskIndex byte `json:"disk_index"`
// # pci address of `Bus:Device.Function` format, or usb bus address of `bus.addr`
Addr string `json:"addr"`
Addr string `json:"addr"`
// Is vgpu physical funcion, That means it cannot be attached to guest
// VGPUPhysicalFunction bool `nullable:"true" default:"false" list:"domain" create:"domain_optional"`
// nvidia vgpu config
// vgpu uuid generated on create
MdevId string `json:"mdev_id"`
// The frame rate limiter (FRL) configuration in frames per second
FRL string `json:"frl"`
// The frame buffer size in Mbytes
Framebuffer string `json:"framebuffer"`
// The maximum resolution per display head, eg: 5120x2880
MaxResolution string `json:"max_resolution"`
// The maximum number of virtual display heads that the vGPU type supports
// In computer graphics and display technology, the term "head" is commonly used to
// describe the physical interface of a display device or display output.
// It refers to a connection point on the monitor, such as HDMI, DisplayPort, or VGA interface.
NumHeads string `json:"num_heads"`
// The maximum number of vGPU instances per physical GPU
MaxInstance string `json:"max_instance"`
VendorDeviceId string `json:"vendor_device_id"`
// reserved memory size for isolated device
ReservedMemory int `json:"reserved_memory"`
@@ -1524,6 +1555,8 @@ type SIsolatedDevice struct {
ReservedCpu int `json:"reserved_cpu"`
// reserved storage size for isolated device
ReservedStorage int `json:"reserved_storage"`
// device numa node
NumaNode byte `json:"numa_node"`
}
// SIsolatedDeviceModel is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SIsolatedDeviceModel.
@@ -1534,6 +1567,8 @@ type SIsolatedDeviceModel struct {
DeviceId string `json:"device_id"`
DevType string `json:"dev_type"`
HotPluggable *bool `json:"hot_pluggable,omitempty"`
// Disable auto detect isolated devices on host
DisableAutoDetect *bool `json:"disable_auto_detect,omitempty"`
}
// SKafka is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SKafka.
@@ -2660,6 +2695,8 @@ type SStorage struct {
StorageConf jsonutils.JSONObject `json:"storage_conf"`
// 存储缓存Id
StoragecacheId string `json:"storagecache_id"`
// master host id
MasterHost string `json:"master_host"`
// indicating whether system disk can be allocated in this storage
// 是否可以用作系统盘存储
// example: true
@@ -2678,6 +2715,8 @@ type SStoragecache struct {
SManagedResourceBase
// 镜像存储地址
Path string `json:"path"`
// master host id
MasterHost string `json:"master_host"`
}
// SStoragecacheResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SStoragecacheResourceBase.

View File

@@ -36,8 +36,10 @@ const (
SERVICE_TYPE_CLOUDMON = "cloudmon"
SERVICE_TYPE_VPCAGENT = "vpcagent"
SERVICE_TYPE_ETCD = "etcd"
SERVICE_TYPE_INFLUXDB = "influxdb"
SERVICE_TYPE_ETCD = "etcd"
SERVICE_TYPE_INFLUXDB = "influxdb"
SERVICE_TYPE_NTP = "ntp"
SERVICE_TYPE_VICTORIA_METRICS = "victoria-metrics"
SERVICE_TYPE_SCHEDULEDTASK = "scheduledtask"
@@ -98,9 +100,9 @@ var (
"apigateway",
"yunionapi",
"billing",
"etcd",
SERVICE_TYPE_ETCD,
"itsm",
"ntp",
SERVICE_TYPE_NTP,
}
)

View File

@@ -211,6 +211,7 @@ var (
"force_dhcp_probe_ipmi",
"tftp_block_size_in_bytes",
"tftp_max_timeout_retries",
"enable_grub_tftp_download",
"lengthy_worker_count",
"short_worker_count",
// "default_ipmi_password",

View File

@@ -335,7 +335,7 @@ type IdentityProviderListInput struct {
// 过滤支持SSO的认证源如果值为all则列出所有的全局认证源否则可出sso为域ID的域认证源
// example: all
SsoDomain string `json:"sso"`
SsoDomain string `json:"sso_domain"`
AutoCreateProject *bool `json:"auto_create_project"`
AutoCreateUser *bool `json:"auto_create_user"`

View File

@@ -307,6 +307,19 @@ type SServiceCertificate struct {
CaPrivateKey string `json:"ca_private_key"`
}
// STokenCache is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.STokenCache.
type STokenCache struct {
apis.SStandaloneAnonResourceBase
Valid bool `json:"valid"`
Method string `json:"method"`
AuditIds string `json:"audit_ids"`
UserId string `json:"user_id"`
ProjectId string `json:"project_id"`
DomainId string `json:"domain_id"`
Source string `json:"source"`
Ip string `json:"ip"`
}
// SUser is an autogenerated struct via yunion.io/x/onecloud/pkg/keystone/models.SUser.
type SUser struct {
apis.SRecordChecksumResourceBase

View File

@@ -93,10 +93,9 @@ type AlertCondition struct {
}
type AlertQuery struct {
Model MetricQuery `json:"model"`
DataSourceId string `json:"data_source_id"`
From string `json:"from"`
To string `json:"to"`
Model MetricQuery `json:"model"`
From string `json:"from"`
To string `json:"to"`
}
type AlertCreateInput struct {
@@ -156,6 +155,7 @@ type AlertListInput struct {
apis.StatusStandaloneResourceListInput
// 以报警是否启用/禁用过滤列表
// Enabled *bool `json:"enabled"`
MonitorResourceId []string `json:"monitor_resource_id"`
}
type AlertDetails struct {
@@ -179,12 +179,14 @@ type ResultLogEntry struct {
// EvalMatch represents the series violating the threshold.
type EvalMatch struct {
Condition string `json:"condition"`
Value *float64 `json:"value"`
ValueStr string `json:"value_str"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Unit string `json:"unit"`
Condition string `json:"condition"`
Value *float64 `json:"value"`
ValueStr string `json:"value_str"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Unit string `json:"unit"`
AlertDetails jsonutils.JSONObject `json:"alert_details"`
IsRecovery bool `json:"is_recovery"`
}
type AlertTestRunOutput struct {

View File

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

View File

@@ -36,12 +36,7 @@ type AlertJointResourceBaseDetails struct {
type AlertnotificationDetails struct {
AlertJointResourceBaseDetails
Notification string `json:"notification"`
}
type AlertJointCreateInput struct {
apis.Meta
AlertId string `json:"alert_id"`
Frequency int64 `json:"frequency"`
}
type AlertnotificationCreateInput struct {
@@ -51,3 +46,7 @@ type AlertnotificationCreateInput struct {
UsedBy string `json:"used_by"`
Params jsonutils.JSONObject `json:"params"`
}
type AlertNotificationListInput struct {
AlertJointListInput
}

View File

@@ -71,12 +71,12 @@ type AlertRecordCreateInput struct {
AlertId string `json:"alert_id"`
// 报警级别
Level string `json:"level"`
State string `json:"state"`
SendState string `json:"send_state"`
ResType string `json:"res_type"`
EvalData []*EvalMatch `json:"eval_data"`
AlertRule AlertRecordRule
Level string `json:"level"`
State string `json:"state"`
SendState string `json:"send_state"`
ResType string `json:"res_type"`
EvalData []*EvalMatch `json:"eval_data"`
AlertRule []*AlertRecordRule `json:"alert_rule"`
}
type AlertRecordRule struct {
@@ -96,4 +96,5 @@ type AlertRecordRule struct {
ConditionType string `json:"condition_type"`
// 静默期
SilentPeriod string `json:"silent_period"`
Reducer string `json:"reducer"`
}

View File

@@ -26,7 +26,7 @@ const (
// AlertResourceTypeCloudaccount means cloudaccount resource
AlertResourceTypeCloudaccount AlertResourceType = "cloudaccount"
// AlertResourceTypeVM means virtual machine guest resource
// AlertResourceTypeVM AlertResourceType = "vm"
AlertResourceTypeVM AlertResourceType = "vm"
)
type AlertResourceCreateInput struct {

View File

@@ -103,6 +103,8 @@ type CommonAlertQuery struct {
//field yunsuan
FieldOpt string `json:"field_opt"`
ConditionType string `json:"condition_type"`
// Operator should be chosen from 'and | or'
Operator string `json:"operator"`
}
type CommonAlertListInput struct {
@@ -159,6 +161,7 @@ type CommonAlertDetails struct {
}
type CommonAlertMetricDetails struct {
Operator string `json:"operator"`
Comparator string `json:"comparator"`
Threshold float64 `json:"threshold"`
WithinRange []float64 `json:"within_range"`

View File

@@ -0,0 +1,8 @@
package monitor
import "yunion.io/x/onecloud/pkg/apis"
const (
DataSourceTypeInfluxdb = apis.SERVICE_TYPE_INFLUXDB
DataSourceTypeVictoriaMetrics = apis.SERVICE_TYPE_VICTORIA_METRICS
)

View File

@@ -40,6 +40,7 @@ const (
METRIC_UNIT_PERCENT = "%"
METRIC_UNIT_BPS = "bps"
METRIC_UNIT_PPS = "pps"
METRIC_UNIT_MBPS = "Mbps"
METRIC_UNIT_BYTEPS = "Bps"
METRIC_UNIT_CPS = "cps"

View File

@@ -28,18 +28,23 @@ type MonitorResourceJointListInput struct {
MonitorResourceId string `json:"monitor_resource_id"`
AlertId string `json:"alert_id"`
JointId []int64 `json:"joint_id"`
Alerting bool `json:"alertinng"`
Alerting bool `json:"alerting"`
AlertState string `json:"alert_state"`
SendState string `json:"send_state"`
ResType string `json:"res_type"`
Metric string `json:"metric"`
ResName string `json:"res_name"`
AlertName string `json:"alert_name"`
Level string `json:"level"`
// 查询所有状态
AllState bool `json:"all_state"`
}
type MonitorResourceJointCreateInput struct {
apis.Meta
MonitorResourceId string `json:"monitor_resource_id"`
AlertId string `json:"alert_id"`
Metric string `json:"metric"`
AlertRecordId string `width:"36" charset:"ascii" list:"user" update:"user"`
AlertState string `width:"18" charset:"ascii" list:"user" update:"user"`

View File

@@ -19,10 +19,10 @@ type NotificationTemplateCreateInput struct {
}
type NotificationTemplateConfig struct {
Title string `json:"title"`
Name string `json:"name"`
ResourceName string `json:"resource_name"`
Matches []EvalMatch `json:"matches"`
Title string `json:"title"`
Name string `json:"name"`
ResourceName string `json:"resource_name"`
Matches []*EvalMatch `json:"matches"`
// PrevAlertState AlertStateType `json:"prev_alert_state"`
// State AlertStateType `json:"state"`
NoDataFound bool `json:"no_data"`

View File

@@ -14,54 +14,12 @@
package monitor
const (
DataSourceTypeInfluxdb = "influxdb"
)
import "fmt"
type DataSourceConfig struct {
Id string
Name string
Driver string
Config interface{}
}
type MetricResource struct {
// Type is the metric resource type. e.g: host, vm, lbinstance
Type string `json:"type"`
// ConfigId is the data source config id
ConfigId string `json:"config_id"`
}
type Metric struct {
Resource MetricResource `json:"resource"`
Measurement string `json:"measurement"`
Field string `json:"field"`
DisplayName string `json:"displayname"`
}
type TimeSeries struct {
Results []TimeSeriesResult `json:"results"`
}
type TimeSeriesResult struct {
Series []TimeSeriesRow `json:"series"`
}
type TimeSeriesRow struct {
Metric Metric `json:"metric"`
Tags map[string]string `json:"tags,omitempty"`
Columns []string `json:"columns,omitempty"`
// Value item is a point with timestamp and value
Values [][]interface{} `json:"values,omitempty"`
}
type MetricRequest struct {
// The start time for the query
From string `json:"from"`
// An end time for the query
To string `json:"to"`
Queries []*MetricQuery `json:"queries"`
Debug bool `json:"debug"`
type Condition struct {
Type string `json:"type"`
Params []float64 `json:"params"`
Operators []string `json:"operators"`
}
type MetricQueryTag struct {
@@ -76,6 +34,61 @@ type MetricQueryPart struct {
Params []string `json:"params"`
}
func NewMetricQueryPartField(fieldName string) MetricQueryPart {
return MetricQueryPart{
Type: "field",
Params: []string{fieldName},
}
}
func NewMetricQueryPartAS(alias string) MetricQueryPart {
return MetricQueryPart{
Type: "alias",
Params: []string{alias},
}
}
func NewMetricQueryPartMath(op string, val string) MetricQueryPart {
return MetricQueryPart{
Type: "math",
Params: []string{fmt.Sprintf("%s %s", op, val)},
}
}
func NewMetricQueryPartFunc(funcName string) MetricQueryPart {
return MetricQueryPart{
Type: funcName,
}
}
func NewMetricQueryPartMean() MetricQueryPart {
return NewMetricQueryPartFunc("mean")
}
func NewMetricQueryPartCount() MetricQueryPart {
return NewMetricQueryPartFunc("count")
}
func NewMetricQueryPartDistinct() MetricQueryPart {
return NewMetricQueryPartFunc("distinct")
}
func NewMetricQueryPartSum() MetricQueryPart {
return NewMetricQueryPartFunc("sum")
}
func NewMetricQueryPartMin() MetricQueryPart {
return NewMetricQueryPartFunc("min")
}
func NewMetricQueryPartMax() MetricQueryPart {
return NewMetricQueryPartFunc("max")
}
func NewMetricQueryPartLast() MetricQueryPart {
return NewMetricQueryPartFunc("last")
}
type MetricQuerySelect []MetricQueryPart
func NewMetricQuerySelect(parts ...MetricQueryPart) MetricQuerySelect {
@@ -94,11 +107,3 @@ type MetricQuery struct {
Policy string `json:"policy"`
ResultFormat string `json:"result_format"`
}
type AlertConditionCombiner string
type Condition struct {
Type string `json:"type"`
Params []float64 `json:"params"`
Operators []string `json:"operators"`
}

View File

@@ -14,15 +14,17 @@
package monitor
import "time"
import (
"strconv"
"time"
)
var (
UNIFIED_MONITOR_FIELD_OPT_TYPE = []string{"Aggregations", "Selectors"}
UNIFIED_MONITOR_GROUPBY_OPT_TYPE = []string{"time", "tag", "fill"}
UNIFIED_MONITOR_FIELD_OPT_VALUE = map[string][]string{
"Aggregations": {"COUNT", "DISTINCT", "INTEGRAL",
"MEAN", "MEDIAN", "MODE", "STDDEV", "SUM"},
"Selectors": {"BOTTOM", "FIRST", "LAST", "MAX", "MIN", "TOP"},
"Aggregations": {"MEAN", "SUM"}, // {"COUNT", "DISTINCT", "INTEGRAL", "MEAN", "MEDIAN", "MODE", "STDDEV", "SUM"},
"Selectors": {"BOTTOM", "FIRST", "LAST", "MAX", "MIN", "TOP"},
}
UNIFIED_MONITOR_GROUPBY_OPT_VALUE = map[string][]string{
"fill": {"linear", "none", "previous", "0"},
@@ -63,6 +65,27 @@ var (
}
)
func GetMeasurementTagIdKeyByResType(resType string) string {
return MEASUREMENT_TAG_ID[resType]
}
func GetMeasurementTagIdKeyByResTypeWithDefault(resType string) string {
tagId := GetMeasurementTagIdKeyByResType(resType)
if len(tagId) == 0 {
tagId = "host_id"
}
return tagId
}
func GetMeasurementResourceId(tags map[string]string, resType string) string {
return tags[GetMeasurementTagIdKeyByResType(resType)]
}
func GetResourceIdFromTagWithDefault(tags map[string]string, resType string) string {
tagId := GetMeasurementTagIdKeyByResTypeWithDefault(resType)
return tags[tagId]
}
type MetricFunc struct {
FieldOptType []string `json:"field_opt_type"`
FieldOptValue map[string][]string `json:"field_opt_value"`
@@ -70,23 +93,6 @@ type MetricFunc struct {
GroupOptValue map[string][]string `json:"group_opt_value"`
}
type MetricInputQuery struct {
From string `json:"from"`
To string `json:"to"`
Scope string `json:"scope"`
Slimit string `json:"slimit"`
Soffset string `json:"soffset"`
//default group by
Unit bool `json:"unit"`
Interval string `json:"interval"`
DomainId string `json:"domain_id"`
ProjectId string `json:"project_id"`
MetricQuery []*AlertQuery `json:"metric_query"`
Signature string `json:"signature"`
ShowMeta bool `json:"show_meta"`
SkipCheckSeries bool `json:"skip_check_series"`
}
type SimpleQueryInput struct {
// 资源Id, 可以不填, 代表查询指定监控的所有监控数据
Id string `json:"id"`
@@ -108,3 +114,103 @@ type SimpleQueryOutput struct {
Time time.Time `json:"time"`
Value float64 `json:"value"`
}
type MetricsQueryResult struct {
SeriesTotal int64
Series TimeSeriesSlice
Metas []QueryResultMeta
}
type TimeSeriesPoints []TimePoint
type TimeSeriesSlice []*TimeSeries
type TimeSeries struct {
// RawName is used to frontend displaying the curve name
RawName string `json:"raw_name"`
Columns []string `json:"columns"`
Name string `json:"name"`
Points TimeSeriesPoints `json:"points"`
Tags map[string]string `json:"tags,omitempty"`
}
type TimePoint []interface{}
func NewTimePoint(value *float64, timestamp float64) TimePoint {
return TimePoint{value, timestamp}
}
func NewTimePointByVal(value float64, timestamp float64) TimePoint {
return NewTimePoint(&value, timestamp)
}
func (p TimePoint) IsValid() bool {
if val, ok := p[0].(*float64); ok && val != nil {
return true
}
return false
//return p[0].(*float64) != nil
}
func (p TimePoint) IsValids() bool {
for i := 0; i < len(p)-1; i++ {
if p[i] == nil {
return false
}
if p[i].(*float64) == nil {
return false
}
}
return true
}
func (p TimePoint) Value() float64 {
return *(p[0].(*float64))
}
func (p TimePoint) Timestamp() float64 {
return p[len(p)-1].(float64)
}
func (p TimePoint) Values() []float64 {
values := make([]float64, 0)
for i := 0; i < len(p)-1; i++ {
values = append(values, *(p[i].(*float64)))
}
return values
}
func (p TimePoint) PointValueStr() []string {
arrStr := make([]string, 0)
for i := 0; i < len(p)-1; i++ {
if p[i] == nil {
arrStr = append(arrStr, "")
}
if fval, ok := p[i].(*float64); ok {
arrStr = append(arrStr, strconv.FormatFloat((*fval), 'f', -1, 64))
continue
}
if ival, ok := p[i].(*int64); ok {
arrStr = append(arrStr, strconv.FormatInt((*ival), 64))
continue
}
arrStr = append(arrStr, p[i].(string))
}
return arrStr
}
func NewTimeSeriesPointsFromArgs(values ...float64) TimeSeriesPoints {
points := make(TimeSeriesPoints, 0)
for i := 0; i < len(values); i += 2 {
points = append(points, NewTimePoint(&values[i], values[i+1]))
}
return points
}
type QueryResultMeta struct {
RawQuery string `json:"raw_query"`
}
const ConditionTypeMetricQuery = "metricquery"

View File

@@ -0,0 +1,47 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package monitor
import (
"crypto/sha256"
"fmt"
"yunion.io/x/jsonutils"
)
type MetricQueryInput struct {
From string `json:"from"`
To string `json:"to"`
Scope string `json:"scope"`
Slimit string `json:"slimit"`
Soffset string `json:"soffset"`
Unit bool `json:"unit"`
Interval string `json:"interval"`
DomainId string `json:"domain_id"`
ProjectId string `json:"project_id"`
MetricQuery []*AlertQuery `json:"metric_query"`
Signature string `json:"signature"`
ShowMeta bool `json:"show_meta"`
SkipCheckSeries bool `json:"skip_check_series"`
}
const (
QUERY_SIGNATURE_KEY = "signature"
)
func DigestQuerySignature(data *jsonutils.JSONDict) string {
data.Remove(QUERY_SIGNATURE_KEY)
return fmt.Sprintf("%x", sha256.Sum256([]byte(data.String())))
}

View File

@@ -0,0 +1 @@
package monitor

View File

@@ -168,6 +168,7 @@ type SendParams struct {
// minutes
GroupTimes uint
ReceiverId string
SendTime time.Time
}
type SRemoteTemplateParam struct {
@@ -225,6 +226,10 @@ type SNotifyConfigContent struct {
//AppSecret string
AppKey string
// sms
VerifiyCode string
AlertsCode string
ErrorCode string
PhoneNumber string
AccessKeyId string
AccessKeySecret string
ServiceUrl string

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